Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was experiencing timeouts when trying to save products on their website. After disabling plugins one by one, they identified that WPML was causing the issue.

Solution:
First, we recommended disabling Cloudflare temporarily and enabling PHP error logging to share the error logs. We provided resources on how to enable error logs:

After analyzing the logs, we found database errors related to W3 Total Cache plugin interfering with database queries. We suggested disabling W3 Total Cache temporarily, clearing the DB cache, and adding "WP_ADMIN" in the "Reject constants" to prevent caching of admin requests.

Additionally, our second tier support identified a small database corruption. The client needed to remove the postmeta value with the key name "_icl_lang_duplicate_of" where the meta value was the post ID causing the issue. The SQL query provided was:

DELETE FROM `wp_postmeta` WHERE `meta_key` = '_icl_lang_duplicate_of' AND `meta_value` = '22037';

It was important to adjust the table prefix to match the client's site database prefix and to make a database backup before executing the query.

We also provided information on the tools and techniques used for debugging, including the use of a local server stack, Xdebug, and an IDE for step debugging.

If the solution provided here is not relevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket in the 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: ,

This topic contains 33 replies, has 3 voices.

Last updated by George Botsev 9 months, 4 weeks ago.

Assisted by: Waqas Bin Hasan.

Author Posts
April 5, 2024 at 3:32 pm #15488887

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I think there's a little confusion here, please correct me if I am wrong.

1) What is PRIME MOVER and "demo website"? As long as I can see based on the conversation on this ticket, you provided access to hidden link where we observed the issue in the beginning. Besides this we don't have any demo website reference.

2) For the migration which happened right after we observed the issue in your site (in very beginning), we provided our own test site on our controlled Cloudways server. You completed the migration and we observed that issue isn't happening in there. It is the same site for which I recently provided you access again.

3) Yes, later you provided a downloadable copy of your website, which I couldn't setup on my local but our 2nd tier team was able to assess the database and since then I am communicating based on their findings. Is this the demo site you are referring to? But I don't think there's any such thing in our notice, except your live site and the CW site (as mentioned above).

Anyways, meanwhile I am communicating with our team, so they can investigate directly in your live site - based on your confirmation about activating/deactivating plugins and caches.

I'll update you as soon as there's more information.

April 5, 2024 at 4:10 pm #15489019

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

With reference to my recent message, our team needs following confirmation before testing in the live site:

- A working FTP Access.
- Confirmation that you've taken a fresh and full backup of site.
- Your permission to disable/enable anything and install new plugins for debugging.

Alternatively you can create a staging/test website on your server for us where the problem can be replicated as we can't replicate this on our CW test site.

Please confirm it in your next reply or let me know if you do not agree with the mentioned.

I've set your next reply as private to share this information safely.

IMPORTANT: If you don't see the section for providing access information, do not write in the message box or the information may appear as public.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

April 8, 2024 at 8:55 am
April 8, 2024 at 4:01 pm #15495464

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your cooperation. I've relayed the message to the team and 'll update you as soon as there's more information.

April 9, 2024 at 2:46 pm #15499986

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Hello!
I am George from the second tier support and your ticket is assigned to me.

I checked the problem with updating the product that you mentioned.
It appears that you have a small database corruption that can be pretty easily fixed.
You have to remove the postmeta value where the key name is "_icl_lang_duplicate_of" and the meta value is the post ID that you are trying to update e.g. : 22037
This was creating a loop in our logic as the value belonged to another post in the same language.

Such SQL query that you can execute by PHPMyAdmin is:

DELETE FROM `wp_postmeta`
WHERE `meta_key` = '_icl_lang_duplicate_of' AND `meta_value` = '22037';

Do note - you have to adjust the value of "wp_postmeta" to match your site database prefix.

Please make backup of your database before doing any destructive changes on your site - just to be on the safe side 😉

April 10, 2024 at 8:58 am #15503061

germaneK

Hello,

I am pleased that you found the solution beneficial for your debugging.
Could you kindly share how you identified the database corruption, the indicators you noticed, and the underlying cause of the issue?

Thanks!

April 10, 2024 at 9:34 am #15503407

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Hello!
Sure, I can share with you what I know...

As you have provided a database dump to us, I used it locally and I was able to reproduce the problem and identify the loop that led to a timeout while updating, caused by an entry in the post meta key "_icl_lang_duplicate_of".
That key had corrupt data - basically pointing the post with id 22062 and signaling that it was a duplicate of the post with id 22037, while both posts were having the same language and different translations pair members (different posts).
So the ID 22037 and 22062 were not in a relation according to our other glue tables, in any other way except the post meta key "_icl_lang_duplicate_of".

I cannot say how this post meta key appeared in the first place and how the corruption came to be - but the issue is pretty clearly noticeable once you can do a step debugging.

Further than that, I have notified our developers of this possible scenario and the implications that it could create, and so it will be taken into consideration.

April 10, 2024 at 9:42 am #15503513

germaneK

Could you please explain how you identified the loop that caused the timeout? Did you utilize any specific tools for this task? I am inquiring out of curiosity and will take this into account for future debugging of this issue or same like this.

April 10, 2024 at 9:53 am #15503579

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

I can point you to some of the tools, but I cannot describe the whole process of debugging the issue. It involves knowledge of WordPress and its hooks (in this case "save_post" hook -> https://developer.wordpress.org/reference/hooks/save_post/ ), WPML plugins, skills and experience.

I use a LAMP/MAMP stack locally (hidden link) with an installed and configured properly Xdebug plugin for PHP (hidden link) and an IDE - in my case PHPStorm (hidden link) but you can use also VSCode or Eclipse (another personal favorite of mine) or Netbeans.

A good starting tutorial you can use is: hidden link

April 10, 2024 at 10:01 am #15503606

germaneK

I am incredibly thankful for your help. I'll definitely keep that in mind for next time, and it would be amazing if WPML could take care of this issue in the upcoming versions. Thanks a million for all your support - it truly means the world to me!