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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

This topic contains 34 replies, has 2 voices.

Last updated by Prosenjit Barman 1 month, 2 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
October 30, 2023 at 12:00 pm #14690719

aarniH

"WooCommerce Multilingual & Multicurrency" slows our site's REST API to a crawl. When using Woocommerce API batch update, to update stock only (25 products at once) it takes close to 4 minutes to run the update, when disabling the plugin, it completes in 2-3s.

Active plugins: Woocommece, WooCommerce Multilingual & Multicurrency, WPML Multilingual CMS and WPML String Translation
Wordpress theme: Twenty Twenty-Three
Memory limit: 512M (PHP & WordPress)
PHP version: 8.0.30
Plugin versions: Latest as of 30/10/2023.
Products: ~1900 in main language + 5 translated languages (translations sync stock etc from main)

All the troubleshooting steps found in the WPML troubleshooting page, etc have been tried multiple times.
Any ideas what could be the problem or where to look for more debug information?

Example partial batch payload:
[{"id": 31741, "stock_quantity": 0}]

October 31, 2023 at 7:02 am #14696811

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand the issue you're having and will try my best to assist you in this matter. To get a better overview of the site and server, please share the debug information of the site in the section that will appear below this ticket.

In this link, you will find the steps to follow: https://wpml.org/faq/provide-debug-information-faster-support/

Please don't paste the debug information directly within the ticket.

Additionally, if you've enabled the Multicurrency feature within the WooCommerce Multilingual, would you please try disabling that feature?

Looking forward to your response.

Best regards,
Prosenjit

October 31, 2023 at 8:18 am #14697205

aarniH

We do have the Multicurrency feature enabled, but disabling it makes no difference. Only disabling the whole plugin does the slowness end.

November 1, 2023 at 5:59 am #14705123

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for trying out the suggestion.

To investigate the problem, I conducted some tests within my development setup. I updated the stock for over 30 products using the REST API via the "Postman" application. With WooCommerce Multilingual activated, the process finished within 8-9 seconds. Here's a screenshot for your reference: hidden link

When I deactivated the plugin, the duration reduced slightly to 6-7 seconds. Such a minor difference is expected since the stock field synchronizes with the translated product. Therefore, during an update, the translated product is updated as well.

Since it takes several minutes on your end, there might be a configuration related to the API causing the delay. Would you please check and confirm that the WooCommerce Legacy API is not enabled on your site? Please follow the steps below.

- Go to "WooCommerce > Settings > Advanced → Legacy API"
- Ensure that the "Legacy REST API" option is disabled.

You can also switch to a default theme like 'twenty twenty-one' and check if the issue persists there or not.

Let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

November 1, 2023 at 8:52 am #14705965

aarniH

For the whole duration of testing, we've been using the theme "Twenty Twenty-Three", which is the default for WP 6.1.

We've also never used or even had the Legacy REST API enabled for Woocommerce.

November 2, 2023 at 4:16 am #14712371

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for the update.

Since the issue is happening in a minimal setting, could you please verify if there are any restrictions in place for the REST API on the server? Additionally, if there's any server-side caching active, consider clearing those caches too.

If the issue persists even after that, a closer inspection will be required to understand the root cause of the issue. I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.

You will find the needed fields below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT
-Please backup site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Looking forward to your response.

Best Regards,
Prosenjit

November 3, 2023 at 8:32 am #14723305

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for sharing the DB and Site dump.

Unfortunately, the site dump is returning a Fatal Error which is why, I can't proceed further.

Instead of sharing the WordPress file, will it be possible for you to create a migration package using the All-in-one Migration plugin and share the package with us? This process is more easier and recommended as well.

