Audit Autoloaded Options Site Health should extend Core's check if available
joemcgill opened this issue · comments
Bug Description
A simplified version of the Audit Autoloaded Options Site Health from this plugin has been merged into WP trunk (see issue). The Site Health Check in this plugin still works when the plugin is installed on a site running WP nightlies, but instead of extending the check, it replaces it entirely, which means that core filters for things like the site_status_autoloaded_options_size_limit
no longer work, and instead need to use the plugin specific perflab_aao_autoloaded_options_limit_size_in_bytes
version.
Steps to reproduce
- Upgrade core local development environment using
https://wordpress.org/wordpress-6.6-beta1.zip
or a nightly version. - Install and activate the Performance Lab plugin
- Try to filter the autoloaded options size limit, like
add_filter( 'site_status_autoloaded_options_size_limit', '__return_zero' );
- Observe that no issues are visible from the Site Health screen
- Deactivate the plugin with the same filter still registered
- Observe that a critical issue is now visible
Suggested approach
The Site Health check in this plugin should still support all supported versions of WordPress (currently 6.4+) so we'll need to do a check to see if there is already a autoloaded_options
check returned from WP_Site_Health::get_tests()
before adding our own. If it already exists, then our enhancements to the test like the description added via perflab_aao_get_autoloaded_options_table()
should hook into various filters like the site_status_autoloaded_options_limit_description
filter.
Optionally, we could already shim in support for anyone using the filters in the 6.6 checks so that they wouldn't have to update their code when upgrading from 6.5 to 6.6 with the Performance Lab plugin running.