Changeset 49237
- Timestamp:
- 10/20/2020 04:21:12 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-site-health.php
r49232 r49237 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 } … … 1465 1465 1466 1466 $result['status'] = 'critical'; 1467 1468 // On development environments, set the status to recommended. 1469 if ( $this->is_development_environment() ) { 1470 $result['status'] = 'recommended'; 1471 } 1467 1472 1468 1473 $result['description'] .= sprintf( … … 2532 2537 ); 2533 2538 2534 // Don't run https test on localhost.2535 if ( 'localhost' === preg_replace( '|https?://|', '', get_site_url()) ) {2539 // Don't run https test on development environments. 2540 if ( $this->is_development_environment() ) { 2536 2541 unset( $tests['direct']['https_status'] ); 2537 2542 } … … 2616 2621 set_transient( 'health-check-site-status-result', wp_json_encode( $site_status ) ); 2617 2622 } 2623 2624 /** 2625 * Checks if the current environment type is set to 'development' or 'local'. 2626 * 2627 * @since 5.6.0 2628 * 2629 * @return bool True if it is a development environment, false if not. 2630 */ 2631 public function is_development_environment() { 2632 return in_array( wp_get_environment_type(), array( 'development', 'local' ), true ); 2633 } 2634 2618 2635 }
Note: See TracChangeset
for help on using the changeset viewer.