Really Simple SSL - Version 2.5.24

Version Description

  • Fix: On multisite, admin_url forced current blog URL's over http even when the current blog was loaded over https. This will now only force http for other blog_urls than the current one, when they are on http and not https.
Download this release

Release Info

Developer RogierLankhorst
Plugin Icon 128x128 Really Simple SSL
Version 2.5.24
Comparing to
See all releases

Code changes from version 2.5.23 to 2.5.24

class-admin.php CHANGED
@@ -2054,11 +2054,11 @@ public function settings_page() {
2054
 
2055
  public function img($type) {
2056
  if ($type=='success') {
2057
- return "<img class='icons' src='" . trailingslashit(rsssl_url) . "img/check-icon.png' alt='success'>";
2058
  } elseif ($type=="error") {
2059
- return "<img class='icons' src='". trailingslashit(rsssl_url) . "img/cross-icon.png' alt='error'>";
2060
  } else {
2061
- return "<img class='icons' src='". trailingslashit(rsssl_url) ."img/warning-icon.png' alt='warning'>";
2062
  }
2063
  }
2064
 
2054
 
2055
  public function img($type) {
2056
  if ($type=='success') {
2057
+ return "<img class='rsssl-icons' src='" . trailingslashit(rsssl_url) . "img/check-icon.png' alt='success'>";
2058
  } elseif ($type=="error") {
2059
+ return "<img class='rsssl-icons' src='". trailingslashit(rsssl_url) . "img/cross-icon.png' alt='error'>";
2060
  } else {
2061
+ return "<img class='rsssl-icons' src='". trailingslashit(rsssl_url) ."img/warning-icon.png' alt='warning'>";
2062
  }
2063
  }
2064
 
class-front-end.php CHANGED
@@ -137,6 +137,8 @@ if ( ! class_exists( 'rsssl_front_end' ) ) {
137
 
138
 
139
 
 
 
140
  /**
141
  * Adds some javascript to redirect to https.
142
  *
137
 
138
 
139
 
140
+
141
+
142
  /**
143
  * Adds some javascript to redirect to https.
144
  *
class-maintain-plugin-load-position.php DELETED
@@ -1,97 +0,0 @@
1
- <?php
2
- defined('ABSPATH') or die("you do not have acces to this page!");
3
-
4
- class rsssl_maintain_plugin_position {
5
-
6
- private static $_this;
7
-
8
- function __construct() {
9
- if ( isset( self::$_this ) )
10
- wp_die( sprintf( __( '%s is a singleton class and you cannot create a second instance.','really-simple-ssl' ), get_class( $this ) ) );
11
-
12
- self::$_this = $this;
13
-
14
- add_action( 'admin_init', array( $this, 'maintainPluginLoadPosition') );
15
-
16
- }
17
-
18
- static function this() {
19
- return self::$_this;
20
- }
21
-
22
- /**
23
- * Sets this plugin to be the first loaded of all the plugins.
24
- */
25
-
26
- public function maintainPluginLoadPosition() {
27
- $sBaseFile = plugin_basename( __FILE__ );
28
- $nLoadPosition = $this->getActivePluginLoadPosition( $sBaseFile );
29
- if ( $nLoadPosition > 1 ) {
30
- $this->setActivePluginLoadPosition( $sBaseFile, 0 );
31
- }
32
- }
33
-
34
- /**
35
- * @param string $sPluginFile
36
- * @return int
37
- */
38
- public function getActivePluginLoadPosition( $sPluginFile ) {
39
- $sOptionKey = is_multisite() ? 'active_sitewide_plugins' : 'active_plugins';
40
- $aActive = get_option( $sOptionKey );
41
- $nPosition = -1;
42
- if ( is_array( $aActive ) ) {
43
- $nPosition = array_search( $sPluginFile, $aActive );
44
- if ( $nPosition === false ) {
45
- $nPosition = -1;
46
- }
47
- }
48
- return $nPosition;
49
- }
50
-
51
- /**
52
- * @param string $sPluginFile
53
- * @param int $nDesiredPosition
54
- */
55
- public function setActivePluginLoadPosition( $sPluginFile, $nDesiredPosition = 0 ) {
56
-
57
- $aActive = $this->setArrayValueToPosition( get_option( 'active_plugins' ), $sPluginFile, $nDesiredPosition );
58
- update_option( 'active_plugins', $aActive );
59
-
60
- if ( is_multisite() ) {
61
- $aActive = $this->setArrayValueToPosition( get_option( 'active_sitewide_plugins' ), $sPluginFile, $nDesiredPosition );
62
- update_option( 'active_sitewide_plugins', $aActive );
63
- }
64
- }
65
-
66
- /**
67
- * @param array $aSubjectArray
68
- * @param mixed $mValue
69
- * @param int $nDesiredPosition
70
- * @return array
71
- */
72
- public function setArrayValueToPosition( $aSubjectArray, $mValue, $nDesiredPosition ) {
73
-
74
- if ( $nDesiredPosition < 0 || !is_array( $aSubjectArray ) ) {
75
- return $aSubjectArray;
76
- }
77
-
78
- $nMaxPossiblePosition = count( $aSubjectArray ) - 1;
79
- if ( $nDesiredPosition > $nMaxPossiblePosition ) {
80
- $nDesiredPosition = $nMaxPossiblePosition;
81
- }
82
-
83
- $nPosition = array_search( $mValue, $aSubjectArray );
84
- if ( $nPosition !== false && $nPosition != $nDesiredPosition ) {
85
-
86
- // remove existing and reset index
87
- unset( $aSubjectArray[ $nPosition ] );
88
- $aSubjectArray = array_values( $aSubjectArray );
89
-
90
- // insert and update
91
- // http://stackoverflow.com/questions/3797239/insert-new-item-in-array-on-any-position-in-php
92
- array_splice( $aSubjectArray, $nDesiredPosition, 0, $mValue );
93
- }
94
-
95
- return $aSubjectArray;
96
- }
97
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
class-multisite.php CHANGED
@@ -45,7 +45,6 @@ if ( ! class_exists( 'rsssl_multisite' ) ) {
45
  add_action('network_admin_menu', array( &$this, 'add_multisite_menu' ) );
46
  add_action('network_admin_edit_rsssl_update_network_settings', array($this,'update_network_options'));
47
 
48
-
49
  if (is_network_admin()) {
50
  add_action('network_admin_notices', array($this, 'show_notices'), 10);
51
  add_action('admin_print_footer_scripts', array($this, 'insert_dismiss_success'));
@@ -58,10 +57,8 @@ if ( ! class_exists( 'rsssl_multisite' ) ) {
58
 
59
  add_action("rsssl_show_network_tab_settings", array($this, 'settings_tab'));
60
 
61
-
62
  add_action( 'wpmu_new_blog', array($this, 'maybe_activate_ssl_in_new_blog'), 10, 6 );
63
 
64
-
65
  }
66
 
67
  static function this() {
@@ -481,17 +478,24 @@ public function settings_tab(){
481
  */
482
 
483
  public function check_admin_protocol($url, $path, $blog_id){
484
- if (!defined('FORCE_SSL_ADMIN')) {
485
 
486
- if (!$this->ssl_enabled_networkwide) {
487
- $home_url = get_blog_option($blog_id, 'home');
488
- if (strpos($home_url, "https://")===false) {
489
- $url = str_replace("https://","http://",$url);
490
- }
491
- }
 
492
 
 
 
 
 
 
 
493
  }
494
 
 
495
  return $url;
496
  }
497
 
45
  add_action('network_admin_menu', array( &$this, 'add_multisite_menu' ) );
46
  add_action('network_admin_edit_rsssl_update_network_settings', array($this,'update_network_options'));
47
 
 
48
  if (is_network_admin()) {
49
  add_action('network_admin_notices', array($this, 'show_notices'), 10);
50
  add_action('admin_print_footer_scripts', array($this, 'insert_dismiss_success'));
57
 
58
  add_action("rsssl_show_network_tab_settings", array($this, 'settings_tab'));
59
 
 
60
  add_action( 'wpmu_new_blog', array($this, 'maybe_activate_ssl_in_new_blog'), 10, 6 );
61
 
 
62
  }
63
 
64
  static function this() {
478
  */
479
 
480
  public function check_admin_protocol($url, $path, $blog_id){
 
481
 
482
+ //if the force_ssl_admin is defined, the admin_url should not be forced back to http: all admin panels should be https.
483
+ if (defined('FORCE_SSL_ADMIN')) return $url;
484
+
485
+ //do not force to http if the request is made for an url of the current blog.
486
+ //if a site is loaded over https, it should return https links, unless the url is requested for another blog.
487
+ //In that case, we only return a https link if the site_url is https, and http otherwise.
488
+ if (get_current_blog_id()==$blog_id) return $url;
489
 
490
+ //now check if the blog is http or https, and change the url accordingly
491
+ if (!$this->ssl_enabled_networkwide) {
492
+ $home_url = get_blog_option($blog_id, 'home');
493
+ if (strpos($home_url, "https://")===false) {
494
+ $url = str_replace("https://","http://",$url);
495
+ }
496
  }
497
 
498
+
499
  return $url;
500
  }
501
 
css/main.css CHANGED
@@ -51,83 +51,11 @@
51
  border:1px solid black;
52
  }
53
 
54
- .icons {
55
- width:15px;
56
- height:15px;
57
- }
58
-
59
  .rsssl-icons {
60
  width:15px;
61
  height:15px;
62
  }
63
 
64
- .loader {
65
- width: 250px;
66
- height: 50px;
67
- line-height: 50px;
68
- text-align: center;
69
- margin: 50px 150px;;
70
- top: 50%;
71
- left: 50%;
72
- -webkit-transform: translate(-50%, -50%);
73
- -ms-transform: translate(-50%, -50%);
74
- transform: translate(-50%, -50%);
75
- text-transform: uppercase;
76
- font-weight: 900;
77
- color: #ce4233;
78
- letter-spacing: 0.2em;
79
- }
80
- .loader::before, .loader::after {
81
- content: "";
82
- display: block;
83
- width: 15px;
84
- height: 15px;
85
- background: #ce4233;
86
- position: absolute;
87
- -webkit-animation: load .7s infinite alternate ease-in-out;
88
- animation: load .7s infinite alternate ease-in-out;
89
- }
90
- .loader::before {
91
- top: 0;
92
- }
93
- .loader::after {
94
- bottom: 0;
95
- }
96
-
97
- @-webkit-keyframes load {
98
- 0% {
99
- left: 0;
100
- height: 30px;
101
- width: 15px;
102
- }
103
- 50% {
104
- height: 8px;
105
- width: 40px;
106
- }
107
- 100% {
108
- left: 235px;
109
- height: 30px;
110
- width: 15px;
111
- }
112
- }
113
-
114
- @keyframes load {
115
- 0% {
116
- left: 0;
117
- height: 30px;
118
- width: 15px;
119
- }
120
- 50% {
121
- height: 8px;
122
- width: 40px;
123
- }
124
- 100% {
125
- left: 235px;
126
- height: 30px;
127
- width: 15px;
128
- }
129
- }
130
-
131
  /* rsssl-rsssl-tooltip for settings page */
132
  /* Base styles for the element that has a rsssl-tooltip */
133
  [data-rsssl-tooltip],
51
  border:1px solid black;
52
  }
53
 
 
 
 
 
 
54
  .rsssl-icons {
55
  width:15px;
56
  height:15px;
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /* rsssl-rsssl-tooltip for settings page */
60
  /* Base styles for the element that has a rsssl-tooltip */
61
  [data-rsssl-tooltip],
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: SSL, https, force SSL, mixed content, insecure content, secure website, we
5
  Requires at least: 4.2
6
  License: GPL2
7
  Tested up to: 4.9
8
- Stable tag: 2.5.23
9
 
10
  No setup required! You only need an SSL certificate, and this plugin will do the rest.
11
 
@@ -78,6 +78,9 @@ If you are experiencing redirect loops on your site, try these [instructions](ht
78
  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.
79
 
80
  == Changelog ==
 
 
 
81
  = 2.5.23 =
82
  * Tested up to WP 4.9
83
  * Added secure cookie notice
5
  Requires at least: 4.2
6
  License: GPL2
7
  Tested up to: 4.9
8
+ Stable tag: 2.5.24
9
 
10
  No setup required! You only need an SSL certificate, and this plugin will do the rest.
11
 
78
  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.
79
 
80
  == Changelog ==
81
+ = 2.5.24 =
82
+ * Fix: On multisite, admin_url forced current blog URL's over http even when the current blog was loaded over https. This will now only force http for other blog_urls than the current one, when they are on http and not https.
83
+
84
  = 2.5.23 =
85
  * Tested up to WP 4.9
86
  * Added secure cookie notice
rlrsssl-really-simple-ssl.php CHANGED
@@ -3,7 +3,7 @@
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: 2.5.23
7
  * Text Domain: really-simple-ssl
8
  * Domain Path: /languages
9
  * Author: Rogier Lankhorst
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: 2.5.24
7
  * Text Domain: really-simple-ssl
8
  * Domain Path: /languages
9
  * Author: Rogier Lankhorst