Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client reported that the WPML plugin was causing CPU overload due to a large number of duplicated queries to the database.

Solution:
We recommended the client to navigate to WPML->Settings->Post Types Translation and change the option from "Translatable - use translation if available or fallback to default language" to "Translatable - only show translated items" for Posts, Pages, and products.

If this solution does not apply to your case, or if it seems outdated, we encourage you to open a new support ticket. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 14 replies, has 2 voices.

Last updated by Bobby 10 months ago.

Assisted by: Bobby.

Author Posts
January 21, 2024 at 9:40 pm #15209115

karelV-8

Hello, your plugin often overloads our CPU. It is a little bit better when we don't preload WP Rocket cache. But, as you can see attached, you have over 700 of duplicated queries to the database, that is insane...!? Can you fix it, improve it please?

Query	Count	Time	Callers	Components	Potential Troublemakers
SELECT value
FROM vfgru_cleantalk_no_cookie_data
WHERE id = '0ec9c200abd989cf64d38a3e7b6353d504237a54afb67d85301d5174161d2f39'
AND name = 'apbct_urls'	2	0.0075	Cleantalk\ApbctWP\Variables\NoCookie::get()
1 call
Cleantalk\ApbctWP\Variables\NoCookie::set()
1 call
Plugin: cleantalk-spam-protect
2 calls
Cleantalk\ApbctWP\Variables\NoCookie::get()
1 call
Cleantalk\ApbctWP\Variables\NoCookie::set()
1 call
SELECT post_type from vfgru_posts where ID=0	4	0.0120	WPML_Query_Filter->determine_post_type()
4 calls
Plugin: sitepress-multilingual-cms
4 calls
WPML_Query_Filter->where_filter_active()
2 calls
WPML_Query_Filter->posts_join_filter()
2 calls
SELECT vfgru_posts.*
FROM vfgru_posts JOIN vfgru_icl_translations wpml_translations
ON vfgru_posts.ID = wpml_translations.element_id
AND wpml_translations.element_type = CONCAT('post_', vfgru_posts.post_type)
WHERE 1=1
AND vfgru_posts.post_name = 'prince-of-persia-the-lost-crown-guard-statue-puzzle-guide'
AND vfgru_posts.post_type = 'post'
AND ( ( ( wpml_translations.language_code = 'en'
OR 0 )
AND vfgru_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) )
OR vfgru_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) )
ORDER BY vfgru_posts.post_date DESC	2	0.0046	WP_Query->get_posts()
2 calls
Plugin: sitepress-multilingual-cms
1 call
WordPress Core
1 call
WP_Query->__construct()
1 call
WP->query_posts()
1 call
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 96
AND icl_t.element_type = 'tax_category'	38	0.2875	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
38 calls
Plugin: sitepress-multilingual-cms
38 calls
WP_Term_Query->populate_terms()
5 calls
get_object_term_cache()
32 calls
get_term_by()
1 call
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 68061
AND icl_t.element_type = 'tax_category'	33	0.2191	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
33 calls
Plugin: sitepress-multilingual-cms
33 calls
WP_Term_Query->populate_terms()
3 calls
get_object_term_cache()
30 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 82
AND icl_t.element_type = 'tax_category'	51	0.3690	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
51 calls
Plugin: sitepress-multilingual-cms
51 calls
WP_Term_Query->populate_terms()
5 calls
get_object_term_cache()
30 calls
get_permalink()
13 calls
get_term_by()
1 call
WPML_Term_Query_Filter->adjust_taxonomies_terms_slugs()
1 call
get_category_by_path()
1 call
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 101
AND icl_t.element_type = 'tax_category'	99	0.5662	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
99 calls
Plugin: sitepress-multilingual-cms
99 calls
get_term_parents_list()
28 calls
get_ancestors()
43 calls
get_term_link()
28 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 133722
AND icl_t.element_type = 'tax_post_tag'	8	0.0501	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
8 calls
Plugin: sitepress-multilingual-cms
8 calls
get_object_term_cache()
4 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 75
AND icl_t.element_type = 'tax_nav_menu'	2	0.0055	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
Plugin: sitepress-multilingual-cms
2 calls
WPML_Nav_Menu->wp_nav_menu_args_filter()
1 call
wp_get_nav_menu_items()
1 call
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 19
AND icl_t.element_type = 'tax_category'	67	0.4696	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
67 calls
Plugin: sitepress-multilingual-cms
67 calls
wp_setup_nav_menu_item()
3 calls
get_term_link()
21 calls
get_ancestors()
21 calls
WPML_Term_Element->get_wp_object()
4 calls
WP_Term_Query->populate_terms()
1 call
get_object_term_cache()
11 calls
get_permalink()
6 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 21
AND icl_t.element_type = 'tax_category'	20	0.1317	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
20 calls
Plugin: sitepress-multilingual-cms
20 calls
wp_setup_nav_menu_item()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
get_object_term_cache()
10 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 65476
AND icl_t.element_type = 'tax_category'	22	0.1129	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
22 calls
Plugin: sitepress-multilingual-cms
22 calls
wp_setup_nav_menu_item()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
WP_Term_Query->populate_terms()
1 call
get_object_term_cache()
11 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 22
AND icl_t.element_type = 'tax_category'	22	0.1132	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
22 calls
Plugin: sitepress-multilingual-cms
22 calls
wp_setup_nav_menu_item()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
WP_Term_Query->populate_terms()
1 call
get_object_term_cache()
11 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 65477
AND icl_t.element_type = 'tax_category'	22	0.1145	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
22 calls
Plugin: sitepress-multilingual-cms
22 calls
wp_setup_nav_menu_item()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
WP_Term_Query->populate_terms()
1 call
get_object_term_cache()
11 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 26
AND icl_t.element_type = 'tax_category'	22	0.1343	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
22 calls
Plugin: sitepress-multilingual-cms
22 calls
wp_setup_nav_menu_item()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
WP_Term_Query->populate_terms()
1 call
get_object_term_cache()
11 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 332
AND icl_t.element_type = 'tax_category'	22	0.1565	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
22 calls
Plugin: sitepress-multilingual-cms
22 calls
wp_setup_nav_menu_item()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
WP_Term_Query->populate_terms()
1 call
get_object_term_cache()
11 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 57305
AND icl_t.element_type = 'tax_category'	10	0.0567	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 67854
AND icl_t.element_type = 'tax_category'	10	0.0735	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 1716
AND icl_t.element_type = 'tax_category'	10	0.0604	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 133723
AND icl_t.element_type = 'tax_category'	10	0.0684	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 68472
AND icl_t.element_type = 'tax_category'	4	0.0187	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
4 calls
Plugin: sitepress-multilingual-cms
4 calls
get_ancestors()
2 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 68441
AND icl_t.element_type = 'tax_category'	10	0.1002	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 83
AND icl_t.element_type = 'tax_category'	4	0.0187	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
4 calls
Plugin: sitepress-multilingual-cms
4 calls
get_ancestors()
2 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 29
AND icl_t.element_type = 'tax_category'	10	0.0915	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 23
AND icl_t.element_type = 'tax_category'	54	0.2534	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
54 calls
Plugin: sitepress-multilingual-cms
54 calls
get_ancestors()
26 calls
get_term_link()
24 calls
get_term_parents_list()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 30
AND icl_t.element_type = 'tax_category'	10	0.0990	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 65479
AND icl_t.element_type = 'tax_category'	10	0.0956	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 27
AND icl_t.element_type = 'tax_category'	10	0.0717	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 65478
AND icl_t.element_type = 'tax_category'	10	0.0758	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 330
AND icl_t.element_type = 'tax_category'	10	0.0707	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 57304
AND icl_t.element_type = 'tax_category'	10	0.0263	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 67853
AND icl_t.element_type = 'tax_category'	10	0.0471	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 2421
AND icl_t.element_type = 'tax_category'	10	0.0214	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 133705
AND icl_t.element_type = 'tax_category'	10	0.1056	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 98
AND icl_t.element_type = 'tax_category'	10	0.0831	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 99
AND icl_t.element_type = 'tax_category'	10	0.0759	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 68906
AND icl_t.element_type = 'tax_category'	28	0.2076	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
28 calls
Plugin: sitepress-multilingual-cms
28 calls
get_permalink()
8 calls
WP_Term_Query->populate_terms()
3 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
2 calls
get_term_link()
2 calls
get_ancestors()
2 calls
WPML_Term_Element->get_wp_object()
4 calls
get_object_term_cache()
7 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 78
AND icl_t.element_type = 'tax_nav_menu'	3	0.0184	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
3 calls
Plugin: sitepress-multilingual-cms
3 calls
WPML_Term_Element->get_element_id()
1 call
WPML_Translation_Element->get_wp_element_type()
2 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 68464
AND icl_t.element_type = 'tax_category'	10	0.0521	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
10 calls
Plugin: sitepress-multilingual-cms
10 calls
WP_Term_Query->populate_terms()
1 call
get_object_term_cache()
5 calls
get_category()
2 calls
get_permalink()
2 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 76
AND icl_t.element_type = 'tax_nav_menu'	5	0.0222	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count()
5 calls
Plugin: sitepress-multilingual-cms
5 calls
wp_get_nav_menu_object()
2 calls
WPML_Term_Element->get_wp_object()
3 calls
Queries.png
January 22, 2024 at 4:11 pm #15212780

