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

Version Description

Download this release

Release Info

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

Code changes from version 110617 to 110620

Files changed (3) hide show
  1. includes/classes/users-list.inc.php +13 -11
  2. readme.txt +7 -4
  3. s2member.php +3 -3
includes/classes/users-list.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_users_list"))
21
  {
@@ -76,7 +76,7 @@ if (!class_exists ("c_ws_plugin__s2member_users_list"))
76
  {
77
  global $wpdb; /* Need this global object reference. */
78
  /**/
79
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
80
  do_action ("ws_plugin__s2member_before_users_list_search", get_defined_vars ());
81
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
82
  /**/
@@ -92,13 +92,13 @@ if (!class_exists ("c_ws_plugin__s2member_users_list"))
92
  $query->query_where .= " OR `user_login` LIKE '" . $s . "' OR `user_nicename` LIKE '" . $s . "' OR `user_email` LIKE '" . $s . "' OR `user_url` LIKE '" . $s . "' OR `display_name` LIKE '" . $s . "'";
93
  $query->query_where .= apply_filters ("ws_plugin__s2member_before_users_list_search_where_or_after", "", get_defined_vars ()) . ")"; /* Leaving room for additional searches here. */
94
  $query->query_where .= " AND `" . $wpdb->users . "`.`ID` IN(SELECT DISTINCT(`user_id`) FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "capabilities'" ./**/
95
- (($qv["role"]) ? " AND `meta_value` LIKE '%" . esc_sql (like_escape ($qv["role"])) . "%'" : "") . ")";
96
  /**/
97
  $query->query_from = apply_filters ("ws_plugin__s2member_before_users_list_search_from", $query->query_from, get_defined_vars ());
98
  $query->query_where = apply_filters ("ws_plugin__s2member_before_users_list_search_where", $query->query_where, get_defined_vars ());
99
  }
100
  /**/
101
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
102
  do_action ("ws_plugin__s2member_after_users_list_search", get_defined_vars ());
103
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
104
  /**/
@@ -117,7 +117,7 @@ if (!class_exists ("c_ws_plugin__s2member_users_list"))
117
  */
118
  public static function users_list_cols ($cols = FALSE)
119
  {
120
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
121
  do_action ("ws_plugin__s2member_before_users_list_cols", get_defined_vars ());
122
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
123
  /**/
@@ -142,7 +142,7 @@ if (!class_exists ("c_ws_plugin__s2member_users_list"))
142
  $cols["s2member_custom_field_" . $field_var] = $field_title;
143
  }
144
  /**/
145
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
146
  do_action ("ws_plugin__s2member_during_users_list_cols", get_defined_vars ());
147
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
148
  /**/
@@ -166,14 +166,14 @@ if (!class_exists ("c_ws_plugin__s2member_users_list"))
166
  static $user, $last_user_id; /* Used internally for optimization. */
167
  static $fields, $last_fields_id; /* Used for optimization. */
168
  /**/
169
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
170
  do_action ("ws_plugin__s2member_before_users_list_display_cols", get_defined_vars ());
171
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
172
  /**/
173
  $user = (is_object ($user) && $user_id === $last_user_id) ? $user : new WP_User ($user_id);
174
  /**/
175
  if ($col === "s2member_registration_time")
176
- $val = ($v = $user->user_registered) ? esc_html (date_i18n ("D M jS, Y", strtotime ($v))) . '<br /><small>@ precisely ' . esc_html (date_i18n ("g:i a", strtotime ($v))) . '</small>' : "—";
177
  /**/
178
  else if ($col === "s2member_paid_registration_times")
179
  {
@@ -181,10 +181,12 @@ if (!class_exists ("c_ws_plugin__s2member_users_list"))
181
  if (is_array ($v = get_user_option ("s2member_paid_registration_times", $user_id)))
182
  foreach ($v as $level => $time) /* Go through each Paid Registration Time. */
183
  {
 
 
184
  if ($level === "level") /* First Payment Time, regardless of Level. */
185
- $val .= (($val) ? "<br />" : "") . '<span title="' . esc_attr (date_i18n ("D M jS, Y", $time)) . ' @ precisely ' . esc_attr (date_i18n ("g:i a", $time)) . '">' . esc_html (date_i18n ("D M jS, Y", $time)) . '</span>';
186
  else if (preg_match ("/^level([0-9]+)$/i", $level) && ($level = preg_replace ("/^level/", "", $level)))
187
- $val .= (($val) ? "<br />" : "") . '<small><em>@Level ' . esc_html ($level) . ': <span title="' . esc_attr (date_i18n ("D M jS, Y", $time)) . ' @ precisely ' . esc_attr (date_i18n ("g:i a", $time)) . '">' . esc_html (date_i18n ("D M jS, Y", $time)) . '</span></em></small>';
188
  }
189
  }
190
  /**/
@@ -221,7 +223,7 @@ if (!class_exists ("c_ws_plugin__s2member_users_list"))
221
  /**/
222
  $last_user_id = $user_id; /* Record this for internal optimizations. */
223
  /**/
224
- return apply_filters ("ws_plugin__s2member_users_list_display_cols", ((strlen ($val)) ? $val : "—"), get_defined_vars ());
225
  }
