Version Description
- Added update counter to Settings/SSL menu item if recommended settings aren't enabled yet
- Added WP-CLI support
- Tweak: made some dashboard items dismissible
- Tweak: added link on multisite networkwide activation notice to switch function hook to fix conversions hanging on 0%
- Tweak: required WordPress version now 4.6 because of get_networks() version
Download this release
Release Info
Developer | RogierLankhorst |
Plugin | Really Simple SSL |
Version | 3.2 |
Comparing to | |
See all releases |
Code changes from version 3.1.5 to 3.2
- assets/ziprecipes.png +0 -0
- class-admin.php +557 -243
- class-multisite.php +85 -17
- class-rsssl-wp-cli.php +28 -0
- css/main.css +43 -2
- css/main.min.css +1 -1
- multisite-cron.php +11 -1
- readme.txt +12 -3
- rlrsssl-really-simple-ssl.php +19 -29
assets/ziprecipes.png
ADDED
Binary file
|
class-admin.php
CHANGED
@@ -48,6 +48,7 @@ class rsssl_admin extends rsssl_front_end
|
|
48 |
|
49 |
function __construct()
|
50 |
{
|
|
|
51 |
if (isset(self::$_this))
|
52 |
wp_die(sprintf(__('%s is a singleton class and you cannot create a second instance.', 'really-simple-ssl'), get_class($this)));
|
53 |
|
@@ -169,7 +170,6 @@ class rsssl_admin extends rsssl_front_end
|
|
169 |
//add the settings page for the plugin
|
170 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_assets'));
|
171 |
add_action('admin_init', array($this, 'load_translation'), 20);
|
172 |
-
add_action('rsssl_configuration_page', array($this, 'configuration_page_more'), 10);
|
173 |
|
174 |
//settings page, form and settings link in the plugins page
|
175 |
add_action('admin_menu', array($this, 'add_settings_page'), 40);
|
@@ -179,6 +179,9 @@ class rsssl_admin extends rsssl_front_end
|
|
179 |
$plugin = rsssl_plugin;
|
180 |
add_filter("plugin_action_links_$plugin", array($this, 'plugin_settings_link'));
|
181 |
|
|
|
|
|
|
|
182 |
//check if the uninstallfile is safely renamed to php.
|
183 |
$this->check_for_uninstall_file();
|
184 |
|
@@ -186,6 +189,8 @@ class rsssl_admin extends rsssl_front_end
|
|
186 |
add_action('wp_ajax_dismiss_htaccess_warning', array($this, 'dismiss_htaccess_warning_callback'));
|
187 |
add_action('wp_ajax_dismiss_success_message', array($this, 'dismiss_success_message_callback'));
|
188 |
add_action('wp_ajax_dismiss_review_notice', array($this, 'dismiss_review_notice_callback'));
|
|
|
|
|
189 |
|
190 |
//handle notices
|
191 |
add_action('admin_notices', array($this, 'show_notices'));
|
@@ -419,7 +424,7 @@ class rsssl_admin extends rsssl_front_end
|
|
419 |
<h1><?php echo __("Detected possible certificate issues", "really-simple-ssl"); ?></h1>
|
420 |
<p>
|
421 |
<?php
|
422 |
-
$reload_https_url = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
423 |
$link_open = '<p><a class="button" target="_blank" href="' . $reload_https_url . '">';
|
424 |
$link_close = '</a></p>';
|
425 |
|
@@ -464,6 +469,7 @@ class rsssl_admin extends rsssl_front_end
|
|
464 |
/**
|
465 |
* @since 2.3
|
466 |
* Returns button to enable SSL.
|
|
|
467 |
*/
|
468 |
|
469 |
public function show_enable_ssl_button()
|
@@ -488,6 +494,8 @@ class rsssl_admin extends rsssl_front_end
|
|
488 |
/**
|
489 |
* @since 2.3
|
490 |
* Shows option to buy pro
|
|
|
|
|
491 |
*/
|
492 |
|
493 |
public function show_pro()
|
@@ -502,6 +510,13 @@ class rsssl_admin extends rsssl_front_end
|
|
502 |
}
|
503 |
}
|
504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
|
506 |
public function wpconfig_is_writable()
|
507 |
{
|
@@ -999,6 +1014,15 @@ class rsssl_admin extends rsssl_front_end
|
|
999 |
}
|
1000 |
|
1001 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1002 |
protected function get_server_variable_fix_code()
|
1003 |
{
|
1004 |
if (is_multisite() && !RSSSL()->rsssl_multisite->ssl_enabled_networkwide && RSSSL()->rsssl_multisite->is_multisite_subfolder_install()) {
|
@@ -1125,6 +1149,8 @@ class rsssl_admin extends rsssl_front_end
|
|
1125 |
|
1126 |
public function save_options()
|
1127 |
{
|
|
|
|
|
1128 |
//any options added here should also be added to function options_validate()
|
1129 |
$options = array(
|
1130 |
'site_has_ssl' => $this->site_has_ssl,
|
@@ -1370,6 +1396,8 @@ class rsssl_admin extends rsssl_front_end
|
|
1370 |
case "ENVHTTPS":
|
1371 |
$testpage_url .= "envhttps";
|
1372 |
break;
|
|
|
|
|
1373 |
}
|
1374 |
|
1375 |
$testpage_url .= ("/ssl-test-page.html");
|
@@ -1497,6 +1525,15 @@ class rsssl_admin extends rsssl_front_end
|
|
1497 |
}
|
1498 |
}
|
1499 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1500 |
public function get_htaccess_version()
|
1501 |
{
|
1502 |
if (!file_exists($this->htaccess_file())) return false;
|
@@ -1726,8 +1763,9 @@ class rsssl_admin extends rsssl_front_end
|
|
1726 |
/**
|
1727 |
*
|
1728 |
* @since 2.2
|
1729 |
-
*
|
1730 |
-
*
|
|
|
1731 |
*/
|
1732 |
|
1733 |
public function mixed_content_fixer_detected()
|
@@ -1750,9 +1788,9 @@ class rsssl_admin extends rsssl_front_end
|
|
1750 |
if ($status != 200) {
|
1751 |
$mixed_content_fixer_detected = 'no-response';
|
1752 |
} elseif (strpos($web_source, "data-rsssl=") === false) {
|
1753 |
-
$mixed_content_fixer_detected = '
|
1754 |
} else {
|
1755 |
-
$mixed_content_fixer_detected = '
|
1756 |
}
|
1757 |
|
1758 |
set_transient('rsssl_mixed_content_fixer_detected', $mixed_content_fixer_detected, 600);
|
@@ -1762,14 +1800,16 @@ class rsssl_admin extends rsssl_front_end
|
|
1762 |
$this->trace_log("Could not connect to website");
|
1763 |
$this->mixed_content_fixer_detected = FALSE;
|
1764 |
}
|
1765 |
-
if ($mixed_content_fixer_detected === '
|
1766 |
$this->trace_log("Mixed content fixer marker not found in the websource");
|
1767 |
$this->mixed_content_fixer_detected = FALSE;
|
1768 |
}
|
1769 |
-
if ($mixed_content_fixer_detected === '
|
1770 |
$this->trace_log("Mixed content fixer was successfully detected on the front end.");
|
1771 |
$this->mixed_content_fixer_detected = true;
|
1772 |
}
|
|
|
|
|
1773 |
}
|
1774 |
|
1775 |
/**
|
@@ -1837,7 +1877,7 @@ class rsssl_admin extends rsssl_front_end
|
|
1837 |
$rule .= "#end wpmu rewritecond " . $domain . "\n";
|
1838 |
}
|
1839 |
|
1840 |
-
//now remove last [OR] if at least on one site the plugin was activated, so we have at
|
1841 |
if (count($this->sites) > 0) {
|
1842 |
$rule = strrev(implode("", explode(strrev("[OR]"), strrev($rule), 2)));
|
1843 |
}
|
@@ -1874,10 +1914,12 @@ class rsssl_admin extends rsssl_front_end
|
|
1874 |
|
1875 |
|
1876 |
/**
|
1877 |
-
*
|
1878 |
*
|
1879 |
* @since 2.2
|
1880 |
*
|
|
|
|
|
1881 |
*/
|
1882 |
|
1883 |
public function show_notice_wpconfig_needs_fixes()
|
@@ -1936,7 +1978,7 @@ class rsssl_admin extends rsssl_front_end
|
|
1936 |
* @return bool
|
1937 |
* since 3.1
|
1938 |
* Check if .well-known/acme-challenge directory exists
|
1939 |
-
*
|
1940 |
*/
|
1941 |
|
1942 |
public function has_acme_challenge_directory()
|
@@ -1953,6 +1995,7 @@ class rsssl_admin extends rsssl_front_end
|
|
1953 |
* @return bool
|
1954 |
* since 3.1
|
1955 |
* Check if there are already .well-known rules in .htaccess file
|
|
|
1956 |
*
|
1957 |
*/
|
1958 |
|
@@ -1986,7 +2029,7 @@ class rsssl_admin extends rsssl_front_end
|
|
1986 |
<ul style="margin-left: 30px; list-style: square;">
|
1987 |
<li><p style="margin-top: -5px;"><a target="_blank" href="https://wordpress.org/support/plugin/really-simple-ssl/reviews/#new-post"><?php _e('Leave a review', 'really-simple-ssl'); ?></a></p></li>
|
1988 |
<li><p style="margin-top: -5px;"><a href="#" id="maybe-later"><?php _e('Maybe later', 'really-simple-ssl'); ?></a></p></li>
|
1989 |
-
<li><p style="margin-top: -5px;"><a href="#" class="review-dismiss"><?php _e('No thanks', 'really-simple-ssl'); ?></a></p></li>
|
1990 |
</ul>
|
1991 |
</div>
|
1992 |
<?php
|
@@ -2052,11 +2095,10 @@ class rsssl_admin extends rsssl_front_end
|
|
2052 |
<p>
|
2053 |
<?php _e("SSL activated!", "really-simple-ssl"); ?>
|
2054 |
<?php _e("Don't forget to change your settings in Google Analytics and Webmaster tools.", "really-simple-ssl");
|
2055 |
-
|
2056 |
<a target="_blank"
|
2057 |
href="https://really-simple-ssl.com/knowledge-base/how-to-setup-google-analytics-and-google-search-consolewebmaster-tools/"><?php _e("More info.", "really-simple-ssl"); ?></a>
|
2058 |
<?php
|
2059 |
-
|
2060 |
$settings_link = '<a href="'.admin_url('options-general.php?page=rlrsssl_really_simple_ssl').'">';
|
2061 |
echo sprintf(__("See the %ssettings page%s for further SSL optimizations." , "really-simple-ssl"), $settings_link, "</a>"); ?>
|
2062 |
</p>
|
@@ -2184,6 +2226,29 @@ class rsssl_admin extends rsssl_front_end
|
|
2184 |
<?php
|
2185 |
}
|
2186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2187 |
|
2188 |
/**
|
2189 |
* Process the ajax dismissal of the success message.
|
@@ -2196,6 +2261,7 @@ class rsssl_admin extends rsssl_front_end
|
|
2196 |
|
2197 |
public function dismiss_success_message_callback()
|
2198 |
{
|
|
|
2199 |
//nonce check fails if url is changed to SSL.
|
2200 |
//check_ajax_referer( 'really-simple-ssl-dismiss', 'security' );
|
2201 |
$this->ssl_success_message_shown = TRUE;
|
@@ -2214,12 +2280,33 @@ class rsssl_admin extends rsssl_front_end
|
|
2214 |
|
2215 |
public function dismiss_htaccess_warning_callback()
|
2216 |
{
|
|
|
2217 |
check_ajax_referer('really-simple-ssl', 'security');
|
2218 |
$this->htaccess_warning_shown = TRUE;
|
2219 |
$this->save_options();
|
2220 |
wp_die(); // this is required to terminate immediately and return a proper response
|
2221 |
}
|
2222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2223 |
/**
|
2224 |
* Process the ajax dismissal of the htaccess message.
|
2225 |
*
|
@@ -2231,6 +2318,8 @@ class rsssl_admin extends rsssl_front_end
|
|
2231 |
|
2232 |
public function dismiss_review_notice_callback()
|
2233 |
{
|
|
|
|
|
2234 |
check_ajax_referer('really-simple-ssl', 'security');
|
2235 |
|
2236 |
$type = isset($_POST['type']) ? $_POST['type'] : false;
|
@@ -2263,9 +2352,18 @@ class rsssl_admin extends rsssl_front_end
|
|
2263 |
if (is_multisite() && rsssl_multisite::this()->hide_menu_for_subsites && !is_super_admin()) return;
|
2264 |
|
2265 |
global $rsssl_admin_page;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2266 |
$rsssl_admin_page = add_options_page(
|
2267 |
__("SSL settings", "really-simple-ssl"), //link title
|
2268 |
-
__("SSL", "really-simple-ssl"), //page title
|
2269 |
$this->capability, //capability
|
2270 |
'rlrsssl_really_simple_ssl', //url
|
2271 |
array($this, 'settings_page')); //function
|
@@ -2275,6 +2373,56 @@ class rsssl_admin extends rsssl_front_end
|
|
2275 |
|
2276 |
}
|
2277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2278 |
/**
|
2279 |
* Admin help tab
|
2280 |
*
|
@@ -2323,6 +2471,246 @@ class rsssl_admin extends rsssl_front_end
|
|
2323 |
echo '</h2>';
|
2324 |
}
|
2325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2326 |
/**
|
2327 |
* Build the settings page
|
2328 |
*
|
@@ -2332,10 +2720,13 @@ class rsssl_admin extends rsssl_front_end
|
|
2332 |
*
|
2333 |
*/
|
2334 |
|
|
|
2335 |
public function settings_page()
|
2336 |
{
|
2337 |
if (!current_user_can($this->capability)) return;
|
2338 |
|
|
|
|
|
2339 |
if (isset ($_GET['tab'])) $this->admin_tabs($_GET['tab']); else $this->admin_tabs('configuration');
|
2340 |
if (isset ($_GET['tab'])) $tab = $_GET['tab']; else $tab = 'configuration';
|
2341 |
|
@@ -2344,113 +2735,36 @@ class rsssl_admin extends rsssl_front_end
|
|
2344 |
<div class="rsssl-main"><?php
|
2345 |
|
2346 |
switch ($tab) {
|
2347 |
-
|
2348 |
-
/*
|
2349 |
-
First tab, configuration
|
2350 |
-
*/
|
2351 |
-
?>
|
2352 |
-
<h2><?php echo __("Detected setup", "really-simple-ssl"); ?></h2>
|
2353 |
-
<table class="really-simple-ssl-table">
|
2354 |
-
|
2355 |
-
<?php if ($this->site_has_ssl) { ?>
|
2356 |
-
<tr>
|
2357 |
-
<td><?php echo $this->ssl_enabled ? $this->img("success") : $this->img("error"); ?></td>
|
2358 |
-
<td><?php
|
2359 |
-
if ($this->ssl_enabled) {
|
2360 |
-
_e("SSL is enabled on your site.", "really-simple-ssl") . " ";
|
2361 |
-
} else {
|
2362 |
-
_e("SSL is not enabled yet", "really-simple-ssl") . " ";
|
2363 |
-
$this->show_enable_ssl_button();
|
2364 |
-
}
|
2365 |
-
?>
|
2366 |
-
</td>
|
2367 |
-
<td></td>
|
2368 |
-
</tr>
|
2369 |
-
<?php }
|
2370 |
-
|
2371 |
-
/* check if the mixed content fixer is working */
|
2372 |
-
if ($this->ssl_enabled && $this->autoreplace_insecure_links && $this->site_has_ssl) {
|
2373 |
-
$this->mixed_content_fixer_detected();
|
2374 |
-
$mixed_content_fixer_detected = get_transient('rsssl_mixed_content_fixer_detected');
|
2375 |
-
?>
|
2376 |
-
<tr>
|
2377 |
-
<td><?php echo $mixed_content_fixer_detected==="success" ? $this->img("success") : $this->img("error"); ?></td>
|
2378 |
-
<td><?php
|
2379 |
-
if ($mixed_content_fixer_detected === 'success') {
|
2380 |
-
echo __("Mixed content fixer was successfully detected on the front-end", "really-simple-ssl") . " ";
|
2381 |
-
} elseif ($mixed_content_fixer_detected === 'no-response') {
|
2382 |
-
$link_open = '<a target="_blank" href="https://really-simple-ssl.com/knowledge-base/how-to-fix-no-response-from-webpage-warning/">';
|
2383 |
-
$link_close = '</a>';
|
2384 |
-
echo sprintf(__("Really Simple SSL has received no response from the webpage. See our knowledge base for %sinstructions on how to fix this warning%s.", 'really-simple-ssl'), $link_open, $link_close);
|
2385 |
-
}
|
2386 |
-
else {
|
2387 |
-
echo __('The mixed content fixer is active, but was not detected on the frontpage. Please follow these steps to check if the mixed content fixer is working.', "really-simple-ssl") . ": ";
|
2388 |
-
echo ' <a target="_blank" href="https://www.really-simple-ssl.com/knowledge-base/how-to-check-if-the-mixed-content-fixer-is-active/">';
|
2389 |
-
_e('Instructions', 'really-simple-ssl');
|
2390 |
-
echo '</a>';
|
2391 |
-
}
|
2392 |
-
?>
|
2393 |
-
</td>
|
2394 |
-
<td></td>
|
2395 |
-
</tr>
|
2396 |
-
<?php } ?>
|
2397 |
-
<tr>
|
2398 |
-
<td><?php echo ($this->site_has_ssl && $this->wpconfig_ok()) ? $this->img("success") : $this->img("error"); ?></td>
|
2399 |
-
<td><?php
|
2400 |
-
if (!$this->wpconfig_ok()) {
|
2401 |
-
_e("Failed activating SSL", "really-simple-ssl") . " ";
|
2402 |
-
} elseif (!$this->site_has_ssl) {
|
2403 |
-
_e("No SSL detected.", "really-simple-ssl") . " ";
|
2404 |
-
} else {
|
2405 |
-
_e("An SSL certificate was detected on your site. ", "really-simple-ssl");
|
2406 |
-
}
|
2407 |
-
?>
|
2408 |
-
</td>
|
2409 |
-
<td></td>
|
2410 |
-
</tr>
|
2411 |
-
<?php if ($this->ssl_enabled) { ?>
|
2412 |
-
<tr>
|
2413 |
-
<td>
|
2414 |
-
<?php echo ($this->has_301_redirect()) ? $this->img("success") : $this->img("warning"); ?>
|
2415 |
-
</td>
|
2416 |
-
<td>
|
2417 |
-
<?php
|
2418 |
-
|
2419 |
-
if ($this->has_301_redirect()) {
|
2420 |
-
_e("301 redirect to https set: ", "really-simple-ssl");
|
2421 |
-
if (RSSSL()->rsssl_server->uses_htaccess() && $this->htaccess_contains_redirect_rules())
|
2422 |
-
_e(".htaccess redirect", "really-simple-ssl");
|
2423 |
-
|
2424 |
-
if (RSSSL()->rsssl_server->uses_htaccess() && $this->htaccess_contains_redirect_rules() && $this->wp_redirect)
|
2425 |
-
echo " " . __("and", "really-simple-ssl") . " ";
|
2426 |
-
|
2427 |
-
if ($this->wp_redirect)
|
2428 |
-
_e("WordPress redirect", "really-simple-ssl");
|
2429 |
-
|
2430 |
-
} elseif (RSSSL()->rsssl_server->uses_htaccess() && (!is_multisite() || !RSSSL()->rsssl_multisite->is_per_site_activated_multisite_subfolder_install())) {
|
2431 |
-
if (is_writable($this->htaccess_file())) {
|
2432 |
-
_e("Enable a .htaccess redirect or WordPress redirect in the settings to create a 301 redirect.", "really-simple-ssl");
|
2433 |
-
} elseif (!is_writable($this->htaccess_file())) {
|
2434 |
-
_e(".htaccess is not writable. Set 301 WordPress redirect, or set the .htaccess manually if you want to redirect in .htaccess.", "really-simple-ssl");
|
2435 |
-
} else {
|
2436 |
-
_e("Https redirect cannot be set in the .htaccess. Set the .htaccess redirect manually or enable WordPress redirect in the settings.", "really-simple-ssl");
|
2437 |
-
}
|
2438 |
-
} else {
|
2439 |
-
_e("No 301 redirect is set. Enable the WordPress 301 redirect in the settings to get a 301 permanent redirect.", "really-simple-ssl");
|
2440 |
-
}
|
2441 |
-
?>
|
2442 |
-
</td>
|
2443 |
-
<td></td>
|
2444 |
-
</tr>
|
2445 |
-
|
2446 |
-
<?php
|
2447 |
-
}
|
2448 |
-
?>
|
2449 |
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2454 |
case 'settings' :
|
2455 |
/*
|
2456 |
Second tab, Settings
|
@@ -2471,8 +2785,8 @@ class rsssl_admin extends rsssl_front_end
|
|
2471 |
|
2472 |
case 'debug' :
|
2473 |
/*
|
2474 |
-
|
2475 |
-
|
2476 |
?>
|
2477 |
<div>
|
2478 |
<?php
|
@@ -2507,6 +2821,8 @@ class rsssl_admin extends rsssl_front_end
|
|
2507 |
</div>
|
2508 |
<?php
|
2509 |
break;
|
|
|
|
|
2510 |
}
|
2511 |
//possibility to hook into the tabs.
|
2512 |
do_action("show_tab_{$tab}");
|
@@ -2563,13 +2879,23 @@ class rsssl_admin extends rsssl_front_end
|
|
2563 |
);
|
2564 |
$this->get_banner_html(array(
|
2565 |
'img' => 'complianz.jpg',
|
2566 |
-
'title' => '
|
2567 |
'description' => __("The Complianz Privacy Suite (GDPR/CaCPA) for WordPress. Simple, Quick and Complete. Up-to-date customized legal documents by a prominent IT Law firm.", "really-simple-ssl"),
|
2568 |
'url' => 'https://wordpress.org/plugins/complianz-gdpr/',
|
2569 |
'pro' => true,
|
2570 |
)
|
2571 |
);
|
2572 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2573 |
if (defined("ultimatemember_version")) {
|
2574 |
|
2575 |
if (!defined("um_tagging_version")) {
|
@@ -2582,28 +2908,6 @@ class rsssl_admin extends rsssl_front_end
|
|
2582 |
)
|
2583 |
);
|
2584 |
}
|
2585 |
-
|
2586 |
-
if (!defined("um_most_visited_version")) {
|
2587 |
-
|
2588 |
-
$this->get_banner_html(array(
|
2589 |
-
'img' => 'most-visited.jpg',
|
2590 |
-
'title' => 'UM Most Visited',
|
2591 |
-
'description' => __("Show the most visited users and add a 'last visited users' tab to each user profile.", "really-simple-ssl"),
|
2592 |
-
'url' => 'https://really-simple-plugins.com/download/most-visited-members/',
|
2593 |
-
)
|
2594 |
-
);
|
2595 |
-
}
|
2596 |
-
|
2597 |
-
if (!defined("um_tagging_version")) {
|
2598 |
-
$this->get_banner_html(array(
|
2599 |
-
'img' => 'mail-alerts.jpg',
|
2600 |
-
'title' => 'UM Mail Alerts',
|
2601 |
-
'description' => __("Automatically send a notification when a user's post on the activity feed is liked or commented on.", "really-simple-ssl"),
|
2602 |
-
'url' => 'https://really-simple-plugins.com/download/um-mail-alerts/',
|
2603 |
-
)
|
2604 |
-
);
|
2605 |
-
|
2606 |
-
}
|
2607 |
}
|
2608 |
|
2609 |
if (defined("EDD_SL_PLUGIN_DIR") && (get_locale() === 'nl_NL')) {
|
@@ -2660,6 +2964,30 @@ class rsssl_admin extends rsssl_front_end
|
|
2660 |
}
|
2661 |
}
|
2662 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2663 |
|
2664 |
private function get_banner_html($args)
|
2665 |
{
|
@@ -2708,100 +3036,6 @@ class rsssl_admin extends rsssl_front_end
|
|
2708 |
wp_enqueue_style('rlrsssl-css');
|
2709 |
}
|
2710 |
|
2711 |
-
|
2712 |
-
/*
|
2713 |
-
|
2714 |
-
feedback for the free users. Pro users see something different.
|
2715 |
-
|
2716 |
-
*/
|
2717 |
-
|
2718 |
-
|
2719 |
-
public function configuration_page_more()
|
2720 |
-
{
|
2721 |
-
?>
|
2722 |
-
<table>
|
2723 |
-
<tr>
|
2724 |
-
<td>
|
2725 |
-
<?php echo $this->contains_hsts() ? $this->img("success") : $this->img("warning"); ?>
|
2726 |
-
</td>
|
2727 |
-
<td>
|
2728 |
-
<?php
|
2729 |
-
if ($this->contains_hsts()) {
|
2730 |
-
_e("HTTP Strict Transport Security was enabled", "really-simple-ssl");
|
2731 |
-
} else {
|
2732 |
-
|
2733 |
-
$wiki_open = '<a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security" target="_blank">';
|
2734 |
-
$link_open = '<a target="_blank" href="' . $this->pro_url . '">';
|
2735 |
-
$link_close = '</a>';
|
2736 |
-
|
2737 |
-
printf(__('%sHTTP Strict Transport Security%s is not enabled.', "really-simple-ssl"), $wiki_open, $link_close);
|
2738 |
-
echo " ";
|
2739 |
-
printf(__("To enable, %sget Premium%s ", "really-simple-ssl"), $link_open, $link_close);
|
2740 |
-
}
|
2741 |
-
?>
|
2742 |
-
</td>
|
2743 |
-
<td></td>
|
2744 |
-
</tr>
|
2745 |
-
<tr>
|
2746 |
-
|
2747 |
-
<td><?php echo ($this->contains_secure_cookie_settings()) ? $this->img("success") : $this->img("warning"); ?></td>
|
2748 |
-
<td><?php
|
2749 |
-
if ($this->contains_secure_cookie_settings()) {
|
2750 |
-
_e("Secure cookies set", "really-simple-ssl") . " ";
|
2751 |
-
} else {
|
2752 |
-
|
2753 |
-
$link_open = '<a target="_blank" href="' . $this->pro_url . '">';
|
2754 |
-
$link_close = '</a>';
|
2755 |
-
|
2756 |
-
_e('Secure cookie settings not enabled.', "really-simple-ssl");
|
2757 |
-
echo " ";
|
2758 |
-
printf(__("To enable, %sget Premium%s ", "really-simple-ssl"), $link_open, $link_close);
|
2759 |
-
}
|
2760 |
-
?>
|
2761 |
-
</td>
|
2762 |
-
<td></td>
|
2763 |
-
</tr>
|
2764 |
-
<?php
|
2765 |
-
/**
|
2766 |
-
?>
|
2767 |
-
<tr>
|
2768 |
-
|
2769 |
-
<td><?php echo (defined('rsssl_pro_path')) ? $this->img("success") : $this->img("warning"); ?></td>
|
2770 |
-
<td>
|
2771 |
-
<?php
|
2772 |
-
$link_open = '<a target="_blank" href="' . $this->pro_url . '">';
|
2773 |
-
$link_close = '</a>';
|
2774 |
-
|
2775 |
-
_e('Content Security Policy violation reporting not enabled.', "really-simple-ssl");
|
2776 |
-
echo " ";
|
2777 |
-
printf(__("To enable, %sget Premium%s ", "really-simple-ssl"), $link_open, $link_close);
|
2778 |
-
|
2779 |
-
?>
|
2780 |
-
</td>
|
2781 |
-
</tr>
|
2782 |
-
**/?>
|
2783 |
-
</table>
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
2787 |
-
<?php
|
2788 |
-
|
2789 |
-
if (!$this->site_has_ssl) {
|
2790 |
-
$this->show_pro();
|
2791 |
-
} else {
|
2792 |
-
if (!$this->ssl_enabled) { ?>
|
2793 |
-
<p><?php _e("If you want to be sure you're ready to migrate to SSL, get Premium, which includes an extensive scan and premium support.", "really-simple-ssl") ?>
|
2794 |
-
<a target="_blank"
|
2795 |
-
href="<?php echo $this->pro_url ?>"><?php _e("Learn more", "really-simple-ssl") ?></a></p>
|
2796 |
-
<?php } else { ?>
|
2797 |
-
<p><?php _e('Still having issues with mixed content? Check out Premium, which includes an extensive scan and premium support. ', "really-simple-ssl") ?>
|
2798 |
-
<a target="_blank"
|
2799 |
-
href="<?php echo $this->pro_url ?>"><?php _e("Learn more", "really-simple-ssl") ?></a></p>
|
2800 |
-
<?php
|
2801 |
-
}
|
2802 |
-
}
|
2803 |
-
}
|
2804 |
-
|
2805 |
/**
|
2806 |
* Create the settings page form
|
2807 |
*
|
@@ -2835,7 +3069,7 @@ class rsssl_admin extends rsssl_front_end
|
|
2835 |
add_settings_field('id_do_not_edit_htaccess', __("Stop editing the .htaccess file", "really-simple-ssl"), array($this, 'get_option_do_not_edit_htaccess'), 'rlrsssl', 'rlrsssl_settings');
|
2836 |
}
|
2837 |
|
2838 |
-
add_settings_field('id_switch_mixed_content_fixer_hook', __("
|
2839 |
|
2840 |
add_settings_field('id_deactivate_keep_ssl', __("Deactivate plugin and keep SSL", "really-simple-ssl"), array($this, 'get_option_deactivate_keep_ssl'), 'rlrsssl', 'rlrsssl_settings');
|
2841 |
|
@@ -3141,11 +3375,13 @@ class rsssl_admin extends rsssl_front_end
|
|
3141 |
RSSSL()->rsssl_help->get_help_tip(__("If this option is set to true, the mixed content fixer will fire on the init hook instead of the template_redirect hook. Only use this option when you experience problems with the mixed content fixer.", "really-simple-ssl"));
|
3142 |
}
|
3143 |
|
3144 |
-
|
3145 |
*
|
3146 |
-
* Add a button and thickbox to deactivate
|
3147 |
*
|
|
|
3148 |
*
|
|
|
3149 |
*
|
3150 |
*/
|
3151 |
|
@@ -3415,3 +3651,81 @@ class rsssl_admin extends rsssl_front_end
|
|
3415 |
}
|
3416 |
|
3417 |
} //class closure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
function __construct()
|
50 |
{
|
51 |
+
|
52 |
if (isset(self::$_this))
|
53 |
wp_die(sprintf(__('%s is a singleton class and you cannot create a second instance.', 'really-simple-ssl'), get_class($this)));
|
54 |
|
170 |
//add the settings page for the plugin
|
171 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_assets'));
|
172 |
add_action('admin_init', array($this, 'load_translation'), 20);
|
|
|
173 |
|
174 |
//settings page, form and settings link in the plugins page
|
175 |
add_action('admin_menu', array($this, 'add_settings_page'), 40);
|
179 |
$plugin = rsssl_plugin;
|
180 |
add_filter("plugin_action_links_$plugin", array($this, 'plugin_settings_link'));
|
181 |
|
182 |
+
//Add update notification to Settings admin menu
|
183 |
+
add_action('admin_menu', array($this, 'rsssl_edit_admin_menu') );
|
184 |
+
|
185 |
//check if the uninstallfile is safely renamed to php.
|
186 |
$this->check_for_uninstall_file();
|
187 |
|
189 |
add_action('wp_ajax_dismiss_htaccess_warning', array($this, 'dismiss_htaccess_warning_callback'));
|
190 |
add_action('wp_ajax_dismiss_success_message', array($this, 'dismiss_success_message_callback'));
|
191 |
add_action('wp_ajax_dismiss_review_notice', array($this, 'dismiss_review_notice_callback'));
|
192 |
+
add_action('wp_ajax_rsssl_dismiss_settings_notice', array($this, 'dismiss_settings_notice_callback'));
|
193 |
+
|
194 |
|
195 |
//handle notices
|
196 |
add_action('admin_notices', array($this, 'show_notices'));
|
424 |
<h1><?php echo __("Detected possible certificate issues", "really-simple-ssl"); ?></h1>
|
425 |
<p>
|
426 |
<?php
|
427 |
+
$reload_https_url = esc_url_raw("https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
|
428 |
$link_open = '<p><a class="button" target="_blank" href="' . $reload_https_url . '">';
|
429 |
$link_close = '</a></p>';
|
430 |
|
469 |
/**
|
470 |
* @since 2.3
|
471 |
* Returns button to enable SSL.
|
472 |
+
* @access public
|
473 |
*/
|
474 |
|
475 |
public function show_enable_ssl_button()
|
494 |
/**
|
495 |
* @since 2.3
|
496 |
* Shows option to buy pro
|
497 |
+
* @access public
|
498 |
+
*
|
499 |
*/
|
500 |
|
501 |
public function show_pro()
|
510 |
}
|
511 |
}
|
512 |
|
513 |
+
/**
|
514 |
+
* @return bool
|
515 |
+
*
|
516 |
+
* Check if wp-config.php is writeable
|
517 |
+
*
|
518 |
+
* @access public
|
519 |
+
*/
|
520 |
|
521 |
public function wpconfig_is_writable()
|
522 |
{
|
1014 |
}
|
1015 |
|
1016 |
|
1017 |
+
/**
|
1018 |
+
* @return string
|
1019 |
+
*
|
1020 |
+
* Get code for server variable fix
|
1021 |
+
*
|
1022 |
+
* @access protected
|
1023 |
+
*
|
1024 |
+
*/
|
1025 |
+
|
1026 |
protected function get_server_variable_fix_code()
|
1027 |
{
|
1028 |
if (is_multisite() && !RSSSL()->rsssl_multisite->ssl_enabled_networkwide && RSSSL()->rsssl_multisite->is_multisite_subfolder_install()) {
|
1149 |
|
1150 |
public function save_options()
|
1151 |
{
|
1152 |
+
delete_transient('rsssl_plusone_count');
|
1153 |
+
|
1154 |
//any options added here should also be added to function options_validate()
|
1155 |
$options = array(
|
1156 |
'site_has_ssl' => $this->site_has_ssl,
|
1396 |
case "ENVHTTPS":
|
1397 |
$testpage_url .= "envhttps";
|
1398 |
break;
|
1399 |
+
default:
|
1400 |
+
$testpage_url .= "serverhttpson";
|
1401 |
}
|
1402 |
|
1403 |
$testpage_url .= ("/ssl-test-page.html");
|
1525 |
}
|
1526 |
}
|
1527 |
|
1528 |
+
/**
|
1529 |
+
* @return bool|string
|
1530 |
+
*
|
1531 |
+
* Get the .htaccess version
|
1532 |
+
*
|
1533 |
+
* @access public
|
1534 |
+
*
|
1535 |
+
*/
|
1536 |
+
|
1537 |
public function get_htaccess_version()
|
1538 |
{
|
1539 |
if (!file_exists($this->htaccess_file())) return false;
|
1763 |
/**
|
1764 |
*
|
1765 |
* @since 2.2
|
1766 |
+
* Check if the mixed content fixer is functioning on the front end, by scanning the source of the homepage for the fixer comment.
|
1767 |
+
* @access public
|
1768 |
+
* @return string $mixed_content_fixer_detected
|
1769 |
*/
|
1770 |
|
1771 |
public function mixed_content_fixer_detected()
|
1788 |
if ($status != 200) {
|
1789 |
$mixed_content_fixer_detected = 'no-response';
|
1790 |
} elseif (strpos($web_source, "data-rsssl=") === false) {
|
1791 |
+
$mixed_content_fixer_detected = 'not-found';
|
1792 |
} else {
|
1793 |
+
$mixed_content_fixer_detected = 'found';
|
1794 |
}
|
1795 |
|
1796 |
set_transient('rsssl_mixed_content_fixer_detected', $mixed_content_fixer_detected, 600);
|
1800 |
$this->trace_log("Could not connect to website");
|
1801 |
$this->mixed_content_fixer_detected = FALSE;
|
1802 |
}
|
1803 |
+
if ($mixed_content_fixer_detected === 'not-found'){
|
1804 |
$this->trace_log("Mixed content fixer marker not found in the websource");
|
1805 |
$this->mixed_content_fixer_detected = FALSE;
|
1806 |
}
|
1807 |
+
if ($mixed_content_fixer_detected === 'found'){
|
1808 |
$this->trace_log("Mixed content fixer was successfully detected on the front end.");
|
1809 |
$this->mixed_content_fixer_detected = true;
|
1810 |
}
|
1811 |
+
|
1812 |
+
return $mixed_content_fixer_detected;
|
1813 |
}
|
1814 |
|
1815 |
/**
|
1877 |
$rule .= "#end wpmu rewritecond " . $domain . "\n";
|
1878 |
}
|
1879 |
|
1880 |
+
//now remove last [OR] if at least on one site the plugin was activated, so we have at least one condition
|
1881 |
if (count($this->sites) > 0) {
|
1882 |
$rule = strrev(implode("", explode(strrev("[OR]"), strrev($rule), 2)));
|
1883 |
}
|
1914 |
|
1915 |
|
1916 |
/**
|
1917 |
+
* Show warning when wpconfig could not be fixed
|
1918 |
*
|
1919 |
* @since 2.2
|
1920 |
*
|
1921 |
+
* @access public
|
1922 |
+
*
|
1923 |
*/
|
1924 |
|
1925 |
public function show_notice_wpconfig_needs_fixes()
|
1978 |
* @return bool
|
1979 |
* since 3.1
|
1980 |
* Check if .well-known/acme-challenge directory exists
|
1981 |
+
* @access public
|
1982 |
*/
|
1983 |
|
1984 |
public function has_acme_challenge_directory()
|
1995 |
* @return bool
|
1996 |
* since 3.1
|
1997 |
* Check if there are already .well-known rules in .htaccess file
|
1998 |
+
* @access public
|
1999 |
*
|
2000 |
*/
|
2001 |
|
2029 |
<ul style="margin-left: 30px; list-style: square;">
|
2030 |
<li><p style="margin-top: -5px;"><a target="_blank" href="https://wordpress.org/support/plugin/really-simple-ssl/reviews/#new-post"><?php _e('Leave a review', 'really-simple-ssl'); ?></a></p></li>
|
2031 |
<li><p style="margin-top: -5px;"><a href="#" id="maybe-later"><?php _e('Maybe later', 'really-simple-ssl'); ?></a></p></li>
|
2032 |
+
<li><p style="margin-top: -5px;"><a href="#" class="review-dismiss"><?php _e('No thanks and never ask me again', 'really-simple-ssl'); ?></a></p></li>
|
2033 |
</ul>
|
2034 |
</div>
|
2035 |
<?php
|
2095 |
<p>
|
2096 |
<?php _e("SSL activated!", "really-simple-ssl"); ?>
|
2097 |
<?php _e("Don't forget to change your settings in Google Analytics and Webmaster tools.", "really-simple-ssl");
|
2098 |
+
?>
|
2099 |
<a target="_blank"
|
2100 |
href="https://really-simple-ssl.com/knowledge-base/how-to-setup-google-analytics-and-google-search-consolewebmaster-tools/"><?php _e("More info.", "really-simple-ssl"); ?></a>
|
2101 |
<?php
|
|
|
2102 |
$settings_link = '<a href="'.admin_url('options-general.php?page=rlrsssl_really_simple_ssl').'">';
|
2103 |
echo sprintf(__("See the %ssettings page%s for further SSL optimizations." , "really-simple-ssl"), $settings_link, "</a>"); ?>
|
2104 |
</p>
|
2226 |
<?php
|
2227 |
}
|
2228 |
|
2229 |
+
public function insert_dismiss_settings_script()
|
2230 |
+
{
|
2231 |
+
$ajax_nonce = wp_create_nonce("really-simple-ssl");
|
2232 |
+
|
2233 |
+
?>
|
2234 |
+
<script type='text/javascript'>
|
2235 |
+
jQuery(document).ready(function ($) {
|
2236 |
+
$(".rsssl-dashboard-dismiss").on("click", ".rsssl-close-warning",function (event) {
|
2237 |
+
var type = $(this).closest('.rsssl-dashboard-dismiss').data('dismiss_type');
|
2238 |
+
var data = {
|
2239 |
+
'action': 'rsssl_dismiss_settings_notice',
|
2240 |
+
'type' : type,
|
2241 |
+
'security': '<?php echo $ajax_nonce; ?>'
|
2242 |
+
};
|
2243 |
+
$.post(ajaxurl, data, function (response) {});
|
2244 |
+
$(this).closest('tr').remove();
|
2245 |
+
});
|
2246 |
+
|
2247 |
+
|
2248 |
+
});
|
2249 |
+
</script>
|
2250 |
+
<?php
|
2251 |
+
}
|
2252 |
|
2253 |
/**
|
2254 |
* Process the ajax dismissal of the success message.
|
2261 |
|
2262 |
public function dismiss_success_message_callback()
|
2263 |
{
|
2264 |
+
if (!current_user_can($this->capability) ) return;
|
2265 |
//nonce check fails if url is changed to SSL.
|
2266 |
//check_ajax_referer( 'really-simple-ssl-dismiss', 'security' );
|
2267 |
$this->ssl_success_message_shown = TRUE;
|
2280 |
|
2281 |
public function dismiss_htaccess_warning_callback()
|
2282 |
{
|
2283 |
+
if (!current_user_can($this->capability) ) return;
|
2284 |
check_ajax_referer('really-simple-ssl', 'security');
|
2285 |
$this->htaccess_warning_shown = TRUE;
|
2286 |
$this->save_options();
|
2287 |
wp_die(); // this is required to terminate immediately and return a proper response
|
2288 |
}
|
2289 |
|
2290 |
+
/**
|
2291 |
+
* Process the ajax dismissal of settings notice
|
2292 |
+
*
|
2293 |
+
* Since 3.1
|
2294 |
+
*
|
2295 |
+
* @access public
|
2296 |
+
*
|
2297 |
+
*/
|
2298 |
+
|
2299 |
+
public function dismiss_settings_notice_callback()
|
2300 |
+
{
|
2301 |
+
if (!current_user_can($this->capability) ) return;
|
2302 |
+
|
2303 |
+
check_ajax_referer('really-simple-ssl', 'security');
|
2304 |
+
$dismiss_type = sanitize_title($_POST['type']);
|
2305 |
+
update_option("rsssl_".$dismiss_type."_dismissed", true);
|
2306 |
+
delete_transient('rsssl_plusone_count');
|
2307 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
2308 |
+
}
|
2309 |
+
|
2310 |
/**
|
2311 |
* Process the ajax dismissal of the htaccess message.
|
2312 |
*
|
2318 |
|
2319 |
public function dismiss_review_notice_callback()
|
2320 |
{
|
2321 |
+
if (!current_user_can($this->capability) ) return;
|
2322 |
+
|
2323 |
check_ajax_referer('really-simple-ssl', 'security');
|
2324 |
|
2325 |
$type = isset($_POST['type']) ? $_POST['type'] : false;
|
2352 |
if (is_multisite() && rsssl_multisite::this()->hide_menu_for_subsites && !is_super_admin()) return;
|
2353 |
|
2354 |
global $rsssl_admin_page;
|
2355 |
+
|
2356 |
+
$count = $this->count_plusones();
|
2357 |
+
|
2358 |
+
if ($count > 0) {
|
2359 |
+
$update_count = "<span class='update-plugins rsssl-update-count'><span class='update-count'>$count</span></span>";
|
2360 |
+
} else {
|
2361 |
+
$update_count = "";
|
2362 |
+
}
|
2363 |
+
|
2364 |
$rsssl_admin_page = add_options_page(
|
2365 |
__("SSL settings", "really-simple-ssl"), //link title
|
2366 |
+
__("SSL", "really-simple-ssl") . $update_count, //page title
|
2367 |
$this->capability, //capability
|
2368 |
'rlrsssl_really_simple_ssl', //url
|
2369 |
array($this, 'settings_page')); //function
|
2373 |
|
2374 |
}
|
2375 |
|
2376 |
+
/**
|
2377 |
+
*
|
2378 |
+
* @since 3.1.6
|
2379 |
+
*
|
2380 |
+
* Add an update count to the WordPress admin Settings menu item
|
2381 |
+
* Doesn't work when the Admin Menu Editor plugin is active
|
2382 |
+
*
|
2383 |
+
*/
|
2384 |
+
|
2385 |
+
public function rsssl_edit_admin_menu()
|
2386 |
+
{
|
2387 |
+
if (!current_user_can($this->capability)) return;
|
2388 |
+
|
2389 |
+
global $menu;
|
2390 |
+
|
2391 |
+
$count = $this->count_plusones();
|
2392 |
+
|
2393 |
+
if ($count > 0) {
|
2394 |
+
$update_count = "<span class='update-plugins rsssl-update-count'><span class='update-count'>$count</span></span>";
|
2395 |
+
} else {
|
2396 |
+
$update_count = "";
|
2397 |
+
}
|
2398 |
+
$menu[80][0] = str_replace(__("Settings"), __("Settings") . $update_count, $menu[80][0]);
|
2399 |
+
|
2400 |
+
}
|
2401 |
+
|
2402 |
+
/**
|
2403 |
+
* @return int
|
2404 |
+
*
|
2405 |
+
* @since 3.1.6
|
2406 |
+
*
|
2407 |
+
* Check if there is an existing update count after the Settings menu item
|
2408 |
+
*
|
2409 |
+
*/
|
2410 |
+
|
2411 |
+
public function get_existing_settings_plusones()
|
2412 |
+
{
|
2413 |
+
global $menu;
|
2414 |
+
|
2415 |
+
$existing_count = "0";
|
2416 |
+
|
2417 |
+
//Get the existing count with regex
|
2418 |
+
if (strpos($menu[80][0], "plugin-count") != false) {
|
2419 |
+
$pattern = "(?<=\'plugin-count'>)(.*?)(?=\<)\g";
|
2420 |
+
$existing_count = preg_match($pattern, $menu[80][0]);
|
2421 |
+
}
|
2422 |
+
|
2423 |
+
return intval($existing_count);
|
2424 |
+
}
|
2425 |
+
|
2426 |
/**
|
2427 |
* Admin help tab
|
2428 |
*
|
2471 |
echo '</h2>';
|
2472 |
}
|
2473 |
|
2474 |
+
|
2475 |
+
/**
|
2476 |
+
* Get array of notices
|
2477 |
+
* - condition: function returning boolean, if notice should be shown or not
|
2478 |
+
* - callback: function, returning boolean or string, with multiple possible answers, and resulting messages and icons
|
2479 |
+
*
|
2480 |
+
* @return array
|
2481 |
+
*/
|
2482 |
+
|
2483 |
+
|
2484 |
+
public function get_notices_list()
|
2485 |
+
{
|
2486 |
+
$defaults = array(
|
2487 |
+
'condition' => array(),
|
2488 |
+
'callback' => false,
|
2489 |
+
);
|
2490 |
+
|
2491 |
+
$notices = array(
|
2492 |
+
'ssl_enabled' => array(
|
2493 |
+
'callback' => 'rsssl_ssl_enabled',
|
2494 |
+
'output' => array(
|
2495 |
+
'1' => array(
|
2496 |
+
'msg' =>__('SSL is enabled on your site.', 'really-simple-ssl'),
|
2497 |
+
'icon' => 'success'
|
2498 |
+
),
|
2499 |
+
'0' => array(
|
2500 |
+
'msg' => __('SSL is not enabled yet', 'really-simple-ssl'),
|
2501 |
+
'icon' => 'warning'
|
2502 |
+
),
|
2503 |
+
),
|
2504 |
+
),
|
2505 |
+
|
2506 |
+
'mixed_content_fixer_detected' => array(
|
2507 |
+
'condition' => array('rsssl_site_has_ssl', 'rsssl_autoreplace_insecure_links', 'rsssl_ssl_enabled'),
|
2508 |
+
'callback' => 'rsssl_mixed_content_fixer_detected',
|
2509 |
+
'output' => array(
|
2510 |
+
'found' => array(
|
2511 |
+
'msg' =>__('Mixed content fixer was successfully detected on the front-end', 'really-simple-ssl'),
|
2512 |
+
'icon' => 'success'
|
2513 |
+
),
|
2514 |
+
'no-response' => array(
|
2515 |
+
'msg' => sprintf(__('Really Simple SSL has received no response from the webpage. See our knowledge base for %sinstructions on how to fix this warning%s', 'really-simple-ssl'),'<a target="_blank" href="https://really-simple-ssl.com/knowledge-base/how-to-fix-no-response-from-webpage-warning/">','</a>'),
|
2516 |
+
'icon' => 'error',
|
2517 |
+
'dismissible' => true,
|
2518 |
+
'plusone' => true
|
2519 |
+
),
|
2520 |
+
'not-found' => array(
|
2521 |
+
'msg' => sprintf(__('The mixed content fixer is active, but was not detected on the frontpage. Please follow %sthese steps%s to check if the mixed content fixer is working.', "really-simple-ssl"),'<a target="_blank" href="https://www.really-simple-ssl.com/knowledge-base/how-to-check-if-the-mixed-content-fixer-is-active/">', '</a>' ),
|
2522 |
+
'icon' => 'error'
|
2523 |
+
),
|
2524 |
+
),
|
2525 |
+
),
|
2526 |
+
|
2527 |
+
'ssl_detected' => array(
|
2528 |
+
'callback' => 'rsssl_ssl_detected',
|
2529 |
+
'output' => array(
|
2530 |
+
'fail' => array(
|
2531 |
+
'msg' =>__('Failed activating SSL.', 'really-simple-ssl'),
|
2532 |
+
'icon' => 'success'
|
2533 |
+
),
|
2534 |
+
'no-ssl-detected' => array(
|
2535 |
+
'msg' => __('No SSL detected', 'really-simple-ssl'),
|
2536 |
+
'icon' => 'warning'
|
2537 |
+
),
|
2538 |
+
'ssl-detected' => array(
|
2539 |
+
'msg' => __('An SSL certificate was detected on your site.', 'really-simple-ssl'),
|
2540 |
+
'icon' => 'success'
|
2541 |
+
),
|
2542 |
+
),
|
2543 |
+
),
|
2544 |
+
|
2545 |
+
'check_redirect' => array(
|
2546 |
+
'callback' => 'rsssl_check_redirect',
|
2547 |
+
'output' => array(
|
2548 |
+
'htaccess-redirect-set' => array(
|
2549 |
+
'msg' =>__('301 redirect to https set: .htaccess redirect.', 'really-simple-ssl'),
|
2550 |
+
'icon' => 'success'
|
2551 |
+
),
|
2552 |
+
'301-wp-redirect' => array(
|
2553 |
+
'msg' => __('301 redirect to https set: WordPress redirect.', 'really-simple-ssl'),
|
2554 |
+
'icon' => 'success'
|
2555 |
+
),
|
2556 |
+
'wp-redirect-to-htaccess' => array(
|
2557 |
+
'msg' => __('WordPress 301 redirect enabled. We recommend to enable the .htaccess redirect option on your specific setup.', 'really-simple-ssl'),
|
2558 |
+
'icon' => 'warning',
|
2559 |
+
'plusone' => true,
|
2560 |
+
'dismissible' => true,
|
2561 |
+
),
|
2562 |
+
'no-redirect-enabled' => array(
|
2563 |
+
'msg' => __('Enable a .htaccess redirect or WordPress redirect in the settings to create a 301 redirect.', 'really-simple-ssl'),
|
2564 |
+
'icon' => 'warning'
|
2565 |
+
),
|
2566 |
+
'htaccess-not-writeable' => array(
|
2567 |
+
'msg' => __('.htaccess is not writable. Set 301 WordPress redirect, or set the .htaccess manually if you want to redirect in .htaccess.', 'really-simple-ssl'),
|
2568 |
+
'icon' => 'warning'
|
2569 |
+
),
|
2570 |
+
'htaccess-cannot-be-set' => array(
|
2571 |
+
'msg' => __('Https redirect cannot be set in the .htaccess. Set the .htaccess redirect manually or enable WordPress redirect in the settings.', 'really-simple-ssl'),
|
2572 |
+
'icon' => 'warning'
|
2573 |
+
),
|
2574 |
+
'default' => array(
|
2575 |
+
'msg' => __('No 301 redirect is set. Enable the WordPress 301 redirect in the settings to get a 301 permanent redirect.', 'really-simple-ssl'),
|
2576 |
+
'icon' => 'warning'
|
2577 |
+
),
|
2578 |
+
),
|
2579 |
+
),
|
2580 |
+
|
2581 |
+
'hsts_enabled' => array(
|
2582 |
+
'callback' => 'rsssl_hsts_enabled',
|
2583 |
+
'output' => array(
|
2584 |
+
'contains-hsts' => array(
|
2585 |
+
'msg' =>__('HTTP Strict Transport Security was enabled.', 'really-simple-ssl'),
|
2586 |
+
'icon' => 'success'
|
2587 |
+
),
|
2588 |
+
'no-hsts' => array(
|
2589 |
+
'msg' => sprintf(__('%sHTTP Strict Transport Security%s is not enabled %s(premium)%s', "really-simple-ssl"), '<a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security" target="_blank">', '</a>', '<a target="_blank" href="' . $this->pro_url . '">', '</a>'),
|
2590 |
+
'icon' => 'warning'
|
2591 |
+
),
|
2592 |
+
),
|
2593 |
+
),
|
2594 |
+
|
2595 |
+
'secure_cookies_set' => array(
|
2596 |
+
'callback' => 'rsssl_secure_cookies_set',
|
2597 |
+
'output' => array(
|
2598 |
+
'set' => array(
|
2599 |
+
'msg' =>__('Secure cookies set', 'really-simple-ssl'),
|
2600 |
+
'icon' => 'success'
|
2601 |
+
),
|
2602 |
+
'not-set' => array(
|
2603 |
+
'msg' => sprintf(__("Secure cookie settings not enabled (%spremium%s) ", "really-simple-ssl"), '<a target="_blank" href="' . $this->pro_url .'">', '</a>'),
|
2604 |
+
'icon' => 'warning'
|
2605 |
+
),
|
2606 |
+
),
|
2607 |
+
),
|
2608 |
+
|
2609 |
+
'mixed_content_scan' => array(
|
2610 |
+
'callback' => 'rsssl_scan_upsell',
|
2611 |
+
'output' => array(
|
2612 |
+
'upsell' => array(
|
2613 |
+
'msg' => sprintf(__("No mixed content scan performed (%spremium%s) ", "really-simple-ssl"), '<a target="_blank" href="' . $this->pro_url .'">', '</a>'),
|
2614 |
+
'icon' => 'warning'
|
2615 |
+
),
|
2616 |
+
),
|
2617 |
+
),
|
2618 |
+
);
|
2619 |
+
|
2620 |
+
$notices = apply_filters('rsssl_notices', $notices);
|
2621 |
+
foreach ($notices as $id => $notice) {
|
2622 |
+
$notices[$id] = wp_parse_args($notice, $defaults);
|
2623 |
+
}
|
2624 |
+
|
2625 |
+
return $notices;
|
2626 |
+
}
|
2627 |
+
|
2628 |
+
// $notices['check-redirect'] = array()
|
2629 |
+
|
2630 |
+
private function notice_row($id, $notice){
|
2631 |
+
if (!current_user_can('manage_options')) return;
|
2632 |
+
|
2633 |
+
//check condition
|
2634 |
+
if (!empty($notice['condition']) ) {
|
2635 |
+
$condition_functions = $notice['condition'];
|
2636 |
+
|
2637 |
+
foreach ($condition_functions as $func) {
|
2638 |
+
$condition = $func();
|
2639 |
+
if (!$condition) return;
|
2640 |
+
}
|
2641 |
+
}
|
2642 |
+
|
2643 |
+
$func = $notice['callback'];
|
2644 |
+
$output = $func();
|
2645 |
+
|
2646 |
+
if (!isset($notice['output'][$output])) {
|
2647 |
+
error_log('Output index not set');
|
2648 |
+
return;
|
2649 |
+
}
|
2650 |
+
|
2651 |
+
$msg = $notice['output'][$output]['msg'];
|
2652 |
+
$icon_type = $notice['output'][$output]['icon'];
|
2653 |
+
|
2654 |
+
if (get_option("rsssl_".$id."_dismissed")) return;
|
2655 |
+
|
2656 |
+
//call_user_func_array(array($classInstance, $methodName), $arg1, $arg2, $arg3);
|
2657 |
+
$icon = $this->img($icon_type);
|
2658 |
+
$dismiss = (isset($notice['output'][$output]['dismissible']) && $notice['output'][$output]['dismissible']) ? $this->rsssl_dismiss_button() : '';
|
2659 |
+
|
2660 |
+
?>
|
2661 |
+
<tr>
|
2662 |
+
<td><?php echo $icon?></td><td class="rsssl-table-td-main-content"><?php echo $msg?></td>
|
2663 |
+
<td class="rsssl-dashboard-dismiss" data-dismiss_type="<?php echo $id?>"><?php echo $dismiss?></td>
|
2664 |
+
</tr>
|
2665 |
+
|
2666 |
+
<?php
|
2667 |
+
}
|
2668 |
+
|
2669 |
+
public function reset_plusone_cache(){
|
2670 |
+
delete_transient('rsssl_plusone_count');
|
2671 |
+
}
|
2672 |
+
|
2673 |
+
public function count_plusones(){
|
2674 |
+
if (!current_user_can('manage_options')) return 0;
|
2675 |
+
|
2676 |
+
$count = get_transient('rsssl_plusone_count');
|
2677 |
+
if (!$count) {
|
2678 |
+
$count = 0;
|
2679 |
+
|
2680 |
+
$notices = $this->get_notices_list();
|
2681 |
+
foreach ($notices as $id => $notice) {
|
2682 |
+
|
2683 |
+
if (get_option("rsssl_".$id."_dismissed")) continue;
|
2684 |
+
|
2685 |
+
$condition_functions = $notice['condition'];
|
2686 |
+
foreach ($condition_functions as $func) {
|
2687 |
+
$condition = $func();
|
2688 |
+
if (!$condition) continue;
|
2689 |
+
}
|
2690 |
+
|
2691 |
+
$func = $notice['callback'];
|
2692 |
+
$output = $func();
|
2693 |
+
$success = ($notice['output'][$output]['icon'] === 'success') ? true : false;
|
2694 |
+
|
2695 |
+
//&& notice not dismissed
|
2696 |
+
if (!$success && isset($notice['output'][$output]['plusone']) && $notice['output'][$output]['plusone']) {
|
2697 |
+
$count++;
|
2698 |
+
}
|
2699 |
+
|
2700 |
+
//Check if there's an existing count after the Settings item
|
2701 |
+
$existing_count = $this->get_existing_settings_plusones();
|
2702 |
+
|
2703 |
+
$count = $count + $existing_count;
|
2704 |
+
|
2705 |
+
}
|
2706 |
+
set_transient('rsssl_plusone_count', $count, 'WEEK_IN_SECONDS');
|
2707 |
+
}
|
2708 |
+
|
2709 |
+
return $count;
|
2710 |
+
|
2711 |
+
}
|
2712 |
+
|
2713 |
+
|
2714 |
/**
|
2715 |
* Build the settings page
|
2716 |
*
|
2720 |
*
|
2721 |
*/
|
2722 |
|
2723 |
+
|
2724 |
public function settings_page()
|
2725 |
{
|
2726 |
if (!current_user_can($this->capability)) return;
|
2727 |
|
2728 |
+
add_action('admin_print_footer_scripts', array($this, 'insert_dismiss_settings_script'));
|
2729 |
+
|
2730 |
if (isset ($_GET['tab'])) $this->admin_tabs($_GET['tab']); else $this->admin_tabs('configuration');
|
2731 |
if (isset ($_GET['tab'])) $tab = $_GET['tab']; else $tab = 'configuration';
|
2732 |
|
2735 |
<div class="rsssl-main"><?php
|
2736 |
|
2737 |
switch ($tab) {
|
2738 |
+
case 'configuration' :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2739 |
|
2740 |
+
/*
|
2741 |
+
First tab, configuration
|
2742 |
+
*/
|
2743 |
+
?>
|
2744 |
+
<h2><?php echo __("Detected setup", "really-simple-ssl"); ?></h2>
|
2745 |
+
<table class="really-simple-ssl-table">
|
2746 |
+
<thead></thead>
|
2747 |
+
<tbody>
|
2748 |
+
<?php
|
2749 |
+
|
2750 |
+
$this->reset_plusone_cache();
|
2751 |
+
$notices = $this->get_notices_list();
|
2752 |
+
foreach ($notices as $id => $notice) {
|
2753 |
+
$this->notice_row($id, $notice);
|
2754 |
+
}
|
2755 |
+
|
2756 |
+
if (!$this->ssl_enabled) {
|
2757 |
+
$this->show_enable_ssl_button();
|
2758 |
+
}
|
2759 |
+
|
2760 |
+
?>
|
2761 |
+
</tbody>
|
2762 |
+
</table>
|
2763 |
+
|
2764 |
+
<?php do_action("rsssl_configuration_page"); ?>
|
2765 |
+
|
2766 |
+
<?php
|
2767 |
+
break;
|
2768 |
case 'settings' :
|
2769 |
/*
|
2770 |
Second tab, Settings
|
2785 |
|
2786 |
case 'debug' :
|
2787 |
/*
|
2788 |
+
third tab: debug
|
2789 |
+
*/
|
2790 |
?>
|
2791 |
<div>
|
2792 |
<?php
|
2821 |
</div>
|
2822 |
<?php
|
2823 |
break;
|
2824 |
+
default:
|
2825 |
+
echo '';
|
2826 |
}
|
2827 |
//possibility to hook into the tabs.
|
2828 |
do_action("show_tab_{$tab}");
|
2879 |
);
|
2880 |
$this->get_banner_html(array(
|
2881 |
'img' => 'complianz.jpg',
|
2882 |
+
'title' => 'Complianz',
|
2883 |
'description' => __("The Complianz Privacy Suite (GDPR/CaCPA) for WordPress. Simple, Quick and Complete. Up-to-date customized legal documents by a prominent IT Law firm.", "really-simple-ssl"),
|
2884 |
'url' => 'https://wordpress.org/plugins/complianz-gdpr/',
|
2885 |
'pro' => true,
|
2886 |
)
|
2887 |
);
|
2888 |
|
2889 |
+
if (!defined("ZRDN_PLUGIN_DIRECTORY")) {
|
2890 |
+
$this->get_banner_html(array(
|
2891 |
+
'img' => 'ziprecipes.png',
|
2892 |
+
'title' => 'Zip Recipes',
|
2893 |
+
'description' => __("Create beautiful SEO friendly recipe cards for your recipes with Zip Recipes.", "really-simple-ssl"),
|
2894 |
+
'url' => 'https://wordpress.org/plugins/zip-recipes/',
|
2895 |
+
)
|
2896 |
+
);
|
2897 |
+
}
|
2898 |
+
|
2899 |
if (defined("ultimatemember_version")) {
|
2900 |
|
2901 |
if (!defined("um_tagging_version")) {
|
2908 |
)
|
2909 |
);
|
2910 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2911 |
}
|
2912 |
|
2913 |
if (defined("EDD_SL_PLUGIN_DIR") && (get_locale() === 'nl_NL')) {
|
2964 |
}
|
2965 |
}
|
2966 |
|
2967 |
+
/**
|
2968 |
+
*
|
2969 |
+
* Add a dismiss button which will dismiss the nearest <tr>. Used on 'Configuration' dashboard page
|
2970 |
+
*
|
2971 |
+
* @since 3.1.6
|
2972 |
+
*
|
2973 |
+
*/
|
2974 |
+
|
2975 |
+
public function rsssl_dismiss_button()
|
2976 |
+
{
|
2977 |
+
return '<button type="button" class="close">
|
2978 |
+
<span class="rsssl-close-warning">X</span>
|
2979 |
+
</button>';
|
2980 |
+
|
2981 |
+
}
|
2982 |
+
|
2983 |
+
/**
|
2984 |
+
* @param $args
|
2985 |
+
*
|
2986 |
+
* @since 3.0
|
2987 |
+
*
|
2988 |
+
* Generate the HTML for the settings page sidebar
|
2989 |
+
*
|
2990 |
+
*/
|
2991 |
|
2992 |
private function get_banner_html($args)
|
2993 |
{
|
3036 |
wp_enqueue_style('rlrsssl-css');
|
3037 |
}
|
3038 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3039 |
/**
|
3040 |
* Create the settings page form
|
3041 |
*
|
3069 |
add_settings_field('id_do_not_edit_htaccess', __("Stop editing the .htaccess file", "really-simple-ssl"), array($this, 'get_option_do_not_edit_htaccess'), 'rlrsssl', 'rlrsssl_settings');
|
3070 |
}
|
3071 |
|
3072 |
+
add_settings_field('id_switch_mixed_content_fixer_hook', __("Use alternative method to fix mixed content", "really-simple-ssl"), array($this, 'get_option_switch_mixed_content_fixer_hook'), 'rlrsssl', 'rlrsssl_settings');
|
3073 |
|
3074 |
add_settings_field('id_deactivate_keep_ssl', __("Deactivate plugin and keep SSL", "really-simple-ssl"), array($this, 'get_option_deactivate_keep_ssl'), 'rlrsssl', 'rlrsssl_settings');
|
3075 |
|
3375 |
RSSSL()->rsssl_help->get_help_tip(__("If this option is set to true, the mixed content fixer will fire on the init hook instead of the template_redirect hook. Only use this option when you experience problems with the mixed content fixer.", "really-simple-ssl"));
|
3376 |
}
|
3377 |
|
3378 |
+
/**
|
3379 |
*
|
3380 |
+
* Add a button and thickbox to deactivate the plugin while keeping SSL
|
3381 |
*
|
3382 |
+
* @since 3.0
|
3383 |
*
|
3384 |
+
* @access public
|
3385 |
*
|
3386 |
*/
|
3387 |
|
3651 |
}
|
3652 |
|
3653 |
} //class closure
|
3654 |
+
|
3655 |
+
/**
|
3656 |
+
* Wrapper function for mixed_content_fixer_detected()
|
3657 |
+
* @return string
|
3658 |
+
*/
|
3659 |
+
|
3660 |
+
function rsssl_mixed_content_fixer_detected(){
|
3661 |
+
return RSSSL()->really_simple_ssl->mixed_content_fixer_detected();
|
3662 |
+
}
|
3663 |
+
|
3664 |
+
function rsssl_site_has_ssl(){
|
3665 |
+
return RSSSL()->really_simple_ssl->site_has_ssl;
|
3666 |
+
}
|
3667 |
+
|
3668 |
+
function rsssl_autoreplace_insecure_links(){
|
3669 |
+
return RSSSL()->really_simple_ssl->autoreplace_insecure_links;
|
3670 |
+
}
|
3671 |
+
|
3672 |
+
function rsssl_ssl_enabled(){
|
3673 |
+
return RSSSL()->really_simple_ssl->ssl_enabled;
|
3674 |
+
}
|
3675 |
+
|
3676 |
+
function rsssl_ssl_detected(){
|
3677 |
+
if (!RSSSL()->really_simple_ssl->wpconfig_ok()) {
|
3678 |
+
return 'fail';
|
3679 |
+
} elseif (!RSSSL()->really_simple_ssl->site_has_ssl) {
|
3680 |
+
return 'no-ssl-detected';
|
3681 |
+
} else {
|
3682 |
+
return 'ssl-detected';
|
3683 |
+
}
|
3684 |
+
|
3685 |
+
return false;
|
3686 |
+
}
|
3687 |
+
|
3688 |
+
function rsssl_check_redirect(){
|
3689 |
+
if (RSSSL()->really_simple_ssl->has_301_redirect() && RSSSL()->rsssl_server->uses_htaccess() && RSSSL()->really_simple_ssl->htaccess_contains_redirect_rules()) {
|
3690 |
+
return 'htaccess-redirect-set';
|
3691 |
+
}
|
3692 |
+
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) {
|
3693 |
+
return 'wp-redirect-to-htaccess';
|
3694 |
+
}
|
3695 |
+
if (RSSSL()->really_simple_ssl->has_301_redirect() && RSSSL()->really_simple_ssl->wp_redirect) {
|
3696 |
+
return '301-wp-redirect';
|
3697 |
+
} elseif (RSSSL()->rsssl_server->uses_htaccess() && (!is_multisite() || !RSSSL()->rsssl_multisite->is_per_site_activated_multisite_subfolder_install())) {
|
3698 |
+
if (is_writable(RSSSL()->really_simple_ssl->htaccess_file())) {
|
3699 |
+
return 'no-redirect-enabled';
|
3700 |
+
} elseif (!is_writable(RSSSL()->really_simple_ssl->htaccess_file())) {
|
3701 |
+
return 'htaccess-not-writeable';
|
3702 |
+
} else {
|
3703 |
+
return 'htaccess-cannot-be-set';
|
3704 |
+
}
|
3705 |
+
} else {
|
3706 |
+
return 'default';
|
3707 |
+
}
|
3708 |
+
}
|
3709 |
+
|
3710 |
+
function rsssl_hsts_enabled()
|
3711 |
+
{
|
3712 |
+
if (RSSSL()->really_simple_ssl->contains_hsts()) {
|
3713 |
+
return 'contains-hsts';
|
3714 |
+
} else {
|
3715 |
+
return 'no-hsts';
|
3716 |
+
}
|
3717 |
+
}
|
3718 |
+
|
3719 |
+
function rsssl_secure_cookies_set()
|
3720 |
+
{
|
3721 |
+
if (RSSSL()->really_simple_ssl->contains_secure_cookie_settings()) {
|
3722 |
+
return 'set';
|
3723 |
+
} else {
|
3724 |
+
return 'not-set';
|
3725 |
+
}
|
3726 |
+
}
|
3727 |
+
|
3728 |
+
function rsssl_scan_upsell()
|
3729 |
+
{
|
3730 |
+
return 'upsell';
|
3731 |
+
}
|
class-multisite.php
CHANGED
@@ -60,9 +60,15 @@ if (!class_exists('rsssl_multisite')) {
|
|
60 |
add_action('wp_ajax_rsssl_pro_dismiss_pro_option_notice', array($this, 'dismiss_pro_option_notice'));
|
61 |
add_action("network_admin_notices", array($this, 'show_pro_option_notice'));
|
62 |
add_action("rsssl_show_network_tab_settings", array($this, 'settings_tab'));
|
63 |
-
add_action('wpmu_new_blog', array($this, 'maybe_activate_ssl_in_new_blog'), 10, 6);
|
64 |
|
65 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
|
68 |
}
|
@@ -79,8 +85,9 @@ if (!class_exists('rsssl_multisite')) {
|
|
79 |
|
80 |
*/
|
81 |
|
82 |
-
public function
|
83 |
{
|
|
|
84 |
if ($this->ssl_enabled_networkwide) {
|
85 |
$site = get_blog_details($blog_id);
|
86 |
$this->switch_to_blog_bw_compatible($site);
|
@@ -89,10 +96,26 @@ if (!class_exists('rsssl_multisite')) {
|
|
89 |
}
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
public function networkwide_choice_notice()
|
94 |
{
|
95 |
-
|
96 |
if ($this->plugin_network_wide_active() && !$this->selected_networkwide_or_per_site) {
|
97 |
add_action('network_admin_notices', array($this, 'show_notice_activate_networkwide'), 10);
|
98 |
}
|
@@ -116,12 +139,13 @@ if (!class_exists('rsssl_multisite')) {
|
|
116 |
|
117 |
|
118 |
/**
|
|
|
|
|
119 |
* On plugin activation, we can check if it is networkwide or not.
|
120 |
*
|
121 |
* @since 2.1
|
122 |
*
|
123 |
* @access public
|
124 |
-
*
|
125 |
*/
|
126 |
|
127 |
public function activate($networkwide)
|
@@ -277,7 +301,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
277 |
|
278 |
|
279 |
/**
|
280 |
-
* Give the user an option to activate
|
281 |
* Needs to be called after detect_configuration function
|
282 |
*
|
283 |
* @since 2.3
|
@@ -295,7 +319,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
295 |
//if no SSL was detected, don't activate it yet.
|
296 |
|
297 |
if (!RSSSL()->really_simple_ssl->site_has_ssl) {
|
298 |
-
$current_url = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]
|
299 |
?>
|
300 |
<div id="message" class="error notice activate-ssl">
|
301 |
<p><?php _e("No SSL was detected. If you do have an SSL certificate, try to reload this page over https by clicking this link:", "really-simple-ssl"); ?>
|
@@ -382,7 +406,6 @@ if (!class_exists('rsssl_multisite')) {
|
|
382 |
|
383 |
if (!$this->plugin_network_wide_active()) return;
|
384 |
|
385 |
-
|
386 |
if (isset($_POST['rsssl_do_activate_ssl_networkwide'])) {
|
387 |
|
388 |
$this->selected_networkwide_or_per_site = true;
|
@@ -391,8 +414,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
391 |
$this->save_options();
|
392 |
|
393 |
//enable SSL on all sites on the network
|
394 |
-
|
395 |
-
//$this->activate_ssl_networkwide();
|
396 |
|
397 |
}
|
398 |
|
@@ -452,6 +474,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
452 |
}
|
453 |
|
454 |
update_site_option('rsssl_run', false);
|
|
|
455 |
}
|
456 |
|
457 |
public function get_process_completed_percentage(){
|
@@ -469,6 +492,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
469 |
|
470 |
public function end_ssl_activation(){
|
471 |
update_site_option('rsssl_ssl_activation_active', false);
|
|
|
472 |
}
|
473 |
|
474 |
public function start_ssl_deactivation(){
|
@@ -478,6 +502,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
478 |
|
479 |
public function end_ssl_deactivation(){
|
480 |
update_site_option('rsssl_ssl_deactivation_active', false);
|
|
|
481 |
}
|
482 |
|
483 |
public function deactivate_ssl_networkwide(){
|
@@ -706,6 +731,27 @@ if (!class_exists('rsssl_multisite')) {
|
|
706 |
return false;
|
707 |
}
|
708 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
/**
|
710 |
* Show notices
|
711 |
*
|
@@ -728,7 +774,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
728 |
<?php _e("Major security issue!", "really-simple-ssl"); ?>
|
729 |
</h1>
|
730 |
<p>
|
731 |
-
<?php _e("The 'force-deactivate.php' file has to be renamed to .txt. Otherwise your ssl can be
|
732 |
</p>
|
733 |
<a href="options-general.php?page=rlrsssl_really_simple_ssl"><?php echo __("Check again", "really-simple-ssl"); ?></a>
|
734 |
</div>
|
@@ -737,15 +783,26 @@ if (!class_exists('rsssl_multisite')) {
|
|
737 |
|
738 |
/*
|
739 |
* ssl switch for sites processing active
|
740 |
-
|
741 |
|
742 |
if ($this->ssl_process_active()) {
|
743 |
?>
|
744 |
<div id="message" class="error notice is-dismissible rlrsssl-fail">
|
745 |
<p>
|
746 |
-
<?php printf(__("Conversion of websites %s percent complete.", "really-simple-ssl"), $this->get_process_completed_percentage()); ?>
|
747 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
748 |
<?php _e("You have just started enabling or disabling SSL on multiple websites at once, and this process is not completed yet. Please refresh this page to check if the process has finished. It will proceed in the background.", "really-simple-ssl"); ?>
|
|
|
|
|
749 |
</p>
|
750 |
</div>
|
751 |
<?php
|
@@ -767,6 +824,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
767 |
else
|
768 |
_e("SSL was activated per site.", "really-simple-ssl");
|
769 |
?>
|
|
|
770 |
<?php _e("Don't forget to change your settings in Google Analytics and Webmaster tools.", "really-simple-ssl"); ?>
|
771 |
|
772 |
<a target="_blank"
|
@@ -875,26 +933,34 @@ if (!class_exists('rsssl_multisite')) {
|
|
875 |
|
876 |
public function dismiss_success_message_callback()
|
877 |
{
|
|
|
|
|
|
|
878 |
update_site_option("rsssl_success_message_shown", true);
|
879 |
wp_die();
|
880 |
}
|
881 |
|
882 |
-
|
883 |
public function dismiss_pro_option_notice()
|
884 |
{
|
885 |
-
|
|
|
|
|
886 |
update_option('rsssl_pro_pro_option_notice_dismissed', true);
|
887 |
wp_die();
|
888 |
}
|
889 |
|
890 |
public function dismiss_wildcard_message_callback()
|
891 |
{
|
|
|
|
|
|
|
892 |
update_site_option("rsssl_wildcard_message_shown", true);
|
893 |
wp_die();
|
894 |
}
|
895 |
|
896 |
public function dismiss_pro_option_script()
|
897 |
{
|
|
|
898 |
$ajax_nonce = wp_create_nonce("rsssl-pro-dismiss-pro-option-notice");
|
899 |
?>
|
900 |
<script type='text/javascript'>
|
@@ -903,7 +969,7 @@ if (!class_exists('rsssl_multisite')) {
|
|
903 |
$(".rsssl-pro-dismiss-notice.notice.is-dismissible").on("click", ".notice-dismiss", function (event) {
|
904 |
var data = {
|
905 |
'action': 'rsssl_pro_dismiss_pro_option_notice',
|
906 |
-
'
|
907 |
};
|
908 |
|
909 |
$.post(ajaxurl, data, function (response) {
|
@@ -925,11 +991,13 @@ if (!class_exists('rsssl_multisite')) {
|
|
925 |
if (!$this->is_settings_page()) return;
|
926 |
|
927 |
$dismissed = get_option('rsssl_pro_pro_option_notice_dismissed');
|
|
|
928 |
if (!$dismissed) {
|
929 |
|
|
|
|
|
930 |
if (defined('rsssl_pro_version')) {
|
931 |
if (!defined('rsssl_pro_ms_version')) {
|
932 |
-
add_action('admin_print_footer_scripts', array($this, 'dismiss_pro_option_script'));
|
933 |
?>
|
934 |
<div id="message" class="updated notice is-dismissible rsssl-pro-dismiss-notice">
|
935 |
<p>
|
60 |
add_action('wp_ajax_rsssl_pro_dismiss_pro_option_notice', array($this, 'dismiss_pro_option_notice'));
|
61 |
add_action("network_admin_notices", array($this, 'show_pro_option_notice'));
|
62 |
add_action("rsssl_show_network_tab_settings", array($this, 'settings_tab'));
|
|
|
63 |
|
64 |
+
//If WP version is 5.1 or higher, use wp_insert_site hook for multisite SSL activation in new blogs
|
65 |
+
//if(version_compare(get_bloginfo('version'),'5.1', '>=') ) {
|
66 |
+
// add_action('wp_insert_site', array($this, 'maybe_activate_ssl_in_new_blog'), 20, 1);
|
67 |
+
//} else {
|
68 |
+
add_action('wpmu_new_blog', array($this, 'maybe_activate_ssl_in_new_blog_deprecated'), 10, 6);
|
69 |
+
//}
|
70 |
+
//Listen for run_ssl_process hook switch
|
71 |
+
add_action('admin_init', array($this, 'listen_for_ssl_conversion_hook_switch'), 40);
|
72 |
|
73 |
|
74 |
}
|
85 |
|
86 |
*/
|
87 |
|
88 |
+
public function maybe_activate_ssl_in_new_blog_deprecated($blog_id, $user_id=false, $domain=false, $path=false, $site_id=false, $meta=false)
|
89 |
{
|
90 |
+
|
91 |
if ($this->ssl_enabled_networkwide) {
|
92 |
$site = get_blog_details($blog_id);
|
93 |
$this->switch_to_blog_bw_compatible($site);
|
96 |
}
|
97 |
}
|
98 |
|
99 |
+
/**
|
100 |
+
* Activate SSl in new block
|
101 |
+
* @since 3.1.6
|
102 |
+
* @param $new_site
|
103 |
+
* @return void
|
104 |
+
*/
|
105 |
+
|
106 |
+
// public function maybe_activate_ssl_in_new_blog($site)
|
107 |
+
// {
|
108 |
+
//
|
109 |
+
// if ($this->ssl_enabled_networkwide) {
|
110 |
+
// $this->switch_to_blog_bw_compatible($site);
|
111 |
+
// RSSSL()->really_simple_ssl->activate_ssl();
|
112 |
+
// restore_current_blog(); //switches back to previous blog, not current, so we have to do it each loop
|
113 |
+
// }
|
114 |
+
// }
|
115 |
+
|
116 |
|
117 |
public function networkwide_choice_notice()
|
118 |
{
|
|
|
119 |
if ($this->plugin_network_wide_active() && !$this->selected_networkwide_or_per_site) {
|
120 |
add_action('network_admin_notices', array($this, 'show_notice_activate_networkwide'), 10);
|
121 |
}
|
139 |
|
140 |
|
141 |
/**
|
142 |
+
* @param $networkwide
|
143 |
+
*
|
144 |
* On plugin activation, we can check if it is networkwide or not.
|
145 |
*
|
146 |
* @since 2.1
|
147 |
*
|
148 |
* @access public
|
|
|
149 |
*/
|
150 |
|
151 |
public function activate($networkwide)
|
301 |
|
302 |
|
303 |
/**
|
304 |
+
* Give the user an option to activate networkwide or not.
|
305 |
* Needs to be called after detect_configuration function
|
306 |
*
|
307 |
* @since 2.3
|
319 |
//if no SSL was detected, don't activate it yet.
|
320 |
|
321 |
if (!RSSSL()->really_simple_ssl->site_has_ssl) {
|
322 |
+
$current_url = esc_url_raw("https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
|
323 |
?>
|
324 |
<div id="message" class="error notice activate-ssl">
|
325 |
<p><?php _e("No SSL was detected. If you do have an SSL certificate, try to reload this page over https by clicking this link:", "really-simple-ssl"); ?>
|
406 |
|
407 |
if (!$this->plugin_network_wide_active()) return;
|
408 |
|
|
|
409 |
if (isset($_POST['rsssl_do_activate_ssl_networkwide'])) {
|
410 |
|
411 |
$this->selected_networkwide_or_per_site = true;
|
414 |
$this->save_options();
|
415 |
|
416 |
//enable SSL on all sites on the network
|
417 |
+
$this->start_ssl_activation();
|
|
|
418 |
|
419 |
}
|
420 |
|
474 |
}
|
475 |
|
476 |
update_site_option('rsssl_run', false);
|
477 |
+
|
478 |
}
|
479 |
|
480 |
public function get_process_completed_percentage(){
|
492 |
|
493 |
public function end_ssl_activation(){
|
494 |
update_site_option('rsssl_ssl_activation_active', false);
|
495 |
+
update_site_option('run_ssl_process_hook_switched', false);
|
496 |
}
|
497 |
|
498 |
public function start_ssl_deactivation(){
|
502 |
|
503 |
public function end_ssl_deactivation(){
|
504 |
update_site_option('rsssl_ssl_deactivation_active', false);
|
505 |
+
update_site_option('run_ssl_process_hook_switched', false);
|
506 |
}
|
507 |
|
508 |
public function deactivate_ssl_networkwide(){
|
731 |
return false;
|
732 |
}
|
733 |
|
734 |
+
/**
|
735 |
+
*
|
736 |
+
* Sometimes conversion of websites hangs on 0%. If user clicks the link, the hook where run_ssl_process (multisite-cron.php)
|
737 |
+
* fires on will be switched to admin_init
|
738 |
+
*
|
739 |
+
*/
|
740 |
+
|
741 |
+
public function listen_for_ssl_conversion_hook_switch()
|
742 |
+
{
|
743 |
+
//check if we are on ssl settings page
|
744 |
+
if (!$this->is_settings_page()) return;
|
745 |
+
//check user role
|
746 |
+
if (!current_user_can('manage_options')) return;
|
747 |
+
//check nonce
|
748 |
+
if (!isset($_GET['token']) || (!wp_verify_nonce($_GET['token'], 'run_ssl_to_admin_init'))) return;
|
749 |
+
//check for action
|
750 |
+
if (isset($_GET["action"]) && $_GET["action"] == 'ssl_conversion_hook_switch') {
|
751 |
+
update_site_option('run_ssl_process_hook_switched', true);
|
752 |
+
}
|
753 |
+
}
|
754 |
+
|
755 |
/**
|
756 |
* Show notices
|
757 |
*
|
774 |
<?php _e("Major security issue!", "really-simple-ssl"); ?>
|
775 |
</h1>
|
776 |
<p>
|
777 |
+
<?php _e("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"); ?>
|
778 |
</p>
|
779 |
<a href="options-general.php?page=rlrsssl_really_simple_ssl"><?php echo __("Check again", "really-simple-ssl"); ?></a>
|
780 |
</div>
|
783 |
|
784 |
/*
|
785 |
* ssl switch for sites processing active
|
786 |
+
*/
|
787 |
|
788 |
if ($this->ssl_process_active()) {
|
789 |
?>
|
790 |
<div id="message" class="error notice is-dismissible rlrsssl-fail">
|
791 |
<p>
|
|
|
792 |
|
793 |
+
<?php
|
794 |
+
//In some cases the rsssl_ssl_process_hook hook can fail. Therefore we offer the option to switch the hook to admin_init when the conversion is stuck.
|
795 |
+
$token = wp_create_nonce('run_ssl_to_admin_init');
|
796 |
+
$run_ssl_process_hook_switch_link = network_admin_url("settings.php?page=really-simple-ssl&action=ssl_conversion_hook_switch&token=" . $token);
|
797 |
+
|
798 |
+
$link_open = '<a target="_self" href="' . $run_ssl_process_hook_switch_link . '">';
|
799 |
+
$link_close = '</a>';
|
800 |
+
?>
|
801 |
+
|
802 |
+
<?php printf(__("Conversion of websites %s percent complete.", "really-simple-ssl"), $this->get_process_completed_percentage()); ?>
|
803 |
<?php _e("You have just started enabling or disabling SSL on multiple websites at once, and this process is not completed yet. Please refresh this page to check if the process has finished. It will proceed in the background.", "really-simple-ssl"); ?>
|
804 |
+
<?php printf(__("If the conversion does not proceed after a few minutes, click %shere%s to force the conversion process.", "really-simple-ssl"), $link_open, $link_close); ?>
|
805 |
+
|
806 |
</p>
|
807 |
</div>
|
808 |
<?php
|
824 |
else
|
825 |
_e("SSL was activated per site.", "really-simple-ssl");
|
826 |
?>
|
827 |
+
|
828 |
<?php _e("Don't forget to change your settings in Google Analytics and Webmaster tools.", "really-simple-ssl"); ?>
|
829 |
|
830 |
<a target="_blank"
|
933 |
|
934 |
public function dismiss_success_message_callback()
|
935 |
{
|
936 |
+
if (!current_user_can($this->capability) ) return;
|
937 |
+
check_ajax_referer('really-simple-ssl-dismiss', 'security');
|
938 |
+
|
939 |
update_site_option("rsssl_success_message_shown", true);
|
940 |
wp_die();
|
941 |
}
|
942 |
|
|
|
943 |
public function dismiss_pro_option_notice()
|
944 |
{
|
945 |
+
if (!current_user_can($this->capability) ) return;
|
946 |
+
check_ajax_referer('rsssl-pro-dismiss-pro-option-notice' ,'security');
|
947 |
+
|
948 |
update_option('rsssl_pro_pro_option_notice_dismissed', true);
|
949 |
wp_die();
|
950 |
}
|
951 |
|
952 |
public function dismiss_wildcard_message_callback()
|
953 |
{
|
954 |
+
if (!current_user_can($this->capability) ) return;
|
955 |
+
check_ajax_referer('really-simple-ssl-dismiss', 'security');
|
956 |
+
|
957 |
update_site_option("rsssl_wildcard_message_shown", true);
|
958 |
wp_die();
|
959 |
}
|
960 |
|
961 |
public function dismiss_pro_option_script()
|
962 |
{
|
963 |
+
|
964 |
$ajax_nonce = wp_create_nonce("rsssl-pro-dismiss-pro-option-notice");
|
965 |
?>
|
966 |
<script type='text/javascript'>
|
969 |
$(".rsssl-pro-dismiss-notice.notice.is-dismissible").on("click", ".notice-dismiss", function (event) {
|
970 |
var data = {
|
971 |
'action': 'rsssl_pro_dismiss_pro_option_notice',
|
972 |
+
'security': '<?php echo $ajax_nonce; ?>'
|
973 |
};
|
974 |
|
975 |
$.post(ajaxurl, data, function (response) {
|
991 |
if (!$this->is_settings_page()) return;
|
992 |
|
993 |
$dismissed = get_option('rsssl_pro_pro_option_notice_dismissed');
|
994 |
+
|
995 |
if (!$dismissed) {
|
996 |
|
997 |
+
add_action('admin_print_footer_scripts', array($this, 'dismiss_pro_option_script'));
|
998 |
+
|
999 |
if (defined('rsssl_pro_version')) {
|
1000 |
if (!defined('rsssl_pro_ms_version')) {
|
|
|
1001 |
?>
|
1002 |
<div id="message" class="updated notice is-dismissible rsssl-pro-dismiss-notice">
|
1003 |
<p>
|
class-rsssl-wp-cli.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined('ABSPATH') or die("you do not have access to this page!");
|
4 |
+
|
5 |
+
class rsssl_wp_cli
|
6 |
+
{
|
7 |
+
|
8 |
+
public function __construct()
|
9 |
+
{
|
10 |
+
|
11 |
+
}
|
12 |
+
|
13 |
+
public function activate_ssl()
|
14 |
+
{
|
15 |
+
RSSSL()->really_simple_ssl->activate_ssl();
|
16 |
+
WP_CLI::success( 'SSL activated' );
|
17 |
+
|
18 |
+
}
|
19 |
+
|
20 |
+
public function deactivate_ssl()
|
21 |
+
{
|
22 |
+
RSSSL()->really_simple_ssl->deactivate_ssl();
|
23 |
+
WP_CLI::success( 'SSL deactivated' );
|
24 |
+
}
|
25 |
+
|
26 |
+
}//Class closure
|
27 |
+
|
28 |
+
WP_CLI::add_command( 'rsssl', 'rsssl_wp_cli' );
|
css/main.css
CHANGED
@@ -25,9 +25,37 @@
|
|
25 |
.activate-ssl .button {
|
26 |
margin-bottom:20px;
|
27 |
}
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
|
|
31 |
.debug-log {
|
32 |
background-color: #fff;
|
33 |
padding:15px;
|
@@ -39,6 +67,10 @@
|
|
39 |
height:15px;
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
42 |
/* rsssl-rsssl-tooltip for settings page */
|
43 |
/* Base styles for the element that has a rsssl-tooltip */
|
44 |
[data-rsssl-tooltip],
|
@@ -523,4 +555,13 @@ input:disabled + .rsssl-slider {
|
|
523 |
}
|
524 |
input:focus + .rsssl-slider {
|
525 |
box-shadow: 0 0 1px #2DAAE1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
526 |
}
|
25 |
.activate-ssl .button {
|
26 |
margin-bottom:20px;
|
27 |
}
|
28 |
+
|
29 |
+
.really-simple-ssl-table {
|
30 |
+
display: flex;
|
31 |
+
flex-direction: column;
|
32 |
+
max-width: 1140px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.rsssl-table-td-main-content {
|
36 |
+
width: 100%;
|
37 |
+
}
|
38 |
+
|
39 |
+
.really-simple-ssl-table tr:first-child {
|
40 |
+
border-top-left-radius: .55rem;
|
41 |
+
border-top-right-radius: .55rem;
|
42 |
+
}
|
43 |
+
|
44 |
+
.really-simple-ssl-table tr:last-child {
|
45 |
+
margin-bottom: 0;
|
46 |
+
border-bottom-left-radius: .55rem;
|
47 |
+
border-bottom-right-radius: .55rem;
|
48 |
+
}
|
49 |
+
|
50 |
+
.really-simple-ssl-table tr {
|
51 |
+
position: relative;
|
52 |
+
display: block;
|
53 |
+
padding: .75rem 1.25rem;
|
54 |
+
margin-bottom: -1px;
|
55 |
+
background-color: #fff;
|
56 |
+
border: 1px solid rgba(0,0,0,.125);
|
57 |
}
|
58 |
+
|
59 |
.debug-log {
|
60 |
background-color: #fff;
|
61 |
padding:15px;
|
67 |
height:15px;
|
68 |
}
|
69 |
|
70 |
+
.rsssl-update-count {
|
71 |
+
margin-left: 4px !important;
|
72 |
+
}
|
73 |
+
|
74 |
/* rsssl-rsssl-tooltip for settings page */
|
75 |
/* Base styles for the element that has a rsssl-tooltip */
|
76 |
[data-rsssl-tooltip],
|
555 |
}
|
556 |
input:focus + .rsssl-slider {
|
557 |
box-shadow: 0 0 1px #2DAAE1;
|
558 |
+
}
|
559 |
+
|
560 |
+
.debug-log {
|
561 |
+
width: 90%;
|
562 |
+
}
|
563 |
+
|
564 |
+
.rsssl-close-warning {
|
565 |
+
color: black;
|
566 |
+
font-size: 1.3em;
|
567 |
}
|
css/main.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.rsssl-notice{background-color:#fff;border-left:4px solid green;padding:1px 15px}.rsssl-main{flex:1;width:80%;float:left}.rsssl-sidebar img{max-width:100%}#message.updated.notice.activate-ssl{padding-top:10px}.activate-ssl ul,.rsssl-result ul,.rsssl_bullets{list-style-type:square;margin-left:30px}.activate-ssl .button{margin-bottom:20px}.really-simple-ssl-table
|
1 |
+
.rsssl-notice{background-color:#fff;border-left:4px solid green;padding:1px 15px}.rsssl-main{flex:1;width:80%;float:left}.rsssl-sidebar img{max-width:100%}#message.updated.notice.activate-ssl{padding-top:10px}.activate-ssl ul,.rsssl-result ul,.rsssl_bullets{list-style-type:square;margin-left:30px}.activate-ssl .button{margin-bottom:20px}.really-simple-ssl-table{display:flex;flex-direction:column;max-width:1140px}.rsssl-table-td-main-content{width:100%}.really-simple-ssl-table tr:first-child{border-top-left-radius:.55rem;border-top-right-radius:.55rem}.really-simple-ssl-table tr:last-child{margin-bottom:0;border-bottom-left-radius:.55rem;border-bottom-right-radius:.55rem}.really-simple-ssl-table tr{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.debug-log{background-color:#fff;padding:15px;border:1px solid black}.rsssl-icons{width:15px;height:15px}.rsssl-update-count{margin-left:4px !important}[data-rsssl-tooltip],.rsssl-tooltip{position:relative;cursor:pointer}[data-rsssl-tooltip]:before,[data-rsssl-tooltip]:after,.rsssl-tooltip:before,.rsssl-tooltip:after{position:absolute;visibility:hidden;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);opacity:0;-webkit-transition:opacity .2s ease-in-out,visibility .2s ease-in-out,-webkit-transform .2s cubic-bezier(0.71,1.7,0.77,1.24);-moz-transition:opacity .2s ease-in-out,visibility .2s ease-in-out,-moz-transform .2s cubic-bezier(0.71,1.7,0.77,1.24);transition:opacity .2s ease-in-out,visibility .2s ease-in-out,transform .2s cubic-bezier(0.71,1.7,0.77,1.24);-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);pointer-events:none}[data-rsssl-tooltip]:hover:before,[data-rsssl-tooltip]:hover:after,[data-rsssl-tooltip]:focus:before,[data-rsssl-tooltip]:focus:after,.rsssl-tooltip:hover:before,.rsssl-tooltip:hover:after,.rsssl-tooltip:focus:before,.rsssl-tooltip:focus:after{visibility:visible;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100);opacity:1}.rsssl-tooltip:before,[data-rsssl-tooltip]:before{z-index:1001;border:6px solid transparent;background:transparent;content:""}.rsssl-tooltip:after,[data-rsssl-tooltip]:after{z-index:1000;padding:8px;width:160px;background-color:#000;background-color:hsla(0,0,20%,0.9);color:#fff;content:attr(data-rsssl-tooltip);font-size:14px;line-height:1.2}[data-rsssl-tooltip]:before,[data-rsssl-tooltip]:after,.rsssl-tooltip:before,.rsssl-tooltip:after,.rsssl-tooltip-top:before,.rsssl-tooltip-top:after{bottom:100%;left:50%}[data-rsssl-tooltip]:before,.rsssl-tooltip:before,.rsssl-tooltip-top:before{margin-left:-6px;margin-bottom:-12px;border-top-color:#000;border-top-color:hsla(0,0,20%,0.9)}[data-rsssl-tooltip]:after,.rsssl-tooltip:after,.rsssl-tooltip-top:after{margin-left:-80px}[data-rsssl-tooltip]:hover:before,[data-rsssl-tooltip]:hover:after,[data-rsssl-tooltip]:focus:before,[data-rsssl-tooltip]:focus:after,.rsssl-tooltip:hover:before,.rsssl-tooltip:hover:after,.rsssl-tooltip:focus:before,.rsssl-tooltip:focus:after,.rsssl-tooltip-top:hover:before,.rsssl-tooltip-top:hover:after,.rsssl-tooltip-top:focus:before,.rsssl-tooltip-top:focus:after{-webkit-transform:translateY(-12px);-moz-transform:translateY(-12px);transform:translateY(-12px)}.rsssl-tooltip-left:before,.rsssl-tooltip-left:after{right:100%;bottom:50%;left:auto}.rsssl-tooltip-left:before{margin-left:0;margin-right:-12px;margin-bottom:0;border-top-color:transparent;border-left-color:#000;border-left-color:hsla(0,0,20%,0.9)}.rsssl-tooltip-left:hover:before,.rsssl-tooltip-left:hover:after,.rsssl-tooltip-left:focus:before,.rsssl-tooltip-left:focus:after{-webkit-transform:translateX(-12px);-moz-transform:translateX(-12px);transform:translateX(-12px)}.rsssl-tooltip-bottom:before,.rsssl-tooltip-bottom:after{top:100%;bottom:auto;left:50%}.rsssl-tooltip-bottom:before{margin-top:-12px;margin-bottom:0;border-top-color:transparent;border-bottom-color:#000;border-bottom-color:hsla(0,0,20%,0.9)}.rsssl-tooltip-bottom:hover:before,.rsssl-tooltip-bottom:hover:after,.rsssl-tooltip-bottom:focus:before,.rsssl-tooltip-bottom:focus:after{-webkit-transform:translateY(12px);-moz-transform:translateY(12px);transform:translateY(12px)}.rsssl-tooltip-right:before,.rsssl-tooltip-right:after{bottom:50%;left:100%}.rsssl-tooltip-right:before{margin-bottom:0;margin-left:-12px;border-top-color:transparent;border-right-color:#000;border-right-color:hsla(0,0,20%,0.9)}.rsssl-tooltip-right:hover:before,.rsssl-tooltip-right:hover:after,.rsssl-tooltip-right:focus:before,.rsssl-tooltip-right:focus:after{-webkit-transform:translateX(12px);-moz-transform:translateX(12px);transform:translateX(12px)}.rsssl-tooltip-left:before,.rsssl-tooltip-right:before{top:3px}.rsssl-tooltip-left:after,.rsssl-tooltip-right:after{margin-left:0;margin-bottom:-16px}.rsssl-really-simple-plugins-logo{background-color:#dcdcdc;margin-left:-15px;margin-right:-15px}.rsssl-sidebar{width:240px;margin-top:20px;padding-left:15px;padding-right:15px;margin-right:15px;padding-bottom:15px;background-color:#ececec}.rsssl-sidebar-single-content-container{min-height:125px;padding-bottom:35px;margin-bottom:10px;background-color:#dcdcdc;width:100%;border-radius:3%}.rsssl-sidebar-single-content-container-pro{min-height:125px;padding-bottom:35px;margin-bottom:10px;background-color:#dcdcdc;width:100%;border-radius:3%}.rsssl-sidebar-title h3{font-size:.9em}.rsssl-sidebar-text-content-pro{font-weight:700;font-size:.8em;width:90%;margin:auto}.rsssl-sidebar-text-content{width:45%;padding-top:5px;padding-right:7px;font-weight:700;font-size:.8em;float:right;margin:10px auto}.rsssl-pro-image{height:30px;margin-top:6px}.rsssl-sidebar-image-pro{width:90%;margin:10px}.rsssl-sidebar-image{width:100px;float:left;padding:10px;height:100px}@media screen and (max-width:1024px) and (min-width:541px){.rsssl-main{width:100%}.rsssl-sidebar-title{text-align:center}.rsssl-container{flex-direction:column}.rsssl-sidebar{width:100%}.rsssl-really-simple-plugins-logo{width:40%}.rsssl-sidebar-single-content-container{width:40%;padding-left:25px;float:left;margin-right:25px}.rsssl-sidebar-single-content-container-pro{width:40%;padding-left:25px;margin:auto auto 25px}.rsssl-sidebar-um-text-content{width:40%}.rsssl-pro-image{display:none}}@media screen and (max-width:540px){.rsssl-main{width:100%}.rsssl-container{flex-direction:column}.rsssl-sidebar{display:grid;text-align:-webkit-center;width:70%}.rsssl-sidebar-um-text-content{width:45%}.rsssl-sidebar-single-content-container-pro{padding-bottom:10px}.rsssl-sidebar-single-content-container{padding-bottom:10px}}.rsssl-sidebar h4{font-size:14px;font-style:italic}.rsssl-wrapper{padding:30px}.rsssl-sidebar-list{font-size:.9em}#rsssl-premium-button-pro{display:inline-table;width:40%;text-align:center;float:right;font-size:inherit;height:25px;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;background-color:#7bd561;color:white;margin-right:5px}.rsssl-sidebar-content{float:left;padding-bottom:10px}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}.rsssl-container{display:flex}#rsssl-premium-button{display:inline-table;width:40%;text-align:center;float:right;font-size:inherit;height:25px;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;background-color:#017faf;color:white;margin-right:5px}.rsssl-more-info-button{clear:both}#TB_ajaxContent{text-align:center !important}#TB_window{height:370px !important}.rsssl-button-deactivate-keep-ssl{margin-right:15px}.rsssl-scan-button{float:left;margin-top:17px;margin-right:5px}.rsssl-switch{position:relative;display:inline-block;width:40px;height:21px}.rsssl-switch input{display:none}.rsssl-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s}.rsssl-slider:before{position:absolute;content:"";height:15px;width:15px;left:4px;bottom:3px;background-color:white;-webkit-transition:.4s;transition:.4s}.rsssl-slider.rsssl-round{border-radius:20px}.rsssl-slider.rsssl-round:before{border-radius:50%}input:checked+.rsssl-slider{background-color:#2daae1}input:checked+.rsssl-slider:before{-webkit-transform:translateX(17px);-ms-transform:translateX(17px);transform:translateX(17px)}input:disabled+.rsssl-slider{background-color:#b3e0f4}input:focus+.rsssl-slider{box-shadow:0 0 1px #2daae1}.debug-log{width:90%}.rsssl-close-warning{color:black;font-size:1.3em}
|
multisite-cron.php
CHANGED
@@ -24,5 +24,15 @@ function rsssl_schedule_cron()
|
|
24 |
wp_clear_scheduled_hook('rsssl_ssl_process_hook');
|
25 |
}
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
24 |
wp_clear_scheduled_hook('rsssl_ssl_process_hook');
|
25 |
}
|
26 |
|
27 |
+
/*
|
28 |
+
* On some sites rsssl_ssl_process_hook will prevent conversion from happening (stuck on 0%).
|
29 |
+
* If that happens, user can click a link (in class-multisite.php) to fire ssl process on admin_init hook
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
|
33 |
+
if (get_site_option('run_ssl_process_hook_switched') !== false) {
|
34 |
+
add_action('admin_init', array(RSSSL()->rsssl_multisite, 'run_ssl_process'));
|
35 |
+
} else {
|
36 |
+
add_action('rsssl_ssl_process_hook', array(RSSSL()->rsssl_multisite, 'run_ssl_process'));
|
37 |
+
}
|
38 |
}
|
readme.txt
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
Contributors: RogierLankhorst, markwolters
|
3 |
Donate link: https://www.paypal.me/reallysimplessl
|
4 |
Tags: SSL, https, force SSL, mixed content, insecure content, secure website, website security, TLS, security, secure socket layers, HSTS
|
5 |
-
Requires at least: 4.
|
6 |
License: GPL2
|
7 |
Tested up to: 5.2
|
8 |
Requires PHP: 5.4
|
9 |
-
Stable tag: 3.
|
10 |
|
11 |
No setup required! You only need an SSL certificate, and this plugin will do the rest.
|
12 |
|
@@ -24,7 +24,7 @@ Always backup before you go! If you do not have a sound backup policy, start hav
|
|
24 |
Any code suggestions? We're on [GitHub](https://github.com/rlankhorst/really-simple-ssl) as well!
|
25 |
|
26 |
= Love Really Simple SSL? =
|
27 |
-
Hopefully this plugin
|
28 |
some cool features.
|
29 |
= Pro features =
|
30 |
* The mixed content scan, which shows you what you have to do if you don't have the green lock yet
|
@@ -41,6 +41,8 @@ some cool features.
|
|
41 |
* The site url and home url are changed to https.
|
42 |
* Your insecure content is fixed by replacing all http:// urls with https://, except hyperlinks to other domains. Dynamically, so no database changes are made (except for the siteurl and homeurl).
|
43 |
|
|
|
|
|
44 |
[contact](https://www.really-simple-ssl.com/contact/) me if you have any questions, issues, or suggestions. Really Simple SSL is developed by [Really Simple Plugins](https://www.really-simple-plugins.com).
|
45 |
|
46 |
= Like to have this plugin in your language? =
|
@@ -79,6 +81,13 @@ If you are experiencing redirect loops on your site, try these [instructions](ht
|
|
79 |
Yes. There is a dedicated network settings page where you can switch between network activated SSL and per page SSL. In the dedicated pro for multisite plugin, you can override all site settings for SSL on the network level, and can activate and deactivate SSL in the network menu for each site.
|
80 |
|
81 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
= 3.1.5 =
|
83 |
* Fix: fixed a bug where having an open_basedir defined showed PHP warnings when using htaccess.conf
|
84 |
|
2 |
Contributors: RogierLankhorst, markwolters
|
3 |
Donate link: https://www.paypal.me/reallysimplessl
|
4 |
Tags: SSL, https, force SSL, mixed content, insecure content, secure website, website security, TLS, security, secure socket layers, HSTS
|
5 |
+
Requires at least: 4.6
|
6 |
License: GPL2
|
7 |
Tested up to: 5.2
|
8 |
Requires PHP: 5.4
|
9 |
+
Stable tag: 3.2
|
10 |
|
11 |
No setup required! You only need an SSL certificate, and this plugin will do the rest.
|
12 |
|
24 |
Any code suggestions? We're on [GitHub](https://github.com/rlankhorst/really-simple-ssl) as well!
|
25 |
|
26 |
= Love Really Simple SSL? =
|
27 |
+
Hopefully this plugin saves you some hours of work. If you want to support the continuing development of this plugin, you might consider buying the [premium](https://www.really-simple-ssl.com/pro/), which includes
|
28 |
some cool features.
|
29 |
= Pro features =
|
30 |
* The mixed content scan, which shows you what you have to do if you don't have the green lock yet
|
41 |
* The site url and home url are changed to https.
|
42 |
* Your insecure content is fixed by replacing all http:// urls with https://, except hyperlinks to other domains. Dynamically, so no database changes are made (except for the siteurl and homeurl).
|
43 |
|
44 |
+
Check out other plugins developed by Really Simple Plugins as well: [Complianz](https://wordpress.org/plugins/complianz-gdpr/) and [Zip Recipes](https://wordpress.org/plugins/zip-recipes/).
|
45 |
+
|
46 |
[contact](https://www.really-simple-ssl.com/contact/) me if you have any questions, issues, or suggestions. Really Simple SSL is developed by [Really Simple Plugins](https://www.really-simple-plugins.com).
|
47 |
|
48 |
= Like to have this plugin in your language? =
|
81 |
Yes. There is a dedicated network settings page where you can switch between network activated SSL and per page SSL. In the dedicated pro for multisite plugin, you can override all site settings for SSL on the network level, and can activate and deactivate SSL in the network menu for each site.
|
82 |
|
83 |
== Changelog ==
|
84 |
+
= 3.2 =
|
85 |
+
* Added update counter to Settings/SSL menu item if recommended settings aren't enabled yet
|
86 |
+
* Added WP-CLI support
|
87 |
+
* Tweak: made some dashboard items dismissible
|
88 |
+
* Tweak: added link on multisite networkwide activation notice to switch function hook to fix conversions hanging on 0%
|
89 |
+
* Tweak: required WordPress version now 4.6 because of get_networks() version
|
90 |
+
|
91 |
= 3.1.5 =
|
92 |
* Fix: fixed a bug where having an open_basedir defined showed PHP warnings when using htaccess.conf
|
93 |
|
rlrsssl-really-simple-ssl.php
CHANGED
@@ -3,38 +3,32 @@
|
|
3 |
* Plugin Name: Really Simple SSL
|
4 |
* Plugin URI: https://www.really-simple-ssl.com
|
5 |
* Description: Lightweight plugin without any setup to make your site SSL proof
|
6 |
-
* Version: 3.
|
7 |
* Text Domain: really-simple-ssl
|
8 |
* Domain Path: /languages
|
9 |
* Author: Rogier Lankhorst, Mark Wolters
|
10 |
* Author URI: https://really-simple-plugins.com
|
11 |
* License: GPL2
|
12 |
*/
|
13 |
-
|
14 |
/* Copyright 2014 Rogier Lankhorst (email : rogier@rogierlankhorst.com)
|
15 |
-
|
16 |
This program is free software; you can redistribute it and/or modify
|
17 |
it under the terms of the GNU General Public License, version 2, as
|
18 |
published by the Free Software Foundation.
|
19 |
-
|
20 |
This program is distributed in the hope that it will be useful,
|
21 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
GNU General Public License for more details.
|
24 |
-
|
25 |
You should have received a copy of the GNU General Public License
|
26 |
along with this program; if not, write to the Free Software
|
27 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
28 |
*/
|
29 |
-
|
30 |
defined('ABSPATH') or die("you do not have access to this page!");
|
31 |
|
32 |
class REALLY_SIMPLE_SSL
|
33 |
{
|
34 |
-
|
35 |
private static $instance;
|
36 |
public $rsssl_front_end;
|
37 |
-
public $
|
38 |
public $rsssl_multisite;
|
39 |
public $rsssl_cache;
|
40 |
public $rsssl_server;
|
@@ -52,38 +46,39 @@ class REALLY_SIMPLE_SSL
|
|
52 |
self::$instance = new REALLY_SIMPLE_SSL;
|
53 |
self::$instance->setup_constants();
|
54 |
self::$instance->includes();
|
55 |
-
|
56 |
self::$instance->rsssl_front_end = new rsssl_front_end();
|
57 |
self::$instance->rsssl_mixed_content_fixer = new rsssl_mixed_content_fixer();
|
58 |
|
|
|
59 |
// Backwards compatibility for add-ons
|
60 |
global $rsssl_front_end, $rsssl_mixed_content_fixer;
|
61 |
$rsssl_front_end = self::$instance->rsssl_front_end;
|
62 |
$rsssl_mixed_content_fixer = self::$instance->rsssl_mixed_content_fixer;
|
63 |
|
|
|
|
|
|
|
|
|
64 |
|
65 |
-
if (is_admin() || get_site_option('rsssl_ssl_activation_active') || get_site_option('rsssl_ssl_deactivation_active')) {
|
66 |
-
if (is_multisite()) {
|
67 |
-
self::$instance->rsssl_multisite = new rsssl_multisite();
|
68 |
-
}
|
69 |
self::$instance->rsssl_cache = new rsssl_cache();
|
70 |
self::$instance->rsssl_server = new rsssl_server();
|
71 |
self::$instance->really_simple_ssl = new rsssl_admin();
|
72 |
self::$instance->rsssl_help = new rsssl_help();
|
73 |
self::$instance->rsssl_certificate = new rsssl_certificate();
|
74 |
-
|
75 |
// Backwards compatibility for add-ons
|
76 |
global $rsssl_cache, $rsssl_server, $really_simple_ssl, $rsssl_help;
|
77 |
$rsssl_cache = self::$instance->rsssl_cache;
|
78 |
$rsssl_server = self::$instance->rsssl_server;
|
79 |
$really_simple_ssl = self::$instance->really_simple_ssl;
|
80 |
$rsssl_help = self::$instance->rsssl_help;
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
self::$instance->hooks();
|
84 |
-
|
85 |
}
|
86 |
-
|
87 |
return self::$instance;
|
88 |
}
|
89 |
|
@@ -92,7 +87,6 @@ class REALLY_SIMPLE_SSL
|
|
92 |
define('rsssl_url', plugin_dir_url(__FILE__));
|
93 |
define('rsssl_path', trailingslashit(plugin_dir_path(__FILE__)));
|
94 |
define('rsssl_plugin', plugin_basename(__FILE__));
|
95 |
-
|
96 |
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
97 |
$plugin_data = get_plugin_data(__FILE__);
|
98 |
define('rsssl_version', $plugin_data['Version']);
|
@@ -101,32 +95,28 @@ class REALLY_SIMPLE_SSL
|
|
101 |
private function includes()
|
102 |
{
|
103 |
require_once(rsssl_path . 'class-front-end.php');
|
104 |
-
|
105 |
require_once(rsssl_path . 'class-mixed-content-fixer.php');
|
|
|
106 |
|
|
|
|
|
|
|
107 |
|
108 |
-
if (is_admin() ||
|
109 |
-
|
110 |
-
|
111 |
-
require_once(rsssl_path . 'multisite-cron.php');
|
112 |
-
}
|
113 |
require_once(rsssl_path . 'class-admin.php');
|
114 |
require_once(rsssl_path . 'class-cache.php');
|
115 |
require_once(rsssl_path . 'class-server.php');
|
116 |
require_once(rsssl_path . 'class-help.php');
|
117 |
require_once(rsssl_path . 'class-certificate.php');
|
118 |
-
|
119 |
-
|
120 |
}
|
121 |
-
|
122 |
-
|
123 |
}
|
124 |
|
125 |
private function hooks()
|
126 |
{
|
127 |
add_action('wp_loaded', array(self::$instance->rsssl_front_end, 'force_ssl'), 20);
|
128 |
-
|
129 |
-
if (is_admin()) {
|
130 |
add_action('plugins_loaded', array(self::$instance->really_simple_ssl, 'init'), 10);
|
131 |
}
|
132 |
}
|
3 |
* Plugin Name: Really Simple SSL
|
4 |
* Plugin URI: https://www.really-simple-ssl.com
|
5 |
* Description: Lightweight plugin without any setup to make your site SSL proof
|
6 |
+
* Version: 3.2
|
7 |
* Text Domain: really-simple-ssl
|
8 |
* Domain Path: /languages
|
9 |
* Author: Rogier Lankhorst, Mark Wolters
|
10 |
* Author URI: https://really-simple-plugins.com
|
11 |
* License: GPL2
|
12 |
*/
|
|
|
13 |
/* Copyright 2014 Rogier Lankhorst (email : rogier@rogierlankhorst.com)
|
|
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License, version 2, as
|
16 |
published by the Free Software Foundation.
|
|
|
17 |
This program is distributed in the hope that it will be useful,
|
18 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
GNU General Public License for more details.
|
|
|
21 |
You should have received a copy of the GNU General Public License
|
22 |
along with this program; if not, write to the Free Software
|
23 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24 |
*/
|
|
|
25 |
defined('ABSPATH') or die("you do not have access to this page!");
|
26 |
|
27 |
class REALLY_SIMPLE_SSL
|
28 |
{
|
|
|
29 |
private static $instance;
|
30 |
public $rsssl_front_end;
|
31 |
+
public $rsssl_mixed_content_fixer;
|
32 |
public $rsssl_multisite;
|
33 |
public $rsssl_cache;
|
34 |
public $rsssl_server;
|
46 |
self::$instance = new REALLY_SIMPLE_SSL;
|
47 |
self::$instance->setup_constants();
|
48 |
self::$instance->includes();
|
|
|
49 |
self::$instance->rsssl_front_end = new rsssl_front_end();
|
50 |
self::$instance->rsssl_mixed_content_fixer = new rsssl_mixed_content_fixer();
|
51 |
|
52 |
+
|
53 |
// Backwards compatibility for add-ons
|
54 |
global $rsssl_front_end, $rsssl_mixed_content_fixer;
|
55 |
$rsssl_front_end = self::$instance->rsssl_front_end;
|
56 |
$rsssl_mixed_content_fixer = self::$instance->rsssl_mixed_content_fixer;
|
57 |
|
58 |
+
$wpcli = defined( 'WP_CLI' ) && WP_CLI;
|
59 |
+
|
60 |
+
if (is_admin() || is_multisite() || $wpcli) {
|
61 |
+
self::$instance->rsssl_multisite = new rsssl_multisite();
|
62 |
|
|
|
|
|
|
|
|
|
63 |
self::$instance->rsssl_cache = new rsssl_cache();
|
64 |
self::$instance->rsssl_server = new rsssl_server();
|
65 |
self::$instance->really_simple_ssl = new rsssl_admin();
|
66 |
self::$instance->rsssl_help = new rsssl_help();
|
67 |
self::$instance->rsssl_certificate = new rsssl_certificate();
|
|
|
68 |
// Backwards compatibility for add-ons
|
69 |
global $rsssl_cache, $rsssl_server, $really_simple_ssl, $rsssl_help;
|
70 |
$rsssl_cache = self::$instance->rsssl_cache;
|
71 |
$rsssl_server = self::$instance->rsssl_server;
|
72 |
$really_simple_ssl = self::$instance->really_simple_ssl;
|
73 |
$rsssl_help = self::$instance->rsssl_help;
|
74 |
+
|
75 |
+
if ( $wpcli ) {
|
76 |
+
self::$instance->rsssl_wp_cli = new rsssl_wp_cli();
|
77 |
+
}
|
78 |
}
|
79 |
|
80 |
self::$instance->hooks();
|
|
|
81 |
}
|
|
|
82 |
return self::$instance;
|
83 |
}
|
84 |
|
87 |
define('rsssl_url', plugin_dir_url(__FILE__));
|
88 |
define('rsssl_path', trailingslashit(plugin_dir_path(__FILE__)));
|
89 |
define('rsssl_plugin', plugin_basename(__FILE__));
|
|
|
90 |
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
91 |
$plugin_data = get_plugin_data(__FILE__);
|
92 |
define('rsssl_version', $plugin_data['Version']);
|
95 |
private function includes()
|
96 |
{
|
97 |
require_once(rsssl_path . 'class-front-end.php');
|
|
|
98 |
require_once(rsssl_path . 'class-mixed-content-fixer.php');
|
99 |
+
$wpcli = defined( 'WP_CLI' ) && WP_CLI;
|
100 |
|
101 |
+
if ( $wpcli ) {
|
102 |
+
require_once(rsssl_path . 'class-rsssl-wp-cli.php');
|
103 |
+
}
|
104 |
|
105 |
+
if (is_admin() || is_multisite() || $wpcli) {
|
106 |
+
require_once(rsssl_path . 'class-multisite.php');
|
107 |
+
require_once(rsssl_path . 'multisite-cron.php');
|
|
|
|
|
108 |
require_once(rsssl_path . 'class-admin.php');
|
109 |
require_once(rsssl_path . 'class-cache.php');
|
110 |
require_once(rsssl_path . 'class-server.php');
|
111 |
require_once(rsssl_path . 'class-help.php');
|
112 |
require_once(rsssl_path . 'class-certificate.php');
|
|
|
|
|
113 |
}
|
|
|
|
|
114 |
}
|
115 |
|
116 |
private function hooks()
|
117 |
{
|
118 |
add_action('wp_loaded', array(self::$instance->rsssl_front_end, 'force_ssl'), 20);
|
119 |
+
if (is_admin() || is_multisite()) {
|
|
|
120 |
add_action('plugins_loaded', array(self::$instance->really_simple_ssl, 'init'), 10);
|
121 |
}
|
122 |
}
|