s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) - Version 3.1.1

Version Description

  • New feature. Now you can use s2member_force_ssl -> yes as a Custom Field with any Post/Page. This feature comes in handy if you need to force SSL on pages hosting PayPal Pro Forms, implemented by the s2Member Pro Module. You can set s2member_force_ssl -> yes to force https://. If your server runs SSL over a special port number, or your server requires the port number to actually be in the URL ( i.e. HOST:port ), you can set s2member_force_ssl -> 443; or to whatever port you need. In addition to forcing https://, s2Member is also capable of forcing SSL compatibility in your theme, and in other quirky plugins. If your theme is NOT 100% compatible with SSL, s2Member can sometimes correct flaws automatically, but not always. For maximum compatibility with SSL, we recommend a premium WordPress theme from PriMoThemes.com, or from another trusted source that states "SSL Compatible".
  • Bug fix. References to the Constant WP_CONTENT_URL have been removed, in favor of content_url(), which is SSL-friendly.
  • Tweak. References to $_SERVER["HTTPS"] have been abandoned, in favor of is_ssl(), which is native to WordPress.
  • Windows. Although full testing on Windows IIS is not completed, one bug report indicated a problem with ["dir_url"]. This has been corrected in v3.1.1, using DIRECTORY_SEPARATOR.
  • Bug fix. PHP 5.3.x reference value on option filters. The apply_filters() call was changed to apply_filters_ref_array(). This has been corrected in v3.1.1.
Download this release

Release Info

Developer PriMoThemes
Plugin Icon 128x128 s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.1 to 3.1.1

includes/functions/force-ssl.inc.php CHANGED
@@ -28,12 +28,16 @@ if (!function_exists ("ws_plugin__s2member_check_force_ssl"))
28
  /**/
29
  do_action ("ws_plugin__s2member_before_check_force_ssl", get_defined_vars ());
30
  /**/
