Skip to content

Improve cleanup of unknown or unregistered image sizes and add logging #217

@ivptr

Description

@ivptr

Feature Request

Describe your use case and the problem you are facing

When cleaning up images, some leftovers remain - specifically those with unknown or unregistered sizes.

Additionally, certain plugins, such as EWWW Image Optimizer, generate extra .webp versions of existing images. These should be removed as part of the cleanup process.

Currently, there is no logging of deleted or generated files, which makes it difficult to track changes or verify cleanup results.

Describe the solution you'd like

Introduce a more thorough cleanup routine that:

  • Deletes intermediate image files and their .webp counterparts, if they exist.
  • Scans the attachment directory and removes files that:
    • Are not registered in metadata.
    • Do not match the expected thumbnail naming convention.
    • Are not legitimate thumbnails.
  • Logs all deleted and generated thumbnails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions