bedrock
bedrock copied to clipboard
add MU plugin that disables two site health status tests 'conflicting' with bedrock
The PR removes the two Site Health Status notifications highlighted in red in the screenshot.
- Auto updates test, mentioned by @retlehs in #522 since Bedrock discourages auto-update by design, we disable the
background_updates
check. - Theme update check , mentioned by @yangm97 in #522 By disabling
theme_version
we disable the test that checks if there is a default theme available, the default 'default theme' is twentytwenty. Since most bedrock installs will probably come without this default theme, this triggers the advice. As a side effect the actual theme update checks aren't done as well. So I am not sure if disabling this test is the way to go.
The code run by the theme_version
check can be found here
This is my first PR attempt for a Roots project. So let me know if I missed something or something can be improved.
As another option, could we instead change the label and categorization of them? This is still probably a good solution, just wondering if it's better to leave them (so people know about their existence) but call out why they are "disabled".
I think this would've been nice, but unfortunately the site_status_tests
hook only lets you add test or remove existing tests, see https://developer.wordpress.org/reference/hooks/site_status_tests/ for the documentation and some examples for this hook.
The only 'workaround' would be to remove these mentioned tests and add new ones specific for a Bedrock installation. Now that I am brainstorming about this idea: For example a test that checks the WP_ENV constant and warns if the site is not on a subdomain and still has the WP_ENV on staging.
There are possibilities but out of the scope of this PR. But might be a nice thing to consider for increasing the UX/DX.
If you want to make a Composer package out of this I'd be happy to add it to our docs, but this isn't something we will be adding in Bedrock at this time