31
- if (is_singular () && get_post_meta ($post->ID, "s2member_force_ssl", true))
32
  {
33
- if (!preg_match ("/^on$/i", $_SERVER["HTTPS"]))
34
  {
35
- wp_redirect ("https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
36
- exit (); /* Redirect to SSL enabled Post/Page. Site must have SSL cert. */
 
 
 
 
37
  }
38
  else /* Otherwise, we buffer the output, and switch everything to https. */
39
  {
@@ -47,7 +51,8 @@ if (!function_exists ("ws_plugin__s2member_check_force_ssl"))
47
  /**/
48
  $tags = apply_filters ("_ws_plugin__s2member_force_ssl_buffer_tags", $tags, get_defined_vars ());
49
  /**/
50
- $buffer = preg_replace_callback ("/\<(" . $tags . ")[^\>]+/i", "_ws_plugin__s2member_force_ssl_buffer_callback", $buffer);
 
51
  /**/
52
  ini_set ("pcre.backtrack_limit", $o_pcre);
53
  /**/
28
  /**/
29
  do_action ("ws_plugin__s2member_before_check_force_ssl", get_defined_vars ());
30
  /**/
31
+ if (is_singular () && ($force_ssl = get_post_meta ($post->ID, "s2member_force_ssl", true)))
32
  {
33
+ if (!is_ssl ()) /* SSL must be enabled here. Redirect to https:// scheme. */
34
  {
35
+ $ssl_host = preg_replace ("/\:[0-9]+$/", "", $_SERVER["HTTP_HOST"]);
36
+ $ssl_port = (is_numeric ($force_ssl) && $force_ssl > 1) ? $force_ssl : 0;
37
+ $ssl_host_port = $ssl_host . (($ssl_port) ? ":" . $ssl_port : "");
38
+ /**/
39
+ wp_redirect ("https://" . $ssl_host_port . $_SERVER["REQUEST_URI"]);
40
+ exit (); /* ^ So let's redirect to the SSL enabled version. */
41
  }
42
  else /* Otherwise, we buffer the output, and switch everything to https. */
43
  {
51
  /**/
52
  $tags = apply_filters ("_ws_plugin__s2member_force_ssl_buffer_tags", $tags, get_defined_vars ());
53
  /**/
54
+ $buffer = preg_replace_callback ("/\<(" . $tags . ")[^\>]+\>/i", "_ws_plugin__s2member_force_ssl_buffer_callback", $buffer);
55
+ $buffer = preg_replace_callback ("/\<style[^\>]*\>(.+?)\<\/style\>/is", "_ws_plugin__s2member_force_ssl_buffer_callback", $buffer);
56
  /**/
57
  ini_set ("pcre.backtrack_limit", $o_pcre);
58
  /**/
includes/functions/is-systematic.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit ("Do not access this file directly.");
16
  /*
17
  Function that determines whether we are on a systematic use page.
18
  */
@@ -62,7 +62,7 @@ if (!function_exists ("ws_plugin__s2member_is_systematic_use_page"))
62
  {
63
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
64
  }
65
- else if (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && ($_SERVER["REQUEST_URI"] === "/" || strtolower (rtrim (get_bloginfo ("url"), "/")) === rtrim (strtolower ("http://" . $_SERVER["HTTP_HOST"]) . $_SERVER["REQUEST_URI"], "/")))
66
  {
67
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ())); /* Only true when the request starts with /?s2member from the root URL of the domain, or from the install. */
68
  }
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit("Do not access this file directly.");
16
  /*
17
  Function that determines whether we are on a systematic use page.
18
  */
62
  {
63
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
64
  }
65
+ else if (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && ($_SERVER["REQUEST_URI"] === "/" || rtrim (strtolower ("http://" . $_SERVER["HTTP_HOST"]) . $_SERVER["REQUEST_URI"], "/") === rtrim (strtolower (get_bloginfo ("url")), "/")))
66
  {
67
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ())); /* Only true when the request starts with /?s2member from the root URL of the domain, or from the install. */
68
  }
includes/functions/nocache.inc.php CHANGED
@@ -64,7 +64,7 @@ if (!function_exists ("ws_plugin__s2member_nocache_constants"))
64
  do_action ("ws_plugin__s2member_before_nocache_constants", get_defined_vars ());
65
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
66
  /**/
67
- if (!$_GET["qcAC"] && ($nocache || is_user_logged_in () || (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && ($_SERVER["REQUEST_URI"] === "/" || strtolower (rtrim (get_bloginfo ("url"), "/")) === rtrim (strtolower ("http://" . $_SERVER["HTTP_HOST"]) . $_SERVER["REQUEST_URI"], "/")))))
68
  {
69
  define ("QUICK_CACHE_ALLOWED", false) . define ("DONOTCACHEPAGE", true);
70
  /**/
64
  do_action ("ws_plugin__s2member_before_nocache_constants", get_defined_vars ());
65
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
66
  /**/
67
+ if (!$_GET["qcAC"] && ($nocache || is_user_logged_in () || (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && ($_SERVER["REQUEST_URI"] === "/" || rtrim (strtolower ("http://" . $_SERVER["HTTP_HOST"]) . $_SERVER["REQUEST_URI"], "/") === rtrim (strtolower (get_bloginfo ("url")), "/")))))
68
  {
69
  define ("QUICK_CACHE_ALLOWED", false) . define ("DONOTCACHEPAGE", true);
70
  /**/
includes/syscon.inc.php CHANGED
@@ -25,7 +25,7 @@ if (($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["is_multisite"] = ((function_exist
25
  /*
26
  Determine the full url to the directory this plugin resides in.
27
  */
28
- $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] = WP_CONTENT_URL . preg_replace ("/^(.*?)(\/" . preg_quote (basename (WP_CONTENT_DIR), "/") . ")/", "", dirname (dirname (__FILE__)));
29
  /*
30
  Check if the plugin has been configured *should be set after the first config via options panel*.
31
  */
@@ -405,7 +405,7 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
405
  $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key_history"] = array_slice ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key_history"], 0, 10);
406
  }
407
  /**/
408
- return apply_filters ("ws_plugin__s2member_options", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]);
409
  }
410
  /**/
411
  call_user_func ("ws_plugin__s2member_configure_options_and_their_defaults");
25
  /*
26
  Determine the full url to the directory this plugin resides in.
27
  */
28
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] = content_url () . preg_replace ("/^(.*?)(\/" . preg_quote (basename (WP_CONTENT_DIR), "/") . ")/", "", preg_replace ("/" . preg_quote (DIRECTORY_SEPARATOR, "/") . "/", "/", dirname (dirname (__FILE__))));
29
  /*
30
  Check if the plugin has been configured *should be set after the first config via options panel*.
31
  */
