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: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 51 replies, has 2 voices.

Last updated by Waqas Bin Hasan 2 years, 1 month ago.

Assisted by: Waqas Bin Hasan.

Author Posts
March 22, 2023 at 2:02 pm #13305795

robinB-8

Here's the full text I chatted with WP.com:

---
dev99devWed, Mar 22, 12:56 PM
WPML plugin not compatible with WP.com hosting. I contacted WPML support on this thread: https://wpml.org/forums/topic/wpml-string-translation-conflict-with-wpml-media/ . You can go and read for learn more. And last message that WPML said to me that: " If you can reach WP.com hosting support and ask them, what can be adjusted on hosting to avoid this? You can share the above mentioned video, as well as, this thread for a reference." Please see this video hidden link

OperatorWed, Mar 22, 12:57 PM
Hi there!

OperatorWed, Mar 22, 12:58 PM
I watched the video link you included, but I don't understand what the video is demonstrating.

OperatorWed, Mar 22, 12:58 PM
I saw that an translated media file was uploaded, and then 3 plugins were disabled.

OperatorWed, Mar 22, 12:58 PM
Then a page on the site was reloaded, but I didn't understand what that was meant to show.

dev99devWed, Mar 22, 12:59 PM
Please see thread

dev99devWed, Mar 22, 12:59 PM
at wpml.org above

OperatorWed, Mar 22, 1:00 PM
I see. Allow me a few minutes to read the thread.

dev99devWed, Mar 22, 1:03 PM
note: that thread have 2 pages

OperatorWed, Mar 22, 1:03 PM
Thank you

OperatorWed, Mar 22, 1:07 PM
I saw that WPML recommended deactivating the CDN. I can explain how to deactivate the CDN.

dev99devWed, Mar 22, 1:07 PM
they disabled CDN

dev99devWed, Mar 22, 1:07 PM
thanks

OperatorWed, Mar 22, 1:08 PM
The CDN is still active.

dev99devWed, Mar 22, 1:08 PM
how to deactive the cdn?

OperatorWed, Mar 22, 1:09 PM
From the left menu tabs, click on Jetpack. Then, in the top right corner, click on Settings.

OperatorWed, Mar 22, 1:09 PM
You will now see new navigation tabs across the top: Security, Performance, Writing... Click on Performance.

dev99devWed, Mar 22, 1:09 PM
yeah

OperatorWed, Mar 22, 1:10 PM
To deactivate the image CDN, deselect the option "Speed up image load times," like this: hidden link

dev99devWed, Mar 22, 1:10 PM
I disabled cdn, thanks

dev99devWed, Mar 22, 1:11 PM
after disable cdn, error still have

dev99devWed, Mar 22, 1:11 PM
the same issue still have

OperatorWed, Mar 22, 1:12 PM
I'll take a look for you to try to understand the problem, but to be clear, WPML is a product made by a company separate from WordPress.com, just to set your expectations on whether I'll be able to help. The WPML product is outside of the scope of what I can help with.

dev99devWed, Mar 22, 1:13 PM
yeah

OperatorWed, Mar 22, 1:18 PM
On my end, the English pages now load the English image, and the Vietnamese pages now load the Vietnamese image, which seems to be the proper action. Here is a video demonstrating my tests: hidden link

OperatorWed, Mar 22, 1:19 PM
It seems that deactivating the image CDN may have resolved the issue.

dev99devWed, Mar 22, 1:19 PM
Please F5 several times

dev99devWed, Mar 22, 1:19 PM
it will show english image again

OperatorWed, Mar 22, 1:19 PM
I did F5 several times in the video.

dev99devWed, Mar 22, 1:19 PM
please try one more time, because I have just removed cache from wp.com

OperatorWed, Mar 22, 1:22 PM
I have refreshed many times, and I still see the Vietnamese image on the Vietnamese page.

