WordPress.org

Forums

WP Retina 2x
[resolved] Automated Way to remove old @2x Images?? (14 posts)

  1. jlomaga
    Member
    Posted 2 years ago #

    I'm working on a new theme for our site and in our test enviornment I've been switching image sizes around a bunch, I've noticed that the plugin doesn't remove old @2x images that are no longer needed. Is there an automated way to clean this up or is this something I'll have to do manually??

    http://wordpress.org/extend/plugins/wp-retina-2x/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    The plugin does remove the @2x file when you remove a media. But if you play a lot with the image sizes, add/change/remove them from your theme and regenerate everything in between, yes probably you will end-up with a lot of garbage generated images; but this is not really the problem of the retina plugin, you will also have all the images generated by WordPress...

  3. jlomaga
    Member
    Posted 2 years ago #

    Actually using the Force Regenerate plugin removes all the old wordpress images that aren't needed anymore, son in the sense it keeps things clean, it's just that when it removes those old images it leaves the @2x version behind. WOnder if it's possible through the @2x generator if it can verify and remove un-needed versions?

  4. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    I wouldn't be clean that way. Either the plugin that deletes the files need to add a "delete" action (which I could "subscribe" to), or that plugin should check for the presence of @2x files. Actually that would make everything easier. Do you mind ask the developer of that plugin?

  5. jlomaga
    Member
    Posted 2 years ago #

    I left a note for that plugin dev. thanks

  6. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    Okay let me know what he says, and depending on that let's see if I have something to do on my side (normally not).

  7. Clifford Paulick
    Member
    Posted 2 years ago #

    If I don't want @2x images anymore, I'm assuming deactivating the plugin won't delete all the files from the server. How do I delete all the 2x files from the server? I'm assuming manually via FTP isn't ideal due to some database-ish stuff. Maybe you could add a "delete all generated 2x files from the server" button. Once that's done, I could use something like http://wordpress.org/extend/plugins/dnui-delete-not-used-image-wordpress/ to delete all the non-2x WP files and then, once all my files are cleaned up on the server, I could re-generate them all if I wanted to.

    Looking forward to your insights.

  8. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    I added this to my to-do list for the plugin. Meanwhile, you can clean your folders using a ls | grep | rm command, you don't have to do this manually one by one.

  9. Clifford Paulick
    Member
    Posted 2 years ago #

    I don't have command line access (WP Engine hosting), but wouldn't that mess up the database thinking there was a 2x image created?

  10. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    It wouldn't, the @2x files are not referenced in the database at all, even the Retina 2x plugin wouldn't mind :)

  11. jlomaga
    Member
    Posted 2 years ago #

    I personally wouldn't mind having to purge all @2x images through the plugin then regenerate all of them through the plugin. Yes still a little time consuming and taxing on the server, but personally if I don't have to touch a command line and I can just do it in WP then I'm very happy.

  12. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    I'll do it when I get my own computer (my MacBook Retina got fried), I added this on my to-do list and it's a nice feature to have.

  13. Clifford Paulick
    Member
    Posted 2 years ago #

    I just tried it out today and it deleted over 900 @2x images on WP Engine hosting in probably 30 minutes (wasn't really timing it, just left the browser window open in case that was required). As far as I can tell, it did exactly what it should have done (i.e. delete @2x and not delete non 2x files). I wonder though, if I manually uploaded @2x images, would it delete those too? And, just to confirm, it only goes through the uploads folder, not the theme folders, right?

    Thanks, Jordy!

  14. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    Exactly, only your uploads folder, no worries :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Retina 2x
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.