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 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 4 replies, has 1 voice.

Last updated by Andreas W. 1 week ago.

Assisted by: Andreas W..

Author Posts
February 21, 2025 at 2:43 pm #16734201

desireeM

Background of the issue:
We have the issue described here https://wpml.org/errata/wrong-url-on-translated-media-files-when-using-a-different-domain-per-language/

Method 1) does not work and also isn't feasible, since we cannot manually edit 10000s of images
Method 2) runs. The 2nd "part" which is "Processing strings... 1820 of 87592 done." which does 10 per ~1 second. So this would take more than 24 hours to run. In reality it never finishes, bc after some time it fails bc the nonce is invalid, since it expired.

Additionally though, it doesn't seem to work either. Since I assume for wp-admin image display it's not in strings but in things it fixes in the first step. However when I open the product edit page, I still see the wrong URL for the images on the right side/where I can add/change the image (URL lik hidden link)

Symptoms:
The process 'Processing strings... 1820 of 87592 done.' takes too long and fails because the nonce becomes invalid.
Additionally, the wrong URL is still displayed for images on the product edit page.

Questions:
You need to change your code to provide a new nonce for every AJAX call to prevent the nonce expiration. In the meantime, is there any workaround?

Method 2 (neither 1) seem to work anymore. How to fix this now? This bug is known since almost 3 years, why wasn't this properly fixed in the meantime?

February 25, 2025 at 6:56 pm #16747516

desireeM

Even though the symptoms are the same as in your open issue, it seems like the actual cause of the bug is https://wpml.org/forums/topic/wrong-uploads-url-in-wp-admin/ - since the media is correct, the issue is that WPML returns the wrong URL for uploads in wp-admin

February 26, 2025 at 7:50 pm #16753252

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

Hello,

As this is a CORS issue there is not really something we can do from our end. Any browser's security mechanism will not allow to access the same site's backend from two different domains.

Basically, if you use different domains, it will be like this:

Original:
hidden link
hidden link

To make sure of the media on your second domain, you will need to be logged in on that domain. On WPML > Languages inside the site's URL settings, you find an option to automatically log in between different domains.

Can you please test if this works out for you?

Best regards
Andreas

March 4, 2025 at 7:48 pm #16775777

desireeM

Just keeping it open until the other issue is resolved first to be able to 100% tell if this is a separate issue to be checked or not.

March 4, 2025 at 9:43 pm #16776041

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

Sure, we can leave the ticket open for a maximum of 14 days.

Please make sure that at WPML > Languages > Language URL format > A different domain per language the option "Auto sign-in and sign-out users from all domains" is enabled.