dev99devWed, Mar 22, 1:23 PM
I can clear cache (I am using wordpress.com hosting) and image will come back vietnamese version, but when I go to advanced editor of Vietnamese page at : hidden link..., and don't change anything, but click to complete button, after that I go to Vietnamese page and after several F5 (refresh) page, image come back to english version

OperatorWed, Mar 22, 1:24 PM
It seems like the problem has to do with the WPML advanced editor. This isn't something I'm able to help with.

OperatorWed, Mar 22, 1:24 PM
On my end, now that the CDN is disabled, I cannot reproduce the issue that you initially described.

dev99devWed, Mar 22, 1:25 PM
hidden link

dev99devWed, Mar 22, 1:26 PM
please go to this url: hidden link

dev99devWed, Mar 22, 1:26 PM
because I removed cache

dev99devWed, Mar 22, 1:26 PM
so please only go to this url to check

OperatorWed, Mar 22, 1:29 PM
Like I've mentioned, I can't reproduce the issue on my end. I can only see the Vietnamese image. I would ask that you refer back to WPML for help with how to resolve the issue. Earlier in your thread, I saw that you mentioned that this doesn't happen when the WPML String Translation plugin is disabled. I would start by looking at that plugin.

dev99devWed, Mar 22, 1:31 PM
You can not reproduce the issue because you removed cache, but not go to "advanced editor" of vietnamese version and click to "save"

dev99devWed, Mar 22, 1:32 PM
if you click save, image will replace to english version

dev99devWed, Mar 22, 1:32 PM
this is link to advanced editor:

dev99devWed, Mar 22, 1:32 PM
hidden link

OperatorWed, Mar 22, 1:32 PM
Going to the advanced editor is outside of the scope of what I can look at because that is only a WPML product.

dev99devWed, Mar 22, 1:32 PM
advanced editor is on hosting: hidden link

OperatorWed, Mar 22, 1:32 PM
On my end, after the cache is cleared, no action on the live site can bring back the English version of the image.

dev99devWed, Mar 22, 1:35 PM
yeah

dev99devWed, Mar 22, 1:46 PM
do you still fix it?

OperatorWed, Mar 22, 1:47 PM
No, I'm unable to fix the issue with the WPML plugin. You'll need to work with the WPML support team to address this issue.

dev99devWed, Mar 22, 1:47 PM
thanks

OperatorWed, Mar 22, 1:47 PM
You're welcome!

dev99devWed, Mar 22, 1:49 PM
WPML team sent other video:

dev99devWed, Mar 22, 1:49 PM
Hi, In addition to previous message, the video (hidden link) clearly shows that even WPML is not active, problem is still there. So we believe WP.com support need to look into that in detail. Please remember to forward the video to them.

OperatorWed, Mar 22, 1:49 PM
Let me take a look. I will only be a moment.

OperatorWed, Mar 22, 1:52 PM
I am still looking into this. Thanks for your patience.

OperatorWed, Mar 22, 1:54 PM
If you clear your site cache, it works?

dev99devWed, Mar 22, 1:54 PM
when I clear cache , it fixed

OperatorWed, Mar 22, 1:55 PM
In that case, you'll need to clear cache when editing image, as it seems WPML stores this in cache in a persistent way.

dev99devWed, Mar 22, 1:56 PM
yeah

OperatorWed, Mar 22, 1:56 PM
There's nothing more we can do from our end, as this is something from WPML codebase.

dev99devWed, Mar 22, 1:57 PM
thanks

OperatorWed, Mar 22, 1:57 PM
You're welcome! Is there anything else I can help you with?

dev99devWed, Mar 22, 1:58 PM
no thanks

OperatorWed, Mar 22, 1:58 PM
Alright. Come chat again if we can help with anything else! Have a nice day!
---

March 22, 2023 at 3:46 pm #13306951

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

Thank you for the update.

So the issue is fixed after clearing the cache and I think they pointed out right that you need to clear the cache when editing the image.

I also double checked with my team and the issue isn't reproducible on local by using your site package. And they advise the same.

