CloudFlare Flexible SSL - Version 1.2.1

Version Description

FIXED: Checking to ensure certain data types

Download this release

Release Info

Developer paultgoodchild
Plugin Icon 128x128 CloudFlare Flexible SSL
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

Files changed (2) hide show
  1. plugin.php +14 -6
  2. readme.txt +5 -1
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: CloudFlare Flexible SSL
4
  * Plugin URI: http://icwp.io/2f
5
  * Description: Fix For CloudFlare Flexible SSL Redirect Loop For WordPress
6
- * Version: 1.2.0
7
  * Text Domain: cloudflare-flexible-ssl
8
  * Author: iControlWP
9
  * Author URI: http://icwp.io/2e
@@ -24,13 +24,15 @@ class ICWP_Cloudflare_Flexible_SSL {
24
  }
25
  }
26
 
27
- $this->maintainPluginLoadPosition();
 
 
28
  }
29
 
30
  /**
31
  * Sets this plugin to be the first loaded of all the plugins.
32
  */
33
- protected function maintainPluginLoadPosition() {
34
  $sBaseFile = plugin_basename( __FILE__ );
35
  $nLoadPosition = $this->getActivePluginLoadPosition( $sBaseFile );
36
  if ( $nLoadPosition > 1 ) {
@@ -45,8 +47,14 @@ class ICWP_Cloudflare_Flexible_SSL {
45
  public function getActivePluginLoadPosition( $sPluginFile ) {
46
  $sOptionKey = is_multisite() ? 'active_sitewide_plugins' : 'active_plugins';
47
  $aActive = get_option( $sOptionKey );
48
- $nPosition = array_search( $sPluginFile, $aActive );
49
- return ( $nPosition === false ) ? -1 : $nPosition;
 
 
 
 
 
 
50
  }
51
 
52
  /**
@@ -72,7 +80,7 @@ class ICWP_Cloudflare_Flexible_SSL {
72
  */
73
  public function setArrayValueToPosition( $aSubjectArray, $mValue, $nDesiredPosition ) {
74
 
75
- if ( $nDesiredPosition < 0 ) {
76
  return $aSubjectArray;
77
  }
78
 
3
  * Plugin Name: CloudFlare Flexible SSL
4
  * Plugin URI: http://icwp.io/2f
5
  * Description: Fix For CloudFlare Flexible SSL Redirect Loop For WordPress
6
+ * Version: 1.2.1
7
  * Text Domain: cloudflare-flexible-ssl
8
  * Author: iControlWP
9
  * Author URI: http://icwp.io/2e
24
  }
25
  }
26
 
27
+ if ( is_admin() ) {
28
+ add_action( 'admin_init', array( $this, 'maintainPluginLoadPosition') );
29
+ }
30
  }
31
 
32
  /**
33
  * Sets this plugin to be the first loaded of all the plugins.
34
  */
35
+ public function maintainPluginLoadPosition() {
36
  $sBaseFile = plugin_basename( __FILE__ );
37
  $nLoadPosition = $this->getActivePluginLoadPosition( $sBaseFile );
38
  if ( $nLoadPosition > 1 ) {
47
  public function getActivePluginLoadPosition( $sPluginFile ) {
48
  $sOptionKey = is_multisite() ? 'active_sitewide_plugins' : 'active_plugins';
49
  $aActive = get_option( $sOptionKey );
50
+ $nPosition = -1;
51
+ if ( is_array( $aActive ) ) {
52
+ $nPosition = array_search( $sPluginFile, $aActive );
53
+ if ( $nPosition === false ) {
54
+ $nPosition = -1;
55
+ }
56
+ }
57
+ return $nPosition;
58
  }
59
 
60
  /**
80
  */
81
  public function setArrayValueToPosition( $aSubjectArray, $mValue, $nDesiredPosition ) {
82
 
83
+ if ( $nDesiredPosition < 0 || !is_array( $aSubjectArray ) ) {
84
  return $aSubjectArray;
85
  }
86
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
6
  Tags: CloudFlare, SSL, Flexible SSL, Universal SSL, redirect loop, HTTPS, HTTP_X_FORWARDED_PROTO
7
  Requires at least: 3.2.0
8
  Tested up to: 4.3
9
- Stable tag: 1.2.0
10
 
11
  Fix For CloudFlare Flexible SSL Redirect Loop For WordPress.
12
 
@@ -46,6 +46,10 @@ For full installation instructions, please review the following article: [Instal
46
 
47
  == Changelog ==
48
 
 
 
 
 
49
  = 1.2.0 =
50
 
51
  ADDED: The plugin will try to set itself to load first, before all other plugins.
6
  Tags: CloudFlare, SSL, Flexible SSL, Universal SSL, redirect loop, HTTPS, HTTP_X_FORWARDED_PROTO
7
  Requires at least: 3.2.0
8
  Tested up to: 4.3
9
+ Stable tag: 1.2.1
10
 
11
  Fix For CloudFlare Flexible SSL Redirect Loop For WordPress.
12
 
46
 
47
  == Changelog ==
48
 
49
+ = 1.2.1 =
50
+
51
+ FIXED: Checking to ensure certain data types
52
+
53
  = 1.2.0 =
54
 
55
  ADDED: The plugin will try to set itself to load first, before all other plugins.