I use git to deploy my production site, and as a result, the sites Health tool is reporting a critical issue due to the auto-updates not working when a site is under version control.

enter image description here

To be honest, it wouldn’t be an issue to allow auto-updates, and just periodically commit the production changes. Is there a way of just forcing them and solving/suppressing this ‘critical issue’?

1 Answer
1

There’s the site_status_tests filter, to e.g. remove the asynchronous background updates tests:

add_filter( 'site_status_tests', function ( $tests ) {
    unset( $tests['async']['background_updates'] );
    return $tests;
} );

But one could argue that this is just hiding information from the user.

Ticket #46733 suggests instead e.g. “…ignored tests section, hidden away like the Passed tests“, so the user can still find this information.

But it’s currently closed as maybelater.

One can also create custom tests, through the site_status_tests filter, as explained in the dev notes. Perhabs a custom test wrapper around WP_Site_Health->get_test_background_updates() to modify as needed, but that sounds unstable. Maybe one could look into a wrapper that uses WP_Site_Health_Auto_Updates->run_tests() instead? Though probably best to join the discussion about this on Trac or GitHub to change this.

Update: WordPress 5.3 will change the message from failure to warning (see #47982)

Leave a Reply

Your email address will not be published. Required fields are marked *