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
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Noman 1 year, 3 months ago.

Assisted by: Noman.

Author Posts
February 20, 2024 at 7:22 am #15320728

kai-lyK

wpml deletes image files from server. it affects only images that are large and are scaled by wordpress (media file with suffix -scaled is created on the server).
howto reproduce:
1. upload image to default language, media file should be large (over 2560px) so that wp generates scaled version (media duplication is enabled).
2. delete image from secondary language or remove language from settings screen and remove content left behind

result: the generated media files are deleted from the server and media library is broken in default language as the files are removed from the server.

setup: this behaviour was observed with WP v6.4.3, default theme - Twenty Twenty-Four v1.0, WPML v4.6.9, WPML String Translation v3.2.9. no other plugins installed.

February 20, 2024 at 2:48 pm #15323610

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Can you please try to disable the big image threshold by adding the below code in functions.php file:

add_filter( 'big_image_size_threshold', '__return_false' );

And see if this resolves the issue?

Thank you

February 21, 2024 at 7:21 am #15325467

kai-lyK

yes can confirm that that keeps the files on the server, but that would be expected - otherwise all images would have problems not only the large ones that get the 'scaled' version generated. I belive that your attachment deletion process needs refinement. Until then all default setups will have problems with large images. This causes files to get deleted from server and, if the site is not backed up, no way to get them back.

As we spent quite a lot of time tracking this issue down I just wanted to let you know about that bug so that you can fix it.

I personally don't need a solution, because for our client sites that had this problem we solved it by rezising the uploaded images so that they would not trigger that large image threshold. Disabling this 'scaled' version generation may result that the images that are loaded on the site are 15mb in size - thats way too much for a website.

February 21, 2024 at 12:23 pm #15327770

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Thanks for additional details. After checking further I found that this issue was already reported. I have added your ticket to our existing report so developers can consider this.

Thank you for your time to report it.