karelV-8

Also, your plugin makes A LOOOOT of queries when going on our post. That is just clearly insane. 1000 of 1333 queries is made just by your plugin. This can't be true and acceptable...

Queries.png
January 23, 2024 at 12:23 am #15213825

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

Thank you for sharing the above information!

1. Please navigate to wp-config.php and verify that ICL_DISABLE_CACHE constant is not set to true. This causes a lot of SQL queries from WPML.

2. What are your results if you temporarily deactivate WP ROCKET CACHE , also test with Object Caching deactivated and update me, please.

January 23, 2024 at 12:14 pm #15216357

karelV-8

Hello,

no, whatever I do, nothing helps.

1. Disabled WP Rocket
2. Disabled Cloudflare
3. Disabled your addons
4. We don't use OP CACHE
5. Cleared and optimized database using your tools in the support tab

No matter what I do, if your main plugin is active, it makes over 900 queries to the database when loading a post. That is just INSANE. When we disable it, we are around 340 with the whole site, just your plugin does three times more...

January 23, 2024 at 12:59 pm #15216769

karelV-8

For example here hidden link why do you search for a lot of terms, taxonomies and who knows what? That is completely useless. Those terms have nothing to do with the post.

Also what logic is in this small part?
AND vfgru_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) )
OR vfgru_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) )

