Improve cleanup of unknown or unregistered image sizes and add logging

Đang mở
#217 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
wordpress
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

command:media-regenerate

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.
Ngôn ngữ chính
Gherkin
Star
47
Fork
42
Merge trung bình
2 giờ 30 phút
Pull request đã merge (30 ngày)
4

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wp-cli/media-command

Tất cả issue của wp-cli/media-command

Issue tương tự

Thêm issue về CLI

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.