Skip Navigation

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

Problem: Performance issues with WPML

Solution: Please update to the latest versions of the WPML 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 10 replies, has 2 voices.

Last updated by per-egilR 10 months, 3 weeks ago.

Assigned support staff: Alejandro.

Author Posts
October 16, 2019 at 9:03 pm #4768571

per-egilR

I'm running a OceanWP + WC + WPML site in English and German. I have approx 130 products and make extensive use of WC product attributes (about 10 per product).

I have one page where all 130 products are listed. According to "Query Monitor", the English (default language) page generates around 650 db queries. The German page on the other hand generates about 2300 db queries.

Most of the additional queries result from 10 (product attributes) x 130 (products) duplicate queries from "SELECT language FROM icl_strings WHERE context='WordPress'
AND name='URL attribute slug: {attribute url}". Identical queries are called 130 times for each product attribute.

I think this is a severe performance issue that should be addressed before releasing WPML 4.3. This is just an extreme example, the same issue occurs in "normal use", i.e. displaying products on a product category page.

October 17, 2019 at 7:54 am #4770971

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello!
Welcome to WPML Support.
I'll do my best to help you solve this issue.

I have a few steps i would like you to follow before we proceed:

1) Can you go to WPML > Localize theme and plugins and check if there are more .mo files to be created? if there are please create them all

2) After you finish step 1, please go to WPML > Support > Troubleshooting > Optimize String tables (It's one of the last options and the newest one).

Step 2 will optimize the tables after the .mo creation (this will be a process that has to be done on "old" sites to make sure the site works correctly after the passage from 4.2.x to 4.3)

I believe what's missing here is step 2 and that might be why you're getting so many queries, but of course i just want to isolate the issue so we can fix this as soon as possible if it's indeed a problem due to something else.

By the way, if you see that you press the step 2 button and it doesn't seem to run, that's because there are still .mo files that are being scanned and need to be created, it's a security measure, so if it doesn't work return to step one and make sure all the .mo files were created.

Let me know how it goes so i know how to proceed.

October 17, 2019 at 10:49 am #4772633

per-egilR

Hello Alejandro,

thanks for getting back to me so quickly.

Please note that I have installed WPML 4.3 from scratch, so updating from a previous version is not an issue. All "Strings in the themes/plugins" are imported by scanning existing theme/plugin .mo files. (see image 2).

1) I don't see an option to "Create .mo files" on the "Theme and plugins localization" page, so I'm not quite sure what you mean by that. Do you mean "Create .po files" or "Scan .mo files"?

Creating .po files doesn't seem to apply, as the respective .mo files are already in place. The strings causing the excessive queries are generated by WCML on WooCommerce >> WooCommerce Multilingual >> tab "Attributes" section "Translations of taxonomy {attribute} labels and slug". These strings/domains don't appear on the "Theme and plugins localization" page.

I scanned two updated .mo files (WPML Multilingual CMS, WP Core).

2) There is no option to "Optimize String tables" on the "Troubleshooting" page (see. image 1).

BTW: In the meantime I have updated to WPML 4.3 RC1 incl. the other WPML plugins.

October 17, 2019 at 11:38 am #4773069

per-egilR

UPDATE:

After translating the product attribute slugs, the duplicate queries for these slugs disappeared. The number of queries was thereby reduced to about 1800.

However, two of the product attributes (language, operator) don't need translation. For these taxonomies the there are still duplicate queries, now (after updating to WPML RC1, maybe?) 239 queries for EACH attribute (see screenshot).

October 17, 2019 at 4:56 pm #4776083

per-egilR

Hi Alejandro,

Thanks. Would it be an option to give you acces to our dev server?

October 17, 2019 at 8:46 pm #4777239

per-egilR

Hi Alejandro,

forget my last post. I have just copied the site to your Cloudways server. I guess you'll need credentials?

October 18, 2019 at 6:58 am #4778783

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

I sent the case to our developers, there's no need for credentials.

I'll contact you as soon as I get an answer from them.
Regards.

October 18, 2019 at 7:59 am #4779201

per-egilR

Hi Alejandro,

Thanks for checking the Cloudways site, but please allow me to disagree with you.

>> I noticed that after doing that, those queries you showed me disappeared.

No, please check the German homepage with Query Monitor. The duplicate queries are still there. I haven't activated any of the plugins you disabled.

>> This means the problem is most likely a compatibility issue.

No, the issue is that WPML ST doesn't create .mo files for strings that are not translated. And then hits the db every time a not translated string is needed. I suggest one of the following solutions:

a) Also create .mo files of not translated strings (copy of the initial language strings)
b) Add caching for not translated strings.

October 18, 2019 at 9:26 am #4779911

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Oh, thanks for that information (i had missed that step and thought the problem was on the back-end, where i couldn't really see what you saw)

I updated the info i sent to our developers, so i'm waiting for them to see if something can be done before the official release hits the market.

I'll keep you updated.

October 21, 2019 at 7:19 am #4791677

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Our developers are still looking into this matter but they have already spotted where the problem is and they are taking care of it.

Thank you very much for the information you provided us, we hope the changes go into the official release of the plugin.

I'll keep you updated.

November 1, 2019 at 10:10 am #4869427

per-egilR

WPML 4.3.2 resolved this issue.