=== Limit Post Revisions ===
Contributors: snehalpancholi
Tags: performance, revisions, database, optimization, cleanup
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cap stored revisions per post and trim existing excess revisions from the database with a single click.

== Description ==

By default WordPress stores unlimited post revisions. On an active site this can mean thousands of revision rows in `wp_posts`, bloating the database and slowing queries.

**Limit Post Revisions** lets you:

* Set a maximum number of revisions per post (0 = disable revisions)
* Choose which post types the limit applies to
* Trim all existing excess revisions with a single button click (AJAX, no timeout)
* Keep your revision limit in sync via the `wp_revisions_to_keep` filter — no `wp-config.php` editing needed

**Features:**

* Per post type selection (all public post types that support revisions are listed)
* Configurable limit: 0–100 revisions
* One-click trim tool with confirmation prompt and live result count
* Compatible with all themes and page builders
* Auto-update via AddonLogic update server

== Installation ==

1. Upload the `limit-post-revisions` folder to `/wp-content/plugins/`
2. Activate through **Plugins → Installed Plugins**
3. Go to **Settings → Limit Post Revisions** to set your limit
4. Click **Trim Revisions Now** to clean up existing excess revisions

== Frequently Asked Questions ==

= Will this delete all my revisions? =
No. Only revisions beyond the configured maximum are deleted when you click Trim. Your most recent revisions (up to the limit) are kept.

= Setting to 0 — what happens? =
Setting the limit to 0 disables revision storage for new saves on the selected post types. Existing revisions are only removed if you click Trim.

= Does it affect Custom Post Types? =
Yes — any public CPT that supports revisions appears in the post type checklist.

== Changelog ==

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.0 =
Initial release.

== Screenshots ==

1. Settings page showing the revision limit field and post type checkboxes.
2. Trim Revisions button with live result feedback.
