This thread is resolved. Here is a description of the problem and solution.
Problem:
The client reported significant slowdowns on their staging site after installing WPML, with page load times increasing to 6-10 seconds. This issue was not present on a similarly configured site without WPML. The client tried various optimizations, including disabling WPML SEO and WPML String Translation modules, which improved load times.
Solution:
We recommended migrating the site to our Cloudways testing environment to isolate the problem. The client used the Cloudways WordPress Migrator plugin for this purpose. After migration, we discovered that the combination of Admin Columns Pro, ACF, and ACFML plugins significantly impacted performance. We provided a temporary workaround by modifying the
translateField
method in the ACFML plugin to prevent certain processes from executing in the admin area, which improved backend performance. We also advised on general performance enhancements such as using PHP 8, enabling caching, and optimizing database indexes.
Please note that this solution might not be relevant if it's outdated or not applicable to your specific case. We 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. If the issue persists, please open a new support ticket at WPML support forum.
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: Performance
This topic contains 26 replies, has 2 voices.
Last updated by Mihai Apetrei 3 months ago.
Assisted by: Mihai Apetrei.
Author | Posts |
---|---|
July 22, 2024 at 1:40 pm #15987110 | |
johnS-9 |
Hi Mihai, No problem if you're busy you're busy. Just thought maybe I'd been funnelled to a different time zone. Lots of vacations on my end too, including me at the end of the week! We use Cloudways a lot, I've had it do similar things in the past. Something related to things being enabled and disabled on the admin UI in CW usually triggers it. The live website for this particular project does have Cloudways object cache pro, breeze (varnish) and redis set up and working... Which is great when you hit the cache, but without the cache things can be painfully slow (on the frontend and the backend). It's very common that the backend page is not cached which is having a big negative impact on the editor experience. The WPML work has now gone live on hidden link Using the hidden link site just now has been terrible. It took so long to load just now I think it's crashed the MySQL database. The database auto-recovered. I've then gone to plugins and disabled all the WPML plugins and taken more screenshots (attached). With WPML disabled the site is noticeably and measurably faster. The impact of having WPML enabled is really quite drastic. Just throwing a caching plugin at this does very much feel like sweeping the problem under the carpet. I have re-enabled the WPML plugins on the staging site (and it's slowed down again). Kind regards, |
July 23, 2024 at 10:10 pm #15994967 | |
Mihai Apetrei Supporter
Languages: English (English ) Timezone: Europe/Bucharest (GMT+02:00) |
I tried a few more things on our Cloudways test site from a longer list that I will share below and I also increased the WP memory, made the uploads folder writable, updated all the WPML plugins plus other outdated plugins and I also disabled 2 plugins (Query monitor, Stage file proxy): [ ] - So the first step is to make sure that your site is adequately resourced. The minimum requirements for WPML (https://wpml.org/home/minimum-requirements/) are very much a minimum, and larger sites should have more memory and server resources to function well. [ ] - Use PHP 8 (performance improved a lot compared to PHP 7), but not the most recent versions (at the time of writing, PHP 8.2 versions) because it takes time for themes and plugins, and WordPress itself, to catch up and ensure compatibility. [ ] - Caching is invaluable. You can use page caching plugins such as Super Cache, W3 Total Cache, or WP-Rocket, and preferably also object caching, for example via Redis and a plugin like https://wordpress.org/plugins/redis-cache/. [ ] - Do not use any kind of SSL-helping plugins. They produce significant overhead by redirecting every request. To use https properly, just convert all links in the database using a safe search-replace plugin such as Better Search Replace or via WP-CLI. [ ] - Consider using the plugin Index WP MySQL For Speed (https://wordpress.org/plugins/index-wp-mysql-for-speed/). WordPress table indexes are not optimised, and this plugin updates the table indexes to improve performance. [ ] - Don't have debugging plugins like Query Monitor active in production, they add overhead. (Likewise make sure Xdebug is not active on your production server.) Review your list of plugins more generally to ensure you are only using plugins that are actually needed. (That includes WPML Media, which is only needed if you need to display different images when showing translated content; it is not needed to translate image texts such as captions.) [ ] - Naturally, you page weight should be as low as possible, which means optimising assets such as JavaScript and CSS files, as well as compressing images. More specifically, relating to WPML: [ ] - Consider disabling "display as translated" (Fallback mode) from post types and taxonomies (in which case content will only be shown on secondary languages where translations exist; the resulting queries are much simpler). [ ] - Try disabling the setting to "Adjust IDs for multilingual functionality" at WPML > Languages > Make themes work multilingual. Recommended themes should not need this setting. [ ] - Turn off "Track where strings appear on the site" in String Translation if it is active. [ ] - Remove untranslated strings and strings that are not needed, as described in https://wpml.org/documentation/getting-started-guide/string-translation/#attachment_9608145 [ ] - From the troubleshooting page (via WPML > Support) at wp-admin/admin.php?page=sitepress-multilingual-cms/menu/troubleshooting.php try the "Cleanup and optimize string tables" and "Clear invalid strings" options. It might also be helpful to "Remove ghost entries from WPML tables". I did not try all of them, still going through the list, things feel a bit more faster now but I have a strong feeling that in the end, I might get to the point where I will further escalate this to our developers to take a closer look to more in-depth areas like the database. I will keep you up to date as soon as I have more news. PS: Also, please do not make any changes on the Cloudways server that I created for the moment so that I can see accurate results. |
July 24, 2024 at 11:29 am #15997949 | |
johnS-9 |
Hi Mihai, Just FYI, I'll be on annual leave for the next ten days, please don't close this thread while I'm away. - PHP version, caching, no debugging plugins etc, SSL, page weight are all things we already have in place. - Index WP MySQL For Speed. Interesting one I'll take a look into. I'll try the WPML specific suggestions when I return from leave, thank you. (I won't touch your copy of the site). --- I've tried this one in the past, but it caused a number of other plugins to have issues as well as a couple of things in the theme which don't use "the loop". "[ ] - Try disabling the setting to "Adjust IDs for multilingual functionality" at WPML > Languages > Make themes work multilingual. Recommended themes should not need this setting." Kind regards, |
July 24, 2024 at 7:37 pm #16000119 | |
Mihai Apetrei Supporter
Languages: English (English ) Timezone: Europe/Bucharest (GMT+02:00) |
I can assure you that this ticket will not get closed, so have no worries. 🙂 Me and our team will do our best to try to find out why things take such a long time. There might be a chance that the database might also need optimization. I will keep you up to date and I will wait for your response. Enjoy your vacation and we will keep in touch. I'm leaving the ticket assigned to myself. |
August 1, 2024 at 8:06 pm #16031276 | |
Mihai Apetrei Supporter
Languages: English (English ) Timezone: Europe/Bucharest (GMT+02:00) |
I just wanted to let you know that I'm currently waiting to hear from our developers. The situation has been escalated further, but it might take a while until we receive more information. I hope you are having an amazing vacation, and we will keep in touch. I will be back as soon as I have updates. |
August 2, 2024 at 8:23 pm #16034756 | |
Mihai Apetrei Supporter
Languages: English (English ) Timezone: Europe/Bucharest (GMT+02:00) |
Hi there. I am back. After our developer's investigation, it seems that the issue appears to be a combination between Admin Columns Pro plugin, ACF and ACFML. This accounts for quite a big performance chunk. A workaround is to go to "wp-content/plugins/acfml/classes/Strings/FieldHooks.php" and look for the method "\ACFML\Strings\FieldHooks::translateField". And there change: if ( self::isAcfFieldGroupScreen() ) { to: if ( self::isAcfFieldGroupScreen() || is_admin() ){ The situation has been further escalated so that it will be further investigated and handled in a future update of our ACFML add-on but for the moment, I wanted to take the time and share the quick workaround that we have available right now as I don't know how much time it will take until there will be a fix in the future updates. I hope that you are having an amazing time off and I hope that when you get back, this workaround will make you happy 🙂 |
August 5, 2024 at 7:52 am #16037805 | |
johnS-9 |
Hi Mihai, I'm back from leave now, that's fantastic! I'm so glad something has been identified! I've applied the patch to hidden link and to our production site and will monitor the situation. Looking at the code change, I would assume this would only benefit the frontend? I hope the future update includes a fix that will resolve the issue on the backend as well. Many thanks, |
August 6, 2024 at 12:16 pm #16043763 | |
Mihai Apetrei Supporter
Languages: English (English ) Timezone: Europe/Bucharest (GMT+02:00) |
Hi there and welcome back. I hope you had an amazing vacation! I wanted to double check with our developers first before I get back to you on your latest question. It seems that the assumption that this will improve the performance only on the front-end is incorrect. On the frontend this has to be executed. The workaround will bypass the further logic from executing by returning prior to running translateGroup public function translateGroup( $fieldGroup ) { if ( self::isAcfFieldGroupScreen() || is_admin() ) { return $fieldGroup; } return $this->translator->translateGroup( $fieldGroup ); } So this workaround should improve the performance in the backend, too. I hope that you will find this information helpful. 🙂 |
August 8, 2024 at 6:56 am #16050681 | |
johnS-9 |
Hi Mihai, Thanks for following up, ok makes sense, I didn't dive too deep into the change other than seeing the new is_admin() condition. Just testing with this in mind it does seem to be quite a bit faster (thank you!) but isn't on par with WPML being disabled, but maybe there's an unavoidable "weight" that comes with multi-language. Averaging around 1.5s - 2.5s to view the backend Articles admin listing. Looking forward to the fix being released! |
August 8, 2024 at 9:01 pm #16054358 | |
Mihai Apetrei Supporter
Languages: English (English ) Timezone: Europe/Bucharest (GMT+02:00) |
Hi there. I am happy to hear that you are seeing improvements 🙂 Yes, there's definitely an addition to the loading time taking into consideration the multitude of WPML functionality. As soon as there's gonna be a new version, you will definitely see it in the correct URL that you shared. I am not sure when this fix will be launched. We, supporters, don't have access to that kind of information and there are a lot of fixes that are worked on daily by our developers, taking into consideration how big is our database of customers and plugins that support WPML. All the issues are split into priority levels, and they are handled and launched based on that. So what I can tell for sure is that this issue, as long as it was already confirmed by our developers at the time when you reported the issue and when you received a workaround, will definitely be added to the future updates but I have no idea when that will be. Thank you so much for your understanding and I wish you an amazing rest of the day. |
August 12, 2024 at 8:45 am #16061093 | |
johnS-9 |
Hi Mihai, Should I mark this thread as resolved? Or should I wait until the plugin update is released? Also I just wanted to say thank you very much for your patience and persistence to help get this resolved. This is something that has/does affect all of our WPML sites so it has a big impact (for us at least!). Kind regards, |
August 12, 2024 at 11:59 am #16062040 | |
Mihai Apetrei Supporter
Languages: English (English ) Timezone: Europe/Bucharest (GMT+02:00) |
Hi there. I definitely understand the situation. However, I don't think it would help if we leave this ticket hanging as the issue has already been escalated internally but I am not sure when a more improved version of the fix will be launched. So I would say that it would be better to mark the ticket as resolved for now until a future update of ACFML will be launched that will include a fix for this exact situation. |
August 12, 2024 at 12:38 pm #16062184 | |
johnS-9 |
Ok, I'll mark this as resolved. Hopefully it makes it into the next few releases! Thanks for everything, all the best. |