=== Krishnakrish Media Reference Auditor ===
Contributors: krishnakrish512
Tags: media, cleanup, attachments, admin, acf
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Scans the Media Library for attachments that don't appear to be referenced anywhere on the site, and lets you review and delete them safely.

== Description ==

Krishnakrish Media Reference Auditor scans post content (including block templates, template parts, and reusable blocks), featured images, ACF fields (including Gallery and repeater fields), page-builder JSON stored in postmeta, the options table (ACF Options Pages, theme frameworks), widgets, Customizer CSS, and the active theme's own files for attachment references.

Anything left over is listed for manual review — nothing is ever deleted automatically. Each result can be checked with a built-in diagnostic tool that explains exactly where (if anywhere) a given attachment was found in use, and any item can be permanently whitelisted ("Keep") so it's excluded from all future scans.

= Key safety features =

* Nothing is deleted without explicit selection and confirmation.
* Attachments uploaded in the last 24 hours are never flagged, since they may not be placed into content yet.
* A manual "Keep" whitelist persists across scans for anything the automated detection can't see.
* A per-attachment "Why?" diagnostic shows exactly which source flagged (or didn't flag) an item as used.

This plugin does not collect any personal data, make external HTTP requests, or send usage statistics anywhere. All scanning happens locally on your server using your site's own database.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Go to Media → Media Auditor.

== Frequently Asked Questions ==

= Will this plugin delete anything automatically? =

No. Nothing is ever deleted without you explicitly selecting items and confirming the action.

= Does it detect ACF fields? =

Yes, including Gallery and repeater fields, plus ACF Options Pages stored in the options table.

= Does it work with page builders? =

The scanner checks JSON page-builder data stored in postmeta, so most page-builder-referenced images are detected.

= Does this plugin send any data externally? =

No. All scanning happens locally against your site's own database; nothing is sent off-site.

== Screenshots ==

1. Media Auditor admin screen showing scan results.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
