=== Quick Media Inspect === Contributors: themelooper Tags: media, images usage, cleanup, optimization, alt text Requires at least: 6.0 Tested up to: 6.8 Requires PHP: 7.4 Stable tag: 1.0.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Detect unused images, clean up your Media Library safely, and generate alt text from filenames. Configure exactly where to scan (content, featured images, post meta) and whether to include revisions. == Description == Quick Media Inspect helps you find unused images, review where images are used, and safely clean up your Media Library. It also lets you quickly generate alt text from file names to improve accessibility and SEO. New: You can choose what locations to scan (content, featured images, post meta like ACF) and whether to include post revisions. This reduces false positives and speeds up scans on large sites. Free features: - Scan Media Library for usage in: - Post/Page content (Gutenberg IDs, classic `wp-image-123`, full URLs, sized variants) - Featured images (`_thumbnail_id`) - Optional: Post meta (e.g., ACF image fields) — toggle in Settings - Include or exclude post revisions from scans (Settings) - Show where each image is used (with direct edit links) - Mark images as Used / Unused / Trashed - Bulk move to Trash, Restore, or Delete Permanently (AJAX) - Generate alt text from filenames (bulk) - Dashboard with real counts: total images, unused, missing alt text What it does NOT include (available in Pro): - Auto delete unused images after X days - Email notifications - Advanced scanning (shortcodes, widgets, options, menus, builders) - AI alt text generation = How it works = - Usage detection checks selected locations based on Settings: - Content: full URL, resized variants, Gutenberg image IDs, classic `wp-image-123` - Featured image: `_thumbnail_id` - Post meta (optional): matches attachment IDs and common serialized/JSON formats used by ACF - You can include or exclude post revisions from content/meta scans. - Trashed attachments are included, so you can restore them from the Scan Results. - Permanent delete is available via Bulk Actions and requires explicit confirmation. = Security = - All admin actions require `manage_options` capability. - Nonces on all forms and AJAX endpoints. == Installation == 1. Upload the plugin folder to `/wp-content/plugins/` or install via the Plugins screen. 2. Activate the plugin through the 'Plugins' screen in WordPress. 3. Go to Quick Media Inspect > Dashboard and click Run Scan. 4. Configure scan scope in Quick Media Inspect > Settings (content, featured, post meta, revisions). == Frequently Asked Questions == = Will this delete my images automatically? = No. The free version will never delete permanently unless you pick "Delete Permanently" from bulk actions. Moving to Trash is the default. = My trashed images disappear on my local site = Enable WordPress Media Trash or use the plugin's built-in fallback. Add to `wp-config.php`: `define('MEDIA_TRASH', true);` = Does it detect images in custom fields (ACF) or page builders? = Free detects post content and featured images. You can optionally enable "Scan post meta" in Settings to detect many ACF image references (IDs, filenames, serialized/JSON). Page builders and additional sources are covered in Pro. = Why are some images marked as used only in revisions? = By default, revisions are excluded. If you enable "Include Revisions" in Settings, references inside revisions will be counted. Disable it to exclude revision-only usage from results. == Screenshots == 1. Dashboard with summary cards 2. Scan results with Used/Unused/Trashed status and usage links 3. Alt text generator for images missing alt text == Changelog == = 1.0.1 = - Settings: Select scan locations (content, featured, post meta) and include/exclude revisions - Usage: Broadened post types to all public types - Meta: Optional ACF-aware post meta scanning (IDs, serialized/JSON) - Bulk actions: Added Delete Permanently to AJAX handler - UI: Standardized CSS classes to `qmi-` prefix - Stability: Safer SQL and filters; avoid removing unrelated filters = 1.0.0 = - Initial release (Free) - Scan results with usage tracking and bulk actions - Alt text generator from filenames - Dashboard with live counts == Upgrade Notice == = 1.0.0 = First release. Please back up before bulk actions on production.