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

Version Description

= v160801 =

(Maintenance Release) Upgrade immediately.

Download this release

Release Info

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

Code changes from version 220421 to 220809

readme.txt CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: s2Member® Framework
4
  Plugin URI: http://s2member.com/
5
  Tags: membership, subscribers, subscriber, members only, roles, capabilities, capability, register, signup, paypal, ecommerce, restriction
6
- Version: 220421
7
- Stable tag: 220421
8
- Tested up to: 6.0-beta2-53236
9
  Requires at least: 4.2
10
  Requires PHP: 5.6.2
11
  Tested up to PHP: 8.1
@@ -140,6 +140,10 @@ Released under the terms of the [GNU General Public License](http://www.gnu.org/
140
 
141
  == Changelog ==
142
 
 
 
 
 
143
  = v220421 =
144
 
145
  - (Framework & Pro) **Enhancement**: Improved PHP compatibility to 8.1.
3
  Plugin Name: s2Member® Framework
4
  Plugin URI: http://s2member.com/
5
  Tags: membership, subscribers, subscriber, members only, roles, capabilities, capability, register, signup, paypal, ecommerce, restriction
6
+ Version: 220809
7
+ Stable tag: 220809
8
+ Tested up to: 6.1-alpha-53862
9
  Requires at least: 4.2
10
  Requires PHP: 5.6.2
11
  Tested up to PHP: 8.1
140
 
141
  == Changelog ==
142
 
143
+ = v220809 =
144
+
145
+ - (Framework) **Enhancement**: New `current_user_days_to_eot_less_than` function for conditionals. Useful when you want to show a message to a user on his last days of access before the EOT time in his profile. E.g. `[s2If current_user_days_to_eot_less_than(31)]Please renew your membership[/s2If]`. Kudos to Felix for his help, see [post 6783](https://f.wpsharks.com/t/6783).
146
+
147
  = v220421 =
148
 
149
  - (Framework & Pro) **Enhancement**: Improved PHP compatibility to 8.1.
s2member.php CHANGED
@@ -20,8 +20,8 @@
20
  */
21
  /* -- This section for WordPress parsing. ------------------------------------------------------------------------------
22
 
23
- Version: 220421
24
- Stable tag: 220421
25
 
26
  SSL Compatible: yes
27
  bbPress Compatible: yes
@@ -36,7 +36,7 @@ PayPal Pro Compatible: yes w/s2Member Pro
36
  Authorize.Net Compatible: yes w/s2Member Pro
37
  ClickBank Compatible: yes w/s2Member Pro
38
 
39
- Tested up to: 6.0-beta2-53236
40
  Requires at least: 4.2
41
 
42
  Requires PHP: 5.6.2
@@ -77,7 +77,7 @@ if(!defined('WPINC')) // MUST have WordPress.
77
  *
78
  * @var string
79
  */
80
- ${__FILE__}['tmp'] = '220421'; //version//
81
  if(!defined('WS_PLUGIN__S2MEMBER_VERSION'))
82
  define('WS_PLUGIN__S2MEMBER_VERSION', ${__FILE__}['tmp']);
83
  /**
@@ -110,7 +110,7 @@ if(!defined('WS_PLUGIN__S2MEMBER_MIN_WP_VERSION'))
110
  *
111
  * @var string
112
  */
113
- ${__FILE__}['tmp'] = '220421'; //version//
114
  if(!defined('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION'))
115
  define('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION', ${__FILE__}['tmp']);
116
  /*
20
  */
21
  /* -- This section for WordPress parsing. ------------------------------------------------------------------------------
22
 
23
+ Version: 220809
24
+ Stable tag: 220809
25
 
26
  SSL Compatible: yes
27
  bbPress Compatible: yes
36
  Authorize.Net Compatible: yes w/s2Member Pro
37
  ClickBank Compatible: yes w/s2Member Pro
38
 
39
+ Tested up to: 6.1-alpha-53862
40
  Requires at least: 4.2
41
 
42
  Requires PHP: 5.6.2
77
  *
78
  * @var string
79
  */
80
+ ${__FILE__}['tmp'] = '220809'; //version//
81
  if(!defined('WS_PLUGIN__S2MEMBER_VERSION'))
82
  define('WS_PLUGIN__S2MEMBER_VERSION', ${__FILE__}['tmp']);
83
  /**
110
  *
111
  * @var string
112
  */
113
+ ${__FILE__}['tmp'] = '210526'; //version//
114
  if(!defined('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION'))
115
  define('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION', ${__FILE__}['tmp']);
116
  /*
src/includes/functions/api-functions.inc.php CHANGED
@@ -2774,7 +2774,7 @@ if(!function_exists('s2member_eot'))
2774
  /**
2775
  * Conditional to determine if the current User has a specific gateway set in his profile.
2776
  *
2777
- * ———— Code Sample Using Both Functions ————
2778
  * ```
2779
  * <!php
2780
  * if(current_user_gateway_is("stripe"))
@@ -2799,4 +2799,42 @@ if (!function_exists("current_user_gateway_is")) {
2799
  function current_user_gateway_is($gateway) {
2800
  return ($gateway === S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY);
2801
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2802
  }
2774
  /**
2775
  * Conditional to determine if the current User has a specific gateway set in his profile.
2776
  *
2777
+ * ———— PHP Code Sample ————
2778
  * ```
2779
  * <!php
2780
  * if(current_user_gateway_is("stripe"))
2799
  function current_user_gateway_is($gateway) {
2800
  return ($gateway === S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY);
2801
  }
2802
+ }
2803
+
2804
+ /**
2805
+ * Conditional to determine if the current User's EOT is closer than a number of days.
2806
+ *
2807
+ * ———— PHP Code Sample ————
2808
+ * ```
2809
+ * <!php
2810
+ * if(current_user_days_to_eot_less_than(31))
2811
+ * echo "Renew your membership";
2812
+ * !>
2813
+ * ```
2814
+ *
2815
+ * ———— Shortcode Conditional Equivalent ————
2816
+ * ```
2817
+ * [s2If current_user_days_to_eot_less_than(31)]
2818
+ * Renew your membership.
2819
+ * [/s2If]
2820
+ * ```
2821
+ *
2822
+ * @package s2Member\API_Functions
2823
+ * @since 220707
2824
+ *
2825
+ * @param int $less_than Days from today, to check if the user's EOT time falls within that number of coming days.
2826
+ * @return bool True if the current User's EOT is closer than $less_than, else false.
2827
+ */
2828
+ if (!function_exists('current_user_days_to_eot_less_than')) {
2829
+ function current_user_days_to_eot_less_than($less_than) {
2830
+ $eot_time = get_user_field('s2member_auto_eot_time');
2831
+ if (empty($eot_time)) {
2832
+ return false;
2833
+ }
2834
+ $now = time();
2835
+ $time_diff = ((int) $eot_time - $now);
2836
+ $days_left = round($time_diff / (60 * 60 * 24));
2837
+ $less_than = (int) $less_than;
2838
+ return ($days_left < $less_than);
2839
+ }
2840
  }
src/includes/translations/s2member.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: 220421\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/s2member\n"
7
- "POT-Creation-Date: 2022-04-21 18:25:11+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: 220809\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/s2member\n"
7
+ "POT-Creation-Date: 2022-08-09 00:11:54+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
src/vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc7a6f6d6900216c69e1e8cecca7e80a7::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit51b7b92c212283cd86a618cf12e61a54::getLoader();
src/vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc7a6f6d6900216c69e1e8cecca7e80a7
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitc7a6f6d6900216c69e1e8cecca7e80a7
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitc7a6f6d6900216c69e1e8cecca7e80a7', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInitc7a6f6d6900216c69e1e8cecca7e80a7', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitc7a6f6d6900216c69e1e8cecca7e80a7::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitc7a6f6d6900216c69e1e8cecca7e80a7
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitc7a6f6d6900216c69e1e8cecca7e80a7::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequirec7a6f6d6900216c69e1e8cecca7e80a7($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequirec7a6f6d6900216c69e1e8cecca7e80a7($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit51b7b92c212283cd86a618cf12e61a54
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit51b7b92c212283cd86a618cf12e61a54', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit51b7b92c212283cd86a618cf12e61a54', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit51b7b92c212283cd86a618cf12e61a54::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit51b7b92c212283cd86a618cf12e61a54::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire51b7b92c212283cd86a618cf12e61a54($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire51b7b92c212283cd86a618cf12e61a54($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
src/vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitc7a6f6d6900216c69e1e8cecca7e80a7
8
  {
9
  public static $files = array (
10
  '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
@@ -30,7 +30,7 @@ class ComposerStaticInitc7a6f6d6900216c69e1e8cecca7e80a7
30
  public static function getInitializer(ClassLoader $loader)
31
  {
32
  return \Closure::bind(function () use ($loader) {
33
- $loader->classMap = ComposerStaticInitc7a6f6d6900216c69e1e8cecca7e80a7::$classMap;
34
 
35
  }, null, ClassLoader::class);
36
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit51b7b92c212283cd86a618cf12e61a54
8
  {
9
  public static $files = array (
10
  '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
30
  public static function getInitializer(ClassLoader $loader)
31
  {
32
  return \Closure::bind(function () use ($loader) {
33
+ $loader->classMap = ComposerStaticInit51b7b92c212283cd86a618cf12e61a54::$classMap;
34
 
35
  }, null, ClassLoader::class);
36
  }