__( 'Jetpack Boost checks', 'jetpack-boost' ), 'test' => array( __CLASS__, 'do_checks' ), ); return $checks; } /** * Do site-health page checks * * @access public * @return array */ public static function do_checks() { $health = new Boost_Health(); $total_issues = $health->get_total_issues(); $issues = $health->get_all_issues(); /** * Default, no issues found */ $result = array( 'label' => __( 'No issues found', 'jetpack-boost' ), 'status' => 'good', 'badge' => array( 'label' => __( 'Performance', 'jetpack-boost' ), 'color' => 'gray', ), 'description' => sprintf( '

%s

', __( 'Jetpack Boost did not find any known performance issues with your site.', 'jetpack-boost' ) ), 'actions' => '', 'test' => 'jetpack_boost_checks', ); /** * If issues found. */ if ( $total_issues ) { $result['status'] = 'critical'; /* translators: $d is the number of performance issues found. */ $result['label'] = sprintf( _n( 'Your site is affected by %d performance issue', 'Your site is affected by %d performance issues', $total_issues, 'jetpack-boost' ), $total_issues ); $result['description'] = __( 'Jetpack Boost detected the following performance issues with your site:', 'jetpack-boost' ); foreach ( $issues as $issue ) { $result['description'] .= '

'; $result['description'] .= "  "; $result['description'] .= wp_kses( $issue, array( 'a' => array( 'href' => array() ) ) ); // Only allow a href HTML tags. $result['description'] .= '

'; } $result['description'] .= '

'; $result['description'] .= sprintf( wp_kses( /* translators: Link to Jetpack Boost. */ __( 'Visit Boost settings page for more information.', 'jetpack-boost' ), array( 'a' => array( 'href' => array() ), ) ), esc_url( admin_url( 'admin.php?page=jetpack-boost' ) ) ); $result['description'] .= '

'; } return $result; } }