WordPress.org

Ready to get started?Download WordPress

Forums

WP Media Cleaner
[closed] Empty trash doesn't work (24 posts)

  1. Greybox
    Member
    Posted 6 months ago #

    Empty trash button doesn't work for me - the files are still listed after I tried to click Empty Trash, Delete with and without checking the files. Even manually deleting files from /uploads/wpmc-trash/ and scanning again didn't help. I had to reset the WP Media Cleaner table and rescan again.

    As a side note, I don't think Delete button should appear on the Trash tab - deleting individual files should place them into trash folder, but they are already in the trash folder! I would rather restore Scan button in that location.

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

  2. Jordy Meow
    Member
    Plugin Author

    Posted 6 months ago #

    Mmm, I tried again and again but cannot replicate. The Empty Trash button works perfectly for me. Did you try on a clean install of WordPress? If you have a way I could replicate that would be awesome.

    Yes, deleting the files manually wouldn't help neither and simply breaks the relationship between the physical trashed file and the database entry.

    The delete button in the trash folder actually delete them "completely". It's an alternative to emptying the folder. For some reason there could be a few huge files the user want to delete but he prefers to keep the others little files to make sure they are not used anywhere.

  3. Greybox
    Member
    Posted 6 months ago #

    Sorry, I can't do a clean install - it's a production site. I will try on my other production site to see if there is any difference.

    In my case pressing delete button doesn't do anything. What is the difference between Delete in the trash tab and Empty Trash?

  4. Jordy Meow
    Member
    Plugin Author

    Posted 6 months ago #

    Empty Trash means Delete "ALL". It would be weird if one was working and the other not. The problem is definitely the same for both of them, but I have no idea what it is...

  5. videoink
    Member
    Posted 6 months ago #

    I have the same issue, delete trash didn't work.I did manually remove items from trash folder. Message Issue: Media (DB entry) not found. this is a production site..how do delete files??
    Thanks

  6. Greybox
    Member
    Posted 6 months ago #

    videoink: as a workaround you can press Reset and then rescan after you manually delete the files via FTP.

    I checked on my other site - same problem.

    I don't know if it's related or a separate problem - thumbs are broken in Trash tab (you may need to refresh (F5) to reveal that). The Trash tab page loads very slow as if it is looking for the thumb image but can't find it.

    And a little cosmetic issue: the Trash tab is not separated by "|" character from the Ignored tab.

  7. Jordy Meow
    Member
    Plugin Author

    Posted 6 months ago #

    Weird, I am testing the trash but it works on all my websites. Don't you have any errors in your PHP logs? Something is happening somewhere.

    It's a separate issue: there is indeed a bug with the thumbs in the trash tab. They are trying to access the images from their previous path... This will be fixed in the next version!

    Oh, about the '|' it's normal ;) Just separate the search from the rest.

  8. Greybox
    Member
    Posted 6 months ago #

    Where can I find the PHP logs? I could not find anything within WordPress interface. In my service provider PHP manager there is only an option to switch between PHP 4 and PHP 5 and it is currently set to PHP 5. Maybe you can suggest some temporary debugging modification code to find out what is going on?

    As for the last issue: I am not sure what "search" you are talking about. Let me clarify again what I mean. There are three tabs: Issues, Ignored and Trash, correct? And this is how I see the "tabs" now:

    Issues(20) | Ignored(0) Trash(4)

    As you can see, Trash is not separated from Ignored. I think they should look like this:

    Issues(20) | Ignored(0) | Trash(4)

  9. Greybox
    Member
    Posted 6 months ago #

    There is also a minor question about the file size formatting/representation. For example, my screen shows "816.97 KO" for a particular file, but I know this file is 816,971 byte or 797 KB, and I am not sure what "O" means.

  10. Jordy Meow
    Member
    Plugin Author

    Posted 6 months ago #

    Sorry... "KO" is actually in French only. I will change it to "KB". O means octets :) Will be corrected in the next release.

    For the logs, you might have to ask your hosting provider. That's strange they don't let you see those. Aren't they somewhere available through FTP?

    Oh, sorry, you meant that! Indeed, a '|' is missing! Thanks for seeing that.

  11. Greybox
    Member
    Posted 6 months ago #

    And what about the decimal point?

    I could not find any relevant log via FTP. Is there any other way to debug? Like I suggested, some debugging mod? I was thinking about the access rights, but this is a little odd that that you can move the files but can't delete them with your script.

  12. Greybox
    Member
    Posted 6 months ago #

    May I also suggest to move the Flattr logo to the bottom of the page where you have the PayPal logo. This is only because Flattr logo is close to the actively used buttons, hovering the cursor above it by accident causes the mini-window to appear and it is a little bit annoying to manually close it or wait for a few seconds for it to disappear automatically.

    [ Please do not bump, that's not permitted here. ]

  13. Jordy Meow
    Member
    Plugin Author

    Posted 5 months ago #

    Sorry I have been really busy and unfortunately... I am still :(

    I wouldn't worry too much about the Flattr, I used it on all my plugins
    and I don't really want to try to move it yet; also I think they will correct this "hovering" issue or might add option to remove it (if I can, I will definitely will).

    For the debugging, there is no other way, by far the best is the PHP logs since there must be something there and it would point to the exact issue.

    Decimal points should be from the dot to a comma, right?

  14. Greybox
    Member
    Posted 5 months ago #

  15. Jordy Meow
    Member
    Plugin Author

    Posted 4 months ago #

    It's very possible :)

    In the file 'wp-media-cleaner.php' can you try to change the code in the function 'function wpmc_activate'?

    The lines 827 and 830 should be:

    size INT(9) NULL,
    ignored BIT NOT NULL DEFAULT 0,
    deleted BIT NOT NULL DEFAULT 0,
    issue TINYTEXT NOT NULL,

    Then use the Reset button in the plugin dashboard and... try again :) Tell me if it works better for you.

  16. Greybox
    Member
    Posted 4 months ago #

    Didn't help, sorry.

  17. Greybox
    Member
    Posted 4 months ago #

    Jordy:

    According to my service provider, we need to enable error logging by modifying wp-config.php as per the plugin developer. This actually agrees with this codex article:
    https://codex.wordpress.org/Debugging_in_WordPress

    Could you e-mail me what statements should I include into wp-config.php?

    Thank you.

  18. Greybox
    Member
    Posted 4 months ago #

    Jordy:

    According to my service provider, we need to enable error logging by modifying wp-config.php as per the plugin developer's instructions. This actually agrees with this codex article:
    https://codex.wordpress.org/Debugging_in_WordPress

    Could you e-mail me what statements should I include into wp-config.php? Where can I collect the logs?

    Thank you.

  19. Greybox
    Member
    Posted 4 months ago #

    Jordy:

    I enabled the log as per the codex, clicked "empty trash" and received a bunch of messages related to media cleaner in debug.log. Here is one of them:

    [05-Mar-2014 23:43:48 UTC] PHP Warning: rename(/services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/./ags_laser_box_animation-400x120.gif,/services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/wpmc-trash/./ags_laser_box_animation-400x120.gif) [<a href='function.rename'>function.rename</a>]: No such file or directory in /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/plugins/wp-media-cleaner/wp-media-cleaner.php on line 227

    My line 227 states:

    if ( is_dir( $originalPath ) || !rename( $originalPath, $trashPath ) ) {

    I have the file ags_laser_box_animation-400x120.gif in wp-content/uploads/wpmc-trash/ folder, but if I am not mistaken, it looks like the script is trying to move the file again instead of dumping it.

  20. Greybox
    Member
    Posted 4 months ago #

    I have deleted the log and recreated it from scratch. There is a bunch of new warnings in the new log after pressing the Empty Trash button:

    [06-Mar-2014 00:20:50 UTC] PHP Warning:  filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/award_animation.swf in /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/plugins/wp-media-cleaner/wp-media-cleaner.php on line 276
    [06-Mar-2014 00:20:50 UTC] PHP Warning:  rename(/services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/award_animation.swf,/services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/wpmc-trash/award_animation.swf) [<a href='function.rename'>function.rename</a>]: No such file or directory in /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/plugins/wp-media-cleaner/wp-media-cleaner.php on line 227

    where line 276 looks like:
    $size = filesize ($fullpath);

  21. Greybox
    Member
    Posted 3 months ago #

    Jordy: Is this the log you were talking about?

  22. Greybox
    Member
    Posted 1 month ago #

    Updated to the latest version, still empty trash doesn't work.

  23. Jordy Meow
    Member
    Plugin Author

    Posted 1 month ago #

    You will have to help me here because I tried the plugin on Windows, Linux and on websites hosted at WPEngine and Hostgator and the trash function worked everywhere...

    You have me a lot of details but I am working on another plugin right now so it's a bit hard for me to give a lot of time on this one. Do you think you can try to find the exact issue?

  24. Greybox
    Member
    Posted 1 month ago #

    I understand that I am not the only user who has this problem. I will try to help you as much as I can, but I am not a programmer and I will need your guidance, if you don't mind.

    Immediately after I attempt to empty trash, My PHP log shows the following:

    [12-Jun-2014 19:56:44 UTC] PHP Warning: rename(/services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/./miner-228x56.jpg,/services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/wpmc-trash/./miner-228x56.jpg) [<a href='function.rename'>function.rename</a>]: No such file or directory in /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/plugins/wp-media-cleaner/wp-media-cleaner.php on line 254

    [12-Jun-2014 19:56:44 UTC] PHP Notice: Undefined variable: trashPath in /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/plugins/wp-media-cleaner/wp-media-cleaner.php on line 304

    wp-media-cleaner.php, line 254:

    if ( is_dir( $originalPath ) || !rename( $originalPath, $trashPath ) ) {
    
    wp-media-cleaner.php, line 304:
    <code>wpmc_clean_dir( $trashPath );</code>

    Based on my very limited knowledge, it looks like your script in line 254 is trying to rename the file in uploads/./miner-228x56.jpg folder into wpmc-trash/./miner-228x56.jpg, but by this time the file miner-228x56.jpg is no longer in uploads folder, it is already in wpmc-trash folder. So why are you trying to move/rename a non-existing file instead of deleting it?:

    rename(
    /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/./miner-228x56.jpg,
    /services/webpages/n/a/nautilus-intl.com/public/wordpress/wp-content/uploads/wpmc-trash/./miner-228x56.jpg
    )

    As for the second error, it seems like trashPath variable is defined in this line:
    $trashPath = trailingslashit( wpmc_trashdir() ) . $issue->path;

    It looks like $trashPath is still undefined. Is the syntax correct?

  25. esmi
    Forum Moderator
    Posted 1 month ago #

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else's topic.

    I am now closing this 4 month old topic as it references an older version of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.