405
  $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key_history"] = array_slice ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key_history"], 0, 10);
406
  }
407
  /**/
408
+ return apply_filters_ref_array ("ws_plugin__s2member_options", array (&$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]));
409
  }
410
  /**/
411
  call_user_func ("ws_plugin__s2member_configure_options_and_their_defaults");
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === s2Member ( Membership w/ PayPal® Integration ) also works w/ BuddyPress ===
2
 
3
- Version: 3.1
4
- Stable tag: 3.1
5
  Framework: WS-P-3.0
6
 
7
  SSL Compatible: yes
@@ -145,7 +145,7 @@ Not yet. This is coming soon though. It will be included in a future release of
145
 
146
  == Upgrade Notice ==
147
 
148
- = 3.1 =
149
  * Upgrade recommended. Fixes a redirection loop on some configurations. Also adds several new features; listed below.
150
 
151
  = 3.0.6 =
@@ -156,6 +156,13 @@ Not yet. This is coming soon though. It will be included in a future release of
156
 
157
  == Changelog ==
158
 
 
 
 
 
 
 
 
159
  = 3.1 =
160
  * bbPress® compatiblity. There is a new internal Bridge that can be installed into bbPress® by s2Member. This new bbPress® (Bridge/plugin) makes it possible for s2Member Levels [0-4] to be converted into bbPress® "Members" on-the-fly, and it will guard your forums against unauthorized access; including forum registrations, which are redirected to your Membership Options Page for s2Member. To install this Bridge Integration, check your WordPress® Dashboard, under: `s2Member -> Bridge Integrations`.
