'; public function get_title(): string { $title = __( 'Health Monitor', 'onecom-wp' ); if ( $this->onecom_is_premium() ) { $title .= apply_filters( 'onecom_hm_subtitle_html', '' . $this->svg_icon . '' ); } // else { // $title .= apply_filters( 'onecom_hm_subtitle_html', '' . __( 'Lite', 'onecom-wp' ) . '' ); // } return $title; } /** * Get page description * @return string */ public function get_description(): string { if ( $this->onecom_is_premium() ) { return $this->hm_description_premium; } return $this->hm_description; } /** * Get info (i) icon * @return string */ public function get_info_icon(): string { return ONECOM_WP_URL . '/modules/health-monitor/assets/images/info.svg'; } public function get_ignored_ul(): string { if ( $this->onecom_is_premium() ) { return '
    ' . $this->get_generated_html_for_checks( 3 ) . '
'; } return '
one.com lock

' . $this->ignored_lite_text . ' ' . $this->get_started . '

'; } public function get_status_with_score( $score ): string { $status = 'poor'; if ( $score > 75 ) { $status = 'good'; } elseif ( $score >= 50 ) { $status = 'ok'; } return $status; } /** * @param $status * gets the html for checks based on the status of checks from the stored scan results * @return false|string */ public function get_generated_html_for_checks( $status ) { $scan_result = get_site_transient( 'ocsh_site_previous_scan' ); if ( is_array( $scan_result ) ) { $todo = array(); $ignored = array(); foreach ( $scan_result as $key => $check ) { if ( $this->is_ignored( $key ) ) { $ignored[] = $this->get_html( $key, $check ); continue; } if ( $status !== 3 && $check['status'] === $status ) { if ( $key === 'performance_cache' ) { $key = 'check_' . $key; } $todo[] = $this->get_html( $key, $check ); } } if ( $status === 3 && ! empty( $ignored ) ) { return implode( '', $ignored ); } else { return implode( '', $todo ); } } return false; } }