[Resolved] Menu sync time out issue - workaround or Patch?
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing timeouts with Cloudflare when using WPML to synchronize and translate menus due to high resource usage and extensive database queries. This issue is exacerbated by the n+1 query problem with a large number of menu options and languages. Solution: We recommend the following workarounds to address the timeout issue: 1. Manually translate the menu to avoid triggering the resource-intensive synchronization process. 2. Temporarily disable Cloudflare while running the menu synchronization or translation process, which will prevent Cloudflare from stopping the request. 3. Consider upgrading to Cloudflare Pro, which allows for a higher timeout limit (up to 100 seconds), potentially preventing these interruptions.
If these solutions do not resolve your issue or seem outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at WPML support forum for further assistance.
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.
I am trying to update the site hidden link using WPML, specifically focusing on modifications, translations, and menu synchronization. A developer identified that the WPML menu sync feature is resource-intensive, leading to Cloudflare timeouts. They attempted optimizations like clearing the PYS events queue table, installing WP-Optimize, logging database queries, running menu sync via CLI, and considering caching options like Kinsta's Redis cache. The issue seems related to the n+1 query problem due to the high number of menu options and languages.
Symptoms:
The menu sync feature in WPML is causing Cloudflare to time out due to high resource usage and a large number of database queries.
Questions:
Can WPML authors suggest a workaround or patch to make the menu sync feature less resource-intensive?
Is there a way to solve the n+1 query problem in WPML's menu sync feature?
Can WPML stream output to prevent Cloudflare from timing out?
1.- Please describe step-by-step how to reproduce the issue on the site.
2.- Share the access credentials to the site in your next message, which I have set private. This way, we will be able to reproduce the steps described in the previous point and check the configuration.
Confirm you have created a full site backup that you can restore if necessary.
Hi Jasmin,
Thank you very much for sharing the credentials requested.
I was able to reproduce the issue, and I will need to run more tests to isolate its cause. Therefore, I kindly ask you to create a staging site with a copy of the production site (you can use the WP Staging plugin for free), where we can run all necessary tests without affecting the live site.
I have set your next message private so you can share the credentials privately.
I ran several troubleshooting steps, but the issue persists. I need your authorization to create a copy of the staging site to escalate this ticket to our 2nd tier of support.
Hello Carlos
Creating the copy on your end, I guess? I see no problem. Or do you need me to create a staging site of the testing site I sent you? Whichever, my answer is yes.
Hi Jasmin,
Thank you very much for your authorization
I couldn't create a copy of the staging site, but I have escalated this ticket to our 2nd tier of support, where our specialists will take a deeper look and will try to find a solution.
In the meantime, please don't make any changes on the staging site.
I will keep you updated on the evolution of this ticket. Thank you very much for your patience and understanding!
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Madrid (GMT+02:00)
Hi there!
This is Paola and I will continue with the ticket as Carlos is on holidays.
I’ve checked everything with our second-tier team, and the issue is related to Cloudflare’s execution time limits, which unfortunately cannot be increased on the free plan.
Even if you raise the PHP memory limit and the max execution time on your hosting (Kinsta), Cloudflare will still interrupt the process once it reaches its timeout limit.
To move forward, there are a few possible workarounds:
1. Translate the menu manually
This avoids triggering the long process that Cloudflare blocks.
2. Temporarily disable Cloudflare
Once disabled, you can run the menu synchronization or translation process without Cloudflare stopping the request.
3. Upgrade to Cloudflare Pro
The Pro plan allows adjusting the timeout limit (up to 100 seconds), which should prevent the interruption.
We are already CLF PRO plan... Can you tell us where exactly we can increase the time?
nevertheless, that's not the fixing... Why is it taking so long? I was never like that. Could you please tell me the reason? And how to fix it?
Hello Paloa
Could you please tell me the reason why it became so long? The DB is LARGE due to WPML creating data. We hired a developer, but he can't solve it, so we're asking WPML support for the proper solution.
Thanks