| @@ -1,28 +1,28 @@ | ||
| 1 | 1 | <?php |
| 2 | +// @codingStandardsIgnoreFile | |
| 2 | 3 | /** |
| 3 | -* The main plugin file. | |
| 4 | -* | |
| 5 | -* This file loads the plugin after checking | |
| 6 | -* PHP, WordPress® and other compatibility requirements. | |
| 7 | -* | |
| 8 | -* Copyright: © 2009-2011 | |
| 9 | -* {@link http://www.websharks-inc.com/ WebSharks, Inc.} | |
| 10 | -* ( coded in the USA ) | |
| 11 | -* | |
| 12 | -* Released under the terms of the GNU General Public License. | |
| 13 | -* You should have received a copy of the GNU General Public License, | |
| 14 | -* along with this software. In the main directory, see: /licensing/ | |
| 15 | -* If not, see: {@link http://www.gnu.org/licenses/}. | |
| 16 | -* | |
| 17 | -* @package s2Member | |
| 18 | -* @since 1.0 | |
| 19 | -*/ | |
| 20 | -/* -- This section for WordPress® parsing. ------------------------------------------------------------------------------ | |
| 4 | + * The main plugin file. | |
| 5 | + * | |
| 6 | + * This file loads the plugin after checking | |
| 7 | + * PHP, WordPress and other compatibility requirements. | |
| 8 | + * | |
| 9 | + * Copyright: © 2009-2011 | |
| 10 | + * {@link http://wpsharks.com/ WP Sharks} | |
| 11 | + * (coded in the USA) | |
| 12 | + * | |
| 13 | + * Released under the terms of the GNU General Public License. | |
| 14 | + * You should have received a copy of the GNU General Public License, | |
| 15 | + * along with this software. In the main directory, see: /licensing/ | |
| 16 | + * If not, see: {@link http://www.gnu.org/licenses/}. | |
| 17 | + * | |
| 18 | + * @package s2Member | |
| 19 | + * @since 1.0 | |
| 20 | + */ | |
| 21 | +/* -- This section for WordPress parsing. ------------------------------------------------------------------------------ | |
| 21 | 22 | |
| 22 | -Version: 111206 | |
| 23 | -Stable tag: 111206 | |
| 24 | -Framework: WS-P-110523 | |
| 23 | +Version: 260917 | |
| 24 | +Stable tag: 260917 | |
| 25 | 25 | |
| 26 | 26 | SSL Compatible: yes |
| 27 | 27 | bbPress Compatible: yes |
| 28 | 28 | WordPress Compatible: yes |
| @@ -29,142 +29,196 @@ | ||
| 29 | 29 | BuddyPress Compatible: yes |
| 30 | 30 | WP Multisite Compatible: yes |
| 31 | 31 | Multisite Blog Farm Compatible: yes |
| 32 | 32 | |
| 33 | -PayPal® Standard Compatible: yes | |
| 34 | -PayPal® Pro Compatible: w/ s2Member Pro | |
| 35 | -Google® Checkout Compatible: w/ s2Member Pro | |
| 36 | -Authorize.Net® Compatible: w/ s2Member Pro | |
| 37 | -ClickBank® Compatible: w/ s2Member Pro | |
| 38 | -AliPay® Compatible: w/ s2Member Pro | |
| 39 | -ccBill® Compatible: w/ s2Member Pro | |
| 33 | +PayPal Standard Compatible: yes | |
| 34 | +Stripe Compatible: yes w/s2Member Pro | |
| 35 | +PayPal Pro Compatible: yes w/s2Member Pro | |
| 36 | +Authorize.Net Compatible: yes w/s2Member Pro | |
| 37 | +ClickBank Compatible: yes w/s2Member Pro | |
| 40 | 38 | |
| 41 | -Tested up to: 3.3 | |
| 42 | -Requires at least: 3.2 | |
| 43 | -Requires: WordPress® 3.2+, PHP 5.2.3+ | |
| 39 | +Tested up to: 7.2-alpha-63608 | |
| 40 | +Requires at least: 4.2 | |
| 44 | 41 | |
| 45 | -Copyright: © 2009 WebSharks, Inc. | |
| 42 | +Requires PHP: 5.6.2 | |
| 43 | +Tested up to PHP: 8.5.9 | |
| 44 | + | |
| 45 | +Copyright: © 2009 WP Sharks | |
| 46 | 46 | License: GNU General Public License |
| 47 | -Contributors: WebSharks, PriMoThemes | |
| 48 | -Author URI: http://www.primothemes.com/ | |
| 49 | -Author: PriMoThemes.com / WebSharks, Inc. | |
| 50 | -Donate link: http://www.primothemes.com/donate/ | |
| 47 | +Contributors: WebSharks, JasWSInc, anguz, raamdev, bruce-caldwell, clavaque | |
| 51 | 48 | |
| 49 | +Author: WP Sharks | |
| 50 | +Author URI: http://s2member.com/ | |
| 51 | +Donate link: http://s2member.com/r/donate | |
| 52 | + | |
| 52 | 53 | Text Domain: s2member |
| 53 | -Domain Path: /includes/translations | |
| 54 | +Domain Path: /languages | |
| 54 | 55 | |
| 55 | -Plugin Name: s2Member | |
| 56 | -Video Tutorials: http://www.s2member.com/videos/ | |
| 57 | -Pro Module / Home Page: http://www.s2member.com/ | |
| 58 | -Pro Module / Prices: http://www.s2member.com/prices/ | |
| 59 | -Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4 | |
| 60 | -Privacy URI: http://www.primothemes.com/about/privacy-policy/ | |
| 61 | -PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304 | |
| 62 | -Professional Installation URI: http://www.s2member.com/professional-installation/ | |
| 63 | -Plugin URI: http://www.primothemes.com/post/product/s2member-membership-plugin-with-paypal/ | |
| 64 | -Description: s2Member® (Membership w/ PayPal®). Powerful (free) membership capabilities. Protect/secure members only content w/ roles/capabilities for members. | |
| 65 | -Tags: membership, members, member, register, signup, paypal, paypal pro, pay pal, s2member, authorize.net, google checkout, ccbill, clickbank, alipay, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, includes extensive documentation, highly extensible | |
| 56 | +Plugin Name: s2Member Framework | |
| 57 | +Forum URI: http://s2member.com/r/forum/ | |
| 58 | +Plugin URI: http://s2member.com/ | |
| 59 | +Privacy URI: http://s2member.com/privacy-policy/ | |
| 60 | +Changelog URI: http://s2member.com/changelog/ | |
| 61 | +Video Tutorials: http://s2member.com/r/s2member-videos/ | |
| 62 | +Knowledge Base: http://s2member.com/kb/ | |
| 63 | +Newsletter: http://s2member.com/r/subscribe/ | |
| 64 | +PayPal Pro Integration: http://s2member.com/r/pp-account-types/ | |
| 66 | 65 | |
| 67 | -if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"])) | |
| 68 | - exit("Do not access this file directly."); | |
| 66 | +Description: s2Member, a powerful (free) membership plugin for WordPress. Protect/secure members only content with roles/capabilities. | |
| 67 | +Tags: s2, s2member, s2 member, membership, users, user, members, member, subscribers, subscriber, members only, roles, capabilities, capability, register, signup, paypal, paypal pro, pay pal, authorize, authorize.net, google wallet, clickbank, click bank, buddypress, buddy press, bbpress, bb press, shopping cart, cart, checkout, ecommerce | |
| 68 | + | |
| 69 | +-- end section for WordPress parsing. ------------------------------------------------------------------------------- */ | |
| 70 | +if(!defined('WPINC')) // MUST have WordPress. | |
| 71 | + exit('Do not access this file directly.'); | |
| 69 | 72 | /** |
| 70 | -* The installed version of s2Member. | |
| 71 | -* | |
| 72 | -* @package s2Member | |
| 73 | -* @since 3.0 | |
| 74 | -* | |
| 75 | -* @var str | |
| 76 | -*/ | |
| 77 | -if (!defined ("WS_PLUGIN__S2MEMBER_VERSION")) | |
| 78 | - define ("WS_PLUGIN__S2MEMBER_VERSION", "111206"); | |
| 73 | + * The installed version of s2Member. | |
| 74 | + * | |
| 75 | + * @package s2Member | |
| 76 | + * @since 3.0 | |
| 77 | + * | |
| 78 | + * @var string | |
| 79 | + */ | |
| 80 | +${__FILE__}['tmp'] = '260917'; //version// | |
| 81 | +if(!defined('WS_PLUGIN__S2MEMBER_VERSION')) | |
| 82 | + define('WS_PLUGIN__S2MEMBER_VERSION', ${__FILE__}['tmp']); | |
| 79 | 83 | /** |
| 80 | -* Minimum PHP version required to run s2Member. | |
| 81 | -* | |
| 82 | -* @package s2Member | |
| 83 | -* @since 3.0 | |
| 84 | -* | |
| 85 | -* @var str | |
| 86 | -*/ | |
| 87 | -if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION")) | |
| 88 | - define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2.3"); | |
| 84 | + * Minimum PHP version required to run s2Member. | |
| 85 | + * | |
| 86 | + * @package s2Member | |
| 87 | + * @since 3.0 | |
| 88 | + * | |
| 89 | + * @var string | |
| 90 | + */ | |
| 91 | +${__FILE__}['tmp'] = '5.6.2'; //php-required-version// | |
| 92 | +if(!defined('WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION')) | |
| 93 | + define('WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION', ${__FILE__}['tmp']); | |
| 89 | 94 | /** |
| 90 | -* Minimum WordPress® version required to run s2Member. | |
| 91 | -* | |
| 92 | -* @package s2Member | |
| 93 | -* @since 3.0 | |
| 94 | -* | |
| 95 | -* @var str | |
| 96 | -*/ | |
| 97 | -if (!defined ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION")) | |
| 98 | - define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "3.2"); | |
| 95 | + * Minimum WordPress version required to run s2Member. | |
| 96 | + * | |
| 97 | + * @package s2Member | |
| 98 | + * @since 3.0 | |
| 99 | + * | |
| 100 | + * @var string | |
| 101 | + */ | |
| 102 | +${__FILE__}['tmp'] = '4.2'; //wp-required-version// | |
| 103 | +if(!defined('WS_PLUGIN__S2MEMBER_MIN_WP_VERSION')) | |
| 104 | + define('WS_PLUGIN__S2MEMBER_MIN_WP_VERSION', ${__FILE__}['tmp']); | |
| 99 | 105 | /** |
| 100 | -* Minimum Pro version required by the Framework. | |
| 101 | -* | |
| 102 | -* @package s2Member | |
| 103 | -* @since 3.0 | |
| 104 | -* | |
| 105 | -* @var str | |
| 106 | -*/ | |
| 107 | -if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION")) | |
| 108 | - define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "111206"); | |
| 106 | + * Minimum Pro version required by the Framework. | |
| 107 | + * | |
| 108 | + * @package s2Member | |
| 109 | + * @since 3.0 | |
| 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']); | |
| 109 | 116 | /* |
| 110 | 117 | Several compatibility checks. |
| 111 | 118 | If all pass, load the s2Member plugin. |
| 112 | 119 | */ |
| 113 | -if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") && version_compare (get_bloginfo ("version"), WS_PLUGIN__S2MEMBER_MIN_WP_VERSION, ">=") && !isset ($GLOBALS["WS_PLUGIN__"]["s2member"])) | |
| 120 | +if(version_compare(PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, '>=') && version_compare(get_bloginfo('version'), WS_PLUGIN__S2MEMBER_MIN_WP_VERSION, '>=') && !isset($GLOBALS['WS_PLUGIN__']['s2member'])) | |
| 121 | +{ | |
| 122 | + $GLOBALS['WS_PLUGIN__']['s2member']['l'] = __FILE__; | |
| 123 | + /* | |
| 124 | + Hook before loaded. | |
| 125 | + */ | |
| 126 | + do_action('ws_plugin__s2member_before_loaded'); | |
| 127 | + /* | |
| 128 | + System configuraton. | |
| 129 | + */ | |
| 130 | + include_once dirname(__FILE__).'/src/includes/syscon.inc.php'; | |
| 131 | + /* | |
| 132 | + Hooks and Filters. | |
| 133 | + */ | |
| 134 | + include_once dirname(__FILE__).'/src/includes/hooks.inc.php'; | |
| 135 | + /* | |
| 136 | + Hook after system config & Hooks are loaded. | |
| 137 | + */ | |
| 138 | + do_action('ws_plugin__s2member_config_hooks_loaded'); | |
| 139 | + /* | |
| 140 | + Load a possible Pro module, if/when available. | |
| 141 | + */ | |
| 142 | + if(apply_filters('ws_plugin__s2member_load_pro', TRUE)) | |
| 114 | 143 | { |
| 115 | - $GLOBALS["WS_PLUGIN__"]["s2member"]["l"] = __FILE__; | |
| 116 | - /* | |
| 117 | - Hook before loaded. | |
| 118 | - */ | |
| 119 | - do_action("ws_plugin__s2member_before_loaded"); | |
| 120 | - /* | |
| 121 | - System configuraton. | |
| 122 | - */ | |
| 123 | - include_once dirname (__FILE__) . "/includes/syscon.inc.php"; | |
| 124 | - /* | |
| 125 | - Hooks and Filters. | |
| 126 | - */ | |
| 127 | - include_once dirname (__FILE__) . "/includes/hooks.inc.php"; | |
| 128 | - /* | |
| 129 | - Hook after system config & Hooks are loaded. | |
| 130 | - */ | |
| 131 | - do_action("ws_plugin__s2member_config_hooks_loaded"); | |
| 132 | - /* | |
| 133 | - Load a possible Pro module, if/when available. | |
| 134 | - */ | |
| 135 | - if (apply_filters ("ws_plugin__s2member_load_pro", true) && file_exists (dirname (__FILE__) . "-pro/pro-module.php")) | |
| 136 | - include_once dirname (__FILE__) . "-pro/pro-module.php"; | |
| 137 | - /* | |
| 138 | - Configure options and their defaults. | |
| 139 | - */ | |
| 140 | - ws_plugin__s2member_configure_options_and_their_defaults (); | |
| 141 | - /* | |
| 142 | - Function includes. | |
| 143 | - */ | |
| 144 | - include_once dirname (__FILE__) . "/includes/funcs.inc.php"; | |
| 145 | - /* | |
| 146 | - Include Shortcodes. | |
| 147 | - */ | |
| 148 | - include_once dirname (__FILE__) . "/includes/codes.inc.php"; | |
| 149 | - /* | |
| 150 | - Hooks after loaded. | |
| 151 | - */ | |
| 152 | - do_action("ws_plugin__s2member_loaded"); | |
| 153 | - do_action("ws_plugin__s2member_after_loaded"); | |
| 144 | + if(is_file($_s2member_pro = dirname(__FILE__).'-pro/pro-module.php')) | |
| 145 | + include_once $_s2member_pro; | |
| 146 | + | |
| 147 | + else if(is_file($_s2member_pro = WP_PLUGIN_DIR.'/'.basename(dirname(__FILE__)).'-pro/pro-module.php')) | |
| 148 | + include_once $_s2member_pro; | |
| 149 | + | |
| 150 | + unset($_s2member_pro); // Housekeeping. | |
| 154 | 151 | } |
| 152 | + /* | |
| 153 | + Configure options and their defaults. | |
| 154 | + */ | |
| 155 | + ws_plugin__s2member_configure_options_and_their_defaults(); | |
| 156 | + /* | |
| 157 | + Function includes. | |
| 158 | + */ | |
| 159 | + include_once dirname(__FILE__).'/src/includes/funcs.inc.php'; | |
| 160 | + /* | |
| 161 | + Include Shortcodes. | |
| 162 | + */ | |
| 163 | + include_once dirname(__FILE__).'/src/includes/codes.inc.php'; | |
| 164 | + /* | |
| 165 | + Hooks after loaded. | |
| 166 | + */ | |
| 167 | + do_action('ws_plugin__s2member_loaded'); | |
| 168 | + do_action('ws_plugin__s2member_after_loaded'); | |
| 169 | +} | |
| 155 | 170 | /* |
| 156 | 171 | Else NOT compatible. Do we need admin compatibility errors now? |
| 157 | 172 | */ |
| 158 | -else if (is_admin ()) /* Admin compatibility errors. */ | |
| 173 | +else if(is_admin()) // Admin compatibility errors. | |
| 174 | +{ | |
| 175 | + if(!version_compare(PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, '>=')) | |
| 159 | 176 | { |
| 160 | - if (!version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=")) | |
| 161 | - { | |
| 162 | - add_action ("all_admin_notices", create_function ('', 'echo \'<div class="error fade"><p>You need PHP v\' . WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION . \'+ to use the s2Member plugin.</p></div>\';')); | |
| 163 | - } | |
| 164 | - else if (!version_compare (get_bloginfo ("version"), WS_PLUGIN__S2MEMBER_MIN_WP_VERSION, ">=")) | |
| 165 | - { | |
| 166 | - add_action ("all_admin_notices", create_function ('', 'echo \'<div class="error fade"><p>You need WordPress® v\' . WS_PLUGIN__S2MEMBER_MIN_WP_VERSION . \'+ to use the s2Member plugin.</p></div>\';')); | |
| 167 | - } | |
| 177 | + add_action('all_admin_notices', function(){ | |
| 178 | + echo '<div class="error fade"><p>You need PHP v' . WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION . '+ to use the s2Member plugin.</p></div>'; | |
| 179 | + }); | |
| 168 | 180 | } |
| 169 | -?> | |
| 181 | + else if(!version_compare(get_bloginfo('version'), WS_PLUGIN__S2MEMBER_MIN_WP_VERSION, '>=')) | |
| 182 | + { | |
| 183 | + add_action('all_admin_notices', function(){ | |
| 184 | + echo '<div class="error fade"><p>You need WordPress v' . WS_PLUGIN__S2MEMBER_MIN_WP_VERSION . '+ to use the s2Member plugin.</p></div>'; | |
| 185 | + }); | |
| 186 | + } | |
| 187 | +} | |
| 188 | +unset(${__FILE__}); // Housekeeping. | |
| 189 | + | |
| 190 | +//2300808 PayPal button encryption notice if they're using it | |
| 191 | +if (is_admin() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_btn_encryption"])) { | |
| 192 | + // Dismiss. | |
| 193 | + add_action('admin_init', function(){ | |
| 194 | + //260303 Show only to administrators. | |
| 195 | + if (!current_user_can('manage_options')) | |
| 196 | + return; | |
| 197 | + | |
| 198 | + $user_id = get_current_user_id(); | |
| 199 | + if (isset($_GET['s2-dismiss-2300808'])) | |
| 200 | + add_user_meta($user_id, 's2_notice_dismissed_2300808', 'true', true); | |
| 201 | + }); | |
| 202 | + | |
| 203 | + // Notice. | |
| 204 | + add_action('admin_notices', function(){ | |
| 205 | + //260303 Show only to administrators. | |
| 206 | + if (!current_user_can('manage_options')) | |
| 207 | + return; | |
| 208 | + | |
| 209 | + $user_id = get_current_user_id(); | |
| 210 | + $logo_url = $GLOBALS['WS_PLUGIN__']['s2member']['c']['dir_url'].'/src/images/logo-square-big.png'; | |
| 211 | + $dismiss_url = esc_url(add_query_arg('s2-dismiss-2300808', '', $_SERVER['REQUEST_URI'])); | |
| 212 | + | |
| 213 | + if (!get_user_meta($user_id, 's2_notice_dismissed_2300808')) { | |
| 214 | + echo ' | |
| 215 | + <div class="notice notice-warning" style="position:relative; margin: 0 0 15px 2px !important; padding: 0 40px 0 0 !important"> | |
| 216 | + <table cellspacing="11" cellpadding="0"><tr> | |
| 217 | + <td><img src="'.$logo_url.'" height="40" width="40" align="top" /></td> | |
| 218 | + <td><span>⚠️ PayPal has given some trouble recently with encrypted buttons, so for the time being it\'s recommended to leave encryption disabled and allow non-encrypted payments. See: <em>s2Member > PayPal Options > Account Details > Button Encryption</em></span></td> | |
| 219 | + </tr></table> | |
| 220 | + <a href="'.$dismiss_url.'" class="notice-dismiss" style="text-decoration:none;"><span class="screen-reader-text">Dismiss this notice.</span></a> | |
| 221 | + </div>'; | |
| 222 | + } | |
| 223 | + }); | |
| 224 | +} | |