=== Gerdoo Orphan Media Cleaner ===
Contributors: maghsoudi
Tags: media cleaner, orphan images, ghost files, database cleaner, uploads cleaner
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Deeply scans both your database (orphans) and filesystem (ghost files) with a safe physical trash bin.

== Description ==

**Is your server storage full of unused images and leftover thumbnails?**
Gerdoo Orphan Media Cleaner is a tool designed to clean your WordPress media library and physical `/uploads/` directory. 

### 🚀 Key Features

* **Deep Database Scanner (Orphans):** Finds images that are registered in your Media Library but are unused in posts, pages, WooCommerce products, Elementor, or ACF fields.
* **Deep Filesystem Scanner (Ghost Files):** Directly scans your physical `/uploads/` folders to find leftover thumbnails and images that the WordPress database doesn't know exist.
* **Safe Physical Trash Bin:** Files deleted from the host are sent to a secure, physical Trash Bin (`/gw-trash-bin/`). You can restore them to their exact original location with a single click!
* **Optimized Processing:** Built with OOP architecture and Cursor-based Pagination. It processes files in smart batches via AJAX, allowing it to scan databases with many images on shared hosts smoothly.
* **Deep Parser Engine:** Smart analysis of JSON strings (Elementor), serialized arrays, and shortcodes to effectively identify used media.

== Installation ==

1. Upload the `gw-smart-media-cleaner` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to Tools -> Gerdoo Media Cleaner to start scanning your site.

== Frequently Asked Questions ==

= Is the host scanner completely free? =
Yes! Finding physical "Ghost Files" on your server is 100% free in this plugin.

= Will this plugin crash my shared host? =
No. The plugin uses Smart Batching and Cursor Pagination to process images 20 at a time. It uses minimal CPU and RAM, making it perfectly safe for huge websites on shared hosting.

= If I delete an image by mistake, can I recover it? =
Yes! If you delete a physical file from the Host Scanner tab, it goes to the "Physical Trash Bin" tab. You can easily click "Restore" to put it back exactly where it was.

== Screenshots ==

1. Database Scanner (Orphans) with smart batch processing.
2. Deep Host Scanner finding unregistered ghost files.
3. The Physical Trash Bin with 1-click restore functionality.

== Changelog ==

= 1.0.0 =
* Initial Release.
* Added Database Orphan Scanner.
* Added Deep Host Scanner.
* Added Physical Trash Bin & Recovery System.