You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Website still consumes a very large amount of disk space after deleting media.
Cause
When deleting an attachment using WP-CLI (wp post delete --force 1234) then WordPress Core deletes its files from the uploads folder, but the webp files generated by Optimus remain in the filesystem.
Goal
Ensure webp derivatives are in sync with actual image attachments.
Free up disk space during cleanups to e.g. restart a site from scratch, or speed up website backup time.
Proposed solution
React to the attachment delete hook.
Check whether webp derivatives of registered image sizes exist in the filesystem.
Delete the existing webp image files.
Notes
After fixing the basic integration behavior, a future PR could introduce a new WP-CLI command wp optimus webp delete-orphans similar to Feature request: add sync-missing command to wp client. #7 that allows to clean up an existing filesystem (i.e., considering all the sites that have obsolete webp image files currently).
The text was updated successfully, but these errors were encountered:
svenba
changed the title
[bug] webp files are not deleted when attachment is deleted
WebP files are not deleted when attachment is deleted
Apr 15, 2020
Problem
Cause
wp post delete --force 1234
) then WordPress Core deletes its files from the uploads folder, but the webp files generated by Optimus remain in the filesystem.Goal
Proposed solution
Notes
wp optimus webp delete-orphans
similar to Feature request: add sync-missing command to wp client. #7 that allows to clean up an existing filesystem (i.e., considering all the sites that have obsolete webp image files currently).The text was updated successfully, but these errors were encountered: