Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

When removing a language, some media files are deleted.

Solution:

The user reported it was an issue with the Image Regenerate & Select Crop plugin by Iulia Cazan. This plugin is not officially compatible with WPML.

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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Itamar 1 year, 9 months ago.

Assisted by: Itamar.

Author Posts
March 14, 2023 at 6:12 pm

oldrichH

With removing the language, the media was deleted

I am trying to: Remove a language and duplicate IDs in the database for that language using the GUI

Link to a page where the issue can be seen: NA

I expected to see: Functional website

Instead, I got: I noticed at first that all the thumbnail images had disappeared, but when restoring from backup I found that a huge number of original files had been deleted as well

March 14, 2023 at 7:18 pm
March 15, 2023 at 1:09 pm #13251713

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I've installed the Duplicator Pro plugin on your site to create a copy of it so that I can investigate this issue on my local server. The creation of the package is taking time. I'll keep you updated here once I have news regarding your issue.

Thank you for your patience.
Itamar.

March 16, 2023 at 3:27 pm #13261689

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thank you for your patience.

I have a copy of your site installed on my local server in case further debugging is needed.

For now, I continued to debug the issue on your staging site. As you suggested, I removed the Slovak language to see the problem. Nevertheless, I could not see the problem. Before removing the Slovak language, I checked the media library and saw 13,432 items. After removing the Slovak language and its content, 13,432 media items were still available in Media -> Library. While debugging this issue, I recorded a video. I am sharing the video to see what I tested and my results. Here is the link to the video.

hidden link

In case I missed something regarding this issue, let me know. Let me know how to see missing image files after removing a language. Tell me the media files' URLs so I can see them before removing the language. Please specify up to 3 files with this problem.

Thanks,
Itamar.

March 17, 2023 at 1:53 am #13265211

oldrichH

Hello, Itamar,
you repeated the exact procedure I did. Originally there were 13483 translated images and they all had thumbnails generated. I left the language removal running for about 6 hours. Then I noticed that the all thumbnails disappeared. I had a fresh backup from a previous incident, so I ran a restore, but on SCP I saw that not only the thumbnails were missing, but many of the folders by year in the uploads folder as well as. Admittedly, I didn't check the number of images in the media library like you did. It is likely that the script only deleted the entries in the deleted language and attachment files.
When you have a copy, I'll revert the thumbnails and DB back to the way they were at the beginning and turn on the Slovak language deletion. I'll also share the video. I see in history that you logged out 12 hours ago, so I will take the session.
The last image you deleted was "20160505_160117" and the original was preserved, so this time "only" the thumbnails disappeared. I will let you know.

Image 2023 27 17 002.png
March 18, 2023 at 4:53 pm #13275525

oldrichH

Testing WPML on staging website v2

1) Uploads folder copy
2) Database dump
3) Duplicator package
4) Setup info:
Plugin iThemesSecury was deactivated after cloning site by duplicator (login address is now /wp-admin)
Plugin Optimole was deactiavated - no sense on staging
Debug is turned on and we are getting persitent error:
realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s) in wp-includes/functions.php on line 2081
Uploads directory holds 65873 files, 410 directories (more details in file diskusage0.txt)
ML shows 13,321 items in Czech, 0 for Slovak and 86,362 items for all languages
All image thumbails are generated (but in other languages than cs_CZ there are still many 0 bytes records which were manually deleted in cs_CZ)
PDF thumnail generation doesn't work for some unknown reason in last months
Other plugins are active as well as on production site
5) Removing Slovak language action
Slovak language removal process started including media translations
Few minutes after uploads directory has 63477 files, 424 directories
6) Media library files status
Slovak language was removed (after many hours)
Uploads directory stats: 17481 files, 424 directories (more details in file diskusage3.txt)
7) Recovery of uploads folder and database
Deactivation of all plugins except WPML
Activation of Query monitor plugin
Uploads follder content snapshot is in files4.txt
8) Removing Slovak language action
Slovak language removal process started including media translations
One hour since starting uploads directory has same number files as before
Anyway, why removing of language, which was just created withing few seconds lasts couple of hours? This is impossible to debug! I just made an export to xliff for analysing but not translated any word.
It will be good to verify the number of 5871 duplicates, which are claimed to be removed, by SQL query.
9) Media library files status
Slovak language was removed (after many hours)
Only 3 image thumbnail sizes has been removed in 2018/05 (details in file files5.txt)
4 posts left in database with sk language code
10) Recovery of uploads folder and database
ML shows 13,433 items in Czech, 0 for Slovak. I am unable to view media from all languages, url parameter lang=all doesn't work (this is very common)
All image thumbails are generated (but in other languages than cs_CZ there are still many 0 bytes records which were manually deleted in cs_CZ)
PDF thumnail generation doesn't work for some unknown reason in last months
Plugin Image Regenerate & Select Crop Version 7.0.1 by Iulia Cazan was deactivated (https://wordpress.org/plugins/image-regenerate-select-crop/)
Other plugins are active as well as on production site
11) Removing Slovak language action
Slovak language removal process started including media translations
One hour since starting uploads directory has same number files as before
Process is still incredibly slow without any progress control. I suspect that since the delete only works for a few seconds after confirmation and then nothing happens until it wants to confirm the continuation again. I have a problem with any WPML ajax.
12) Media library files status
Slovak language was removed (after many hours)
Uploads directory has same number files as before

The video is available at the URL I forwarded last time.

So my main problem is solved, but if you want to add anything else I will be glad. I'll let Iulia know about the problem.

My issue is resolved now. Thank you!

March 19, 2023 at 7:28 am #13277087

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hello, and thank you very much for the detailed explanation and the debugging process you have taken to analyze this case.

I'm glad the issue is solved now and that you have found the cause of the problem!

I must mention that the Image Regenerate & Select Crop by Iulia Cazan is not officially compatible with WPML. It is not on our list of recommended plugins here.

https://wpml.org/plugin/

I've also checked our internal documentation, and no other motion to this plugin exists. This plugin is unknown to us.

It would be great if you could contact the authors of the plugin and urge them to join our Go Global Program. You can find details about it here.

https://wpml.org/documentation/theme-compatibility/go-global-program/

We will happily cooperate with the authors in making their plugin officially compatible with WPML.

As for the other problem, you mentioned that deleting the Slovak language took many hours. When I checked things on your staging site, it took only 15 minutes, not several hours. In any case, this is a separate and different issue. If you want us to help with this issue, please open a new ticket in our support forum, and we will help you with this case.

I wish you all the best, and keep up the good work!

Cheers,
Itamar.