Sajib Media Cleanup & Storage Manager helps WordPress administrators find unused media, duplicate images, orphan files and stale generated thumbnails before removing anything. It builds a reference index across WordPress content and metadata, supports Elementor, ACF and WooCommerce workflows, identifies preliminary unused and duplicate-unused media, and provides reference checks before cleanup; these checks are not a guarantee that every third-party or dynamically generated reference is discoverable.
Key features include:
- Reference-aware Media Library audit.
- Exact second-pass cleanup plans before destructive operations.
- Final live verification immediately before cleanup.
- Safety Vault delayed-purge hold with cancellation and fresh verification before permanent deletion.
- Duplicate-unused detection using file hashes.
- Safe orphan discovery in standard WordPress date-based upload folders.
- Media Family inspection for original, generated and optimized variants.
- Stale derivative auditing with current-reference protection.
- Incremental scan fingerprints, storage analytics and audit history.
- Background jobs designed for shared-hosting environments.
Sajib Media Cleanup & Storage Manager does not treat an unattached image as automatically unused. Candidates must pass the plugin's verification workflow before they can become cleanup-ready.
Author
Developed by
Mohamed Sajib.
Portfolio:
sajib.dev.cv
1.7.0-rc2 (development; not released)
- Reworked SQL templates, identifier placeholders, filter binding and fingerprint commit ordering.
- Added fail-closed database checks and complete attachment metadata validation.
- Hardened final permissions, stale-derivative checks and UTC job timestamps.
- Context-aware media ID extraction and isolated WordPress/MySQL tests added.
- Added real WordPress/MySQL, browser, concurrency, compatibility and package acceptance coverage.
1.6.4
- Excluded legacy HMG media-cleaner tables from custom reference discovery.
- Prevents historical scanner/index data from falsely marking attachments as live website usage.
- Improves cleanup accuracy on sites upgraded from earlier Media Guard/Harrington Media Guardian builds.
1.6.3
- Rechecked the complete WordPress.org review package and hardened self-reference isolation.
- Excluded all plugin-owned operational tables from custom website-reference discovery.
- Skip filesystem symlinks during orphan discovery before they can become candidates.
- Replaced remaining dynamic identifier SQL with WordPress identifier placeholders where applicable.
- Restored the Media Family explorer button.
- Reformatted distributed CSS and JavaScript for clearly human-readable source review.
1.6.2
- Fixed delayed-purge integrity checks so an attachment's own inventory metadata is not mistaken for frontend usage.
- Tightened safe handling of missing orphan paths during purge.
- Removed PHP error-suppression operators from filesystem reads and image inspection.
- Improved AJAX checkbox normalization and admin output escaping.
- Kept all WordPress.org review fixes from 1.6.1.
1.6.1
- Renamed to place the unique Sajib identifier first and prepared the requested
sajib-media-cleanup-manager slug.
- Hardened all attachment-derived filesystem paths with uploads-directory containment and safe filename handling.
- Replaced metadata-derived wildcard sibling matching with containment-checked directory enumeration.
- Replaced direct file deletion calls with WordPress core file deletion after path validation.
- Added consistent unslashing and sanitization for AJAX input.
- Clarified Safety Vault as a delayed-purge hold rather than a physical file move.
- Added explicit human-readable source and no-build documentation for directory review.
1.6.0
- Renamed with a distinctive sajibsays identifier and new public slug.
- Replaced the previous short internal prefix with the unique
sajmc_ / SAJMC_ prefix.
- Added strict uploads-directory containment checks for every attachment-derived filesystem path.
- Reworked Safety Vault as delayed purge so it does not copy files into web-accessible storage.
- Added human-readable JavaScript/CSS source copies and documented the no-build asset workflow.
- Retained background-worker timeout recovery and bounded metadata scanning.
1.5.2
- Added automatic stale-worker recovery after Action Scheduler/host timeouts.
- Reduced builder-reference batch size and added a six-second soft execution budget.
- Large Elementor/metadata payloads are scanned in bounded chunks.
- Fingerprint writes are split into smaller transactions to reduce lock/timeout risk.
- Existing valid scan progress can resume safely after updating.
1.5.1
- Improved stale-derivative reference accuracy.
- Separated self attachment metadata from authoritative frontend references.
- Kept current page, template, option and active-code protections before derivative cleanup.
- Prepared the plugin for WordPress.org distribution under GPL v2 or later.
1.5.0
- Added Safety Vault quarantine and restore workflow.
- Added post-cleanup integrity checks.
- Added Media Family inspection.
- Added incremental scan delta reporting.
- Added stale derivative audit and cleanup workflow.