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.
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.
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.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.