| 开发者 | hakeemify |
|---|---|
| 更新时间 | 2026年9月17日 18:09 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
--user=<an administrator>; without it, the admin is not read and the scan
says so.
Plans before it acts. You get a preview: every change, its risk level, what
it touches, and the recovery point that will be taken. The same scan and the
same profile always produce the same plan.
Takes a recovery point first. Before anything changes, the current
configuration is captured. Before rows are deleted, the rows themselves are
captured, and the deletion does not run unless that capture completed.
Verifies, then rolls back if it has to. After applying, Debloater requests
your front page, a post, your dashboard and your REST API, and if one of them
fails, it puts everything back and tells you what failed. It also requests the
login page, and warns rather than rolling back if that looks wrong. When you
apply from the dashboard, it also asks a fresh request whether each change
loaded, and puts everything back if one did not. From WP-CLI the same checks run
as the administrator you name with --user=<an administrator>, and a failure
puts everything back there too. Without --user, or on a site that cannot make
requests to itself, these checks cannot run; the change stays, and Debloater
reports which checks could not run.
Diagnoses a request. Pick a page — the home page, a post, the shop, the
cart, the checkout, the dashboard, or any address on your site — and Debloater
requests it once with its profiler switched on. It records how long the request
took, its peak memory, how many database queries it ran and how long they took,
and how long it waited on other servers, and turns what crossed a threshold
into findings: a slow or repeated query pattern, a plugin with a large share of
the time, a request that waited on other servers. Every finding says what it
could not observe. A diagnosis changes nothing, is one request rather than a
speed score, and is never added to the Debloat Score. If a cache answered the
request instead of your site, it says so and records no figures. The most
recent 20 diagnoses are kept.
Connects what it measured to what it can change. A diagnosis of a page
records the scripts and stylesheets it printed. Where one of Debloater's
changes removes something it printed — the emoji script, jQuery Migrate, the
cart-fragments script off the shop — the finding names that change and says
whether it is offered on your site, decided from your last scan exactly as
every other change is. Review it, apply it the usual way, then diagnose the same
page again to see the observed change.
Adds nothing to a page when nothing is selected. With no changes selected,
a front-end page loads none of Debloater's change handlers and makes no query
to Debloater's own data.
Three profiles
wp debloater scan --check-plugin-updates, or the check_plugin_updates
parameter of the REST scan endpoint; the dashboard never does — Debloater asks
https://api.wordpress.org/plugins/info/1.2/ for the last-updated date of each
installed plugin, one request per plugin, so it can tell you which look
abandoned. Each request names the plugin's slug, and its user agent names this
site's address. Nothing else about your site is sent. The dates are cached, and
the choice is not remembered: the next scan does not ask unless told to. This
is WordPress's own API; see the
wordpress.org privacy notice.
The rules Debloater reasons with ship inside the plugin and are never fetched.
A newer set arrives when you update the plugin.
Nothing else leaves your server.
WP-CLI
wp debloater scan --user=
wp debloater findings
wp debloater preview --profile=safe
wp debloater apply --profile=safe --yes
wp debloater rollback --yes
wp debloater status
wp debloater diagnose --user= [--type=checkout] [--deep]
wp debloater diagnosis []
Exit codes: 0 applied and verified, 1 error, 2 rolled back, 3 applied with
warnings. diagnose exits 0 when something was measured and 1 when nothing
was.
It removes work your site is doing. Whether that is measurable depends on what your site was doing to begin with. Debloater records before-and-after counts — requests, bytes, rows — on each change, and never reports a change as making your site faster.
After applying, Debloater requests your front page, a post, your dashboard and
your REST API. If one of them fails, it restores the previous state and reports
what failed. From WP-CLI, pass --user=<an administrator> so the checks that
need a signed-in user can run. If your site cannot make requests to itself, or
the change was applied from WP-CLI without --user, those checks are reported
as not run and the change stays in place.
Yes. Every apply creates a recovery point. You can roll back any of them from
"Changes & recovery" on the dashboard, or with wp debloater rollback.
Only when you choose a change that deletes rows. Those changes are never part of "Fix Safe Issues" or the other two profiles. The finding shows how many rows the scan counted. Before rows are deleted they are copied into a recovery point, and if that copy does not complete, nothing is deleted.
The changes Debloater applied stop, and it forgets which changes were applied:
if you install it again, it starts with nothing applied rather than turning them
back on. Rows a change deleted are not put back by uninstalling; roll the change
back first if you want them.
It deletes the files that hold recovery points larger than 8 MB, so those can no
longer be restored, and removes anything an older version left under
wp-content/. Exports you wrote under wp-content/uploads/debloater/ are left
in place. Its database tables and other settings are kept, including smaller
recovery points and the scan history, so after installing it again you can still
see what was changed and roll it back. A rollback puts the site back as it was
just before that change, so changes applied before it come back on too. There is
no setting to remove them on uninstall.
The changes you apply are stored in your database, not written as PHP files,
and nothing is added to must-use plugins.
Two things are written as files, both of them data, under
wp-content/uploads/debloater/:
backups/.wp debloater export and wp debloater profile export write their JSON
there, with a random suffix on the file name..htaccess refusing web access, which Apache honours; on
Nginx or another server, add your own rule to refuse
wp-content/uploads/debloater/. --file=- prints an export to standard output
instead, and a file path is refused.
No. There is no telemetry, licensing call or usage reporting. The requests it makes on its own go to your own site. The one request to wordpress.org happens only when you ask for it, and is described under "External services".
Debloater does not cache anything. Its command-line end-to-end check runs on a site with WooCommerce, Elementor, Contact Form 7, Rank Math and LiteSpeed Cache active.
wp debloater diagnose and wp debloater diagnosis, and REST routes to run, list and read diagnoses.