=== SmartProductSEO Media Library Cleanup ===

Contributors: jolizzie
Tags: media cleanup, unused images, media library, image cleanup, database cleanup
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Safely find, review, restore, and clean unused WordPress media files with a review-first cleanup workflow.

== Description ==

Is your Media Library full of old images, unused uploads, duplicate files, and forgotten media?

SmartProductSEO Media Cleanup helps you discover unused images, review media usage, safely move files to Trash, restore files if needed, and permanently remove unnecessary media from your WordPress website.

Whether you run a WooCommerce store, blog, business website, portfolio, membership site, or agency, keeping your media library organized can improve workflow, reduce storage usage, and make managing content much easier.

Unlike aggressive cleanup tools, SmartProductSEO Media Cleanup takes a conservative approach and helps identify images that may no longer be actively used before you decide what to remove.

Key Features

* Scan your Media Library for unused images.
* Detect unattached media files.
* Review image usage information.
* Move images to Trash before deletion.
* Restore images from Trash at any time.
* Permanently delete images when ready.
* Track scan history.
* View storage analytics.
* Detect WooCommerce image relationships.
* Detect theme logo relationships.
* Use a review-first cleanup workflow.
* Manage images with bulk action tools.

Safe Cleanup Process

1. Run a Media Library scan.
2. Review identified images.
3. Move unwanted images to Trash.
4. Restore files if needed.
5. Permanently delete only when ready.

This workflow provides an extra layer of protection before files are permanently removed.

== Installation ==

1. Upload the plugin files to the /wp-content/plugins/smart-media-cleanup-media-library-cleanup/ directory, or install the plugin through the WordPress plugins screen.
2. Activate the plugin through the Plugins screen in WordPress.
3. Navigate to SmartProductSEO Media Cleanup in the WordPress admin menu.
4. Run your first media scan.

== Frequently Asked Questions ==

= Will this delete my images automatically? =

No. SmartProductSEO Media Cleanup never automatically deletes images. You choose which files to move to Trash and permanently delete.

= Can I restore images after moving them to Trash? =

Yes. Images moved to Trash can be restored before permanent deletion.

= Does this work with WooCommerce? =

Yes. The plugin is designed to help WooCommerce store owners manage large media libraries.

= Is this safe to use on production websites? =

The plugin follows a conservative cleanup workflow and encourages reviewing results before deleting files.

= Does it work with large media libraries? =

Yes. SmartProductSEO Media Cleanup is designed to help manage websites with large image collections.

== Screenshots ==

1. Smart Media Cleanup Dashboard and Scan Center.
2. Media Library Scanner showing detected cleanup candidates.
3. Trash Review Center with restore and review workflow.
4. Permanent Delete Center for final media cleanup.
5. Storage Analytics Dashboard showing cleanup opportunities and protected media.

== Changelog ==

= 1.2.1 =

* Added Dashboard | 🔑 Upgrade To PRO plugin row link.
* Added Upgrade To PRO dashboard card.

Version 1.2.0
Removed scanner limitation architecture.
Improved WordPress.org compliance.
Fixed Media Library Scanner functionality.
Fixed Trash Review functionality.
Fixed Permanent Delete functionality.
Minor code cleanup and stability improvements.


Version 1.1.9
Fixed Media Library Trash connection issues.
Fixed Permanent Delete connection issues.
Restored Trash Review and Permanent Delete functionality.
Improved scanner, trash, and cleanup workflow reliability.
Minor code cleanup and stability improvements.

Version 1.1.8
Removed scanner limitation architecture.
Simplified Media Library scanning workflow.
Improved WordPress.org compliance.
Fixed scanner reliability issues.
Minor code cleanup and optimization.

Version 1.1.7
Fixed Media Library Scanner not scanning images correctly.
Restored normal image scan functionality.
Removed scanner restriction logic flagged during WordPress.org review.
Improved scanner stability and reliability.
Minor code cleanup and optimization.

