Open rmens opened 4 years ago
This library generates images on the fly and does not save its data in DB. So deleting the files from the uploads folder may be risky if not done correctly.
I see. There is limited data to work with, but I'm thinking of:
I tried it with this, and it worked. but only for file names that have been saved
https://github.com/syamilmj/Aqua-Resizer/pull/118/commits/707cb1a8e7bdb7c10072577b69bba6db482a276b
I've made a PR for this quite some time ago https://github.com/syamilmj/Aqua-Resizer/pull/112 - it updates attachment metadata with the new sizes, so WP is aware of them and deletes when needed
Can that PR be merged please @syamilmj?
When an image is deleted via the wp-admin media library, all the sizes generated by WordPress are deleted, but not the sizes generated by the Aqua-Resizer. This leaves a whole lot of junk on the filesystem.
Is it possible to make a function that hooks into wp_delete_attachment to let Aqua-Resizer cleanup after itself?