Linux 软件免费装
Banner图

Revision Autopilot

开发者 takahironishii
更新时间 2026年9月22日 18:52
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

cleanup revision wp-cli automation abilities

下载

0.1.0 0.2.0 1.0.0

详情介绍:

WordPress keeps a full copy of a post every time you update it. Over a few years those copies quietly become the largest thing in your database, and nothing in the admin shows you how much of it they are. Revision Autopilot shows you, then removes them — however you prefer to work. A screen, when a person is deciding Under Tools → Revision Autopilot you get the total, an estimate of the space it occupies, and a breakdown by parent post type. Delete everything, or one post type at a time. Deletion runs in batches with a progress bar that reports what is left after each one, so a site with tens of thousands of revisions finishes without hitting a PHP time limit. Every destructive action asks twice, in two different places on screen, and says exactly how many revisions it is about to remove. That confirmation works with JavaScript switched off too. WP-CLI, when a script is deciding wp revision-autopilot count wp revision-autopilot delete --scope=post --limit=100 wp revision-autopilot optimize --dry-run reports what matches without touching it. --all repeats a bounded batch until nothing is left. Abilities, when something else entirely is deciding The same operations are published as abilities — named operations with input and output schemas, permission callbacks and behavioural annotations — using the Abilities API introduced in WordPress 6.9. Anything that can discover abilities can find these, understand what they take and return, check whether it is allowed to run them, and read back a structured result. All three surfaces sit on one set of objects, so they cannot drift apart in what they actually do. What it exposes Four abilities, all under the revision-autopilot/ namespace: And three WP-CLI commands over the same code: wp revision-autopilot count wp revision-autopilot delete --scope=post --limit=100 wp revision-autopilot optimize How it stays safe Deleting revisions cannot be undone, and the same operations are reachable from three directions. Each one has to be safe on its own terms. Moving here from Takahiro Revision Cleanup The same author published Takahiro Revision Cleanup, a revision cleanup plugin with a screen under Tools. As of version 1.0.0 this plugin does everything that one did, and Takahiro Revision Cleanup is being retired. If you are moving across: install this plugin, activate it, then deactivate and delete the old one. Nothing needs exporting — both read the same revisions straight out of wp_posts, so the figures will look the same on the first screen you open. Two details for anyone who had integrated with the old plugin:

安装:

  1. Upload the plugin to /wp-content/plugins/revision-autopilot/, or install it through the plugins screen.
  2. Activate it.
  3. Open Tools → Revision Autopilot. Nothing is deleted until you ask for it.
Scripts and agents need no setup at all: wp revision-autopilot count works immediately, and the abilities register themselves on WordPress 6.9 and up.

屏幕截图:

  • Every destructive action asks twice and says how many revisions it is about to remove. The confirmation works with JavaScript switched off.
  • Deletion runs in batches. The progress appears where you clicked, and reports what is left after each one.
  • `wp revision-autopilot count` reports the same figures for scripts and cron.
  • Deletion is bounded from the command line too. `--dry-run` reports a scope without touching it, and `--all` repeats one batch at a time.
  • `wp revision-autopilot optimize` runs OPTIMIZE TABLE on the two allowlisted tables, and a second count confirms what is left.

常见问题:

Do I have to use the command line?

No. Everything is on the screen under Tools. WP-CLI and the abilities exist for sites where cleanup should happen without a person watching — scheduled scripts, agent-driven maintenance, fleets of sites managed from one place — but nothing requires them.

Is deleting revisions reversible?

No. Revisions are deleted permanently. Take a backup first, and use --dry-run or count-revisions to see what would go before it goes.

Why does one call not delete everything?

Because an unbounded delete on a large site is a request that runs until something kills it, leaving you with no idea how far it got. Each call removes a bounded batch and tells you how many remain, so the caller stays in control. wp revision-autopilot delete --all loops for you.

Deleting revisions did not shrink my database.

Deleting rows does not shrink the table file; only OPTIMIZE does. Run optimize-tables after deleting.

How do I call an ability over REST?

Read-only abilities are called with GET, destructive ones with POST, against /wp-json/wp-abilities/v1/abilities/<name>/run. The abilities that take no arguments — count-revisions and optimize-tables — still need an input parameter present, even though it is empty: curl -u user:app-password "https://example.com/wp-json/wp-abilities/v1/abilities/revision-autopilot/count-revisions/run?input=" Leaving input off entirely returns ability_invalid_input. The ones that do take arguments are called the usual way, for example ?input[per_page]=20.

Does it work without the Abilities API?

The abilities need WordPress 6.9 or newer. On anything from WordPress 5.9 up, the screen and the WP-CLI commands work exactly the same — the abilities simply do not register, and nothing errors.

更新日志:

1.0.0 0.2.1 0.2.0 0.1.0