Description
MediaTidy is a local media optimization and maintenance toolkit for WordPress. It helps you make images lighter, fix missing ALT text, find duplicate and unused media, and check what slows your pages down, all from one dashboard.
Image optimization
- Converts eligible JPEG and PNG attachments to WebP (and AVIF when supported by server GD or Imagick).
- Offers 3 compression profiles: balanced, visual-protection, and strict with a configurable sub-100 KB target.
- Preserves generated WordPress image dimensions and attachment IDs to prevent layout shifts or broken links.
- Automatic optimization on upload is disabled by default and requires explicit administrator activation.
Page-aware optimization & SVG cleanup
- Scans a specific published page to identify and optimize only the exact media assets used on that page.
- Includes a conservative SVG minifier that removes redundant comments and editor metadata without altering path geometry.
- Unsafe SVGs containing script tags or event handlers are rejected for safety.
Contextual ALT text
- Suggests meaningful accessibility ALT text based on surrounding page headings, captions, filenames, and nearby content.
- Provides a preview screen so you can inspect proposed ALT text before applying it.
- Never overwrites existing manual ALT text unless you explicitly enable that option.
Safe duplicate cleanup
- Detects exact duplicate images by comparing cryptographic file hashes.
- Automatically selects a primary keeper attachment and migrates database references (posts, meta, featured images).
- Places redundant copies in quarantine first with an old-to-new 301 redirection map to prevent 404 errors.
- Permanent removal is unlocked only after a second verification step confirms no references remain.
Unused media scanner
- Runs a read-only scan of WordPress posts, postmeta, options, and local theme/upload files.
- Identifies unattached and unused Media Library images for administrator review.
- Moves approved items to a safety-trash workflow instead of deleting them outright.
Storage analytics & history
- Provides a detailed storage breakdown across uploads, themes, plugins, and server disk capacity.
- Records before-and-after snapshots and maintains an optimization history log of disk space saved.
Site Speed Lab
- Conducts same-site synthetic performance checks for cache headers, image dimensions, lazy loading, and oversized images.
- Provides low-risk safe fixes for image attributes without modifying core theme code or combined assets.
PageSpeed Insights (optional)
- Runs official Google PageSpeed Insights tests on demand when an administrator clicks the test action.
- Supports optional Google API keys to avoid server quota limitations.
Privacy-friendly performance analytics (optional)
- Provides optional first-party visitor and real-user Core Web Vitals tracking, disabled by default.
- Stores no IP addresses, user-agent strings, or personal identifying information; uses HMAC-hashed anonymous visitor identifiers.
External services
MediaTidy can use the Google PageSpeed Insights API only when an administrator explicitly starts a Google PageSpeed test from Site Speed Lab.
When this action is used, the plugin sends the same-site URL selected for testing, the selected mobile/desktop strategy, requested Lighthouse categories, locale, and an optional administrator-supplied Google API key to Google’s PageSpeed Insights API. Google receives the network request from the WordPress server. No Media Library files or local visitor analytics records are sent by this feature.
Service information: https://developers.google.com/speed/docs/insights/v5/get-started
Google Terms of Service: https://policies.google.com/terms
Google Privacy Policy: https://policies.google.com/privacy
The plugin’s internal page scanner and internal speed audit make server-side requests only to URLs on the same WordPress site and do not use a third-party service.
Development source
Human-readable source files are included for every shipped asset. WordPress uses assets/admin.min.css, assets/admin.min.js, and assets/tracker.min.js in normal production mode and the readable assets/admin.css, assets/admin.js, and assets/tracker.js files when SCRIPT_DEBUG is enabled. The minified files can be regenerated from the readable source with standard CSS/JavaScript minifiers (for example Clean-CSS and Terser); no private source repository is required.
The plugin never rewrites JavaScript, JSON, HTML, or other generated code files in the uploads directory. Uploads-directory code scanning is read-only; supported page-builder cache APIs are used when a media URL change requires cached output to be regenerated.
Privacy
Local visitor/performance analytics is disabled by default. When enabled by an administrator, a first-party browser cookie is used to distinguish anonymous daily visitors. The random browser identifier is HMAC-hashed before database storage. The analytics feature does not store IP addresses, referrer URLs, user-agent strings, email addresses, or WordPress account identifiers, and does not send the collected analytics data off-site.
WordPress privacy-policy helper text is registered in the Privacy settings screen when the plugin is active.
Google PageSpeed Insights is a separate optional external service described above and is contacted only after an administrator explicitly starts a PageSpeed test.
Installation
- Back up your WordPress site before running bulk media changes.
- Upload the plugin files to
/wp-content/plugins/wahab-media-maintainer/or install via Plugins > Add New > Upload Plugin. - Activate MediaTidy through the Plugins screen in WordPress.
- Open MediaTidy in the WordPress admin menu.
- Review Settings before enabling automatic upload optimization, ALT automation, or cleanup workflows.
- Test a small batch of images before running site-wide optimization.
FAQ
How do I convert WordPress images to WebP?
Open MediaTidy > Media Optimization, choose your preferred profile (Balanced, Visual, or Strict), select individual attachments or run bulk optimization. Eligible JPEG and PNG files are converted locally on your web server.
Will it delete or replace my original images?
By default, MediaTidy does not delete your original image backup. In-place conversion updates WordPress attachment serving references, and removing the hidden pre-scaled original is an opt-in setting in the plugin options.
Will optimizing images change my image sizes or break my pages?
No. The plugin preserves original image dimensions and aspect ratios to prevent browser upscaling, blur, or content shifts. Visual-protection mode ensures compression never falls below safety floors.
How do I find unused images in my media library?
Navigate to MediaTidy > Unused Media Cleanup and run the usage scanner. The scanner searches post content, custom fields, theme files, and options in read-only mode to surface unreferenced media for review.
Is it safe to remove duplicate images? What about broken links?
Yes. MediaTidy uses a multi-step safe consolidation workflow. It detects exact byte matches, migrates database references to the keeper image, places duplicates into quarantine, and maintains 301 redirects before final cleanup is permitted.
Does it generate ALT text automatically? Can it overwrite my own ALT text?
MediaTidy only generates ALT text when you run the ALT engine or enable the setting. It will never overwrite custom ALT text you have manually written unless you explicitly allow it.
Does it work if my server does not support AVIF?
Yes. If your server lacks AVIF support in GD or ImageMagick, MediaTidy safely converts eligible images to WebP instead.
Does it send my data anywhere?
No. Image processing, SVG minification, ALT generation, and duplicate detection run entirely on your server. Only the optional Google PageSpeed Insights feature connects to Google’s public API, and only when you manually initiate a test.
Is it free?
Yes. All built-in features including WebP conversion, duplicate consolidation, ALT generation, and speed auditing are included under the GPL license with no external subscriptions.
Changelog
7.2.0
- Renamed plugin display name to MediaTidy, refreshed readme and admin labels. No functional changes.
7.1.9
- Addressed remaining actionable third-party audit findings while preserving the official Plugin Check fixes.
- Added production minified assets with readable source files still included in the package.
- Added short-lived caching for PageSpeed, same-site discovery, and internal speed requests.
- Primed post-meta caches for loop-heavy admin/report workflows and isolated necessary live database scans.
- Cleaned admin accessibility/static-analysis findings, plugin headers, and coding-standard details.
7.1.8
- Removed shell-command video transcoding from the WordPress.org build.
- Replaced direct local file operations in key workflows with the WordPress Filesystem API.
- Added Multisite analytics-table initialization and admin accessibility labels.
- Refactored dynamic helper callbacks to explicit methods for clearer static analysis.
7.1.7
- Addressed Plugin Check internationalization findings by documenting formatted translation placeholders.
- Replaced the remaining discouraged file rename operation with the WordPress Filesystem API.
- Prepared dynamic database identifiers with
%iand moved LIKE wildcards into prepared replacement parameters. - Sanitized analytics request values and legacy URL request paths before use.
- Documented intentional live database scans/writes with narrow PHPCS annotations where object caching is not appropriate.
- Removed the discouraged execution-time extension call and tightened read-only admin query handling.
7.1.5
- Updated the plugin identity and text domain for the assigned
wahab-media-maintainerslug. - Replaced direct plugin-directory constants with paths resolved from the plugin file and WordPress APIs.
- Ensured duplicate quarantine migrates known references and persists recovery mappings before any later permanent cleanup.
- Removed direct rewriting of generated code files in uploads; builder-cache handling now uses supported APIs only.
- Kept privileged request handlers behind capability and nonce checks and moved the top-level admin menu to a lower position.
- Clarified that distributed JavaScript/CSS is human-readable source and requires no build step.
7.1.0
- Prepared the distribution for WordPress.org review with Abdul Wahab as the plugin author.
- Changed fresh-install defaults so automatic upload optimization, ALT automation, analytics, and original-image backup removal are opt-in.
- Added stricter uploads-directory validation before image, SVG, and video file mutation.
- Switched same-site page discovery to WordPress’s SSRF-safe HTTP request helper.
- Hardened MP4 transcoding command execution and metadata update behavior.
- Added clear external-service and privacy documentation for Google PageSpeed Insights and optional local analytics.
- Retains selective/page-aware optimization, WebP/AVIF conversion, SVG minification, duplicate preview, quarantine, and verification workflows from 7.0.