= 1.1.6 =
* Removed scan amount caps so the Media Library scan checks all image attachments.
* The normal scan now uses the complete local theme/customizer usage scanner included in the plugin.
* Cleaned internal wording and unused option names for WordPress.org review clarity.
* Renamed internal trash/delete files to neutral names.
* Updated version to 1.1.6.

= 1.1.5 =
* Updated internal namespace to smcmlc_ for improved uniqueness.
* Removed legacy generic AJAX aliases.
* Removed old commercial-link action from the Plugins screen.
* Cleaned unused admin CSS selectors from earlier versions.
* Updated admin asset handles and localized script object naming.
* Preserved Media Library scanning, Trash Review, Restore, Permanent Delete, Scan History, and Storage Analytics workflows.

= 1.1.4 =
* Improved plugin prefix consistency across PHP, CSS, JavaScript, options, and AJAX actions.
* Improved dashboard, trash review, and permanent delete workflow consistency.
* Improved WordPress.org review preparation.

= 1.1.3 =
* Improved Media Library scanner stability.
* Improved Trash Review and Permanent Delete workflows.
* Improved cleanup statistics handling.
* Improved dashboard navigation.

= 1.1.2 =
* Fixed Trash Review manager loading issue.
* Restored Trash Review table rendering.
* Connected Restore, Permanent Delete, Bulk Restore, and Bulk Permanent Delete handlers.
* Improved scan history consistency.

= 1.1.1 =
* Fixed Scan Media Library button connection issues.
* Standardized AJAX action names across the plugin.
* Unified nonce handling between PHP and JavaScript.
* Cleaned duplicated selectors and duplicate JavaScript bindings.
* Improved bulk action reliability for Trash, Restore, and Permanent Delete workflows.

= 1.1.0 =
* Improved scanner reliability.
* Refined dashboard component loading and scanner initialization.
* Updated internal scanner architecture for cleaner maintenance.

= 1.0.9 =
* Cleaned remaining generic CSS and JavaScript class references.
* Preserved Media Library Scan, Trash Review, Restore, and Permanent Delete functionality.
* Improved consistency between PHP, CSS, and JavaScript naming conventions.

= 1.0.8 =
* Preserved dashboard functionality and scan workflows.
* Improved compatibility with WordPress admin environments containing many active plugins.
* General stability improvements.

= 1.0.7 =
* Cleaned up admin CSS and JavaScript naming conventions.
* Reduced risk of naming collisions with other plugins and themes.

= 1.0.6 =
* Cleaned plugin structure for WordPress.org compliance.
* Updated internal function, option, and identifier prefixes for improved uniqueness and compatibility.
* Refined Media Library Trash Review and Permanent Delete workflows.

= 1.0.5 =
* Updated WordPress compatibility information.
* Improved uninstall routine compliance.
* Minor maintenance updates.

= 1.0.4 =
* Cleaned plugin structure.
* Updated readme and contributor information.
* General stability and compatibility improvements.

= 1.0.3 =
* Improved plugin navigation from the WordPress Plugins screen.
* Minor dashboard and plugin integration improvements.

= 1.0.2 =
* Fixed Trash Review page errors.
* Fixed Media Library Trash functionality.
* General bug fixes and cleanup.

= 1.0.1 =
* Created standalone plugin package.
* Added Media Library Scanner.
* Added Trash Review and Permanent Delete tools.
* Added Scan History and Storage Analytics.
* Added dashboard styling and functionality improvements.

= 1.0.0 =
* Initial WordPress.org release.
* Added Media Library Scanner.
* Added Unused Image Detection.
* Added Trash Review.
* Added Permanent Delete Center.
* Added Scan History.
* Added Storage Analytics Dashboard.
* Added WooCommerce image awareness.
* Added theme logo protection.

== Upgrade Notice ==

= 1.2.1 =
Adds the Upgrade To PRO plugin row link and dashboard upgrade card.