=== 360 Orbit Media Cleaner ===
Contributors: joergliwa
Tags: media library, cleanup, images, storage, webp
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.19
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Finds unused media files and outdated image sizes and moves them to a reversible holding area. Nothing is deleted without your consent.

== Description ==

Media Cleaner scans your entire media library for files that are no longer needed:

* Media files that are no longer referenced in any post, ACF gallery or content block.
* Image sizes that your current theme no longer registers (for example after switching themes).
* Files in the uploads folder that were never registered in the media library ("filesystem orphans").

Files that are found are **not deleted**. Instead they are moved to `uploads-legacy`, where they can be restored individually, by selection or all at once. Only the trash deletes files permanently, and only after you explicitly confirm it.

= Free version vs. Pro =

The free version includes the complete cleanup process (scan, legacy media management, trash). This is the core of the plugin and can be used without restrictions.

**Media Cleaner Pro** adds:

* Automatically regenerate missing image sizes (for example after switching themes).
* Downscale original images and optionally serve them as WebP/AVIF, including a safe backup area for the originals.
* Automatic update notifications directly in the WordPress admin.

== Installation ==

1. Upload the plugin ZIP under *Plugins → Add New Plugin → Upload Plugin*.
2. Activate the plugin.
3. Start a scan from the **Media Cleaner** menu.

== Frequently Asked Questions ==

= Are files deleted immediately? =

No. Files that are found are first moved to `uploads-legacy` and can be restored from there at any time. Files are only permanently deleted from disk in the trash, after you explicitly confirm it.

= Are ACF fields taken into account? =

Yes. The scan checks featured images, ACF image fields, ACF galleries/repeaters as well as references in content (Gutenberg blocks, classic galleries).

= What is the difference between "Legacy Media" and "Original Backups"? =

Legacy media are the cleanup findings of the scan (unused files or outdated sizes). Original backups are only created by the Pro feature "Downscale Originals" and are kept strictly separate in a folder of their own.

= Who is liable in case of damage? =

This plugin is provided without any warranty ("as is"). The developer accepts no liability for data loss or damage resulting from the use of the plugin. We strongly recommend creating a complete backup of your files and database before using it.

== Screenshots ==

1. The cleanup page: start a scan for unused media files and outdated image sizes.

== Changelog ==

= 1.0.19 =
* Fixed a fatal error when the free and Pro versions were loaded together.
* The protective .htaccess in the legacy folders is now written through the WordPress filesystem API.

== Upgrade Notice ==

= 1.0.19 =
Fixes a fatal error when the free and Pro versions are loaded together.

