| Server IP : 68.183.124.220 / Your IP : 216.73.217.19 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/really-simple-ssl/ |
Upload File : |
<?php
defined('ABSPATH') or die("you do not have access to this page!");
if (!class_exists("rsssl_site_health")) {
class rsssl_site_health {
private static $_this;
function __construct() {
if ( isset( self::$_this ) ) {
wp_die( sprintf( __( '%s is a singleton class and you cannot create a second instance.', 'really-simple-ssl' ), get_class( $this ) ) );
}
add_filter( 'site_status_tests', array($this, 'rsssl_hsts_check' ) );
self::$_this = $this;
}
static function this() {
return self::$_this;
}
public function rsssl_hsts_check( $tests ) {
$tests['direct']['really-simple-ssl'] = array(
'label' => __( 'Really Simple SSL HSTS test' ),
'test' => array($this, "rsssl_hsts_test"),
);
return $tests;
}
public function rsssl_hsts_test() {
$result = array(
'label' => __( '301 SSL redirect enabled', 'really-simple-ssl' ),
'status' => 'good',
'badge' => array(
'label' => __( 'SSL' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'You have set a 301 redirect to SSL. This is important for SEO purposes', 'really-simple-ssl' )
),
'actions' => '',
'test' => 'really-simple-ssl',
);
if (RSSSL()->really_simple_ssl->has_301_redirect() && RSSSL()->really_simple_ssl->wp_redirect && RSSSL()->rsssl_server->uses_htaccess() && !RSSSL()->really_simple_ssl->htaccess_redirect) {
$result['status'] = 'recommended';
$result['label'] = __( '301 .htaccess redirect is not enabled.' , 'really-simple-ssl' );
$result['description'] = sprintf(
'<p>%s</p>',
__( 'The 301 .htaccess redirect is often the fastest and most reliable redirect option.' )
);
$result['actions'] .= sprintf(
'<p><a href="%s">%s</a></p>',
esc_url( admin_url("options-general.php?page=rlrsssl_really_simple_ssl&tab=settings") ),
__( 'Enable 301 .htaccess redirect', 'really-simple-ssl' )
);
}
return $result;
}
}
}