161
  * New plugin that is HIGHLY recommended for s2Member. Get [WP Show IDs](http://www.primothemes.com/post/wp-show-ids-plugin/). Simple, yet elegant. Shows IDs for Posts, Pages, Media, Links, Categories, Tags, and Users in the admin tables for easy access. Very lightweight. Also supports Custom Post Types / Taxonomies.
1
  === s2Member ( Membership w/ PayPal® Integration ) also works w/ BuddyPress ===
2
 
3
+ Version: 3.1.1
4
+ Stable tag: 3.1.1
5
  Framework: WS-P-3.0
6
 
7
  SSL Compatible: yes
145
 
146
  == Upgrade Notice ==
147
 
148
+ = 3.1+ =
149
  * Upgrade recommended. Fixes a redirection loop on some configurations. Also adds several new features; listed below.
150
 
151
  = 3.0.6 =
156
 
157
  == Changelog ==
158
 
159
+ = 3.1.1 =
160
+ * New feature. Now you can use `s2member_force_ssl -> yes` as a Custom Field with any Post/Page. This feature comes in handy if you need to force SSL on pages hosting PayPal® Pro Forms, implemented by the s2Member Pro Module. You can set `s2member_force_ssl -> yes` to force *https://*. If your server runs SSL over a special port number, or your server requires the port number to actually be in the URL ( i.e. HOST:port ), you can set `s2member_force_ssl -> 443`; or to whatever port you need. In addition to forcing *https://*, s2Member is also capable of forcing SSL compatibility in your theme, and in other quirky plugins. If your theme is NOT 100% compatible with SSL, s2Member can sometimes correct flaws automatically, but not always. For maximum compatibility with SSL, we recommend a premium WordPress® theme from PriMoThemes.com, or from another trusted source that states "SSL Compatible".
161
+ * Bug fix. References to the Constant `WP_CONTENT_URL` have been removed, in favor of `content_url()`, which is SSL-friendly.
162
+ * Tweak. References to `$_SERVER["HTTPS"]` have been abandoned, in favor of `is_ssl()`, which is native to WordPress®.
163
+ * Windows®. Although full testing on Windows® IIS is not completed, one bug report indicated a problem with `["dir_url"]`. This has been corrected in v3.1.1, using `DIRECTORY_SEPARATOR`.
164
+ * Bug fix. PHP 5.3.x reference value on option filters. The `apply_filters()` call was changed to `apply_filters_ref_array()`. This has been corrected in v3.1.1.
165
+
166
  = 3.1 =
167
  * bbPress® compatiblity. There is a new internal Bridge that can be installed into bbPress® by s2Member. This new bbPress® (Bridge/plugin) makes it possible for s2Member Levels [0-4] to be converted into bbPress® "Members" on-the-fly, and it will guard your forums against unauthorized access; including forum registrations, which are redirected to your Membership Options Page for s2Member. To install this Bridge Integration, check your WordPress® Dashboard, under: `s2Member -> Bridge Integrations`.
168
  * New plugin that is HIGHLY recommended for s2Member. Get [WP Show IDs](http://www.primothemes.com/post/wp-show-ids-plugin/). Simple, yet elegant. Shows IDs for Posts, Pages, Media, Links, Categories, Tags, and Users in the admin tables for easy access. Very lightweight. Also supports Custom Post Types / Taxonomies.
s2member.php CHANGED
@@ -9,8 +9,8 @@ along with this software. In the main directory, see: /licensing/
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
- Version: 3.1
13
- Stable tag: 3.1
14
  Framework: WS-P-3.0
15
 
16
  SSL Compatible: yes
@@ -43,11 +43,11 @@ Tags: membership, members, member, register, signup, paypal, pay pal, s2member,
43
  Direct access denial.
44
  */
45
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
46
- exit("Do not access this file directly.");
47
  /*
48
  Define versions.
49
  */
50
- define ("WS_PLUGIN__S2MEMBER_VERSION", "3.1");
51
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
52
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "2.9.2");
53
  define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.0.5");
@@ -60,7 +60,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
60
  /*
61
  Hook before loaded.
62
  */
63
- do_action("ws_plugin__s2member_before_loaded");
64
  /*
65
  System configuraton.
66
  */
@@ -72,7 +72,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
72
  /*
73
  Hook after system config & hooks are loaded.
74
  */
75
- do_action("ws_plugin__s2member_config_hooks_loaded");
76
  /*
77
  Load a possible Pro module, if/when available.
78
  */
@@ -88,7 +88,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
88
  /*
89
  Hook after loaded.
90
  */
91
- do_action("ws_plugin__s2member_after_loaded");
92
  }
93
  else if (is_admin ()) /* Admin compatibility errors. */
94
  {
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
+ Version: 3.1.1
13
+ Stable tag: 3.1.1
14
  Framework: WS-P-3.0
15
 
16
  SSL Compatible: yes
43
  Direct access denial.
44
  */
45
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
46
+ exit ("Do not access this file directly.");
47
  /*
48
  Define versions.
49
  */
50
+ define ("WS_PLUGIN__S2MEMBER_VERSION", "3.1.1");
51
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
52
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "2.9.2");
53
  define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.0.5");
60
  /*
61
  Hook before loaded.
62
  */
63
+ do_action ("ws_plugin__s2member_before_loaded");
64
  /*
65
  System configuraton.
66
  */
72
  /*
73
  Hook after system config & hooks are loaded.
74
  */
75
+ do_action ("ws_plugin__s2member_config_hooks_loaded");
76
  /*
77
  Load a possible Pro module, if/when available.
78
  */
88
  /*
89
  Hook after loaded.
90
  */
91
+ do_action ("ws_plugin__s2member_after_loaded");
92
  }
93
  else if (is_admin ()) /* Admin compatibility errors. */
94
  {