| 开发者 |
robbsie
turbopress |
|---|---|
| 更新时间 | 2026年8月24日 02:44 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
acf_field_group is attributed to Advanced Custom Fields while acfxtra_setting is not. Anything that cannot be attributed is reported as not attributed rather than assigned to the nearest plausible plugin. Guessing would be worse than saying nothing.
The unattributed remainder is grouped by its shared prefix, so instead of one anonymous lump you see, for example, that six options starting with ionos account for 186 KB. Grouping is not attribution and is labelled as such, but it turns a dead end into something you can search for.
Options whose plugin is no longer installed are reported as their own category. So are theme modifications of themes that have been deleted. These are the leftovers no uninstall routine removed.
Object cache, OPcache and page cache in one picture
maxmemory-policy.object-cache.php and advanced-cache.php drop-ins from their file header.opcache_get_status in disable_functions, running but with opcache.restrict_api locking this path out, and measured from the command line where OPcache is off anyway. Only the first two are faults of the site; the rest are hosting arrangements and are left out of the score rather than counted against you. Where the counters are unreadable the plugin still asks opcache_is_script_cached whether a WordPress core file is in the cache, so it can say whether OPcache is actually working instead of guessing from a configuration flag.INFORMATION_SCHEMA with size, engine, row count, collation and free space. Tables whose prefix belongs to a plugin that is not installed.
Free space is reported per engine rather than as one number, because DATA_FREE does not mean the same thing everywhere. In MyISAM it is waste that OPTIMIZE TABLE returns to the file system. In InnoDB it is space the engine reuses for new rows, so it is reported separately and never called reclaimable. And with innodb_file_per_table switched off it describes the shared tablespace, so the same figure appears on every table; there the plugin leaves it out and says why, rather than adding one number up thirty times.
Collations are compared against the WordPress tables, not against the majority: on a site with many plugin tables the plugins outnumber core, and a plain majority would report WordPress itself as the anomaly. Tables still on the three byte utf8 or utf8mb3 are called out separately, because those cannot store emoji and make joins against utf8mb4 tables fail outright.
On large tables the exact count is attempted under a deadline enforced by the database server. Only when that deadline passes does the plugin fall back to a bounded sample, and the result then says so. Because orphans are created by events and therefore sit in contiguous blocks rather than spread evenly, a sample can be genuinely inconclusive; in that case the plugin reports a confirmed lower bound and states that the total could not be determined, instead of printing a number that looks measured.
WooCommerce data is treated with care. Orders, their metadata and active sessions are never counted as orphaned, trashed orders are never offered for deletion, and while WooCommerce keeps its orders in its own tables (HPOS), post meta is reported but not offered for cleanup at all: whether a row still belongs to an order cannot be answered reliably then, and that is not a basis for an irreversible delete.
Cleanup
Cleanup exists, but it is a side function, not the selling point. Every category runs on its own, never all at once. Dry run is the default: you see how many rows are affected and confirm before anything is deleted. Work is batched over the REST API with a progress display. There is no cron job and no automatic cleanup.
On the command line
Everything the screen does is available through WP-CLI, because the scanners
were written to know nothing about the admin screen.
wp turbopress-diagnostics scan # score and the figures behind it wp turbopress-diagnostics scan --refresh # measure again first wp turbopress-diagnostics report > report.json # the full document wp turbopress-diagnostics categories # what can be cleaned, and how much wp turbopress-diagnostics cleanup orphan_postmeta # simulate wp turbopress-diagnostics cleanup orphan_postmeta --execute # delete, asks first
That turns a report across many installations into a shell loop, which is the
difference between a tool for one site and a tool for a hosting account.
What this plugin does not do
/wp-content/plugins/turbopress-database-diagnostics/ or install it through Plugins → Add New.Reading is safe. The scan runs two queries against the options table and a handful of aggregate queries against INFORMATION_SCHEMA, all of them bounded. Nothing runs during normal page loads.
Cleanup deletes rows, and deleting rows is never risk free. Every operation shows you the affected row count first and requires confirmation. Make a backup before you delete anything.
Because it does not know. Option names carry no author. Attribution is derived from prefixes, and when a prefix matches nothing on the installation, the honest answer is that the origin is unknown. A guess would send you looking in the wrong place.
Yes. The prefix table is filterable:
`
add_filter(
'turbopress_diagnostics_plugin_prefixes',
function ( $prefixes, $plugins, $themes ) {
$prefixes['acme'] = array(
'type' => 'plugin', // plugin, mu_plugin, theme,
// removed_plugin, removed_theme
'id' => 'acme-widgets', // directory slug
'label' => 'Acme Widgets', // name shown in the report
);
return $prefixes;
},
10,
3
);
The array is keyed by prefix without a trailing separator.$pluginscontains the installed plugins and must-use plugins keyed by slug,$themes` the installed themes keyed by stylesheet, so you can decide whether to register anything at all. Entries that do not follow this shape are discarded, because a malformed entry would produce a wrong statement about who is responsible for a payload.
If you are a plugin author whose options are showing up as unattributed on other people's sites, adding this filter to your own plugin fixes it for every user at once.
Yes, and that is the point of it for anyone looking after more than one site. wp turbopress-diagnostics scan prints the score and the figures behind it, wp turbopress-diagnostics report the full JSON document, wp turbopress-diagnostics categories what can be cleaned up, and wp turbopress-diagnostics cleanup <category> runs one category. Cleanup simulates unless you add --execute, and asks for confirmation unless you add --yes.
wp help turbopress-diagnostics lists every subcommand and option. The commands are also shown on the plugin screen, under the settings.
turbopress_diagnostics_loopback_sslverify decides whether the loopback request verifies the TLS certificate. Return false on a staging environment behind a self signed certificate, where the check would fail for a reason unrelated to caching.
turbopress_diagnostics_table_prefixes registers table name prefixes so leftover tables of a plugin that is gone are named rather than ignored, in the same way as the option prefixes above.
turbopress_diagnostics_count_time_budget sets how many seconds an exact orphan count may take on a large table before it falls back to a sample. The default is 5. The deadline is enforced by the database server, so an overrunning query is stopped rather than left to consume the PHP execution time. Raise it to trade a slower scan for an exact number.
Probably not. Managed hosting commonly puts opcache_get_status into disable_functions, or restricts it with opcache.restrict_api. OPcache keeps working; only the counters are unreadable. The plugin tells that apart from a genuinely disabled OPcache, leaves it out of the score instead of counting it against your site, and still reports the configuration through opcache_get_configuration, which usually survives. It also asks whether a WordPress core file is currently in the cache, which answers whether OPcache is doing its job even when the numbers are hidden.
No. It is a single GET request to your own home URL, made by your own server, to look at the response headers. Nothing is sent to any third party. You can switch it off in the settings, in which case page cache detection is skipped.
It does not. Redis and Valkey statistics are read through the connection the object cache drop-in has already established. If the drop-in does not expose its client, the plugin reports that no statistics are available rather than trying to connect on its own.
Yes, as JSON. This is meant for support tickets: it contains the measurements and option names, no option values.
autoload_memory is now called autoload_decoded, because that is what it measures.%i placeholder of $wpdb->prepare() instead of being quoted by hand and interpolated into the query. This raises the requirement to WordPress 6.2, which is where %i arrived.tpdiag.wp turbopress-diagnostics) and the four public filters, which are now turbopress_diagnostics_*.update_core, update_plugins or update_themes are marked separately, because WordPress skips the expiry lookup for those three names and so never clears them by reading them.