Improve cleanup of unknown or unregistered image sizes and add logging
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- wordpress
- Domain
- cli
Research direction
No files, tests, or entry points are named. Start by locating the image cleanup routine and its attachment metadata handling, then define the affected files and tests from the existing behavior. Done means unknown, unregistered, intermediate, and matching .webp files are handled as specified, with deleted and generated thumbnails logged.
Written by the indexing model from the issue text.
Description
Feature Request
- Yes, I reviewed the contribution guidelines.
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
.webpcounterparts, 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.
- Dominant language
- Gherkin
- Stars
- 47
- Forks
- 42
- Avg merge
- 2h 30m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wp-cli/media-command
-
command:media
Difficulty 5/5 Over a week Newbie friendliness 45/100
wp-cli/media-command#254 · 3 comments · 1 reaction ·
-
command:media-regenerate
Difficulty 4/5 3-5 days Newbie friendliness 35/100
wp-cli/media-command#120 · 1 comment ·
All issues in wp-cli/media-command
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AvengeMedia/DankMaterialShell#3523 ·
-
comp/cli comp/cron P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NousResearch/hermes-agent#117433 · 2 comments ·