Just install the All-In-One Migration plugin(https://wordpress.org/plugins/all-in-one-wp-migration/) on your site and create an export file by excluding the Revision, media files and comments(Screenshot: hidden link). Once the export file is ready, Download the file, upload it to Google Drive, and share the link to the file. FYI, the files and database will be included within the downloaded file.

You can also check the guide on exporting using the AIO Migration plugin: hidden link

I have enabled a private field for you so that you can securely share the file(Simply add the link as you did before).

I will deploy the package and investigate the issue further. Looking forward to your response.

Best regards,
Prosenjit

November 6, 2023 at 7:06 am #14734969

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well. Sorry for the delay in responding due to the weekend.

Thank you for sharing the package. I'll proceed to set it up in my local environment for a deeper examination. Once I have insights or updates, I'll surely inform you.

I truly appreciate your patience and kind cooperation in this matter.

Best regards,
Prosenjit

November 7, 2023 at 4:55 am #14742853

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,

I have deployed the package and conducted multiple tests, unfortunately, I was still unable to pinpoint the underlying cause of the issue.

However, for further investigation, I escalated this issue to the 2nd tier team. As soon as I have any update from them, I will let you know.

Thank you for your patience.

Best regards,
Prosenjit

November 15, 2023 at 11:29 am #14807575

aarniH

Are there any updates, it's been a while?

November 16, 2023 at 3:34 am #14821583

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,

I hope this message finds you well. Our development team has conducted a thorough investigation into this matter. We've identified the root cause of the problem, and it appears that resolving this issue will require significant refactoring of the code. I understand that this might be disappointing news, and I want to assure you that we are committed to finding a solution as swiftly as possible.

Unfortunately, at this moment, we do not have a workaround to offer. However, our team is actively working on addressing this issue. To keep our users informed, we have published an errata, which provides more details on the matter. You can view it here: https://wpml.org/errata/woocommerce-multilingual-significantly-slows-down-rest-api-response-during-bulk-product-updates/.

Please rest assured that we are doing everything we can to resolve this as quickly as possible. I will make sure to keep you updated on our progress and notify you as soon as a solution is available. Additionally, updates will be posted on the Errata page, so we recommend checking there for the latest information.

Your patience and understanding in this situation are greatly appreciated. If you have any further questions or concerns in the meantime, please do not hesitate to reach out.

best regards,
Prosenjit

November 16, 2023 at 9:19 am #14823447

aarniH

Thank you Prosenjit for your reply.

I'm glad to learn that the issue has been identified. Is there some kind of timeline for a possible fix/workaround? Are we talking days, weeks or perhaps even months?

This issue is critical to us and I'd assume to many others as well, as it prevents any kind of mass product updating.

November 17, 2023 at 4:49 am #14831661

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,

At this moment, we do not have a specific estimated time of resolution (ETA). I understand this may not be the news you were hoping for, and I sincerely apologize for any difficulties this may be causing you. Please be assured that our team is diligently working to resolve this issue as efficiently as possible.

We value your patience and understanding in this matter. I will ensure to keep you informed with regular updates as we progress towards a solution.

Best regards,
Prosenjit

November 27, 2023 at 12:14 pm #14929703

aarniH

Has there been any updates on this so far? At least the errata link hasn't been updated.

Also what is the cause of this problem? Asking because when we know the issue we could come up with a possible workaround.

November 28, 2023 at 7:38 am #14936295

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well.

Thank you for reaching out for an update on the ongoing issue. I wanted to let you know that our development team is currently working on resolving the problem. As of now, we do not have any new updates to share, which is why the Errata page remains unchanged.

As mentioned before, a significant refactoring in code is necessary to effectively address the issue. Our team has pinpointed that the root of the problem stems from a specific hook: woocommerce_rest_insert_product_object. There are different actions and logic to sync a product with its translation involved with this. So, we need to be careful about the approach to solve the issue.

We understand the importance of this matter to you, and we are doing everything we can to expedite the process. As soon as there are any developments or updates, we will make sure to inform you promptly.

Thank you for your patience and understanding in this matter.

Best regards,
Prosenjit