As an alternate you can disable caching plugins but of course this 'll have a toll on the performance. You can also disable and/or clear cache in WPML -> Support -> Troubleshooting page.

See this guide hidden link if you want to force disable cache on WordPress level.

In short, caches help boosting the performance and if you are frequently updating the content, you can set the cache expiry threshold to minimum or can clear caches manually as needed.

I hope this clarifies the matter now.

Regards.

March 22, 2023 at 3:52 pm #13307013

robinB-8

I don't like disable cache.

Can you fix WPML so that when I "save" in "advanced editor" , it will automatic clear cache for me?

I don't like disable or manual delete cache

March 22, 2023 at 4:35 pm #13307439

robinB-8

I disabled AND clear cache in WPML -> Support -> Troubleshooting page.

But the error still exists.

Error only fixed when I clear cache at hidden link (Hosting Configuration from WP.com)

March 22, 2023 at 4:37 pm #13307445

robinB-8

I think you fix this error not only for me, but for many users at WordPress.com hosting.

So I think you should fix it thoroughly this error

March 23, 2023 at 3:15 pm #13316549

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

Thank you for the updates and sorry for the delay. Actually I was waiting for some updates from our team as well as I am off today.

However, I got some info and the issue is being further escalated. Our compatibility team is trying to communicate with wp.com so that they get more insights and fix this for the good.

I appreciate your patience and cooperation in this regard.

I'll keep you posted for further development.

Regards.

April 4, 2023 at 6:20 pm #13403333

robinB-8

any updates?

April 4, 2023 at 8:49 pm #13404277

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

I just checked in our system, there're active efforts towards this but no clear picture so far. Our team is trying to contact and communicate.

I'll update you once there's any visible or notable information available.

Thank you for your patience and cooperation.

Regards.

April 11, 2023 at 10:57 pm #13450667

robinB-8

Do you need keep stagging site?

April 12, 2023 at 3:12 pm #13457149

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

I've just asked the team for a confirmation on this. I'll update you as soon as I hear back.

Regards.

April 13, 2023 at 3:28 pm #13466319

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

Thank you for your patience and cooperation.

I've got some confirmation about the staging site, but, still waiting from dev team about it.

I'll write you as soon as I have that.

Regards.

April 14, 2023 at 3:25 pm #13475041

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

Thank you for your patience and cooperation.

Our team is using that staging site and is in active communication with WordPress.com team. So they need it for some more time, I hope that's not a problem for you.

I'll write you about further updates as soon as I have one.

Regards.

April 14, 2023 at 5:14 pm #13475477

robinB-8

Thank you, hope it gets fixed soon

April 14, 2023 at 7:26 pm #13476157

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

We hope so too, thank you for your understanding and cooperation.

Have a great day 🙂

April 19, 2023 at 3:57 pm #13506311

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

Thank you so much for your patience and cooperation.

Our team suggests to add the following code to your active theme's functions.php file:

// WPML Workaround for compsupp-6695
function wpml_compsupp6695_clear_cache_for_media_translation($sources, $size_array, $image_src, $image_meta, $attachment_id) {

	if (is_singular() && class_exists('SitePress')) {

		// Get the current language
		$current_language = apply_filters('wpml_current_language', NULL);

		// Continue If the current language is not the default language
		if ($current_language !== apply_filters('wpml_default_language', NULL)) {

			// Get the image's language using WPML filter
			$image_language = apply_filters('wpml_element_language_code', NULL, array('element_id' => $attachment_id, 'element_type' => 'post_attachment'));

			// If the image's language is different from the current language, flush the cache
			if ($image_language !== $current_language) {
				wp_cache_flush();
			}
		}
	}

	return $sources;
}

add_filter('wp_calculate_image_srcset', 'wpml_compsupp6695_clear_cache_for_media_translation', 10, 5);

and save the file. Then try and let me know as they have tested it and it seems to fix the problem.

Confirm this on your staging site first, then apply on the production. Remember to take full backup of your site and database beforehand.

FYI, hopefully it 'll be fixed in a future version.

Regards.