In the plugin’s code, I actually MOVE the file so it’s normally impossible that you would get them at two places.
Can you check your PHP logs? There is definitely something happening here, it’s the first time I hear of this issue.
Hi Jordy,
sorry for my late answer. I had to figure out how to enable error logging.
When emptying trash, PHP error reports:
[03-Jun-2014 07:21:28 UTC] PHP Warning: rename(/var/www/web474/html/DOMAINFOLDER/wp-content/uploads/2011/01/20110117-220635.jpg,/var/www/web474/html/DOMAINFOLDER/wp-content/uploads/wpmc-trash/2011/01/20110117-220635.jpg): No such file or directory in /var/www/web474/html/DOMAINFOLDER/wp-content/plugins/wp-media-cleaner/wp-media-cleaner.php on line 227
[03-Jun-2014 07:21:28 UTC] PHP Warning: rename(/var/www/web474/html/DOMAINFOLDER/wp-content/uploads/2013/05/kellerclubcast-logo-48.png,/var/www/web474/html/DOMAINFOLDER/wp-content/uploads/wpmc-trash/2013/05/kellerclubcast-logo-48.png): No such file or directory in /var/www/web474/html/DOMAINFOLDER/wp-content/plugins/wp-media-cleaner/wp-media-cleaner.php on line 227
I replaced my original subfolder with the DOMAINFOLDER value in the example above.
Deleting a file does not produce a PHP-error, it now correctly moves the files to the designated trash folder (was there an update to the plugin that I installed without noticing? ;-). Maybe I was confused by the whole bunch of image versions I have in my uploads folder due to two or three theme changes in recent years. For some files, I have more than 20 sizes/version automatically generated by creat image size
.
As I understand it, “empty trash” tries again to rename the files to the trash-folder instead of permanently deleting them.
I updated the plugin. Empty trash really delete the files. However, the folders aren’t removed for now…