Ticket #47058: 47058.2.diff
| File 47058.2.diff, 1.8 KB (added by , 5 years ago) |
|---|
-
src/wp-admin/includes/class-wp-site-health.php
106 106 if ( 'site-health' === $screen->id && ! isset( $_GET['tab'] ) ) { 107 107 $tests = WP_Site_Health::get_tests(); 108 108 109 // Don't run https test on localhost.110 if ( 'localhost' === preg_replace( '|https?://|', '', get_site_url()) ) {109 // Don't run https test on development environments. 110 if ( $this->is_development_environment() ) { 111 111 unset( $tests['direct']['https_status'] ); 112 112 } 113 113 … … 1464 1464 1465 1465 $result['status'] = 'critical'; 1466 1466 1467 // On development environments, set the status to recommended 1468 if ( $this->is_development_environment() ) { 1469 $result['status'] = 'recommended'; 1470 } 1471 1467 1472 $result['description'] .= sprintf( 1468 1473 '<p>%s</p>', 1469 1474 sprintf( … … 2519 2524 'critical' => 0, 2520 2525 ); 2521 2526 2522 // Don't run https test on localhost.2523 if ( 'localhost' === preg_replace( '|https?://|', '', get_site_url()) ) {2527 // Don't run https test on development environments. 2528 if ( $this->is_development_environment() ) { 2524 2529 unset( $tests['direct']['https_status'] ); 2525 2530 } 2526 2531 … … 2595 2600 2596 2601 set_transient( 'health-check-site-status-result', wp_json_encode( $site_status ) ); 2597 2602 } 2603 2604 /** 2605 * Check if we are in a development environment. 2606 * 2607 * Checks if the wp_get_environment_type function returns 2608 * development or local. 2609 * 2610 * @since 5.6.0 2611 * 2612 * @return bool True if it is a development environment, false if not. 2613 */ 2614 public function is_development_environment() { 2615 return in_array( wp_get_environment_type(), array( 'development', 'local' ), true ); 2616 } 2617 2598 2618 }