=== Feathersweep Database Cleanup ===
Contributors: lightningbyrd
Tags: database, cleanup, optimization, transients, performance
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The database janitor that knows what it is looking at. Cleans background-queue bloat, expired transients, trash and spam. Dry run first, always.

== Description ==

Feathersweep scans and safely cleans the bloat generic optimizers miss, then shows you exactly what it found before it removes anything.

**Dry run is the default.** Every run only reports what it *would* delete until you switch dry run off.

= What it cleans =

* **Background queue (Action Scheduler)**: complete and canceled actions past retention, and the failed actions core never purges, each with their log rows. On busy sites these two tables are the single biggest bloat source, growing into gigabytes.
* **Expired transients**: all of them, site and network scope. The ones nothing ever collects.
* **Trash, spam and old revisions**, older than retention. Revisions are off by default.
* **Expired sessions**, including legacy `_wc_session_` leftovers, when WooCommerce is present.
* **Autoload advisor**: the options loaded into memory on every single page view, sorted by weight and identified by plugin where possible, with a functionally-safe "stop autoloading" action that is one-click reversible. Core-critical options are never offered.

= Hard safety rules, regardless of settings =

* Nothing younger than its retention window is touched.
* Pending and in-process background jobs are never touched. The live queue is sacred.
* **Orders, products, customers and users are never touched by any cleaner.**
* Deletes run in bounded batches with a time budget and schedule their own continuation, so no long-running query ever hangs your site.
* Feathersweep adds no tables of its own, autoloads nothing, and caps its own history.

= Works on any WordPress site =

WooCommerce is recommended but not required. The background-queue, transient, trash and autoload cleaners help any WordPress site. The commerce-specific cleaners stand down when WooCommerce is absent.

= Set and forget =

A weekly schedule, an optional "reclaimed X MB this week" email summary, a full run history with per-cleaner breakdown, and an optional OPTIMIZE TABLE pass for maintenance windows.

= No account, no service =

No external service, no API key, no telemetry. Feathersweep makes no outbound requests of any kind.

== Installation ==

1. Upload and activate, then open **Tools > Feathersweep**.
2. The Scan tab shows where the weight is and what is reclaimable.
3. Run a dry-run report, which is the default, and read it.
4. **Back up your database.** Any deletion tool deserves a fresh backup first.
5. Disable dry run in Settings, run once manually, and verify the site.
6. Re-enable the weekly schedule and forget about it.

== Frequently Asked Questions ==

= What is actually taking up the space? =

Every site running a background queue logs everything it does, and those tables grow because completed work is kept for weeks and failed work is kept forever. Add expired sessions, expired transients that never get collected, trash, spam, and a handful of plugins autoloading megabytes of options into memory on every page view, and the site gets slower every month while backups balloon.

= Will it delete anything I need? =

Dry run is on by default, so the first thing you get is a report rather than a deletion. Beyond that, the hard rules above hold regardless of settings: nothing inside its retention window, nothing pending or in-process, and no commerce data, ever.

= What does the autoload advisor actually change? =

Autoloaded options are read into memory on every request, so a few megabytes there taxes every page view for every visitor. The advisor lists options over 50 KB and lets you stop autoloading them. This is functionally safe: the option still exists and `get_option()` still returns it. WordPress simply stops preloading it. Every change is recorded with its original value and is one-click reversible, and core-critical options are never offered.

= Why is my database file the same size after a clean? =

Deleting rows does not shrink the file on disk until OPTIMIZE TABLE runs. InnoDB reuses the freed space internally either way, and queries get faster immediately. Enable the OPTIMIZE TABLE pass only if you have a low-traffic window, because it briefly locks tables while reclaiming disk.

= Does it need WooCommerce? =

No. It is sharper on a store, because that is where the background queue works hardest, but the queue, transient, trash and autoload cleaners are useful on any WordPress site.

= Does it phone home? =

No. There are no outbound HTTP requests anywhere in the plugin.

== Screenshots ==

1. Scan: table weights, queue status counts, cleanable-now previews, and the estimated reclaimable total.
2. Autoload advisor: the heaviest always-loaded options, identified, with reversible stop-autoloading.
3. History: every run, dry or real, with a per-cleaner breakdown.
4. Settings: the dry-run switch, the weekly schedule, and per-cleaner retention windows.
5. The weekly email summary: what was reclaimed, per cleaner.
6. Help: what is touched, what never is, and the recommended rollout.

== Changelog ==

= 1.0.8 =
* Fixed: the Help tab, the notice shown after each action, and the autoload advisor still said "Featherweight" after the rename. Everything you see now says Feathersweep.
* The Help tab and one Settings description no longer read as if the plugin were only for WooCommerce stores. It works on any WordPress site, and stores are simply where the background queue grows fastest.
* Wording only. No change to what any cleaner deletes or never touches.

= 1.0.7 =
* Renamed from "Featherweight Database Cleanup" to "Feathersweep Database Cleanup". An established WordPress.org optimization plugin is already called Featherweight, and two plugins in the same category sharing a name helps nobody.
* The rename goes all the way down: text domain, option names, cron hooks, the admin page address and the WooCommerce log source. An upgrade migrates your settings, run history, autoload undo list and last-run time across automatically, and reschedules the weekly job, so nothing is lost and nothing needs re-configuring.
* One thing you do have to change by hand: if you defined `LB_FWEIGHT_REMOVE_ALL_DATA` in wp-config.php, it is now `LB_FSWEEP_REMOVE_ALL_DATA`.

== Upgrade Notice ==

= 1.0.8 =
Wording only: finishes the rename in the Help tab and admin notices. No change to what any cleaner touches.

= 1.0.7 =
Renamed to Feathersweep. Settings and history migrate automatically. If you set LB_FWEIGHT_REMOVE_ALL_DATA in wp-config.php, rename it to LB_FSWEEP_REMOVE_ALL_DATA.
