get_all_settings(); $items = array(); $items[] = array( 'ok' => ! empty( $s['cache_enabled'] ) || ! empty( $s['page_cache'] ) || ! empty( $s['enable_page_cache'] ), 'label' => 'Page cache configured' ); $items[] = array( 'ok' => is_ssl(), 'label' => 'HTTPS (SSL)' ); $items[] = array( 'ok' => ! empty( $s['login_limit_enabled'] ), 'label' => 'Login attempt limit' ); $items[] = array( 'ok' => ! empty( $s['cookie_consent_enabled'] ) || ! is_ssl(), 'label' => 'Cookie consent (or non-HTTPS skip)' ); $items[] = array( 'ok' => ! empty( $s['lazyload_enabled'] ) || ! empty( $s['media_optimize_enabled'] ), 'label' => 'Media lazyload or optimize' ); $items[] = array( 'ok' => (bool) get_option( 'blog_public' ), 'label' => 'Visible to search engines' ); $ok = 0; foreach ( $items as $i ) { if ( ! empty( $i['ok'] ) ) { ++$ok; } } return array( 'score' => (int) round( 100 * $ok / max( 1, count( $items ) ) ), 'items' => $items ); } }