Guide

Attachments Inspector architecture

Three modules share the plugin bootstrap in includes/class-plugin.php.

Modules

ModuleRole
Attachments_PanelBlock editor sidebar + panel REST
Attachment_ReportFrontend query-var report, ACP column, report REST
Image_MismatchEditor toolbar, admin bar, find/import REST, CLI, Ability

Image mismatch scanner

Image_Mismatch_Scanner powers the admin bar, WP-CLI wp prc attachments-inspector mismatch-report, and Ability prc-attachments-inspector/scan-image-mismatches.

  • Default / max batch size: 50 posts
  • Case A: legacy host/path + matching attached filename
  • Case B: attachment id is present but invalid, or filename ≠ src filename. A missing id is not a mismatch.
  • Case A takes precedence when both match

Attachment report traversal

The report endpoint resolves a child post ID to its parent, walks up to 25 children when include_children is true, and supports mime_type filtering. Filter hook: prc_attachments_report_items.

Extensibility

JavaScript filter prc-platform.attachments-panel (withFilters) lets other plugins wrap the sidebar component.

Was this helpful?