226
  }
227
  }
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_users_list"))
21
  {
76
  {
77
  global $wpdb; /* Need this global object reference. */
78
  /**/
79
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
80
  do_action ("ws_plugin__s2member_before_users_list_search", get_defined_vars ());
81
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
82
  /**/
92
  $query->query_where .= " OR `user_login` LIKE '" . $s . "' OR `user_nicename` LIKE '" . $s . "' OR `user_email` LIKE '" . $s . "' OR `user_url` LIKE '" . $s . "' OR `display_name` LIKE '" . $s . "'";
93
  $query->query_where .= apply_filters ("ws_plugin__s2member_before_users_list_search_where_or_after", "", get_defined_vars ()) . ")"; /* Leaving room for additional searches here. */
94
  $query->query_where .= " AND `" . $wpdb->users . "`.`ID` IN(SELECT DISTINCT(`user_id`) FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "capabilities'" ./**/
95
+ ( ($qv["role"]) ? " AND `meta_value` LIKE '%" . esc_sql (like_escape ($qv["role"])) . "%'" : "") . ")";
96
  /**/
97
  $query->query_from = apply_filters ("ws_plugin__s2member_before_users_list_search_from", $query->query_from, get_defined_vars ());
98
  $query->query_where = apply_filters ("ws_plugin__s2member_before_users_list_search_where", $query->query_where, get_defined_vars ());
99
  }
100
  /**/
101
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
102
  do_action ("ws_plugin__s2member_after_users_list_search", get_defined_vars ());
103
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
104
  /**/
117
  */
118
  public static function users_list_cols ($cols = FALSE)
119
  {
120
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
121
  do_action ("ws_plugin__s2member_before_users_list_cols", get_defined_vars ());
122
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
123
  /**/
142
  $cols["s2member_custom_field_" . $field_var] = $field_title;
143
  }
144
  /**/
145
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
146
  do_action ("ws_plugin__s2member_during_users_list_cols", get_defined_vars ());
147
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
148
  /**/
166
  static $user, $last_user_id; /* Used internally for optimization. */
167
  static $fields, $last_fields_id; /* Used for optimization. */
168
  /**/
169
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
170
  do_action ("ws_plugin__s2member_before_users_list_display_cols", get_defined_vars ());
171
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
172
  /**/
173
  $user = (is_object ($user) && $user_id === $last_user_id) ? $user : new WP_User ($user_id);
174
  /**/
175
  if ($col === "s2member_registration_time")
176
+ $val = ( ($time = strtotime (get_date_from_gmt ($user->user_registered)))) ? esc_html (date ("D M jS, Y", $time)) . '<br /><small>@ precisely ' . esc_html (date ("g:i a", $time)) . '</small>' : "—";
177
  /**/
178
  else if ($col === "s2member_paid_registration_times")
179
  {
181
  if (is_array ($v = get_user_option ("s2member_paid_registration_times", $user_id)))
182
  foreach ($v as $level => $time) /* Go through each Paid Registration Time. */
183
  {
184
+ $time = strtotime (get_date_from_gmt (date ("Y-m-d H:i:s", $time)));
185
+ /**/
186
  if ($level === "level") /* First Payment Time, regardless of Level. */
187
+ $val .= (($val) ? "<br />" : "") . '<span title="' . esc_attr (date ("D M jS, Y", $time)) . ' @ precisely ' . esc_attr (date ("g:i a", $time)) . '">' . esc_html (date ("D M jS, Y", $time)) . '</span>';
188
  else if (preg_match ("/^level([0-9]+)$/i", $level) && ($level = preg_replace ("/^level/", "", $level)))
189
+ $val .= (($val) ? "<br />" : "") . '<small><em>@Level ' . esc_html ($level) . ': <span title="' . esc_attr (date ("D M jS, Y", $time)) . ' @ precisely ' . esc_attr (date ("g:i a", $time)) . '">' . esc_html (date ("D M jS, Y", $time)) . '</span></em></small>';
190
  }
191
  }
192
  /**/
223
  /**/
224
  $last_user_id = $user_id; /* Record this for internal optimizations. */
225
  /**/
226
+ return apply_filters ("ws_plugin__s2member_users_list_display_cols", ( (strlen ($val)) ? $val : "—"), get_defined_vars ());
227
  }