SELECT SQL_CALC_FOUND_ROWS vfgru_posts.ID
FROM vfgru_posts
LEFT JOIN vfgru_term_relationships
ON (vfgru_posts.ID = vfgru_term_relationships.object_id) JOIN vfgru_icl_translations wpml_translations
ON vfgru_posts.ID = wpml_translations.element_id
AND wpml_translations.element_type = CONCAT('post_', vfgru_posts.post_type)
WHERE 1=1
AND ( vfgru_term_relationships.term_taxonomy_id IN (86,52357,96,60399,20,101,137,29,68463,85,52358,97,30,1152,83,68473,8046,68475,52359,23,65479,333,68474,87,27,825,84,133377,133723,61031,330,68952,57304,68441,82,88,67853,68472,1153,2421,52356,65478,17,68464,133705,98,99) )
AND ((vfgru_posts.post_type = 'post'
AND (vfgru_posts.post_status = 'publish'
OR vfgru_posts.post_status = 'private')))
AND ( ( ( wpml_translations.language_code = 'en'
OR 0 )
AND vfgru_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) )
OR vfgru_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) )
GROUP BY vfgru_posts.ID
ORDER BY vfgru_posts.post_date DESC
LIMIT 0, 20

January 23, 2024 at 8:48 pm #15218842

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for updating me!

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

January 26, 2024 at 12:46 am #15228543

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for the access details!

The server protection details are working OK, however, I am having a hard time accessing the backend.

Please verify that the access details were not changed.

Screen Shot 2024-01-25 at 4.46.02 PM.png
January 26, 2024 at 2:16 am #15228565

karelV-8

Use as login: support@wpml.org instead of wpml

January 26, 2024 at 9:42 pm #15231753

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you, I was able to access the backend.

To make sure we are testing the same post I will be focusing on this one hidden link

The site has many plugins, therefore the first step to debug this issue is to deactivate 3rd party plugins which takes us down to an average of 176 Queries from 400 Queries.

Deactivating WPML takes us down from 176 to 65 queries. (roughly 100 queries coming from WPML with no duplicate queries)

------------------------------------------

Regarding the load time:

3.78s to load without WPML

4.60s to load with WPML

This is right around a 20% increase in load time which is normal when using WPML.

--------------------------------------------

Regarding the queries:

Duplicated queries ---> There are 6 none of which come from WPML

Slow Queries --> 1 coming from WPML

SELECT trid, SUM(CASE language_code
WHEN 'en'
THEN 1
ELSE 0 END) AS `en`,SUM(CASE language_code
WHEN 'es'
THEN 1
ELSE 0 END) AS `es`
FROM vfgru_icl_translations
WHERE element_type = 'post_post'
GROUP BY trid
HAVING `en`= 0
ORDER BY trid;

SitePress->get_orphan_translations

0.0935

WPML interacts with various components on your website, which is why you may notice several SQL operations by WPML.

However, I did notice something out of the ordinary when I visited WPML Translation Management and WPML Settings.

Are these pages currently working OK for you? As with my account, I see them blank. If these pages have some issues this could cause some problems.

