ABSpath = $this->getABSPATH();
$this->get_options();
$this->get_admin_options();
$this->get_plugin_upgraded(); //call always, otherwise db version will not match anymore.
if (is_multisite()) {
$this->pro_url = 'https://really-simple-ssl.com/pro-multisite';
} else {
$this->pro_url = 'https://really-simple-ssl.com/pro';
}
register_deactivation_hook(dirname(__FILE__) . "/" . $this->plugin_filename, array($this, 'deactivate'));
add_action( 'admin_init', array($this, 'add_privacy_info') );
add_action( 'admin_init', array($this, 'maybe_dismiss_review_notice') );
add_action( 'admin_init', array($this, 'insert_secure_cookie_settings'), 70 );
add_action( 'admin_init', array($this, 'recheck_certificate') );
add_action( "update_option_rlrsssl_options", array( $this, "maybe_clear_transients" ), 10, 3 );
add_action( 'wp_ajax_update_ssl_detection_overridden_option', array( $this, 'update_ssl_detection_overridden_option' ) );
// Only show deactivate popup when SSL has been enabled.
if ($this->ssl_enabled) {
add_action('admin_footer', array($this, 'deactivate_popup'), 40);
}
}
static function this()
{
return self::$_this;
}
/**
* @param $oldvalue
* @param $newvalue
* @param $option
*/
public function maybe_clear_transients($oldvalue, $newvalue, $option){
if ($oldvalue !== $newvalue ) {
$this->clear_transients();
}
}
/**
* Clear some transients
*/
public function clear_transients(){
delete_transient('rsssl_mixed_content_fixer_detected');
delete_transient('rsssl_plusone_count');
delete_transient('rsssl_remaining_task_count');
delete_transient( 'rsssl_can_use_curl_headers_check' );
delete_transient( 'rsssl_admin_notices' );
}
/**
* Add some privacy info, telling our users we aren't tracking them
*/
public function add_privacy_info()
{
if (!function_exists('wp_add_privacy_policy_content')) {
return;
}
$content = sprintf(
__('Really Simple SSL and Really Simple SSL add-ons do not process any personal identifiable information, so the GDPR does not apply to these plugins or usage of these plugins on your website. You can find our privacy policy here.', 'really-simple-ssl'),
'https://really-simple-ssl.com/privacy-statement/'
);
wp_add_privacy_policy_content(
'Really Simple SSL',
wp_kses_post(wpautop($content, false))
);
}
/**
* Check if current day falls within required date range.
*
* @return bool
*/
public function is_bf(){
if ( defined("rsssl_pro_version" ) ) {
return false;
}
$start_day = 22;
$end_day = 29;
$current_year = date("Y");//e.g. 2021
$current_month = date("n");//e.g. 3
$current_day = date("j");//e.g. 4
if ( $current_year == 2021 && $current_month == 11 &&
$current_day >=$start_day &&
$current_day <= $end_day
) {
return true;
} else {
return false;
}
}
/**
* Dismiss review notice of dismissed by the user
*/
public function maybe_dismiss_review_notice() {
if (isset($_GET['rsssl_dismiss_review_notice'])){
$this->review_notice_shown = true;
$this->save_options();
}
}
/**
* Update SSL detection overridden option
*/
public function update_ssl_detection_overridden_option() {
if ( ! rsssl_user_can_manage() ) return;
if ( isset( $_POST['action'] ) && $_POST['action'] === 'update_ssl_detection_overridden_option' ) {
if ( isset ( $_POST['override_ssl_checked'] ) && $_POST['override_ssl_checked'] !== false ) {
update_option('rsssl_ssl_detection_overridden', true);
}
wp_die();
}
}
/**
* Initializes the admin class
*
* @since 2.2
*
* @access public
*
*/
public function init()
{
if ( ! current_user_can('manage_options') && ! current_user_can('manage_security') ) return;
$is_on_settings_page = $this->is_settings_page();
if (defined("RSSSL_FORCE_ACTIVATE") && RSSSL_FORCE_ACTIVATE) {
$options = get_option('rlrsssl_options');
$options['ssl_enabled'] = true;
update_option('rlrsssl_options', $options);
}
/*
* check if we're one minute past the activation. Then flush rewrite rules
* this way we lower the memory impact on activation
* Flush should happen on shutdown, not on init, as often happens in other plugins
* https://codex.wordpress.org/Function_Reference/flush_rewrite_rules
* */
$activation_time = get_option('rsssl_flush_rewrite_rules');
$more_than_one_minute_ago = $activation_time < strtotime("-1 minute");
$less_than_2_minutes_ago = $activation_time > strtotime("-2 minute");
if (get_option('rsssl_flush_rewrite_rules') && $more_than_one_minute_ago && $less_than_2_minutes_ago){
delete_option('rsssl_flush_rewrite_rules');
add_action('shutdown', 'flush_rewrite_rules');
}
$more_than_2_minute_ago = get_option('rsssl_flush_caches') < strtotime("-2 minute");
$less_than_5_minutes_ago = get_option('rsssl_flush_caches') > strtotime("-5 minute");
if (get_option('rsssl_flush_caches') && $more_than_2_minute_ago && $less_than_5_minutes_ago){
delete_option('rsssl_flush_caches');
add_action('shutdown', array( RSSSL()->rsssl_cache, 'flush' ) );
}
// Set default progress toggle to remaining tasks if it hasn't been set
if (!get_option('rsssl_all_tasks') && !get_option('rsssl_remaining_tasks') ) {
update_option('rsssl_remaining_tasks', true);
}
/*
Detect configuration when:
- SSL activation just confirmed.
- on settings page
- No SSL detected
*/
//when configuration should run again
if ($this->clicked_activate_ssl() || !$this->ssl_enabled || !$this->site_has_ssl || $is_on_settings_page || is_network_admin() || defined('RSSSL_DOING_SYSTEM_STATUS') ) {
$this->detect_configuration();
if (is_multisite()) $this->build_domain_list();//has to come after clicked_activate_ssl, otherwise this domain won't get counted.
//flush caches when just activated ssl
//flush the permalinks
if ($this->clicked_activate_ssl()) {
if (!defined('RSSSL_NO_FLUSH') || !RSSSL_NO_FLUSH) {
update_option('rsssl_flush_rewrite_rules', time());
}
update_option('rsssl_flush_caches', time());
}
if (!$this->wpconfig_ok()) {
//if we were to activate ssl, this could result in a redirect loop. So warn first.
add_action("admin_notices", array($this, 'show_notice_wpconfig_needs_fixes'));
if (is_multisite()) add_action('network_admin_notices', array($this, 'show_notice_wpconfig_needs_fixes'), 10);
$this->ssl_enabled = false;
$this->save_options();
} elseif ($this->ssl_enabled) {
add_action('admin_init', array($this, 'configure_ssl'), 20);
}
}
add_action( 'admin_init', array( $this, 'check_upgrade' ), 10, 2 );
//when SSL is enabled, and not enabled by user, ask for activation.
add_action("admin_notices", array($this, 'show_notice_activate_ssl'), 10 );
add_action('rsssl_activation_notice', array($this, 'ssl_detected'), 10);
add_action('rsssl_activation_notice_inner', array($this, 'almost_ready_to_migrate'), 30);
add_action('rsssl_activation_notice_footer', array($this, 'show_enable_ssl_button'), 50);
//add the settings page for the plugin
add_action('admin_enqueue_scripts', array($this, 'enqueue_assets'));
//settings page, form and settings link in the plugins page
add_filter( "option_page_capability_rlrsssl_options", array( $this, 'capability_check_wrapper') );
add_filter( "option_page_capability_rsssl_network_options", array( $this, 'capability_check_wrapper') );
add_action('admin_menu', array($this, 'add_settings_page'), 40);
add_action('admin_init', array($this, 'create_form'), 40);
add_action('admin_init', array($this, 'listen_for_deactivation'), 40);
add_action( 'update_option_rlrsssl_options', array( $this, 'maybe_remove_highlight_from_url' ), 50 );
$plugin = rsssl_plugin;
add_filter("plugin_action_links_$plugin", array($this, 'plugin_settings_link'));
add_action( 'rocket_activation', array($this, 'removeHtaccessEdit' ) );
add_filter( 'before_rocket_htaccess_rules', array($this, 'add_htaccess_redirect_before_wp_rocket' ) );
//Add update notification to Settings admin menu
add_action('admin_menu', array($this, 'rsssl_edit_admin_menu') );
//callbacks for the ajax dismiss buttons
add_action('wp_ajax_dismiss_success_message', array($this, 'dismiss_success_message_callback'));
add_action('wp_ajax_rsssl_dismiss_review_notice', array($this, 'dismiss_review_notice_callback'));
add_action('wp_ajax_rsssl_dismiss_settings_notice', array($this, 'dismiss_settings_notice_callback'));
add_action('wp_ajax_rsssl_update_task_toggle_option', array($this, 'update_task_toggle_option'));
add_action('wp_ajax_rsssl_redirect_to_le_wizard', array($this, 'rsssl_redirect_to_le_wizard'));
//handle notices
add_action('admin_notices', array($this, 'show_notices'));
//show review notice, only to free users
if (!defined("rsssl_pro_version") && (!defined("rsssl_pp_version")) && (!defined("rsssl_soc_version")) && (!class_exists('RSSSL_PRO')) && (!is_multisite())) {
add_action('admin_notices', array($this, 'show_leave_review_notice'));
}
}
/**
* Return capability for use in option_page_capability_ filter
* @return string
*/
public function capability_check_wrapper() {
return $this->capability;
}
public function check_upgrade() {
$prev_version = get_option( 'rsssl_current_version', false );
if ( $prev_version && version_compare( $prev_version, '4.0', '<' ) ) {
update_option('rsssl_remaining_tasks', true);
}
if ( $prev_version && version_compare( $prev_version, '4.0.10', '<=' ) ) {
if (function_exists('is_wpe') && is_wpe()) {
$this->wp_redirect = true;
$this->htaccess_redirect = false;
$this->save_options();
}
}
if ( $prev_version && version_compare( $prev_version, '5.1.3', '<=' ) ) {
if ( get_option( 'rsssl_disable_ocsp' ) ) {
$options = get_option( 'rsssl_options_lets-encrypt' );
$options['disable_ocsp'] = true;
update_option( 'rsssl_options_lets-encrypt', $options );
delete_option('rsssl_disable_ocsp');
}
}
if ( $prev_version && version_compare( $prev_version, '5.3.0', '<=' ) ) {
if ( file_exists($this->htaccess_file() ) && is_writable($this->htaccess_file() ) ) {
$htaccess = file_get_contents( $this->htaccess_file() );
$pattern_start = "/rlrssslReallySimpleSSL rsssl_version\[.*.]/";
$pattern_end = "/rlrssslReallySimpleSSL/";
if ( preg_match_all( $pattern_start, $htaccess ) ) {
$htaccess = preg_replace( $pattern_start, "Really Simple SSL Redirect " . rsssl_version, $htaccess );
$htaccess = preg_replace( $pattern_end, "Really Simple SSL Redirect", $htaccess );
file_put_contents( $this->htaccess_file(), $htaccess );
}
}
}
// Add manage_security capability
if ( $prev_version && version_compare( $prev_version, '5.3.3', '<' ) ) {
rsssl_add_manage_security_capability();
}
update_option( 'rsssl_current_version', rsssl_version );
}
/**
* Deactivate the plugin while keeping SSL
* Activated when the 'uninstall_keep_ssl' button is clicked in the settings tab
*
*/
public function listen_for_deactivation()
{
//check user role
if (! rsssl_user_can_manage() ) return;
//check nonce
if (!isset($_GET['token']) || (!wp_verify_nonce($_GET['token'], 'rsssl_deactivate_plugin'))) return;
//check for action
if (isset($_GET["action"]) && $_GET["action"] == 'uninstall_keep_ssl') {
//deactivate plugin, but don't revert to http.
$plugin = $this->plugin_dir . "/" . $this->plugin_filename;
$plugin = plugin_basename(trim($plugin));
if (is_multisite()) {
$network_current = get_site_option('active_sitewide_plugins', array());
if (is_plugin_active_for_network($plugin)) {
unset($network_current[$plugin]);
}
update_site_option('active_sitewide_plugins', $network_current);
//remove plugin one by one on each site
$sites = get_sites();
foreach ($sites as $site) {
RSSSL()->rsssl_multisite->switch_to_blog_bw_compatible($site);
$current = get_option('active_plugins', array());
$current = $this->remove_plugin_from_array($plugin, $current);
update_option('active_plugins', $current);
restore_current_blog(); //switches back to previous blog, not current, so we have to do it each loop
}
} else {
$current = get_option('active_plugins', array());
$current = $this->remove_plugin_from_array($plugin, $current);
update_option('active_plugins', $current);
}
wp_redirect(admin_url('plugins.php'));
exit;
}
}
/**
* Remove the plugin from the active plugins array when called from listen_for_deactivation
*
* */
public function remove_plugin_from_array($plugin, $current)
{
$key = array_search($plugin, $current);
if (false !== $key) {
unset($current[$key]);
}
return $current;
}
/**
* @Since 3.1
*
* Check if site uses an htaccess.conf file, used in bitnami installations
*
*/
public function uses_htaccess_conf() {
$htaccess_conf_file = dirname(ABSPATH) . "/conf/htaccess.conf";
//conf/htaccess.conf can be outside of open basedir, return false if so
$open_basedir = ini_get("open_basedir");
if (!empty($open_basedir)) return false;
if (is_file($htaccess_conf_file) ) {
return true;
} else {
return false;
}
}
public function get_sites_bw_compatible()
{
global $wp_version;
$sites = ($wp_version >= 4.6) ? get_sites() : wp_get_sites();
return $sites;
}
/**
* The new get_sites function returns an object.
* @param $site
*/
public function switch_to_blog_bw_compatible($site)
{
global $wp_version;
if ($wp_version >= 4.6) {
switch_to_blog($site->blog_id);
} else {
switch_to_blog($site['blog_id']);
}
}
/**
* checks if the user just clicked the "activate SSL" button.
*/
private function clicked_activate_ssl()
{
if ( ! rsssl_user_can_manage() ) return;
if (isset($_POST['rsssl_do_activate_ssl'])) {
$this->activate_ssl();
update_option('rsssl_activation_timestamp', time());
return true;
}
return false;
}
/**
* If the user has clicked "recheck certificate, clear the cache for the certificate check.
* @return void
*/
public function recheck_certificate(){
if (!rsssl_user_can_manage()) return;
if (isset($_POST['rsssl_recheck_certificate']) || isset($_GET['rsssl_recheck_certificate'])) {
delete_transient('rsssl_certinfo');
}
}
/**
* Activate the SSL for this site
*/
public function activate_ssl()
{
$this->ssl_enabled = true;
$this->wp_redirect = true;
$this->set_siteurl_to_ssl();
$this->save_options();
}
/**
* Deactivate SSL for this site
*/
public function deactivate_ssl()
{
//only revert if SSL was enabled first.
if ($this->ssl_enabled) {
$this->ssl_enabled = false;
$this->wp_redirect = false;
$this->htaccess_redirect = false;
$this->remove_ssl_from_siteurl();
$this->save_options();
}
}
/**
* redirect to settings page
*/
public function redirect_to_settings_page($tab='configuration') {
if (isset($_GET['page']) && $_GET['page'] == 'rlrsssl_really_simple_ssl') return;
$url = add_query_arg( array(
"page" => "rlrsssl_really_simple_ssl",
"tab" => $tab,
), admin_url( "options-general.php" ) );
wp_redirect( $url );
exit;
}
/**
* Check if the wp config configuration is ok for SSL activation
*
* @return bool
*/
public function wpconfig_ok()
{
if (($this->do_wpconfig_loadbalancer_fix || $this->no_server_variable || $this->wpconfig_siteurl_not_fixed) && !$this->wpconfig_is_writable()) {
$result = false;
} else {
$result = true;
}
return apply_filters('rsssl_wpconfig_ok_check', $result);
}
/**
This message is shown when SSL is not enabled by the user yet
*/
public function show_notice_activate_ssl()
{
//prevent showing the review on edit screen, as gutenberg removes the class which makes it editable.
$screen = get_current_screen();
if ( $screen->base === 'post' ) return;
if ($this->ssl_enabled) return;
if (defined("RSSSL_DISMISS_ACTIVATE_SSL_NOTICE") && RSSSL_DISMISS_ACTIVATE_SSL_NOTICE) return;
//for multisite, show only activate when a choice has been made to activate networkwide or per site.
if (is_multisite() && !RSSSL()->rsssl_multisite->selected_networkwide_or_per_site) return;
//on multisite, only show this message on the network admin. Per site activated sites have to go to the settings page.
//otherwise sites that do not need SSL possibly get to see this message.
if (is_multisite() && !is_network_admin()) return;
//don't show in our Let's Encrypt wizard
if (isset($_GET['tab']) && $_GET['tab']==='letsencrypt') return;
if (!$this->wpconfig_ok()) return;
if (!rsssl_user_can_manage()) return;
do_action('rsssl_activation_notice');
}
/**
* Show a notice that the website is ready to migrate to SSL.
*/
public function ssl_detected()
{
ob_start();
do_action('rsssl_activation_notice_inner');
$content = ob_get_clean();
ob_start();
do_action('rsssl_activation_notice_footer');
$footer = ob_get_clean();
$class = apply_filters("rsssl_activation_notice_classes", "updated activate-ssl rsssl-pro-dismiss-notice");
$title = __("Almost ready to migrate to SSL!", "really-simple-ssl");
echo $this->notice_html( $class, $title, $content, $footer);
}
/**
* Show almost ready to migrate notice
*/
public function almost_ready_to_migrate()
{
_e("Before you migrate, please check for: ", 'really-simple-ssl'); ?>
base === 'post' ) return;
//don't show admin notices on our own settings page: we have the warnings there
if ( $this->is_settings_page() ) return;
$notices = $this->get_notices_list( array('admin_notices'=>true) );
foreach ( $notices as $id => $notice ){
$notice = $notice['output'];
$class = ( $notice['status'] !== 'completed' ) ? 'error' : 'updated';
echo $this->notice_html( $class.' '.$id, $notice['title'], $notice['msg'] );
}
}
/**
* Insert some ajax script to dismiss the review notice, and stop nagging about it
*
* @since 3.0
*
* @access public
*
* type: dismiss, later
*
*/
public function insert_dismiss_review()
{
$ajax_nonce = wp_create_nonce("really-simple-ssl");
?>
ssl_success_message_shown = TRUE;
$this->save_options();
wp_die();
}
/**
* Process the ajax dismissal of settings notice
*
* Since 3.1
*
* @access public
*
*/
public function dismiss_settings_notice_callback()
{
if (!rsssl_user_can_manage() ) return;
if (!isset($_POST['token']) || (!wp_verify_nonce($_POST['token'], 'rsssl_nonce'))) {
return;
}
if (isset($_POST['type'])) {
$dismiss_type = sanitize_title( $_POST['type'] );
update_option( "rsssl_".$dismiss_type."_dismissed", true );
delete_transient( 'rsssl_plusone_count' );
}
// count should be updated, therefore clear cache
$this->clear_transients();
$data = array(
'tasks' => $this->get_remaining_tasks_count(),
'percentage' => $this->get_score_percentage(),
);
$response = json_encode( $data );
header( "Content-Type: application/json" );
echo $response;
exit;
}
/**
* Process the ajax dismissal of the htaccess message.
*
* @since 2.1
*
* @access public
*
*/
public function dismiss_review_notice_callback()
{
$type = isset($_POST['type']) ? $_POST['type'] : false;
if ($type === 'dismiss'){
$this->review_notice_shown = TRUE;
}
if ($type === 'later') {
//Reset activation timestamp, notice will show again in one month.
update_option('rsssl_activation_timestamp', time());
}
$this->save_options();
wp_die(); // this is required to terminate immediately and return a proper response
}
/**
* Adds the admin options page
*
* @since 2.0
*
* @access public
*
*/
public function add_settings_page()
{
if ( ! rsssl_user_can_manage() ) return;
//hides the settings page if the hide menu for subsites setting is enabled
if (is_multisite() && rsssl_multisite::this()->hide_menu_for_subsites && !is_super_admin()) return;
global $rsssl_admin_page;
$count = $this->count_plusones();
if ($count > 0 ) {
$update_count = "$count";
} else {
$update_count = "";
}
$rsssl_admin_page = add_options_page(
__("SSL settings", "really-simple-ssl"), //link title
__("SSL", "really-simple-ssl") . $update_count, //page title
$this->capability, //capability
'rlrsssl_really_simple_ssl', //url
array($this, 'settings_page')); //function
}
/**
*
* @since 3.1.6
*
* Add an update count to the WordPress admin Settings menu item
* Doesn't work when the Admin Menu Editor plugin is active
*
*/
public function rsssl_edit_admin_menu()
{
if (!rsssl_user_can_manage()) return;
global $menu;
$count = $this->count_plusones();
$menu_slug = 'options-general.php';
$menu_title = __('Settings');
foreach($menu as $index => $menu_item){
if (!isset($menu_item[2]) || !isset($menu_item[0])) continue;
if ($menu_item[2]===$menu_slug){
$pattern = '/([1-9])<\/span><\/span>/i';
if (preg_match($pattern, $menu_item[0], $matches)){
if (isset($matches[1])) $count = intval($count) + intval($matches[1]);
}
$update_count = $count > 0 ? "$count":'';
$menu[$index][0] = $menu_title . $update_count;
}
}
}
/**
* Create tabs on the settings page
*
* @since 2.1
*
* @access public
*
*/
public function admin_tabs($current = 'configuration')
{
$tabs = array(
'configuration' => '',
);
$tabs = apply_filters("rsssl_grid_tabs", $tabs);
//allow the license tab to show up for older version, to allow for upgrading
$legacy_tabs = apply_filters("rsssl_tabs", array());
if (isset($legacy_tabs['license'])) $tabs['license']= $legacy_tabs['license'];
// Only show general tab if there are other tabs as well
if (count($tabs) > 1) {
$tabs['configuration'] = __("General", "really-simple-ssl");
}
$high_contrast = $this->high_contrast ? 'rsssl-high-contrast' : ''; ?>
false,
'premium_only' => false,
'dismiss_on_upgrade' => false,
'status' => 'open', //status can be "all" (all tasks, regardless of dismissed or open), "open" (not success/completed) or "completed"
);
$args = wp_parse_args($args, $defaults);
$cache_admin_notices = !$this->is_settings_page() && $args['admin_notices'];
//if we're on the settings page, we need to clear the admin notices transient, because this list never gets requested on the settings page, and won'd get cleared otherwise
if ($this->clicked_activate_ssl() || $this->is_settings_page() || isset($_GET['ssl_reload_https']) ) {
delete_transient('rsssl_admin_notices');
}
if ( $cache_admin_notices) {
$cached_notices = get_transient('rsssl_admin_notices');
if ( $cached_notices ) return $cached_notices;
}
$htaccess_file = $this->uses_htaccess_conf() ? "htaccess.conf (/conf/htaccess.conf/)" : $htaccess_file = ".htaccess";
if ( $this->ssl_type != "NA" ) {
$rules = $this->get_redirect_rules( true );
$arr_search = array( "<", ">", "\n" );
$arr_replace = array( "<", ">", " " );
$rules = str_replace( $arr_search, $arr_replace, $rules );
$rules = substr($rules, 4, -4);
} else {
$rules = __( "No recommended redirect rules detected.", "really-simple-ssl" ) ;
}
$rules = ' ' . $rules . ' ';
$notice_defaults = array(
'condition' => array(),
'callback' => false,
);
$curl_error = get_transient('rsssl_curl_error');
$current_plugin_folder = $this->get_current_rsssl_free_dirname();
//get expiry date, if we have one.
$certinfo = get_transient('rsssl_certinfo');
$end_date = isset($certinfo['validTo_time_t']) ? $certinfo['validTo_time_t'] : false;
$expiry_date = !empty($end_date) ? date( get_option('date_format'), $end_date ) : __("(Unknown)", "really-simple-ssl");
$test_url = 'https://www.ssllabs.com/ssltest/analyze.html?d='.home_url();
$notices = array(
'deactivation_file_detected' => array(
'callback' => 'RSSSL()->really_simple_ssl->check_for_uninstall_file',
'score' => 30,
'output' => array(
'fail' => array(
'title' => __("Major security issue!", "really-simple-ssl"),
'msg' => __("The 'force-deactivate.php' file has to be renamed to .txt. Otherwise your ssl can be deactivated by anyone on the internet.", "really-simple-ssl") .' '.
''.__("Check again", "really-simple-ssl").'',
'icon' => 'warning',
'admin_notice' => true,
'plusone' => true,
),
),
),
'non_default_plugin_folder' => array(
'callback' => 'RSSSL()->really_simple_ssl->uses_default_folder_name',
'score' => 30,
'output' => array(
'false' => array(
'msg' => sprintf(__("The Really Simple SSL plugin folder in the /wp-content/plugins/ directory has been renamed to %s. This might cause issues when deactivating, or with premium add-ons. To fix this you can rename the Really Simple SSL folder back to the default %s.", "really-simple-ssl"),"" . $current_plugin_folder . "" , "really-simple-ssl"),
'url' => 'https://really-simple-ssl.com/knowledge-base/why-you-should-use-the-default-plugin-folder-name-for-really-simple-ssl/',
'icon' => 'warning',
'admin_notice' => false,
),
),
),
'mixed_content_scan' => array(
'dismiss_on_upgrade' => true,
'condition' => array('rsssl_ssl_enabled'),
'callback' => '_true_',
'score' => 5,
'output' => array(
'true' => array(
'url' => 'https://really-simple-ssl.com/knowledge-base/how-to-track-down-mixed-content-or-insecure-content/',
'msg' => __("SSL is now activated. Check if your website is secure by following this article.", "really-simple-ssl"),
'icon' => 'open',
'dismissible' => true,
'plusone' => true,
),
),
),
'compatiblity_check' => array(
'condition' => array('rsssl_incompatible_premium_version'),
'callback' => '_true_',
'score' => 5,
'output' => array(
'true' => array(
'url' => 'https://really-simple-ssl.com/pro/',
'msg' => __( "Really Simple SSL pro is not up to date. Update Really Simple SSL pro to ensure compatibility.", "really-simple-ssl"),
'icon' => 'open',
'dismissible' => false,
'plusone' => true,
),
),
),
'google_analytics' => array(
'dismiss_on_upgrade' => true,
'callback' => '_true_',
'condition' => array('rsssl_ssl_enabled', 'rsssl_ssl_activation_time_no_longer_then_3_days_ago'),
'score' => 5,
'output' => array(
'true' => array(
'msg' => __("Remember to change your URLs in external services like Google Analytics, Search Console and others. This should prevent any data loss resulting from the switch to https.", "really-simple-ssl"),
'url' => 'https://really-simple-ssl.com/knowledge-base/how-to-setup-google-analytics-and-google-search-consolewebmaster-tools/',
'icon' => 'open',
'dismissible' => true,
'plusone' => true,
),
),
),
'upgraded_to_four' => array(
'callback' => 'RSSSL()->really_simple_ssl->upgraded_to_four',
'score' => 5,
'output' => array(
'true' => array(
'url' => __('https://really-simple-ssl.com/really-simple-ssl-4-a-new-dashboard'),
'msg' => __("Really Simple SSL 4.0. Learn more about our newest major release.", "really-simple-ssl"),
'icon' => 'open',
'dismissible' => true,
'plusone' => true,
),
),
),
'ssl_enabled' => array(
'callback' => 'rsssl_ssl_enabled',
'score' => 30,
'output' => array(
'true' => array(
'msg' =>__('SSL is enabled on your site.', 'really-simple-ssl'),
'icon' => 'success'
),
'false' => array(
'msg' => __('SSL is not enabled yet.', 'really-simple-ssl'),
'icon' => 'warning',
'plusone' => true,
),
),
),
'ssl_detected' => array(
'condition' => array('NOT rsssl_ssl_detection_overridden'),
'callback' => 'rsssl_ssl_detected',
'score' => 30,
'output' => array(
'fail' => array(
'url' => 'https://really-simple-ssl.com/wp-config-fix-needed',
'msg' => __("The wp-config.php file is not writable, and needs to be edited. Please set this file to writable.", "really-simple-ssl"),
'icon' => 'warning'
),
'no-ssl-detected' => array(
'title' => __("No SSL detected", "really-simple-ssl"),
'msg' => __("No SSL detected. Use the retry button to check again.", "really-simple-ssl").
'
',
'icon' => 'warning',
'admin_notice' => false,
'dismissible' => $this->ssl_enabled
),
'no-response' => array(
'title' => __("Could not test certificate", "really-simple-ssl"),
'msg' => __("Automatic certificate detection is not possible on your server.", "really-simple-ssl").
'
',
'icon' => 'warning',
'admin_notice' => false,
'dismissible' => true,
),
'ssl-detected' => array(
'msg' => __('An SSL certificate was detected on your site.', 'really-simple-ssl'),
'icon' => 'success'
),
'about-to-expire' => array(
'title' => __("Your SSL certificate will expire soon.", "really-simple-ssl"),
'msg' => sprintf(__("SSL certificate will expire on %s.","really-simple-ssl"), $expiry_date).' '.__("If your hosting provider auto-renews your certificate, no action is required. Alternatively, you have the option to generate an SSL certificate with Really Simple SSL.","really-simple-ssl").' '.
sprintf(__("Depending on your hosting provider, %smanual installation%s may be required.", "really-simple-ssl"),'','').
'
',
'icon' => 'warning',
'admin_notice' => false,
),
),
),
'mixed_content_fixer_detected' => array(
'condition' => array('rsssl_ssl_enabled'),
'callback' => 'RSSSL()->really_simple_ssl->mixed_content_fixer_detected',
'score' => 10,
'output' => array(
'found' => array(
'msg' =>__('Mixed content fixer was successfully detected on the front-end.', 'really-simple-ssl'),
'icon' => 'success'
),
'no-response' => array(
'url' => 'https://really-simple-ssl.com/knowledge-base/how-to-fix-no-response-from-webpage-warning/',
'msg' => __('Really Simple SSL has received no response from the webpage.', 'really-simple-ssl'),
'icon' => 'open',
'dismissible' => true,
'plusone' => true
),
'not-found' => array(
'url' => "https://really-simple-ssl.com/knowledge-base/how-to-check-if-the-mixed-content-fixer-is-active/",
'msg' => __('The mixed content fixer is active, but was not detected on the frontpage.', "really-simple-ssl"),
'icon' => 'open',
'dismissible' => true
),
'error' => array(
'msg' =>__('Error occurred when retrieving the webpage.', 'really-simple-ssl'),
'icon' => 'open',
'dismissible' => true
),
'not-enabled' => array(
'url' => $this->generate_enable_link($setting_name = 'autoreplace_insecure_links', $type='free'),
'msg' =>__('Mixed content fixer not enabled. Enable the option to fix mixed content on your site.', 'really-simple-ssl'),
'icon' => 'open',
'dismissible' => true
),
'curl-error' => array(
'url' => 'https://really-simple-ssl.com/knowledge-base/curl-errors/',
'msg' =>sprintf(__("The mixed content fixer could not be detected due to a cURL error: %s. cURL errors are often caused by an outdated version of PHP or cURL and don't affect the front-end of your site. Contact your hosting provider for a fix.", 'really-simple-ssl'), "" . $curl_error . ""),
'icon' => 'open',
'dismissible' => true,
),
),
),
'wordpress_redirect' => array(
'condition' => array('rsssl_ssl_enabled', 'NOT RSSSL()->really_simple_ssl->htaccess_redirect_allowed'),
'callback' => 'RSSSL()->really_simple_ssl->has_301_redirect',
'score' => 10,
'output' => array(
'true' => array(
'msg' => __('301 redirect to https set.', 'really-simple-ssl'),
'icon' => 'success'
),
'false' => array(
'msg' => __('No 301 redirect is set. Enable the WordPress 301 redirect in the settings to get a 301 permanent redirect.', 'really-simple-ssl'),
'icon' => 'open'
),
)
),
'check_redirect' => array(
'condition' => array('rsssl_ssl_enabled' , 'RSSSL()->really_simple_ssl->htaccess_redirect_allowed', 'NOT is_multisite'),
'callback' => 'rsssl_check_redirect',
'score' => 10,
'output' => array(
'htaccess-redirect-set' => array(
'msg' =>__('301 redirect to https set: .htaccess redirect.', 'really-simple-ssl') ,
'icon' => 'success'
),
'wp-redirect-to-htaccess' => array(
'url' => $this->generate_enable_link($setting_name = 'wp-redirect-to-htaccess', $type='free'),
'msg' => __('WordPress 301 redirect enabled. We recommend to enable a 301 .htaccess redirect.', 'really-simple-ssl'),
'icon' => 'open',
'plusone' => RSSSL()->rsssl_server->uses_htaccess(),
'dismissible' => true,
),
'no-redirect-set' => array(
'msg' => __('Enable a .htaccess redirect or WordPress redirect in the settings to create a 301 redirect.', 'really-simple-ssl') ,
'icon' => 'open',
'dismissible' => false
),
'htaccess-not-writeable' => array(
'url' => 'https://really-simple-ssl.com/knowledge-base/manually-insert-htaccess-redirect-http-to-https/',
'msg' => sprintf(__('The %s file is not writable. You can either use the WordPress redirect, add the rules manually, or set the file to %swritable%s.', 'really-simple-ssl'), $htaccess_file, '', ''),
'icon' => 'warning',
'dismissible' => true
),
'htaccess-rules-test-failed' => array(
'url' => 'https://really-simple-ssl.com/knowledge-base/manually-insert-htaccess-redirect-http-to-https/',
'msg' => __('The .htaccess redirect rules selected by this plugin failed in the test. Set manually or dismiss to leave on WordPress redirect.', 'really-simple-ssl') . $rules,
'icon' => 'warning',
'dismissible' => true,
'plusone'=>true,
),
),
),
'elementor' => array(
'condition' => array( 'rsssl_ssl_activation_time_no_longer_then_3_days_ago'),
'callback' => 'rsssl_uses_elementor',
'score' => 5,
'output' => array(
'true' => array(
'url' => 'https://really-simple-ssl.com/knowledge-base/how-to-fix-mixed-content-in-elementor-after-moving-to-ssl/',
'msg' => __("Your site uses Elementor. This can require some additional steps before getting the secure lock.", "really-simple-ssl"),
'icon' => 'open',
'dismissible' => true
),
),
),
'divi' => array(
'condition' => array( 'rsssl_ssl_activation_time_no_longer_then_3_days_ago'),
'callback' => 'rsssl_uses_divi',
'score' => 5,
'output' => array(
'true' => array(
'url' => "https://really-simple-ssl.com/knowledge-base/mixed-content-when-using-divi-theme/",
'msg' => __("Your site uses Divi. This can require some additional steps before getting the secure lock.", "really-simple-ssl"),
'icon' => 'open',
'dismissible' => true
),
),
),
'secure_cookies_set' => array(
'condition' => array(
'rsssl_ssl_enabled',
'RSSSL()->really_simple_ssl->can_apply_networkwide',
),
'callback' => 'RSSSL()->really_simple_ssl->secure_cookie_settings_status',
'score' => 5,
'output' => array(
'set' => array(
'msg' =>__('HttpOnly Secure cookies have been set automatically!', 'really-simple-ssl'),
'icon' => 'success',
'url' => 'https://really-simple-ssl.com/secure-cookies-with-httponly-secure-and-use_only_cookies/',
),
'not-set' => array(
'msg' => __('HttpOnly Secure cookies not set.', 'really-simple-ssl'),
'icon' => 'warning',
'dismissible' => true,
'plusone' => true,
'url' => 'https://really-simple-ssl.com/secure-cookies-with-httponly-secure-and-use_only_cookies/',
),
'wpconfig-not-writable' => array(
'msg' => __("To set the httponly secure cookie settings, your wp-config.php has to be edited, but the file is not writable.","really-simple-ssl").' '.__("Add the following lines of code to your wp-config.php.","really-simple-ssl") .
"