Please make sure to update to WPML to the latest and check our list of Known Issues before reporting

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 20 replies, has 3 voices.

Last updated by Itamar 5 days, 3 hours ago.

Assigned support staff: Itamar.

Author Posts
December 27, 2019 at 11:05 am #5200019

stefanS-102

Hi!

We have had a lot of CPU problems lately and been reaching high over CPU limtes on our hosting account. We have the "GoGeek" account on Siteground, which has the most CPU limits available. Investigated it further and it was multiple problems, all related to WPML.

* When working in admin, with products, "/wp-json/wpml/tm/v1/ate/jobs/download/" will be called 5 times for each page load, burning CPU, on our other site the same script will loop endlessly hundreds of times. Solved this temporarily by turning of Advanced Translation in WPML. Tried truncating the downlods-table, doesnt help.

* When working on frontend, if we have multiple tabs, if you switch language in one tab "cart-fragments" will start looping on all open tabs eating thousands of CPU seconds within a couple of minutes. Same goes if one of our customers has open the site before, then switching language on a new tab. That will kill the CPU.

Read about multiple people having similar problems, getting taken down from Siteground because of WPML.

December 28, 2019 at 1:31 am #5202419

stefanS-102

Hi!

But you just wrote the SFTP credentials to that server on a public forum, and asking me to put my files and database there?

December 30, 2019 at 8:09 am #5209913

Yvette
Supporter

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

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

the reply is now private - please let me know when your migration is done.
I will need you to also communicate a username/password which we can use to log into the migrated site.

I am opening the private area for this information.

December 30, 2019 at 8:44 am #5210007

stefanS-102

Hi, thank you for your reply.

Can you change the credentials to that server or start a new one. That info is already indexed on Google and public. We dont want to upload our customers information to a server that is reachable to anyone.

Hope you understand

Thank you.

December 30, 2019 at 12:05 pm #5210873

stefanS-102

Hi!

I´ve now moved the site, to recreate the bugs:

Bug 1:
* Go to products, or posts, products is worse than posts. See never ending calls to "/wp-json/wpml/tm/v1/ate/jobs/download" beeing called. Use Firebug or similar to see the js-reloads.

Bug 2:
* Open the site, frontend. Add a product to the cart, open a new tab and change language on that tab. A loop will start calling cart fragments with 3-4 cpu seconds used every second.
Sometimes this happens directly, sometimes if you refresh or go to another menu option on both tabs the loop will start. When this start we see 20 000 cpu seconds used within minutes.

login:
username: wpml
pass: F(jRhbBwecp8gAmQ4sMC5Dav

December 30, 2019 at 12:12 pm #5211015

stefanS-102

To recreate the second bug easier.
Have something in the cart, but refresh or be on another page than the one you were at when adding the cart item. Then open a new tab and change language.

I believe the call to cart fragments wont happen with ajax on the page where you added the item since that is being called when adding the item. So be on any other page and the loop will start.

December 31, 2019 at 4:26 pm #5216599

Yvette
Supporter

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

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

Hi there,

I tried logging in with the credentials you provided...but they don´t seem to be working.
Can you please check them again?

December 31, 2019 at 5:30 pm #5216705

stefanS-102

I cant, your server doesnt work anymore. Prompts for error on a folder, which is not reachable, does not exist, and its not possible to create the folder due to SFTP permissions

January 2, 2020 at 1:01 pm #5223661

Yvette
Supporter

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

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

Oh = ( I cannot connect either.

Can we try the migration again? Please open the private area below here for the new server instance to migrate to:

January 2, 2020 at 9:55 pm #5226037

stefanS-102

Hi!

Can you remove the database and our files from the old server, and just upload a demo with WPML and Wpml woocommerce. The error is not specific to our page. I can show you the error on a demo page.
Spent two nights migrating the site to servers that does not work. The sftp-user do not have permission to create the missing folder, and the www-user does not have permssions to create it either. Neither to remove the files. The error was not there after migrating the site so the permissions on your server is messing up the plugins permissions to unwritable folders.

January 3, 2020 at 12:00 pm #5229301

Yvette
Supporter

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

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

Hmmm. I am not aware of these restrictions to be honest but I am also unable to connect via sftp.

1. Failed migrations
OK I´ve removed the two migrated servers although the last one I gave you did not seem to have any data there in teh first place...

2. Demo site
You wrote: ":.. I can show you the error on a demo page...."
I currently only have the cloudways servers to offer but I can provide a demo site within this context. Please try logging in here:
hidden link

Does this help?

January 3, 2020 at 12:28 pm #5229559

stefanS-102

Hi Yvette, thank you for your reply and setting up the demo page.

The reason i wanted the old files and database removed is because i wrote the login credentials for the account i created to you, here in a private message, yet it shows as a public message. Therefore, for safety reasons, i wanted the database and files removed. Are both the database and webserver removed?

I will recreate the bugs on your demo page.
Thank you for your help.

January 5, 2020 at 11:45 am #5236325

stefanS-102

Hi!

Here is bug nr 1 on your demo page, the most serious one.

Steps:
* Have cart synced between languages in Wpml settings
* Have a translated item in the cart
* Change language in one tab when having multiple tabs open.

This will create a infinite loop eating cpu, each open tab will start the loop calling: ?wc-ajax=get_refreshed_fragments once every second, for example 5 tabs eats more than 5 cpu seconds each real second.

Its not uncommon, especially on mobile devices that customers have 4-5 tabs opened browsing different products. If the customers change the language in one of these tabs the loop will start until the server goes down or the user gets banned from the server.

Another common scenario that a customers browse the page, have the old tabs open in the background on a mobile device, comes back a day later, and as the language selection is not stored properly by WPML they will be sent to the default language. Having 1 tab in default language and 3-4 tabs in their language selection. This will also start the loop and kill the server.

See video:
hidden link

January 9, 2020 at 12:46 pm #5261649

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, @stefans-102

Yvette asked me to take care of this ticket. I hope that it is OK with you.

As we already recently discussed in another ticket (see below link), this issue (calling: ?wc-ajax=get_refreshed_fragments once every second) is being debugged again by our WooCommerce Multilingual developer.
https://wpml.org/forums/topic/massive-server-cpu-spike-due-to-woocommerce-multilingual/page/2/
I can tell you that one of our top superiors also aware of this issue and asked the developer to look into it. I'll keep you updated here when I have news regarding this issue.

In this ticket, you also mentioned another backend issue (/wp-json/wpml/tm/v1/ate/jobs/download/). This issue is known to us. You can see a reference to it in another forum ticket here.
https://wpml.org/forums/topic/extremely-high-executions-by-wpml/

The problem is that an ATE job can get stuck in the download queue if it's not processed within 7 days. Please proceed like so to correct it.
1. Take a backup of the DB of your site.

2. Connect to the database and empty the table _icl_translation_download.

After that, everything should work. WPML will make a call to ATE to fetch new data about jobs, download them, and no more calls to that URL (because the queue will be empty).

This issue is escalated to our developers, who will fix it in future versions of WPML. I'll let you know here once the version with the fix will be released.

Thank you for your patience.
Itamar.

January 9, 2020 at 8:58 pm #5265031

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

The status of this thread is now set to 'Escalated to WPML developers team'.
I'll keep you updated here when I have news regarding this issue (calling: ?wc-ajax=get_refreshed_fragments once every second).

Thanks,
Itamar.