228
  }
229
  }
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === s2Member® ( Membership w/ PayPal® ) ===
2
 
3
- Version: 110617
4
- Stable tag: 110617
5
  Framework: WS-P-110523
6
 
7
  SSL Compatible: yes
@@ -173,9 +173,12 @@ Please visit s2Member.com for [video tutorials](http://www.s2member.com/videos/)
173
 
174
  == Changelog ==
175
 
 
 
 
176
  = v110617 =
177
- * **(s2Member)** Bug fix. ** A bug first introduced in s2Member v110604 has been corrected. This bug was hindering s2Member's ability to identify MIME types for protected File Downloads.
178
- * **(s2Member)** HTML 5 MIME types. ** s2Member has been updated to provide support through File Download protection for HTML 5 MIME types: `video/ogg` and `video/webm`.
179
 
180
  = v110606 =
181
  * **(s2Member). MailChimp® over SSL.** s2Member has been updated to communicate with the MailChimp® API over SSL, for improved security. No action or reconfiguration is necessary, as this only affects the HTTP protocol used during communication with the MailChimp® API.
1
  === s2Member® ( Membership w/ PayPal® ) ===
2
 
3
+ Version: 110620
4
+ Stable tag: 110620
5
  Framework: WS-P-110523
6
 
7
  SSL Compatible: yes
173
 
174
  == Changelog ==
175
 
176
+ = v110620 =
177
+ * **(s2Member) Bug fix.** s2Member has been updated to support GMT offset in date calculations for Registration Time. In previous versions, this was addressed using `date_i18n()`, but this update now includes the proper function call to `get_date_from_gmt()`. No changes are necessary, as this update simply corrects the way Registration Times are displayed in your list of Users. Starting with v110620, s2Member will now display Registration Times with the correct GMT offset, based on your configuration of `WordPress -> General Options -> Timezone`.
178
+
179
  = v110617 =
180
+ * **(s2Member) Bug fix.** A bug first introduced in s2Member v110604 has been corrected. This bug was hindering s2Member's ability to identify MIME types for protected File Downloads.
181
+ * **(s2Member) HTML 5 MIME types.** s2Member has been updated to provide support through File Download protection for HTML 5 MIME types: `video/ogg` and `video/webm`.
182
 
183
  = v110606 =
184
  * **(s2Member). MailChimp® over SSL.** s2Member has been updated to communicate with the MailChimp® API over SSL, for improved security. No action or reconfiguration is necessary, as this only affects the HTTP protocol used during communication with the MailChimp® API.
s2member.php CHANGED
@@ -19,8 +19,8 @@
19
  */
20
  /* -- This section for WordPress® parsing. ------------------------------------------------------------------------------
21
 
22
- Version: 110617
23
- Stable tag: 110617
24
  Framework: WS-P-110523
25
 
26
  SSL Compatible: yes
@@ -70,7 +70,7 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
70
  * @var str
71
  */
72
  if (!defined ("WS_PLUGIN__S2MEMBER_VERSION"))
73
- define ("WS_PLUGIN__S2MEMBER_VERSION", "110617");
74
  /**
75
  * Minimum PHP version required to run s2Member.
76
  *
19
  */
20
  /* -- This section for WordPress® parsing. ------------------------------------------------------------------------------
21
 
22
+ Version: 110620
23
+ Stable tag: 110620
24
  Framework: WS-P-110523
25
 
26
  SSL Compatible: yes
70
  * @var str
71
  */
72
  if (!defined ("WS_PLUGIN__S2MEMBER_VERSION"))
73
+ define ("WS_PLUGIN__S2MEMBER_VERSION", "110620");
74
  /**
75
  * Minimum PHP version required to run s2Member.
76
  *