This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing performance issues with WPML on their e-commerce site, particularly when WPML plugins are activated, resulting in increased load times.
Solution: We suggested checking if the auto_adjust_ids setting under WPML > Languages > Make themes work multilingual is enabled, as this can impact performance, and if so disabling it.
We advised that debugging tools like Query Monitor should be disabled after testing, as they can also affect performance.
For a more complete checklist of steps you can take to improve performance, visit this ticket/.
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.
Performance issues typically occur with large e-commerce sites, and often when using mega-menus that display a large number of product categories on a single page.
That is something we are currently focusing on in development, and I can see that your site looks to fall in this category.
To be more specific, I will need access to your site (better, a staging server with comparable resources) to be able to take a closer look if that's okay.
Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.
I can see in the details from Query Monitor a familiar pattern with many calls to a WPML function maybe_populate_cache which occurs when many product categories are referenced on the page (because of menus, or relating to the products shown on the page).
We recently (in WPML 4.6.9) optimised those queries, and they are quite fast, but work is ongoing in identifying ways to reduce the number of queries overall, and we should see some ongoing performance improvements in subsequent WPML releases.
One thing I noted on your site was the auto_adjust_ids setting at WPML > Languages > Make themes work multilingual was checked, and this will have a performance impact.
This staging site appears to be slower than your production site, but after deactivating that setting I saw an improvement on the home page from ~4s to 2.3s.
Could you try the same on your production server and see what difference it makes?
I notice you have the Code Profiler plugin active and you have recently run with- and without-WPML profiles. After deactivating the above setting I re-ran the profile and noticed a considerable improvement: WPML still consumed the most time, but the difference with other plugins was much less pronounced, and as the note from Code Profiler itself says, because WPML loads first among the many plugins which use Composer, it's time is penalised relative to the others. Also, because WPML loads early, it makes quite a few calls such as loading options that would be made by other plugins if WPML were inactive. (That doesn't explain the difference in overall load times when WPML is active or not, but it does partly explain the relative performance of WPML compared to other plugins.)
Note, also, when you are finished testing you should disable debugging tools like Query Monitor as they do have a modest performance impact themselves.