Screen Shot 2024-01-26 at 1.26.59 PM.png
Screen Shot 2024-01-26 at 1.04.30 PM.png
Screen Shot 2024-01-26 at 1.02.57 PM.png
January 26, 2024 at 11:47 pm #15231930

karelV-8

Hello, it is necessary to test the pages on the frontend, not backend. And yes, those pages work for me, see attached. Aren't you blocked? Can you see something in the console?

If I run the site then it's around 1200 queries and 800 to 900 is from you. If I disable your plugin, we are at around 400. So it's not just with the plugins. I think your plugin simply works and processes a LOT of queries based on I don't know what and sends hundreds of them to the databse...

w1.png
w2.png
January 29, 2024 at 10:46 pm #15241136

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi,

Thank you for poinitning me to the front end load, indeed I do see 900 Queries in the front end. (I was not able to see the WP top bar before, I can see it OK now)

Switching to a standard WordPress theme such as the Twenty24 theme drops the queries to 216 --- 115 of which are duplicate queries

I will be communicating with our dev team regarding this and will update you as soon as I have some feedback.

SELECT post_type from vfgru_posts where ID=0	2	0.0004	WPML_Query_Filter->determine_post_type
2 calls
WPML_Query_Filter->where_filter_active
1 call
WPML_Query_Filter->posts_join_filter
1 call
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 68061
AND icl_t.element_type = 'tax_category'	18	0.0059	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
18 calls
WP_Term_Query->populate_terms
1 call
get_object_term_cache
12 calls
get_ancestors
1 call
WPML_Term_Element->get_wp_object
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 96
AND icl_t.element_type = 'tax_category'	18	0.0057	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
18 calls
WP_Term_Query->populate_terms
1 call
get_object_term_cache
12 calls
get_ancestors
1 call
WPML_Term_Element->get_wp_object
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 133722
AND icl_t.element_type = 'tax_post_tag'	6	0.0023	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
6 calls
WP_Term_Query->populate_terms
1 call
get_object_term_cache
1 call
WPML_Term_Element->get_wp_object
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 82
AND icl_t.element_type = 'tax_category'	30	0.0099	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
30 calls
get_term_by
1 call
WPML_Term_Query_Filter->adjust_taxonomies_terms_slugs
1 call
WP_Term_Query->populate_terms
1 call
get_category_by_path
1 call
get_object_term_cache
12 calls
get_permalink
9 calls
get_ancestors
1 call
WPML_Term_Element->get_wp_object
4 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 101
AND icl_t.element_type = 'tax_category'	36	0.0113	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
36 calls
get_term_parents_list
21 calls
get_ancestors
13 calls
get_term_link
2 calls
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 17
AND icl_t.element_type = 'tax_category'	2	0.0006	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
2 calls
get_ancestors
1 call
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
1 call
SELECT (
SELECT term_taxonomy.count
FROM vfgru_term_taxonomy term_taxonomy
INNER JOIN vfgru_icl_translations translations
ON translations.element_id = term_taxonomy.term_taxonomy_id
WHERE translations.trid = icl_t.trid
AND translations.language_code = 'en' ) as originalCount
FROM vfgru_terms AS t
INNER JOIN vfgru_term_taxonomy AS tt
ON t.term_id = tt.term_id
LEFT JOIN vfgru_icl_translations icl_t
ON icl_t.element_id = tt.term_taxonomy_id
WHERE t.term_id = 23
AND icl_t.element_type = 'tax_category'	3	0.0008	WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
3 calls
WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count
2 calls
get_ancestors
1 call
January 30, 2024 at 8:42 am #15242010

karelV-8

Hm, that's weird because I saw 900 even with the default wordpress theme.. Btw. you can use query monitor and the details are at the bottom of the screen 🙂 See attached, that is twentytwenty, but checking one of the posts, not the homepage. stiill 685 here... 511 from WPML_Term_Display_As_Translated_Adjust_Count->get_term_adjust_count and 518 in total duplicated queries.

Queries.png
January 30, 2024 at 9:50 pm #15246586

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi,

Please go to WPML->Settings->Post Types Translation and change the option from "Translatable
use translation if available or fallback to default language" to "Translatable
only show translated items" for Posts, Pages, and products.

Once done let me know your results, please.

At tthe moment I do not have full access to those settings with my account.

January 31, 2024 at 12:27 am #15246821

karelV-8

Hm, that was correctly set. But categories and tags were not. I must think more about those and what settings should be set there... When tags are only show translated items then it get down a LOT...

111.png
112.png
January 31, 2024 at 6:30 pm #15251221

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for updating me!

Categories and Tags by default are set to "Translatable only show translated items".

Most of the queries we saw were coming from the "display as translated logic"

Screen Shot 2024-01-31 at 10.28.35 AM.png