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

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: 

This topic contains 21 replies, has 2 voices.

Last updated by Kor 9 months, 1 week ago.

Assisted by: Kor.

Author Posts
March 28, 2024 at 11:04 am #15459895

francescoF-25

I have changes some image sizes in my wordpress setup, f. eg from 800x480 to 720x480, and i did use WP-CLI to run the regenerate command. While the images in the main language work fine, the images in the translated pages still show up the old {filename}-800x480.jpg URL. The only way to fix this is to regenerate manually the selected images via UI by using the WP Regenerate Thumbnails pligin which is painfully slow to do to such task for like 1000 images. The "Start" sync media command in WPML > Settings > Media doesn't update/do shit.

March 28, 2024 at 11:16 am #15459979

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

Here is the ticket. I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

April 2, 2024 at 9:16 am #15471623

francescoF-25

Forgot to paste the link to the english version of the cpt

hidden link

April 4, 2024 at 10:34 am #15482457

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for getting back to me.

Upon inspection, just to clarify, the images displayed here hidden link should be loading the "featured" image from the portfolio posts, correct? I'm specifically referring to the post located here hidden link.

Because the "featured" image is loading properly on the portfolio post itself, I'm curious as to why it's not appearing on this page hidden link.

I'd like to let you know that I've deactivated some plugins for troubleshooting purposes.

April 4, 2024 at 10:42 am #15482483

francescoF-25

In the portfolio post itself there is no featured image to load as it is just an image widget within the Siteorigin Page Builder.

If you check the postmeta table for a corresponding attachment id (EN language) you'll see that the meta_value still report old image sizes that no longer exist or have been changed since the 1st upload.

It seems that these meta values does not get updated by wp-cli regenerate command and not even by the Start sync feature of WPML media.

Surprisingly, they are updated when using the Regenerate Thumbnail plugin to regenerate thumbnail. You can check this by regenerating image sizes for a EN portfolio featured image via the plugin, i'll start to show then.

I bet there's something going on with the hooks/filters coordination when using wp-cli and some update check that doesn't work well for the Start sync feature-

April 5, 2024 at 8:00 am #15486583

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for responding.

The media translation feature isn't intended for modifying image file names. For further details, you can visit this link: https://wpml.org/documentation/getting-started-guide/media-translation/#id5. This feature primarily assists in updating database entries with translated image captions, titles, meta-text, and other relevant information when new entries are generated. Therefore, what you're aiming to accomplish is essentially a feature request.

April 5, 2024 at 8:14 am #15486688

francescoF-25

Hi Kor,

I think you did not understand what I am trying to accomplish, because it is not a feature request.

I know you are a professionale with development skill so I am asking for your attention because it is evident you havent' read my previous posts carefully.

I am not trying to modify file names and I have never intended nor written that I want to do so, neither I can't say how could you understand that from what I have said until now, because "change the file names" it is not really the matter here.

This is what happened in a ordered lists of events:

1. I had my website, with WPML happily configured and several additional image_sizes, everything was working fine
2. I have decided to make some changes in the website, thus I needed to add and/or change the additional images sizes, registered by other plugins and/or via theme's functions.php
3. Then, obviously I had to regenerate the thumbnails, which is a pretty common task in these cases. To do so, I decided to go for wp-cli regenerate command, because it is faster than equivalent plugins such as the aforementioned Regenerate Thumbnails plugin
4. I noticed that the "translated" media entries DID NOT WORK because they're still pointing to the old image sizes.
5. Then, I opened this support ticket.
6. Since I am a developer myself, I started to make some test, to try understand why the fuck is this happening? These test lead to two findings: 1) the database entries created by WPML for the translated media do not get updated when running the wp-cli regenerate command; 2) regenerating thumbnail works fine with the Regenerate Thumbnail plugin.
7. I shared with you these finding, to speed up the bugfix issue, because it is evident that plugin thumbnail regeneration is triggering some actions that allow WPML to update its media entries, while wp-cli regenerate command it is not.

