PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 260917
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v260917
260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 120213 All 189 releases
← All changes | s2member.php +191 -134 110913260917 View file →
@@ -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: 110913
23 -Stable tag: 110913
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,140 +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.2.1
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 / Prices: http://www.s2member.com/prices/
58 -Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
59 -Privacy URI: http://www.primothemes.com/about/privacy-policy/
60 -PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304
61 -Professional Installation URI: http://www.s2member.com/professional-installation/
62 -Plugin URI: http://www.primothemes.com/post/product/s2member-membership-plugin-with-paypal/
63 -Description: s2Member® (Membership w/ PayPal®). Powerful (free) membership capabilities. Protect/secure members only content w/ roles/capabilities for members.
64 -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/
65 65
66 -if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
67 - 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.');
68 72 /**
69 -* The installed version of s2Member.
70 -*
71 -* @package s2Member
72 -* @since 3.0
73 -*
74 -* @var str
75 -*/
76 -if (!defined ("WS_PLUGIN__S2MEMBER_VERSION"))
77 - define ("WS_PLUGIN__S2MEMBER_VERSION", "110913");
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']);
78 83 /**
79 -* Minimum PHP version required to run s2Member.
80 -*
81 -* @package s2Member
82 -* @since 3.0
83 -*
84 -* @var str
85 -*/
86 -if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION"))
87 - 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']);
88 94 /**
89 -* Minimum WordPress® version required to run s2Member.
90 -*
91 -* @package s2Member
92 -* @since 3.0
93 -*
94 -* @var str
95 -*/
96 -if (!defined ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION"))
97 - 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']);
98 105 /**
99 -* Minimum Pro version required by the Framework.
100 -*
101 -* @package s2Member
102 -* @since 3.0
103 -*
104 -* @var str
105 -*/
106 -if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION"))
107 - define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "110913");
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']);
108 116 /*
109 117 Several compatibility checks.
110 118 If all pass, load the s2Member plugin.
111 119 */
112 -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))
113 143 {
114 - $GLOBALS["WS_PLUGIN__"]["s2member"]["l"] = __FILE__;
115 - /*
116 - Hook before loaded.
117 - */
118 - do_action ("ws_plugin__s2member_before_loaded");
119 - /*
120 - System configuraton.
121 - */
122 - include_once dirname (__FILE__) . "/includes/syscon.inc.php";
123 - /*
124 - Hooks and Filters.
125 - */
126 - include_once dirname (__FILE__) . "/includes/hooks.inc.php";
127 - /*
128 - Hook after system config & Hooks are loaded.
129 - */
130 - do_action ("ws_plugin__s2member_config_hooks_loaded");
131 - /*
132 - Load a possible Pro module, if/when available.
133 - */
134 - if (apply_filters ("ws_plugin__s2member_load_pro", true) && file_exists (dirname (__FILE__) . "-pro/pro-module.php"))
135 - include_once dirname (__FILE__) . "-pro/pro-module.php";
136 - /*
137 - Configure options and their defaults.
138 - */
139 - ws_plugin__s2member_configure_options_and_their_defaults ();
140 - /*
141 - Function includes.
142 - */
143 - include_once dirname (__FILE__) . "/includes/funcs.inc.php";
144 - /*
145 - Include Shortcodes.
146 - */
147 - include_once dirname (__FILE__) . "/includes/codes.inc.php";
148 - /*
149 - Hook after loaded.
150 - */
151 - 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.
152 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 +}
153 170 /*
154 171 Else NOT compatible. Do we need admin compatibility errors now?
155 172 */
156 -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, '>='))
157 176 {
158 - if (!version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">="))
159 - {
160 - 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>\';'));
161 - }
162 - else if (!version_compare (get_bloginfo ("version"), WS_PLUGIN__S2MEMBER_MIN_WP_VERSION, ">="))
163 - {
164 - 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>\';'));
165 - }
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 + });
166 180 }
167 -?>
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 +}