codethatfits/mediamatcher
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
=== MediaMatcher === Contributors: CodeThatFits Tags: media, migration, broken links, external urls, media library Requires at least: 5.8 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 1.0.5 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Scan your posts for external file URLs and match them to files in your media library. Perfect for site migrations and consolidating media assets. == Description == MediaMatcher helps you identify external file URLs in your WordPress content and replace them with files from your media library. This is perfect for: * **Site migrations** - After moving to a new domain, update old URLs to point to your media library * **Content consolidation** - Find files referenced from external sources and bring them into your media library * **Broken link detection** - Identify external URLs that are no longer accessible * **Media cleanup** - Discover which external files you might want to import locally = Key Features = * **Comprehensive Scanning** - Scans posts, pages, and all custom post types * **Deep Content Parsing** - Parses Gutenberg blocks, shortcodes, ACF fields, and page builder data (Elementor, Beaver Builder, etc.) * **Fuzzy Matching** - Intelligent filename matching finds similar files even with slight naming variations * **Multiple Match Suggestions** - Shows top 5 potential matches with similarity scores * **Broken Link Detection** - Identifies external URLs returning 404 or other errors * **Import to Library** - Import external files directly into your media library * **Dry Run Mode** - Preview changes before applying them * **Backup & Rollback** - Every replacement is backed up and can be rolled back * **Serialized Data Support** - Safely handles serialized data from page builders * **Bulk Operations** - Replace multiple URLs at once = How It Works = 1. Go to **Tools → MediaMatcher** 2. Select which post types to scan 3. Click **Start Scan** 4. Review matched external URLs 5. Select replacements from suggested matches or browse your media library 6. Click Replace - with automatic backup = Safe & Secure = * All operations require admin permissions * AJAX requests are protected with nonces * Backups are created before every replacement * Rollback functionality lets you undo changes * Dry run mode to preview without changes == Installation == 1. Upload the `mediamatcher` folder to `/wp-content/plugins/` 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Navigate to **Tools → MediaMatcher** to start scanning = Manual Installation = 1. Download the plugin zip file 2. Log into your WordPress admin 3. Go to Plugins → Add New → Upload Plugin 4. Upload the zip file and click Install Now 5. Activate the plugin == Frequently Asked Questions == = Does this modify my posts automatically? = No. MediaMatcher only makes changes when you explicitly click a Replace button. Use Dry Run mode to preview changes without applying them. = What content does it scan? = MediaMatcher scans: * Post content (the main editor) * Post meta fields (custom fields) * Gutenberg block attributes * Shortcode attributes * ACF fields * Page builder data (Elementor, Beaver Builder, Divi, etc.) * Serialized data = What file types does it detect? = All common file types including: * Images: jpg, jpeg, png, gif, webp, svg * Documents: pdf, doc, docx, xls, xlsx, ppt, pptx * Audio: mp3, wav, ogg, flac * Video: mp4, webm, avi, mov * Archives: zip, rar, 7z = How does the fuzzy matching work? = MediaMatcher uses several strategies: 1. **Exact match** - Case-insensitive filename comparison (100% score) 2. **Normalized match** - Strips WordPress suffixes like -300x200 (95% score) 3. **Levenshtein distance** - Finds similar names with typos or variations = Can I import external files? = Yes! If no match is found, you can click "Import to Library" to download the external file, add it to your media library, and replace the URL in one step. = How do rollbacks work? = Every replacement creates a backup record. Go to the Backups tab to see all replacement batches. Click Rollback to restore the original URLs. = Is it safe for large sites? = Yes. Scanning is done in batches to avoid timeouts. The batch size is configurable in Settings. = Does it work with multisite? = Currently MediaMatcher works on single WordPress installations. Multisite support is planned for a future release. == Screenshots == 1. Scan configuration with post type selection and threshold settings 2. Results table showing external URLs with matched media library files 3. Match selector with multiple suggestions and browse/import options 4. Broken links tab showing inaccessible external URLs 5. Backup history with rollback functionality == Changelog == = 1.0.0 = * Initial release * Scan posts, pages, and custom post types for external URLs * Fuzzy filename matching with similarity scores * Parse Gutenberg blocks, shortcodes, and ACF fields * Broken link detection * Import external files to media library * Dry run mode for previewing changes * Backup and rollback support * Serialized data handling for page builders == Upgrade Notice == = 1.0.0 = Initial release of MediaMatcher. == Privacy Policy == MediaMatcher does not collect any personal data. When checking external URLs for broken links, only HTTP HEAD requests are made to verify accessibility. No data is sent to external servers except for these validation requests. == Support == For support questions, please use the WordPress.org plugin support forum.