Skip Navigation

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.

This topic contains 19 replies, has 2 voices.

Last updated by xiaoweiX 2 years, 3 months ago.

Assisted by: Nigel.

Author Posts
August 10, 2022 at 8:37 am #11838331

xiaoweiX

My site has a performance problem caused by many requests to admin-ajax.php after enabling a new language in WPML. I need help to figure out a fix. Could you help?

Here is a more thorough explanation:

It appears that after I enabled German in WPML. The backend post/page/product editors (and even WPRocket configuration page) send LOTS of admin-ajax.php requests like in this screenshot:

hidden link

It is not always reproducible, but it is eventually reproducible if I refresh the editor page or open another product/post editor page.

I recorded my findings in the following videos:

hidden link - in this video, I demonstrate the extra admin-ajax.php requests sent on WPRocket's settings page after German is enabled in WPML

hidden link - in this video, I extended my observation in post/product editors

August 12, 2022 at 3:26 am #11854077

xiaoweiX

Hi, any updates? Anything you need?

August 12, 2022 at 3:01 pm #11857725

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Hi there

Firstly let me apologise for the slow response, we aim for a lot better but have an unexpected busy spell coincide with a few holiday absences.

Regarding your issue, I've looked at the links you shared, but it is not easy to guess at what is happening without being able to inspect the back-end of the site.

So let me get access credentials from you.

It would certainly be preferable if you had a staging server we could examine, rather than the production site. If only the production site is available I can make some preliminary investigations at least.

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 13, 2022 at 11:10 am #11860627

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Thanks for that Shawn

If it doesn't happen on the staging server, perhaps I could get access to that as well so that I can compare?

I'll set another private reply for that, and I'll look into it when I'm back at my desk on Monday.

August 15, 2022 at 9:11 am #11865629

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

I can see the issue on the staging server so I'm not touching the production server.

I'm currently trying to take a copy of the site for testing, although biulding the package is very slow.

We have a similar report a few weeks ago, though your case has some key differences (that involved Translate Everything mode), and I'm waiting for some feedback from my colleagues.

I'll keep you posted.

August 16, 2022 at 5:38 am #11870175

xiaoweiX

Since you'll check the issue on copy site, I will disable the German language on the live site for now.

Thank you!

August 16, 2022 at 11:24 am #11872045

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

So we think the issue is related to hiding the languages. Why that happens is something for us to look further into, but to resolve the issue for you, can you on the production server add back German and unhide the extra languages (you currently have languages hidden, except for the default language).

This same is working on the staging server.

You should be able to hide the languages again and it continue to work normally, but whenever you add a new language you will want to avoid hiding it until a batch media translation job has a chance to run (and editing a product post is one of the actions that will trigger the job).

Can you please confirm that it works?

August 17, 2022 at 1:20 am #11876093

xiaoweiX

Thanks.

I tested. I did this: hidden link and observed my server load. It was still higher than usual, so I opened the product editor and saw lots of admin-ajax.php requests, like before.

Then I disabled hiding of both German and Spanish languages. And I tried to reproduce the ajax requests in the product editor. I eventually still did. hidden link

It appears disabling language didn't help.

My questions

1. Was my test to your point? Anything I missed?
2. Would disable media translation help?
3. If I had to disable language hiding, how can I prevent the search engines from indexing my translated site?

Thanks
Shawn

August 17, 2022 at 7:47 am #11877863

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

1. That was correct, and I went back in a briefy ran the tests myself just to be sure. It seems to require some action such as reloading the post—it didn't appear on the initial page load—but in any case I was able to reproduce the requests without hidden languages.

2. Yes, it would. Do you actually need/intend to translate the media (i.e. use different versions of the images on different language versions of the products)? The problem doesn't occur if you disable the WPML Media Translation plugin, and perhaps you don't need it. (You don't need it if you are using the same images but want different image titles and captions, for example. See https://wpml.org/documentation/getting-started-guide/media-translation/.)

3. Disabling language hiding was only supposed to be a temporary measure while a batch media translation job completed, but it doesn't seem to have helped on the production server anyway.

I'm still discussing this with my colleagues, but if you decide you don't need media translation then that would resolve the issue for you.

August 17, 2022 at 11:18 pm #11882839

xiaoweiX

I disabled media translation. Unfortunately, server load climbs up from near 0.5 to between 2 and 3 in about 5 mins.

August 18, 2022 at 9:41 am #11885727

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Sorry, the code trying to run the batch process is in the core WPML plugin not the Media Translation add-on, so disabling that doesn't prevent the batch from running.

It should be possible to update the settings to disable the translate media batch job, and am just confirming details with my colleague.

While I'm waiting on them, can I just ask a little about the history of the site? The default language is English, and yet if I disable the Spanish language temporarily I see that the site has 10000 Spanish images.

August 18, 2022 at 11:17 pm #11889903

xiaoweiX

Site's default language was English. Later Spanish was enabled. And media translation activated. Then I did this https://wpml.org/documentation/getting-started-guide/media-translation/#id5:~:text=Set%20language%20information%20for%20existing%20media and this https://wpml.org/documentation/getting-started-guide/media-translation/#id5:~:text=Translate%20existing%20media%20in%20all%20languages

August 22, 2022 at 1:49 pm #11905505

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Sorry, we're still looking into this and the auto-login link to the staging server no longer works. (It redirects to the front-end and we cannot access the back end.)

Could I ask you to re-enable it while we continue to work on this?

I'd better create another private reply in case you need to share different credentials.

August 22, 2022 at 2:45 pm #11905671

xiaoweiX

Sure, here is the new login

August 23, 2022 at 9:32 am #11910517

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Thanks for that. I've turned my discussions with colleagues into its own internal ticket about the issue and have escalated this issue to the second tier, and will report back when they have some findings to share.

Please keep the staging site available for them to access.