I really do not understand how you could misunderstand all of it with "The user is trying to rename files". It really isn't part of the matter here.

So I am asking kindly to review all the above conversation and at least try.

April 5, 2024 at 9:24 am #15487093

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I sincerely apologize for any misunderstanding and for any inconvenience caused. Thank you for providing such detailed information regarding the issue you're experiencing with WPML and thumbnail regeneration.

To ensure we fully grasp the situation, could you kindly clarify the following points:

1. Could you please explain in more detail how you configured WPML and the additional image sizes before making changes to your website? This will help us understand the initial setup.
2. When you regenerated thumbnails using the wp-cli command, did you notice any specific error messages or unexpected behavior? Any additional details you can provide about this process would be helpful.
3. Can you outline the exact steps you took to regenerate thumbnails using wp-cli and how you observed that the "translated" media entries were not updating accordingly?
4. Have you encountered any other issues or unexpected behavior with WPML or any other plugins/themes during this process?

Additionally, to assist our 2nd Tier Support in replicating the issue and investigating further, could you please provide step-by-step instructions on how we can reproduce the problem on our end? This could include any specific configurations or settings that were in place before regeneration, the commands used for thumbnail regeneration, and any observations made afterward.

Your cooperation and patience are greatly appreciated as we work towards resolving this issue effectively.

April 5, 2024 at 9:52 am #15487223

francescoF-25

Hi Kor, thanks for your reply. Answers below.

1. Could you please explain in more detail how you configured WPML and the additional image sizes before making changes to your website? This will help us understand the initial setup.

You can find the configuration in the website clone I have provided as it is a perfect intact copy with every WPML setting untouched since day 1.

2. When you regenerated thumbnails using the wp-cli command, did you notice any specific error messages or unexpected behavior? Any additional details you can provide about this process would be helpful.

No errors of any kind.

3. Can you outline the exact steps you took to regenerate thumbnails using wp-cli and how you observed that the "translated" media entries were not updating accordingly?

After redefining some images sizes from both the Media options page in Wp Admin and my theme's functions.php, I have opened terminal, installed wp-cli following guidelines, run the wp-cli regenerate command by giving the wp installation folder (as there are different version of the website on the domain).

I observed that the translated media entries did not update from the links I provided above of the sole CPT Archive where images are set via standard WP functions, whereas images into the single-post page show up because they are rendered via SiteOrigin's Image Widget which should have some fallback rules if the selected image size file is not available.

hidden link -> new images show up
hidden link -> no image show up, unless they have been regenerated using Regenerate Thumbnail plugin

This can be verified by checking the postmeta table in the db for attachments ids related to WPML's duplicated entries, as WPML duplicates the entry and the corresponding meta_value(s) for each attachment. The meta values in question still report old images sizes.

Moreover, as already stated many times, running the Sync tool in WPML Media doesn't sync anything.

NB: If needed, current registered image sizes list can be obtained by looking at the Regerate Thumbnail plugin options page, at the bottom.

4. Have you encountered any other issues or unexpected behavior with WPML or any other plugins/themes during this process?

Nope

April 5, 2024 at 7:30 pm #15489583

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I will escalate this matter to our 2nd Tier Support for further investigation on your behalf.

I still require additional clarification regarding the steps you took to reproduce the issue.

1. You've opened this page hidden link and configured the media sizes. Also, you mentioned options in the theme's functions.php. What did you change or apply to the theme's functions.php?

2. You open a terminal, install wp-cli following guidelines, and run the wp-cli regenerate command by giving the wp installation folder (as there are different versions of the website on the domain). Could you tell us a little bit more about the command that you run?

3. The translated media entries did not update from the links here hidden link . These images are rendered via SiteOrigin's Image Widget which should have some fallback rules if the selected image size file is not available.

4. Running the Sync tool in WPML > Settings > Translation of Media doesn't sync anything.

Note :
hidden link -> new images show up
hidden link -> no image show up, unless they have been regenerated using the Regenerate Thumbnail plugin

