Skip to content

Commit

Permalink
remove site health tests that aren't relevant to pantheon envs
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Apr 19, 2024
1 parent be5a6d2 commit 582dc00
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions inc/site-health.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
<?php
/**
* Pantheon Site Health Modifications
*
* @package pantheon
*/

namespace Pantheon\Site_Health;

// If on Pantheon...
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {
add_filter( 'site_status_tests', __NAMESPACE__ . '\\site_health_mods' );
}

/**
* Modify the Site Health tests.
*
* @param array $tests The Site Health tests.
* @return array
*/
function site_health_mods( $tests ) {
// Remove checks that aren't relevant to Pantheon environments.
unset( $tests['direct']['update_temp_backup_writable'] );
unset( $tests['direct']['available_updates_disk_space'] );
unset( $tests['async']['background_updates'] );
return $tests;
}
1 change: 1 addition & 0 deletions pantheon.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {
require_once 'inc/functions.php';
require_once 'inc/pantheon-page-cache.php';
require_once 'inc/site-health.php';
if ( ! defined( 'DISABLE_PANTHEON_UPDATE_NOTICES' ) || ! DISABLE_PANTHEON_UPDATE_NOTICES ) {
require_once 'inc/pantheon-updates.php';
}
Expand Down

0 comments on commit 582dc00

Please sign in to comment.