WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Enable Media Replace] deletion of old files (5 posts)

  1. jwsand
    Member
    Posted 4 years ago #

    This plugin is a great idea. I tested it with PDFs and it worked great. The only issue I had is that when it replaces an image, it does not delete the old thumbnail images from the server. This results in files on the server that are not used. Further wordpress is not aware of these "extra" images in their database. If this plugin would take care of this then it would be a perfect tool. One that should be in the core of wordpress.

    http://wordpress.org/extend/plugins/enable-media-replace/

  2. Måns Jonasson
    Member
    Posted 4 years ago #

    Thank you, I've had a look at it and I see the problem. Part of the problem is the (stupid) way in which WordPress handles thumbnail images. Since all the thumbnails are pre-rendered they are static in the uploads folder and this makes it somewhat difficult to accurately detect and delete them.

    I'll take this into consideration for the next version of the plugin.

  3. jwsand
    Member
    Posted 4 years ago #

    From what I have studied it looks like, but I am not 100% sure, the other images are stored in a serialized format in the database. Maybe an easy solution would be to unserialize the data to identify the thumbnails. You can see the PHP function here http://www.php.net/manual/en/function.unserialize.php

  4. Måns Jonasson
    Member
    Posted 3 years ago #

    I don't think the locations of other files are stored in the database at all, but rather left orphaned in the uploads folder, unfortunately.

    /M;

  5. Måns Jonasson
    Member
    Posted 3 years ago #

    The new version (2.4) now deletes old thumbnails from the server.

Topic Closed

This topic has been closed to new replies.

About this Topic