Additional note : Can be verified by checking the postmeta table in the db for attachments ids related to WPML's duplicated entries, as WPML duplicates the entry and the corresponding meta_value(s) for each attachment. The meta values in question still report old images sizes.

April 15, 2024 at 8:19 am #15517678

francescoF-25

I cannot understand what's the matter with this process asking again and again stuff than can easily be verified in 2 seconds by your 2nd tiers developer. Are they actual developers? If so, they can check the code.

It seems as if you're bouncing any support request that goes beyond "click there and there" which it's exactly how you keep code quality low.

Anyway answers below:

1. You've opened this page hidden link and configured the media sizes. Also, you mentioned options in the theme's functions.php. What did you change or apply to the theme's functions.php?

I filtered the images sizes adding new ones and changing existing ones like any normal developer would do.

2. You open a terminal, install wp-cli following guidelines, and run the wp-cli regenerate command by giving the wp installation folder (as there are different versions of the website on the domain). Could you tell us a little bit more about the command that you run?

wp-cli regenerate. developer. resources. are. public. more here: https://developer.wordpress.org/cli/commands/media/regenerate/

3. The translated media entries did not update from the links here hidden link . These images are rendered via SiteOrigin's Image Widget which should have some fallback rules if the selected image size file is not available.

The last sentence in WRONG. I clearly wrote that post type archive template's featured images are using standard WordPress functions, such as wp_get_featured_image etcetera while the images in the single post template are using SiteOrigin's Image Widget which should include a fallback in order to always show the selected images, moreover I really do not know if the widget is referencing the translated attachment-id or the original language one BUT THIS IS TOTALLY UNRELATED TO THE ISSUE: the only reason why I wrote about it it's to explain why translated posts show images, while the archive templates do not.

Please. Ask. To. 2nd. Tier. To. Solve. The. Issue.

Thanks.

April 16, 2024 at 10:13 am #15524046

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for getting back to me.

Unfortunately, I am unable to escalate this to our 2nd Tier Support team without sufficient information from your end.

Based on the details you've provided, here's how we can replicate the issue:

1. We modified the media sizes in the media options and implemented custom PHP code in the functions.php file to add new image sizes.

2. We then utilized the wp-cli tool to regenerate the media files (refer to https://developer.wordpress.org/cli/commands/media/regenerate/).

3. Following that, we executed the Sync tool located in WPML > Settings > Translation of Media, but it failed to synchronize anything.

4. Upon visiting the primary language page at hidden link, we observed that new images appeared. However, on the translated page at hidden link, the new images did not appear.

Please confirm the above steps so that I can escalate this for you.

April 16, 2024 at 10:22 am #15524127

francescoF-25

With some corrections below for better understanding.

1. We had our original media sizes in the media options and some implemented custom PHP code in the functions.php file to add new images sizes.

2. We built the website with these image sizes, thus pictures were uploaded and reduced to the set sizes.

3. After some years, we needed to change them, so we modified the media sizes in the media options and changed those in the custom PHP code in the functions.php file.

4. We then utilized the wp-cli tool to regenerate the media files (refer to https://developer.wordpress.org/cli/commands/media/regenerate/).

5. Following that, we executed the Sync tool located in WPML > Settings > Translation of Media, but it failed to synchronize anything.

6. Upon visiting the primary language page at hidden link, we observed that new images appeared. However, on the translated page at hidden link, the new images did not appear.

7. We noticed that the issue does not occur when regenerating images from within the WordPress admin interface by using plugins such as Regenerate Thumbnails. However, this workaround is not feasible when dealing with a huge number of images as it is substancially slower.

April 16, 2024 at 7:31 pm #15528175

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I've just escalated this and I will come back to you once I've feedback.

April 17, 2024 at 8:50 am #15530305

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for your understanding.

After consulting with our 2nd Tier Support, it appears that achieving what you're looking for isn't currently possible using WPML's "media sync feature." As you suggested, you'll need to utilize a third-party plugin such as Thumbnail Regeneration to accomplish this task.

The topic ‘[Closed] Media Translation feature not working correctly’ is closed to new replies.