Improve cleanup of unknown or unregistered image sizes and add logging#218
Improve cleanup of unknown or unregistered image sizes and add logging#218ivptr wants to merge 1 commit intowp-cli:mainfrom
Conversation
Log deleted and generated file names. Delete corresponding .webp images if they exist.
|
Hi there, thanks for your PR! A couple of initial observations: Deleting Similarly, deleting any files not found in the database is also very risky. And it's not really related to thumbnail regeneration. This functionality is probably better kept in its own dedicated command. See #6 and https://github.com/DigitalTactics/wp-cli-mediadiff Since that's a lot of changes overall, we would definitely require some tests to verify they work as intended. The additional logging can be useful, but also a bit noisy. We should consider making them debug messages or so. Aside: let's use the term allowlist instead of whitelist :) |
|
EWWW doesn't save any webp info in the attachment metadata. So when we've got pairs like As for deleting files not found in the db - well, that’s exactly what "Removes files for unknown/unregistered image sizes" is meant to do using the command Without proper logging, we’re just guessing what is going on. It might say thumbnails were regenerated, but behind the scenes… nothing actually happened. |
That's concerning :( It would indeed require double checking that we don't incorrectly delete unrelated files |
More thorough removal of files with unknown or unregistered image sizes.
Delete corresponding .webp images if they exist.
Log deleted and generated file names.
Fixes #217