PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 260909
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v260909
260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 120213 120219 120301 All 187 releases
s2member / s2member.php

s2member.php in s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions 260909, at s2member.php

225 lines 7.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // @codingStandardsIgnoreFile
3 /**
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. ------------------------------------------------------------------------------
22
23 Version: 260909
24 Stable tag: 260909
25
26 SSL Compatible: yes
27 bbPress Compatible: yes
28 WordPress Compatible: yes
29 BuddyPress Compatible: yes
30 WP Multisite Compatible: yes
31 Multisite Blog Farm Compatible: yes
32
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
38
39 Tested up to: 7.2-alpha-63521
40 Requires at least: 4.2
41
42 Requires PHP: 5.6.2
43 Tested up to PHP: 8.5.9
44
45 Copyright: © 2009 WP Sharks
46 License: GNU General Public License
47 Contributors: WebSharks, JasWSInc, anguz, raamdev, bruce-caldwell, clavaque
48
49 Author: WP Sharks
50 Author URI: http://s2member.com/
51 Donate link: http://s2member.com/r/donate
52
53 Text Domain: s2member
54 Domain Path: /languages
55
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
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.');
72 /**
73 * The installed version of s2Member.
74 *
75 * @package s2Member
76 * @since 3.0
77 *
78 * @var string
79 */
80 ${__FILE__}['tmp'] = '260909'; //version//
81 if(!defined('WS_PLUGIN__S2MEMBER_VERSION'))
82 define('WS_PLUGIN__S2MEMBER_VERSION', ${__FILE__}['tmp']);
83 /**
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']);
94 /**
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']);
105 /**
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']);
116 /*
117 Several compatibility checks.
118 If all pass, load the s2Member plugin.
119 */
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))
143 {
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.
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 }
170 /*
171 Else NOT compatible. Do we need admin compatibility errors now?
172 */
173 else if(is_admin()) // Admin compatibility errors.
174 {
175 if(!version_compare(PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, '>='))
176 {
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 });
180 }
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 }
225