WordPress.org

Forums

WP Media Cleaner
[resolved] Files not deleted - emptying trash won't work (4 posts)

  1. rob_st_82
    Member
    Posted 1 year ago #

    I just installed this plugin to get rid most of the custom image sized images in my upload folder since I switched my wordpress theme recently.

    First issue: files are rather being copied than moved to the trash folder. I'm not sure if that is a desired behaviour.

    Second: emptying trash won't work. The plugin does something and counts up the numbers, but files aren't deleted. Neither in the trash folder, nor in their origin.

    Edit:
    The files also stay in the media cleaner "frontend" in the trash folder, so they aren't deleted here too (even when refreshing page as plugin suggests).

    https://wordpress.org/plugins/wp-media-cleaner/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. rob_st_82
    Member
    Posted 1 year ago #

    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.

  4. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    I updated the plugin. Empty trash really delete the files. However, the folders aren't removed for now...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Media Cleaner
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic