add_header( $index ); } elseif ( is_array( $index ) && 2 === count( $index ) ) { $detector->add_header( $index[0], (int) $index[1] ); } return true; } /** * Registers tools. * * @param Tools_Registry $registry */ public function register_tools( Tools_Registry $registry ) { $registry->register( new class( 'security-check-pro', ITSEC_Modules::get_config( 'security-check-pro' ) ) extends Config_Tool { public function run( array $form = [] ): Result { $response = ITSEC_Security_Check_Pro_Utility::get_server_response(); if ( is_wp_error( $response ) ) { return Result::error( $response ); } $result = Result::success(); if ( ! empty( $response['remote_ip'] ) ) { $result->add_success_message( __( 'Identified remote IP entry to protect against IP spoofing.', 'it-l10n-ithemes-security-pro' ) ); } if ( ! empty( $response['ssl_supported'] ) ) { $result->add_success_message( __( 'Your site supports SSL.', 'it-l10n-ithemes-security-pro' ) ); if ( ITSEC_Modules::is_active( 'ssl' ) ) { $result->add_info_message( __( 'Requests for http pages are redirected to https as recommended.', 'it-l10n-ithemes-security-pro' ) ); } else { $result->add_info_message( __( 'Redirecting all http page requests to https is highly recommended as it protects login details from being stolen when using public WiFi or insecure networks.', 'it-l10n-ithemes-security-pro' ) ); } } else { $result->add_warning_message( __( 'Your site does not support SSL.', 'it-l10n-ithemes-security-pro' ) ); } return $result; } } ); } }