• If WordPress option to add year and month to uploads directory is active, thumbnails can’t be deleted because of bad resulting path in delete_files() in file phoenix-media-rename\classes\class-media-rename.php. Both $uploads_path and $size_data[‘path’] have year and mont. Tried to change ‘path’ to ‘basedir’ and it works fine for me now.

    	static function delete_files($attachment_id, $option_debug_mode){
    		$uploads_path = wp_upload_dir();
    		$uploads_path = $uploads_path['basedir']; // path -> basedir
    
    • This topic was modified 1 year, 2 months ago by ripper33rus.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author crossi72

    (@crossi72)

    Hi @ripper33rus,
    thank you for the hint, I’ll check it as soon as possible ??

    C.

    Plugin Author crossi72

    (@crossi72)

    I confirm that your fix works, I just released version 3.11.3 that integrates your fix.

    Thank you
    C.

    Hello, excuse me if inappropriate to post here, but thought it is pragmatic to request the answer extension. Does this issue with the thumbnail images deletion means, that this plugin is deleting thumbnails during renaming process or the problem as described is referring to any WP thumbnails deletion process?

    Plugin Author crossi72

    (@crossi72)

    Hi @n381,
    the issues reported by @ripper33rus was that Phoenix Media Rename didn’t delete the old thumbnails after renaming a file, leaving them on server.

    When you rename a file using Phoenix Media Rename, the old thumbnails are deleted and a new set of thumbnails is generated to reflect the new filename, al posts using the image are updated to reflect the new name.

    C.

    Thank you for the provided answer,

    please would you confirm, does this processing on rename/deletion also applies to original images?

    Plugin Author crossi72

    (@crossi72)

    Yes: Phoenix Media Rename generates a new image using the new filename, then deletes the old one, this is slower than renaming the file but renaming directly the file can cause issues on some server.

    C.

    Hello, thank you for this additional explanation.

    Do you also have an advice on the remnant images deletion without risking the newly generated ?

    Plugin Author crossi72

    (@crossi72)

    The deletion process is automatic and involves only the renamed images, so you don’t risk losing other files.

    There was an issue that caused some file to fail to delete, but the plugin delete only the renamed file and his thumbnails and only if the new file has been correctly generated.

    C.

    Thank you, understand, the problem of this topic also applies to website i’m managing, as was using the version prior the updated modification presented. Now there are leftover images after the numerous thumbnail file were renamed. Can you suggest deletion plugin that is compatible, as in past trials some used plugins were deleting also the renamed images along original ?

    Additionally there is possible files permissions problem as the files in the specific directory at cPanel File manager are totaling around 4GB, while accessing that directory via sFTP and calculating total is at just 2GB excluding the option/possibility of filename filtering and removal.

    • This reply was modified 8 months, 3 weeks ago by n381.
    • This reply was modified 8 months, 3 weeks ago by n381.
    Plugin Author crossi72

    (@crossi72)

    I don’t know any plugin able to delete unneeded files, but there are likely to be reliable ones.

    Automatically detect unneeded files is tricky, because other than WordPress managed files (who are easy to find) there can be files generated by plugins using custom systems, that can be missed by the plugin, causing the deletion of some useful file.

    C.

    Thank you, i’ve been already considering so.

    • This reply was modified 8 months, 3 weeks ago by n381.
    • This reply was modified 8 months, 3 weeks ago by n381.
    Thread Starter ripper33rus

    (@ripper33rus)

    You may try this plugin to clean media library, of course after full backup. For me it works fine. Also, Autoremove Attachments plugin may be useful.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘thumbnails deletion issue’ is closed to new replies.