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 7 replies, has 2 voices.
Last updated by Nigel 1 year, 5 months ago.
Assisted by: Nigel.
Author | Posts |
---|---|
August 17, 2023 at 5:41 pm #14248221 | |
gustavG-2 |
I have two problems. All plugins are updated, all WPML requirements are met, WP core is updated. |
August 18, 2023 at 1:38 pm #14252777 | |
Nigel Supporter Timezone: Europe/Madrid (GMT+01:00) |
Hi there I visited your site. I noticed that switching language to navigate the load times were very long, whereas accessing the same pages directly they loaded very promptly. Checking the browser network requests I see that a ajax request made when clicking the language switcher results—eventually—in a 400 bad request, which accounts for the different loading times depending on how you arrive at a page. I don't know the cause of that, I'm going to run some tests locally in a similar setup (with different domains for each language) to see what to expect. Otherwise, the only thing that I note from your debug info is that the memory allocated to WordPress (128M) could be higher, but while that would likely improve performance it wouldn't be transformative. I'll get back to you when I've done a little more testing. |
August 18, 2023 at 2:22 pm #14253139 | |
Nigel Supporter Timezone: Europe/Madrid (GMT+01:00) |
OK, I can see how it is supposed to work on my local site, and from the plugin code it looks like the language switcher ajax request is failing because of a nonce problem, and I'll need to look into your site to see if I can determine why. Would it be possible to get access to the back end, and may I add some plugins to aid with debugging the issue? (I can also look at the back-end performance at the same time.) 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. |
August 21, 2023 at 11:53 am #14263445 | |
Nigel Supporter Timezone: Europe/Madrid (GMT+01:00) |
Thanks for that. I see that you are using an atypical set up for WordPress. I was intending to activate debug logging so that I could modify some of the WPML plugin code just to dump some vars to the log so that I can track what is happening with that particular code. (If I was working on a local copy of the site I'd be using Xdebug to step through the code execution, but that it arduous on remote servers.) While I can see how your configuration files are set up for the different environments, I don't really want to go editing these myself in such a set up, particularly the production environment configuration. Could you do that for me? Turn on debug mode for the environment I have access to (production), and confirm where I'll be able to find the resulting wp-debug.log file? (If you have a staging or development environment where I can see the same issue, naturally that would be better.) Also, in general the experience in the back end has been very zippy, the pages are quick to load. Do you have examples of some specific pages that are problematic that I should look at? Thanks |
August 21, 2023 at 12:29 pm #14263835 | |
gustavG-2 |
Debug is now activated and you'll find the log here: "../logs/debug.log" |
August 21, 2023 at 12:45 pm #14263941 | |
gustavG-2 |
And, I agree, the speed in backend is good now. This morning, I switched the PHP version back and forth witch seems to have "cured" the backend. Maybe some proceses that where causing this got interupted. |
August 21, 2023 at 3:25 pm #14265643 | |
Nigel Supporter Timezone: Europe/Madrid (GMT+01:00) |
Thanks for that. I've been able to isolate where in the code the problem is occurring, but not the cause. I'm consulting with my colleagues, so please bear with me a little longer while I await their feedback. In the meantime, the few lines of code I've added to the site for debugging shouldn't make any difference to your site, if you could please leave the debug.log active for now. I'll update you when I have some news. |
August 23, 2023 at 7:34 am #14275009 | |
Nigel Supporter Timezone: Europe/Madrid (GMT+01:00) |
Hello again I had another user reporting the something similar, although in their case they had a more conventional WordPress set up, and so I had them check what at first appears to be unrelated but which they confirm has solved the issue. Please see this erratum about performance problems related to String Translation with the latest WordPress update and try the proposed solution (Option 1): https://wpml.org/errata/wordpress-6-3-performance-issues-with-string-translation-in-specific-scenarios/ I'm not as confident that it will entirely resolve the issue on your site, because of your custom set up. Ordinarily when using separate domains per language (https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/how-to-use-wpml-with-different-domains-per-language/) when visiting the back end of the site this always occurs on the default domain (if you try to visit /wp-admin/ on a secondary language url you will be redirected to the default domain /wp-admin/). But on your site this doesn't happen, it is possible to navigate the back end at your secondary domain url. I think that is why the ajax request submitted when clicking the language switcher (which relates to passing session data between the sites) sometimes returns a 400 error, rather than just taking a long time (related to the String Translation issue, which is what happened with the other conventional site). Anyway, please try that, and let me know how you get on. |
August 23, 2023 at 8:55 am #14276173 | |
gustavG-2 |
I removed the "default" strings and the issue where resolved. |