This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with translating link targets and syncing menu items using WPML. Specifically, they encounter an error message 'Error! Reload the page and try again' when translating link targets and a 504 timeout error when syncing menu items, despite increasing the timeout limit. Solution: We identified that the issues occur when using WPML with the Breeze caching plugin and WooCommerce. Disabling the Cache System option in Breeze resolves the issue with translating link targets. For syncing menu items, if continuing with Breeze, we recommend adding the following code to the functions.php file of your Child Theme to handle currency switching for non-logged-in users:
Additionally, we suggest consulting the Breeze support to explore options for excluding specific scripts from caching. If Breeze support cannot provide a solution, please contact us for further assistance. Please note that this solution might be outdated or not applicable to your specific case. 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 issue persists, please open a new support ticket at 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.
Background of the issue:
I'm trying to translate all link targets on my website using WPML. Additionally, I need to sync all the items on my menu.
Symptoms:
WPML says 'Error! Reload the page and try again' when translating link targets. I also encounter a 504 timeout error when syncing menu items, even after increasing the timeout limit to 2 hours.
Questions:
Is there a way to translate link targets via code?
Is there a way to sync menu items via code?
I have access to the server so I can change the time to whatever value I have too. Is there a recommendation from your side that I can change it too. I had one time running the server with 2h and it wasn't enough
That is why I asked if there was a way to do this outside the backend and do it via a cron job for example
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Honestly, this is the biggest amount of internal links I have seen so far and I can not tell how long the dialog would need to run. I know that this dialog can demand a lot of time, but maybe we should check if an error will be logged while the dialog is running.
If 2 hours were not enough in the past, maybe try setting the limit even higher.
What I can offer is to take a look at the affected original contents and their translations and run some tests, if you provide me admin access and links to example contents.
Also, if you provide me admin access I can enable WP DEBUG and check for errors but please make sure first to set the time limit in PHP to a significantly higher value.
I would like to request temporary access (wp-admin and FTP) to the website to investigate the issue further.
You can find the required fields below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.
IMPORTANT
Please be sure to back up your website and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and website credentials will be set to "PUBLIC." DO NOT publish the data unless you see the required wp-admin / FTP fields.
I may need to install a plugin called "All In One WP Migration" to create a copy of the website so I can investigate the issue further on a virtual server for comparison.
The private reply form looks like this: hidden link
Click "I still need assistance" the next time you reply.
Video: hidden link
Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket using the private response form.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
The site has more than 12k products.
It would be very helpful in this case if you could provide exact examples.
Please send me the links or titles of the original products.
Further, there are 32 Updates available. Please do only report an issue, if you verified that the issue persists after running the site with the latest versions of all components (WP Core, Theme, Plugins).
Sorry for the late response on this subject. I found the route of the problem and it was related to the permalinks that were not correctly setup for the other languages.
I do have another problem. My client wants to include a currency switcher on the product page that should only change the currency and not the language. I have added it on the website but its not working. Do you know why? do they work independently?
Link to an example product in Euros (€) - hidden link
Can you please try to change it to Pounds (£) and see why its not working?
Thank you for confirming that the currency switcher works independently from the language switcher, and I have updated most plugins. Some are not possible because, being a staging site, licenses didn't carry over.
This is still not working. The page reloads and the currency doesn't change. Here is a link to a product - hidden link you can test in your side
Sorry I was referring to the woocommerce settings "Default customer location" not WPML.
I have asked a colleague in the office to try the currency switcher again and still not working.
We used the same environment as shown on the video. We are in the UK while trying this. Are you in the UK as well? Does my location interfere with the switch of the currency?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
I was able to recreate the issue using only WPML and Breeze with WooCommerce on a test site in a minimal setup:
Example: hidden link
Disabling the Cache System option in Breeze solves the issue.
---
Before taking any further steps, could you please ask the "Breeze" support about how to avoid caching for the currency switcher's script which is located at /wp-content/plugins/woocommerce-multilingual/res/js/wcml-multi-currency.min.js.
I tried to exclude the script from caching using the plugins options, but it seems not to solve the issue.
---
If the Breeze Support can not provide a solution, please get back to me so that I can escalate this issue internally.