Version Description
- Bug fix. Comparison between
$_SERVER["HTTP_HOST"]
and a PayPal Custom/Proxy was failing on some servers that force a host port number into the$_SERVER["HTTP_HOST"]
environment variable. MediaTemple does this. If you're hosted by MediaTemple, and you're using the s2Member Pro Module, you should upgrade to v3.1.3+. - Bug fix. The WP_Http class, which is responsible for handling cURL, ExtHTTP, and/or fopen functionality for connections to PayPal, was defaulting to a
5
second stream timeout. Under certain conditions, this was too low ( i.e. slow responses from PayPal, and/or a WordPress MySQL database ). The default timeout has now been increased to20
seconds; which is designed to give high priority status to IPN processing routines; thereby reducing the chances of a connection timeout considerably, and improving the overall reliability of the s2Member checkout experience. - Localhost support. s2Member now supports "localhost" installations of WordPress; tested against WAMP and MAMP. Thanks to ScriptyGoddess for reporting this, and for her assistance with testing against her MAMP installation.
- General UI cleanup. In particular, the PayPal Option panels have been cleaned up a bit; making these important panels "less intimidating" to site owners that are brand new to s2Member.
- Support for File Download Restrictions, based on specific Member Level Sub-directories. For full details, please check your WP Dashboard, under:
s2Member -> API Scripting -> "Custom Capability and Member Level Files"
. - The file
/includes/s2member.js
is now a development source file. The live version is now optimized, inside:/includes/s2member-min.js
. This helps to further reduce the s2Member footprint. - Virtual terminal support
(txn_type=virtual_terminal)
has been added to the s2Member IPN processor. This provides developers with access to Hooks/Filters on Virtual Terminal transactions. - Internal optimization of s2member.css. These optimizations are designed to further reduce the footprint of s2Member.
- Bug fix. A bug was discovered in the PayPal IPN routines; specifically with
payment_status
. Under the right conditions, it was possible for a declined echeck payment to slip through with aFailed
payment status. s2Member v3.1.3+ corrects this bug.
Download this release
Release Info
Developer | PriMoThemes |
Plugin | ![]() |
Version | 3.1.3 |
Comparing to | |
See all releases |
Code changes from version 3.1.2 to 3.1.3
- includes/functions/activate-deactivate.inc.php +19 -19
- includes/functions/constants.inc.php +5 -5
- includes/functions/css-js-w-globals.inc.php +18 -14
- includes/functions/file-download-access.inc.php +15 -5
- includes/functions/is-systematic.inc.php +6 -10
- includes/functions/menu-pages.inc.php +11 -3
- includes/functions/nocache.inc.php +1 -1
- includes/functions/page-level-access.inc.php +2 -6
- includes/functions/paypal-button.inc.php +2 -2
- includes/functions/paypal-notify.inc.php +49 -13
- includes/functions/paypal-return.inc.php +30 -26
- includes/functions/paypal-utilities.inc.php +4 -4
- includes/functions/register-access.inc.php +1 -1
- includes/functions/tracking-codes.inc.php +4 -4
- includes/functions/utilities.inc.php +53 -1
- includes/mailchimp/nc-mcapi.inc.php +3 -2
- includes/menu-pages/api-ops.inc.php +12 -12
- includes/menu-pages/code-samples/level-file-downloads.php +5 -0
- includes/menu-pages/down-ops.inc.php +1 -1
- includes/menu-pages/menu-pages-min.js +1 -0
- includes/menu-pages/menu-pages-s-min.js +1 -0
- includes/menu-pages/menu-pages-s.js +31 -30
- includes/menu-pages/menu-pages.css +5 -0
- includes/menu-pages/menu-pages.js +33 -33
- includes/menu-pages/paypal-buttons.inc.php +67 -67
- includes/menu-pages/paypal-ops.inc.php +39 -17
- includes/menu-pages/scripting.inc.php +12 -3
- includes/menu-pages/start.inc.php +2 -2
- includes/menu-pages/trk-ops.inc.php +8 -8
- includes/s2member-min.js +1 -0
- includes/s2member.js +0 -5
- includes/syscon.inc.php +0 -5
- includes/templates/options/paypal-currencies.html +24 -24
- readme.txt +15 -3
- s2member.php +8 -8
includes/functions/activate-deactivate.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Check existing installations that have not been re-activated.
|
18 |
Attach to: add_action("admin_init");
|
@@ -138,9 +138,7 @@ if (!function_exists ("ws_plugin__s2member_activate"))
|
|
138 |
if (!is_array (get_option ("ws_plugin__s2member_options")))
|
139 |
update_option ("ws_plugin__s2member_options", array ());
|
140 |
/**/
|
141 |
-
|
142 |
-
/**/
|
143 |
-
if (get_option ("ws_plugin__s2member_configured")) /* If they already have s2Member configured, read the Changelog. */
|
144 |
{
|
145 |
$notice = '<strong>s2Member</strong> has been <strong>re-activated</strong>, with the latest version.<br />';
|
146 |
$notice .= 'You now have version ' . WS_PLUGIN__S2MEMBER_VERSION . '. Your existing configuration remains.<br />';
|
@@ -154,6 +152,8 @@ if (!function_exists ("ws_plugin__s2member_activate"))
|
|
154 |
ws_plugin__s2member_enqueue_admin_notice ($notice, array ("plugins.php", "ws-plugin--s2member-options"));
|
155 |
}
|
156 |
/**/
|
|
|
|
|
157 |
do_action ("ws_plugin__s2member_after_activation", get_defined_vars ());
|
158 |
/**/
|
159 |
return;
|
@@ -175,10 +175,10 @@ if (!function_exists ("ws_plugin__s2member_deactivate"))
|
|
175 |
$role = &get_role ("subscriber");
|
176 |
$role->remove_cap ("access_s2member_level0");
|
177 |
/**/
|
178 |
-
remove_role
|
179 |
-
remove_role
|
180 |
-
remove_role
|
181 |
-
remove_role
|
182 |
/**/
|
183 |
$role = &get_role ("administrator");
|
184 |
$role->remove_cap ("access_s2member_level0");
|
@@ -212,33 +212,33 @@ if (!function_exists ("ws_plugin__s2member_deactivate"))
|
|
212 |
{
|
213 |
if (file_exists ($htaccess = $files_dir . "/.htaccess"))
|
214 |
if (is_writable ($htaccess))
|
215 |
-
unlink
|
216 |
/**/
|
217 |
-
@rmdir
|
218 |
}
|
219 |
/**/
|
220 |
if (is_dir ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
221 |
{
|
222 |
if (file_exists ($htaccess = $logs_dir . "/.htaccess"))
|
223 |
if (is_writable ($htaccess))
|
224 |
-
unlink
|
225 |
/**/
|
226 |
if (file_exists ($log = $logs_dir . "/paypal-ipn.log"))
|
227 |
if (is_writable ($log))
|
228 |
-
unlink
|
229 |
/**/
|
230 |
if (file_exists ($log = $logs_dir . "/paypal-rtn.log"))
|
231 |
if (is_writable ($log))
|
232 |
-
unlink
|
233 |
/**/
|
234 |
-
@rmdir
|
235 |
}
|
236 |
/**/
|
237 |
-
delete_option
|
238 |
-
delete_option
|
239 |
-
delete_option
|
240 |
-
delete_option
|
241 |
-
delete_option
|
242 |
/**/
|
243 |
do_action ("ws_plugin__s2member_during_deactivation", get_defined_vars ());
|
244 |
}
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Check existing installations that have not been re-activated.
|
18 |
Attach to: add_action("admin_init");
|
138 |
if (!is_array (get_option ("ws_plugin__s2member_options")))
|
139 |
update_option ("ws_plugin__s2member_options", array ());
|
140 |
/**/
|
141 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"]) /* If already configured, read the Changelog. */
|
|
|
|
|
142 |
{
|
143 |
$notice = '<strong>s2Member</strong> has been <strong>re-activated</strong>, with the latest version.<br />';
|
144 |
$notice .= 'You now have version ' . WS_PLUGIN__S2MEMBER_VERSION . '. Your existing configuration remains.<br />';
|
152 |
ws_plugin__s2member_enqueue_admin_notice ($notice, array ("plugins.php", "ws-plugin--s2member-options"));
|
153 |
}
|
154 |
/**/
|
155 |
+
update_option ("ws_plugin__s2member_activated_version", WS_PLUGIN__S2MEMBER_VERSION);
|
156 |
+
/**/
|
157 |
do_action ("ws_plugin__s2member_after_activation", get_defined_vars ());
|
158 |
/**/
|
159 |
return;
|
175 |
$role = &get_role ("subscriber");
|
176 |
$role->remove_cap ("access_s2member_level0");
|
177 |
/**/
|
178 |
+
remove_role("s2member_level1");
|
179 |
+
remove_role("s2member_level2");
|
180 |
+
remove_role("s2member_level3");
|
181 |
+
remove_role("s2member_level4");
|
182 |
/**/
|
183 |
$role = &get_role ("administrator");
|
184 |
$role->remove_cap ("access_s2member_level0");
|
212 |
{
|
213 |
if (file_exists ($htaccess = $files_dir . "/.htaccess"))
|
214 |
if (is_writable ($htaccess))
|
215 |
+
unlink($htaccess);
|
216 |
/**/
|
217 |
+
@rmdir($files_dir);
|
218 |
}
|
219 |
/**/
|
220 |
if (is_dir ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
221 |
{
|
222 |
if (file_exists ($htaccess = $logs_dir . "/.htaccess"))
|
223 |
if (is_writable ($htaccess))
|
224 |
+
unlink($htaccess);
|
225 |
/**/
|
226 |
if (file_exists ($log = $logs_dir . "/paypal-ipn.log"))
|
227 |
if (is_writable ($log))
|
228 |
+
unlink($log);
|
229 |
/**/
|
230 |
if (file_exists ($log = $logs_dir . "/paypal-rtn.log"))
|
231 |
if (is_writable ($log))
|
232 |
+
unlink($log);
|
233 |
/**/
|
234 |
+
@rmdir($logs_dir);
|
235 |
}
|
236 |
/**/
|
237 |
+
delete_option("ws_plugin__s2member_activated_version");
|
238 |
+
delete_option("ws_plugin__s2member_configured");
|
239 |
+
delete_option("ws_plugin__s2member_cache");
|
240 |
+
delete_option("ws_plugin__s2member_notices");
|
241 |
+
delete_option("ws_plugin__s2member_options");
|
242 |
/**/
|
243 |
do_action ("ws_plugin__s2member_during_deactivation", get_defined_vars ());
|
244 |
}
|
includes/functions/constants.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Define several API Constants for s2Member.
|
18 |
Note that these are duplicated into the JavaScript API as well.
|
@@ -32,7 +32,7 @@ if (!function_exists ("ws_plugin__s2member_constants"))
|
|
32 |
$login_redirection_override = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) ? /* Only when applicable. */
|
33 |
ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"], $current_user) : "";
|
34 |
/**/
|
35 |
-
eval
|
36 |
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
|
37 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
38 |
/**/
|
@@ -207,14 +207,14 @@ if (!function_exists ("ws_plugin__s2member_constant_metas"))
|
|
207 |
foreach ($results as $r) /* Fill in the array we need. */
|
208 |
if ($r->meta_key === "s2member_file_download_access_log")
|
209 |
$m["s2member_file_download_access_log"] = (array)maybe_unserialize ($r->meta_value);
|
210 |
-
else if ($
|
211 |
$m["s2member_custom_fields"] = (array)maybe_unserialize ($r->meta_value);
|
212 |
else if ($r->meta_key === "s2member_subscr_id")
|
213 |
$m["s2member_subscr_id"] = (string)$r->meta_value;
|
214 |
-
else if ($
|
215 |
$m["s2member_custom"] = (string)$r->meta_value;
|
216 |
/**/
|
217 |
-
eval
|
218 |
do_action ("ws_plugin__s2member_during_constant_metas", get_defined_vars ());
|
219 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
220 |
}
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Define several API Constants for s2Member.
|
18 |
Note that these are duplicated into the JavaScript API as well.
|
32 |
$login_redirection_override = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) ? /* Only when applicable. */
|
33 |
ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"], $current_user) : "";
|
34 |
/**/
|
35 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
36 |
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
|
37 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
38 |
/**/
|
207 |
foreach ($results as $r) /* Fill in the array we need. */
|
208 |
if ($r->meta_key === "s2member_file_download_access_log")
|
209 |
$m["s2member_file_download_access_log"] = (array)maybe_unserialize ($r->meta_value);
|
210 |
+
else if ($r->meta_key === "s2member_custom_fields")
|
211 |
$m["s2member_custom_fields"] = (array)maybe_unserialize ($r->meta_value);
|
212 |
else if ($r->meta_key === "s2member_subscr_id")
|
213 |
$m["s2member_subscr_id"] = (string)$r->meta_value;
|
214 |
+
else if ($r->meta_key === "s2member_custom")
|
215 |
$m["s2member_custom"] = (string)$r->meta_value;
|
216 |
/**/
|
217 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
218 |
do_action ("ws_plugin__s2member_during_constant_metas", get_defined_vars ());
|
219 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
220 |
}
|
includes/functions/css-js-w-globals.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function adds styles to the header.
|
18 |
This function is also fired in the admin area.
|
@@ -49,15 +49,17 @@ if (!function_exists ("ws_plugin__s2member_css"))
|
|
49 |
/**/
|
50 |
if ($_GET["ws_plugin__s2member_css"])
|
51 |
{
|
52 |
-
header("Content-Type: text/css; charset=utf-8");
|
53 |
-
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
|
54 |
-
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
|
55 |
-
header("Cache-Control: max-age=604800");
|
56 |
-
header("Pragma: public");
|
57 |
/**/
|
58 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
59 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
60 |
/**/
|
|
|
|
|
61 |
include_once dirname (dirname (__FILE__)) . "/s2member.css";
|
62 |
/**/
|
63 |
do_action ("ws_plugin__s2member_during_css", get_defined_vars ());
|
@@ -86,7 +88,7 @@ if (!function_exists ("ws_plugin__s2member_add_js_w_globals"))
|
|
86 |
{
|
87 |
$a = get_defined_constants (true);
|
88 |
$c = (array)$a["user"];
|
89 |
-
unset($a);
|
90 |
/**/
|
91 |
foreach ($c as $k => $v)
|
92 |
if (preg_match ("/^S2MEMBER_/i", $k))
|
@@ -122,11 +124,11 @@ if (!function_exists ("ws_plugin__s2member_js_w_globals"))
|
|
122 |
/**/
|
123 |
if ($_GET["ws_plugin__s2member_js_w_globals"])
|
124 |
{
|
125 |
-
header("Content-Type: text/javascript; charset=utf-8");
|
126 |
-
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
|
127 |
-
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
|
128 |
-
header("Cache-Control: max-age=604800");
|
129 |
-
header("Pragma: public");
|
130 |
/**/
|
131 |
$g = "var S2MEMBER_VERSION = '" . ws_plugin__s2member_esc_sq (S2MEMBER_VERSION) . "',"; /* Since 3.0. */
|
132 |
/**/
|
@@ -194,12 +196,14 @@ if (!function_exists ("ws_plugin__s2member_js_w_globals"))
|
|
194 |
$g .= "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = '" . ws_plugin__s2member_esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) . "',";
|
195 |
$g .= "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '" . ws_plugin__s2member_esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0) . "',";
|
196 |
/**/
|
197 |
-
$g = trim ($g, " ,") .
|
198 |
/**/
|
199 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
200 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
201 |
/**/
|
202 |
-
|
|
|
|
|
203 |
/**/
|
204 |
do_action ("ws_plugin__s2member_during_js_w_globals", get_defined_vars ());
|
205 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Function adds styles to the header.
|
18 |
This function is also fired in the admin area.
|
49 |
/**/
|
50 |
if ($_GET["ws_plugin__s2member_css"])
|
51 |
{
|
52 |
+
header ("Content-Type: text/css; charset=utf-8");
|
53 |
+
header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
|
54 |
+
header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
|
55 |
+
header ("Cache-Control: max-age=604800");
|
56 |
+
header ("Pragma: public");
|
57 |
/**/
|
58 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
59 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
60 |
/**/
|
61 |
+
ob_start ("ws_plugin__s2member_compress_css"); /* Compress. */
|
62 |
+
/**/
|
63 |
include_once dirname (dirname (__FILE__)) . "/s2member.css";
|
64 |
/**/
|
65 |
do_action ("ws_plugin__s2member_during_css", get_defined_vars ());
|
88 |
{
|
89 |
$a = get_defined_constants (true);
|
90 |
$c = (array)$a["user"];
|
91 |
+
unset ($a);
|
92 |
/**/
|
93 |
foreach ($c as $k => $v)
|
94 |
if (preg_match ("/^S2MEMBER_/i", $k))
|
124 |
/**/
|
125 |
if ($_GET["ws_plugin__s2member_js_w_globals"])
|
126 |
{
|
127 |
+
header ("Content-Type: text/javascript; charset=utf-8");
|
128 |
+
header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
|
129 |
+
header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
|
130 |
+
header ("Cache-Control: max-age=604800");
|
131 |
+
header ("Pragma: public");
|
132 |
/**/
|
133 |
$g = "var S2MEMBER_VERSION = '" . ws_plugin__s2member_esc_sq (S2MEMBER_VERSION) . "',"; /* Since 3.0. */
|
134 |
/**/
|
196 |
$g .= "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = '" . ws_plugin__s2member_esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) . "',";
|
197 |
$g .= "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '" . ws_plugin__s2member_esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0) . "',";
|
198 |
/**/
|
199 |
+
$g = trim ($g, " ,") . ";"; /* Trim & add semicolon. */
|
200 |
/**/
|
201 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
202 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
203 |
/**/
|
204 |
+
echo $g . "\n"; /* Add a line break before inclusion. */
|
205 |
+
/**/
|
206 |
+
include_once dirname (dirname (__FILE__)) . "/s2member-min.js";
|
207 |
/**/
|
208 |
do_action ("ws_plugin__s2member_during_js_w_globals", get_defined_vars ());
|
209 |
/**/
|
includes/functions/file-download-access.inc.php
CHANGED
@@ -181,13 +181,23 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
|
|
181 |
&& wp_redirect (add_query_arg (array ("s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))) !== "nill")
|
182 |
exit ();
|
183 |
/**/
|
184 |
-
else if (preg_match ("/^access[_\-]s2member[_
|
185 |
{
|
186 |
-
list ($
|
187 |
-
$
|
188 |
/**/
|
189 |
-
if (!$current_user->has_cap
|
190 |
-
&& wp_redirect (add_query_arg (array ("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
exit ();
|
192 |
}
|
193 |
/**/
|
181 |
&& wp_redirect (add_query_arg (array ("s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))) !== "nill")
|
182 |
exit ();
|
183 |
/**/
|
184 |
+
else if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $_GET["s2member_file_download"])) /* Level required? */
|
185 |
{
|
186 |
+
list ($level_req) = preg_split ("/\//", $_GET["s2member_file_download"], 2); /* Which Level does this require? */
|
187 |
+
$level_req = preg_replace ("/[^0-9]/", "", $level_req);
|
188 |
/**/
|
189 |
+
if (!$current_user->has_cap ("access_s2member_level" . $level_req) /* Ok, do they have permission? */
|
190 |
+
&& wp_redirect (add_query_arg (array ("s2member_level_req" => $level_req, "s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
191 |
+
exit ();
|
192 |
+
}
|
193 |
+
/**/
|
194 |
+
else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $_GET["s2member_file_download"])) /* Custom Capability? */
|
195 |
+
{
|
196 |
+
list ($ccap_req) = preg_split ("/\//", $_GET["s2member_file_download"], 2); /* Which Capability does this require? */
|
197 |
+
$ccap_req = preg_replace ("/-/", "_", $ccap_req);
|
198 |
+
/**/
|
199 |
+
if (!$current_user->has_cap ($ccap_req) /* Ok, do they have permission? */
|
200 |
+
&& wp_redirect (add_query_arg (array ("s2member_ccap_req" => $ccap_req, "s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
201 |
exit ();
|
202 |
}
|
203 |
/**/
|
includes/functions/is-systematic.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function that determines whether we are on a systematic use page.
|
18 |
*/
|
@@ -30,11 +30,11 @@ if (!function_exists ("ws_plugin__s2member_is_systematic_use_page"))
|
|
30 |
{
|
31 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
32 |
}
|
33 |
-
else if (preg_match ("/^
|
34 |
{
|
35 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
36 |
}
|
37 |
-
else if ($_SERVER["REMOTE_ADDR"] === $_SERVER["SERVER_ADDR
|
38 |
{
|
39 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
40 |
}
|
@@ -50,11 +50,7 @@ if (!function_exists ("ws_plugin__s2member_is_systematic_use_page"))
|
|
50 |
{
|
51 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
52 |
}
|
53 |
-
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]
|
54 |
-
&& ($login_redirection_override = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]))/**/
|
55 |
-
&& ($login_redirect_path = @parse_url ($login_redirection_override, PHP_URL_PATH)) && ($login_redirect_query = @parse_url ($login_redirection_override, PHP_URL_QUERY)) !== "nill"/**/
|
56 |
-
&& ($login_redirect_uri = (($login_redirect_query) ? $login_redirect_path . "?" . $login_redirect_query : $login_redirect_path))/**/
|
57 |
-
&& preg_match ("/^" . preg_quote ($login_redirect_uri, "/") . "#x2F;", $_SERVER["REQUEST_URI"]))
|
58 |
{
|
59 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
60 |
}
|
@@ -62,9 +58,9 @@ if (!function_exists ("ws_plugin__s2member_is_systematic_use_page"))
|
|
62 |
{
|
63 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
64 |
}
|
65 |
-
else if (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && ($_SERVER["REQUEST_URI
|
66 |
{
|
67 |
-
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
68 |
}
|
69 |
else /* Otherwise, we return false. */
|
70 |
{
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Function that determines whether we are on a systematic use page.
|
18 |
*/
|
30 |
{
|
31 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
32 |
}
|
33 |
+
else if (preg_match ("/^CLI#x2F;i", PHP_SAPI))
|
34 |
{
|
35 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
36 |
}
|
37 |
+
else if ($_SERVER["REMOTE_ADDR"] === $_SERVER["SERVER_ADDR"] && !preg_match ("/^localhost(\:[0-9]+)?#x2F;i", $_SERVER["HTTP_HOST"]))
|
38 |
{
|
39 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
40 |
}
|
50 |
{
|
51 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
52 |
}
|
53 |
+
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_override = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"])) && ($login_redirect_path = parse_url ($login_redirection_override, PHP_URL_PATH)) !== "nill" && ($login_redirect_query = parse_url ($login_redirection_override, PHP_URL_QUERY)) !== "nill" && ($login_redirect_uri = (($login_redirect_query) ? $login_redirect_path . "?" . $login_redirect_query : $login_redirect_path)) && preg_match ("/^" . preg_quote ($login_redirect_uri, "/") . "#x2F;", $_SERVER["REQUEST_URI"]))
|
|
|
|
|
|
|
|
|
54 |
{
|
55 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
56 |
}
|
58 |
{
|
59 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
60 |
}
|
61 |
+
else if (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && (parse_url ($_SERVER["REQUEST_URI"], PHP_URL_PATH) === "/" || parse_url (rtrim ($_SERVER["REQUEST_URI"], "/"), PHP_URL_PATH) === parse_url (rtrim (get_bloginfo ("url"), "/"), PHP_URL_PATH)))
|
62 |
{
|
63 |
+
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
64 |
}
|
65 |
else /* Otherwise, we return false. */
|
66 |
{
|
includes/functions/menu-pages.inc.php
CHANGED
@@ -117,7 +117,7 @@ if (!function_exists ("ws_plugin__s2member_add_admin_options"))
|
|
117 |
add_submenu_page ("ws-plugin--s2member-options", "s2Member Information", "s2Member Info", "edit_plugins", "ws-plugin--s2member-info", "ws_plugin__s2member_info_page");
|
118 |
/**/
|
119 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars ()))
|
120 |
-
add_submenu_page ("ws-plugin--s2member-options", "s2Member Quick
|
121 |
}
|
122 |
/**/
|
123 |
do_action ("ws_plugin__s2member_after_add_admin_options", get_defined_vars ());
|
@@ -218,8 +218,11 @@ if (!function_exists ("ws_plugin__s2member_menu_pages_js"))
|
|
218 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
219 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
220 |
/**/
|
221 |
-
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages.js";
|
222 |
-
|
|
|
|
|
|
|
223 |
/**/
|
224 |
do_action ("ws_plugin__s2member_during_menu_pages_js", get_defined_vars ());
|
225 |
/**/
|
@@ -250,7 +253,12 @@ if (!function_exists ("ws_plugin__s2member_menu_pages_css"))
|
|
250 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
251 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
252 |
/**/
|
|
|
|
|
253 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages.css";
|
|
|
|
|
|
|
254 |
@include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-s.css";
|
255 |
/**/
|
256 |
do_action ("ws_plugin__s2member_during_menu_pages_css", get_defined_vars ());
|
117 |
add_submenu_page ("ws-plugin--s2member-options", "s2Member Information", "s2Member Info", "edit_plugins", "ws-plugin--s2member-info", "ws_plugin__s2member_info_page");
|
118 |
/**/
|
119 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars ()))
|
120 |
+
add_submenu_page ("ws-plugin--s2member-options", "s2Member Quick-Start Guide", "Quick-Start Guide", "edit_plugins", "ws-plugin--s2member-start", "ws_plugin__s2member_start_page");
|
121 |
}
|
122 |
/**/
|
123 |
do_action ("ws_plugin__s2member_after_add_admin_options", get_defined_vars ());
|
218 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
219 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
220 |
/**/
|
221 |
+
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-min.js";
|
222 |
+
/**/
|
223 |
+
echo "\n"; /* Add a line break before inclusion of this file. */
|
224 |
+
/**/
|
225 |
+
@include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-s-min.js";
|
226 |
/**/
|
227 |
do_action ("ws_plugin__s2member_during_menu_pages_js", get_defined_vars ());
|
228 |
/**/
|
253 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
254 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
255 |
/**/
|
256 |
+
ob_start("ws_plugin__s2member_compress_css"); /* Compress. */
|
257 |
+
/**/
|
258 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages.css";
|
259 |
+
/**/
|
260 |
+
echo "\n"; /* Add a line break before inclusion of this file. */
|
261 |
+
/**/
|
262 |
@include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-s.css";
|
263 |
/**/
|
264 |
do_action ("ws_plugin__s2member_during_menu_pages_css", get_defined_vars ());
|
includes/functions/nocache.inc.php
CHANGED
@@ -64,7 +64,7 @@ if (!function_exists ("ws_plugin__s2member_nocache_constants"))
|
|
64 |
do_action ("ws_plugin__s2member_before_nocache_constants", get_defined_vars ());
|
65 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
66 |
/**/
|
67 |
-
if (!$_GET["qcAC"] && ($nocache || is_user_logged_in () || (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && ($_SERVER["REQUEST_URI
|
68 |
{
|
69 |
define ("QUICK_CACHE_ALLOWED", false) . define ("DONOTCACHEPAGE", true);
|
70 |
/**/
|
64 |
do_action ("ws_plugin__s2member_before_nocache_constants", get_defined_vars ());
|
65 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
66 |
/**/
|
67 |
+
if (!$_GET["qcAC"] && ($nocache || is_user_logged_in () || (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && (parse_url ($_SERVER["REQUEST_URI"], PHP_URL_PATH) === "/" || parse_url (rtrim ($_SERVER["REQUEST_URI"], "/"), PHP_URL_PATH) === parse_url (rtrim (get_bloginfo ("url"), "/"), PHP_URL_PATH)))))
|
68 |
{
|
69 |
define ("QUICK_CACHE_ALLOWED", false) . define ("DONOTCACHEPAGE", true);
|
70 |
/**/
|
includes/functions/page-level-access.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function for handling Page Level Access permissions.
|
18 |
Attach to: add_action("template_redirect");
|
@@ -34,11 +34,7 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
|
|
34 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
35 |
exit ();
|
36 |
/**/
|
37 |
-
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]
|
38 |
-
&& ($login_redirection_override = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]))/**/
|
39 |
-
&& ($login_redirect_path = @parse_url ($login_redirection_override, PHP_URL_PATH)) && ($login_redirect_query = @parse_url ($login_redirection_override, PHP_URL_QUERY)) !== "nill"/**/
|
40 |
-
&& ($login_redirect_uri = (($login_redirect_query) ? $login_redirect_path . "?" . $login_redirect_query : $login_redirect_path))/**/
|
41 |
-
&& preg_match ("/^" . preg_quote ($login_redirect_uri, "/") . "#x2F;", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
42 |
exit ();
|
43 |
/**/
|
44 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function for handling Page Level Access permissions.
|
18 |
Attach to: add_action("template_redirect");
|
34 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
35 |
exit ();
|
36 |
/**/
|
37 |
+
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_override = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"])) && ($login_redirect_path = parse_url ($login_redirection_override, PHP_URL_PATH)) !== "nill" && ($login_redirect_query = parse_url ($login_redirection_override, PHP_URL_QUERY)) !== "nill" && ($login_redirect_uri = (($login_redirect_query) ? $login_redirect_path . "?" . $login_redirect_query : $login_redirect_path)) && preg_match ("/^" . preg_quote ($login_redirect_uri, "/") . "#x2F;", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
|
|
|
|
|
|
|
|
38 |
exit ();
|
39 |
/**/
|
40 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
includes/functions/paypal-button.inc.php
CHANGED
@@ -76,7 +76,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_button"))
|
|
76 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code);
|
77 |
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $code);
|
78 |
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $code);
|
79 |
-
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr
|
80 |
/**/
|
81 |
$code = preg_replace ('/ name\="item_name" value\="(.*?)"/', ' name="item_name" value="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["desc"])) . '"', $code);
|
82 |
$code = preg_replace ('/ name\="item_number" value\="(.*?)"/', ' name="item_number" value="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["sp_ids_exp"])) . '"', $code);
|
@@ -105,7 +105,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_button"))
|
|
105 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code); /* This brings them back to Front Page. */
|
106 |
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $code);
|
107 |
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $code);
|
108 |
-
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr
|
109 |
$code = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ($attr["level"])), $code);
|
110 |
/**/
|
111 |
$code = preg_replace ('/ \<\!--(\<input type\="hidden" name\="(amount|src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/', " $1", $code);
|
76 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code);
|
77 |
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $code);
|
78 |
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $code);
|
79 |
+
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $code);
|
80 |
/**/
|
81 |
$code = preg_replace ('/ name\="item_name" value\="(.*?)"/', ' name="item_name" value="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["desc"])) . '"', $code);
|
82 |
$code = preg_replace ('/ name\="item_number" value\="(.*?)"/', ' name="item_number" value="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["sp_ids_exp"])) . '"', $code);
|
105 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code); /* This brings them back to Front Page. */
|
106 |
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $code);
|
107 |
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $code);
|
108 |
+
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $code);
|
109 |
$code = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ($attr["level"])), $code);
|
110 |
/**/
|
111 |
$code = preg_replace ('/ \<\!--(\<input type\="hidden" name\="(amount|src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/', " $1", $code);
|
includes/functions/paypal-notify.inc.php
CHANGED
@@ -43,11 +43,14 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
43 |
$paypal["s2member_log"][] = "s2Member POST vars verified through a POST back to PayPal®.";
|
44 |
/**/
|
45 |
$paypal["custom"] = (!$paypal["custom"]) ? ws_plugin__s2member_paypal_custom ($paypal["recurring_payment_id"]) : $paypal["custom"];
|
|
|
|
|
|
|
46 |
/* Notifications following the PayPal® Pro format for recurring payments, do NOT carry the "custom" value, so we do a lookup.
|
47 |
This is only crucial for one IPN call in Standard Integration: `txn_type=recurring_payment_suspended_due_to_max_failed_payment`.
|
48 |
In Pro Integrations, we just need to make sure the "custom" field is assigned for each account during on-site checkout.
|
49 |
This way the "custom" value will always be available when it needs to be; for both Standard and Pro services. */
|
50 |
-
if (preg_match ("/^" . preg_quote
|
51 |
{ /* The business address validation was removed from this routine, because PayPal® always fills that with the primary
|
52 |
email address. In cases where an alternate PayPal® address is being paid, validation was not possible. */
|
53 |
$paypal["s2member_log"][] = "s2Member originating domain ( _SERVER[HTTP_HOST] ) validated.";
|
@@ -59,13 +62,42 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
59 |
{
|
60 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
61 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
Express Checkout transactions.
|
63 |
This is not really necessary. It is only here because this txn_type could
|
64 |
be necessary in a future release of s2Member. For now, it's just a fill-in.
|
65 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
66 |
*/
|
67 |
-
if (/**/preg_match ("/^express_checkout#x2F;i", $paypal["txn_type"])/**/
|
68 |
-
&&
|
|
|
69 |
{
|
70 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
71 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
|
@@ -93,7 +125,8 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
93 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
94 |
*/
|
95 |
else if (/**/preg_match ("/^cart#x2F;i", $paypal["txn_type"])/**/
|
96 |
-
&&
|
|
|
97 |
{
|
98 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
99 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
|
@@ -119,6 +152,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
119 |
*/
|
120 |
else if (/**/preg_match ("/^web_accept#x2F;i", $paypal["txn_type"])/**/
|
121 |
&& preg_match ("/^sp\:[0-9,]+\:[0-9]+#x2F;", $paypal["item_number"])/**/
|
|
|
122 |
&& $paypal["payer_email"] && $paypal["txn_id"]/**/)
|
123 |
{
|
124 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
@@ -241,8 +275,9 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
241 |
( option_name1, option_selection1 ); which allow account modifications.
|
242 |
*/
|
243 |
else if (/**/preg_match ("/^(web_accept|subscr_signup)#x2F;i", $paypal["txn_type"])/**/
|
244 |
-
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
245 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
|
|
|
|
246 |
&& $paypal["payer_email"]/**/)
|
247 |
{
|
248 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
@@ -483,11 +518,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
483 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
484 |
*/
|
485 |
else if (/**/preg_match ("/^recurring_payment_profile_created#x2F;i", $paypal["txn_type"])/**/
|
486 |
-
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
487 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
488 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
|
|
489 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/)
|
490 |
-
/*
|
491 |
{
|
492 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
493 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
|
@@ -576,9 +611,10 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
576 |
We need these to update: `s2member_last_payment_time`.
|
577 |
*/
|
578 |
else if (/**/preg_match ("/^(subscr_payment|recurring_payment)#x2F;i", $paypal["txn_type"])/**/
|
579 |
-
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
580 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
581 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
|
|
|
|
582 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
583 |
&& $paypal["payer_email"] && $paypal["txn_id"] && $paypal["mc_gross"]/**/)
|
584 |
{
|
@@ -641,9 +677,9 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
641 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
642 |
*/
|
643 |
else if (/**/preg_match ("/^(subscr_failed|recurring_payment_failed|recurring_payment_skipped)#x2F;i", $paypal["txn_type"])/**/
|
644 |
-
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
645 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
646 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
|
|
647 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
648 |
&& $paypal["payer_email"]/**/)
|
649 |
{
|
@@ -675,11 +711,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
675 |
*/
|
676 |
else if (/**/preg_match ("/^(subscr_cancel|recurring_payment_profile_cancel)#x2F;i", $paypal["txn_type"])/**/
|
677 |
&& !(preg_match ("/^recurring_payment_profile_cancel#x2F;i", $paypal["txn_type"]) && preg_match ("/^failed#x2F;i", $paypal["initial_payment_status"]))/**/
|
678 |
-
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
679 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
680 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
681 |
&& ($paypal["period1"] || ($paypal["period1"] = ws_plugin__s2member_paypal_pro_period1 ($paypal)))/**/
|
682 |
&& ($paypal["period3"] || ($paypal["period3"] = ws_plugin__s2member_paypal_pro_period3 ($paypal)))/**/
|
|
|
683 |
&& $paypal["payer_email"]/**/)
|
684 |
{
|
685 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
@@ -728,9 +764,9 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
728 |
|| (preg_match ("/^recurring_payment_profile_cancel#x2F;i", $paypal["txn_type"]) && preg_match ("/^failed#x2F;i", $paypal["initial_payment_status"]))/**/
|
729 |
|| (preg_match ("/^new_case#x2F;i", $paypal["txn_type"]) && preg_match ("/^chargeback#x2F;i", $paypal["case_type"]))/**/
|
730 |
|| (!$paypal["txn_type"] && preg_match ("/^(refunded|reversed)#x2F;i", $paypal["payment_status"]))/**/)/**/
|
731 |
-
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/
|
732 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
733 |
-
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number
|
|
|
734 |
{
|
735 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
736 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
|
@@ -873,7 +909,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
873 |
}
|
874 |
else
|
875 |
{
|
876 |
-
$paypal["s2member_log"][] = "Ignoring this IPN request. The txn_type does not require any action on the part of s2Member.";
|
877 |
}
|
878 |
}
|
879 |
else /* Else a custom conditional has been applied by filters. */
|
43 |
$paypal["s2member_log"][] = "s2Member POST vars verified through a POST back to PayPal®.";
|
44 |
/**/
|
45 |
$paypal["custom"] = (!$paypal["custom"]) ? ws_plugin__s2member_paypal_custom ($paypal["recurring_payment_id"]) : $paypal["custom"];
|
46 |
+
/**/
|
47 |
+
$payment_status_issues = "/^(failed|denied|expired|refunded|reversed|reversal|canceled_reversal|voided)#x2F;i";
|
48 |
+
/**/
|
49 |
/* Notifications following the PayPal® Pro format for recurring payments, do NOT carry the "custom" value, so we do a lookup.
|
50 |
This is only crucial for one IPN call in Standard Integration: `txn_type=recurring_payment_suspended_due_to_max_failed_payment`.
|
51 |
In Pro Integrations, we just need to make sure the "custom" field is assigned for each account during on-site checkout.
|
52 |
This way the "custom" value will always be available when it needs to be; for both Standard and Pro services. */
|
53 |
+
if (preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)#x2F;", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"]))
|
54 |
{ /* The business address validation was removed from this routine, because PayPal® always fills that with the primary
|
55 |
email address. In cases where an alternate PayPal® address is being paid, validation was not possible. */
|
56 |
$paypal["s2member_log"][] = "s2Member originating domain ( _SERVER[HTTP_HOST] ) validated.";
|
62 |
{
|
63 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
64 |
/*
|
65 |
+
Virtual Terminal transactions.
|
66 |
+
This is not really necessary. It is only here because this txn_type could
|
67 |
+
be necessary in a future release of s2Member. For now, it's just a fill-in.
|
68 |
+
These Hooks/Filters will remain, so you can use them now; if you need to.
|
69 |
+
*/
|
70 |
+
if (/**/preg_match ("/^virtual_terminal#x2F;i", $paypal["txn_type"])/**/
|
71 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
72 |
+
&& $paypal["txn_id"]/**/)
|
73 |
+
{
|
74 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
75 |
+
do_action ("ws_plugin__s2member_during_paypal_notify_before_virtual_terminal", get_defined_vars ());
|
76 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
77 |
+
/**/
|
78 |
+
$paypal["s2member_log"][] = "s2Member txn_type identified as virtual_terminal.";
|
79 |
+
/**/
|
80 |
+
$processing = $during = true; /* Yes, we ARE processing this. */
|
81 |
+
/**/
|
82 |
+
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
83 |
+
/**/
|
84 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
85 |
+
do_action ("ws_plugin__s2member_during_paypal_notify_during_virtual_terminal", get_defined_vars ());
|
86 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
87 |
+
/**/
|
88 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
89 |
+
do_action ("ws_plugin__s2member_during_paypal_notify_after_virtual_terminal", get_defined_vars ());
|
90 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
91 |
+
}
|
92 |
+
/*
|
93 |
Express Checkout transactions.
|
94 |
This is not really necessary. It is only here because this txn_type could
|
95 |
be necessary in a future release of s2Member. For now, it's just a fill-in.
|
96 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
97 |
*/
|
98 |
+
else if (/**/preg_match ("/^express_checkout#x2F;i", $paypal["txn_type"])/**/
|
99 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
100 |
+
&& $paypal["txn_id"]/**/)
|
101 |
{
|
102 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
103 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
|
125 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
126 |
*/
|
127 |
else if (/**/preg_match ("/^cart#x2F;i", $paypal["txn_type"])/**/
|
128 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
129 |
+
&& $paypal["txn_id"]/**/)
|
130 |
{
|
131 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
132 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
|
152 |
*/
|
153 |
else if (/**/preg_match ("/^web_accept#x2F;i", $paypal["txn_type"])/**/
|
154 |
&& preg_match ("/^sp\:[0-9,]+\:[0-9]+#x2F;", $paypal["item_number"])/**/
|
155 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
156 |
&& $paypal["payer_email"] && $paypal["txn_id"]/**/)
|
157 |
{
|
158 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
275 |
( option_name1, option_selection1 ); which allow account modifications.
|
276 |
*/
|
277 |
else if (/**/preg_match ("/^(web_accept|subscr_signup)#x2F;i", $paypal["txn_type"])/**/
|
|
|
278 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
279 |
+
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
280 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
281 |
&& $paypal["payer_email"]/**/)
|
282 |
{
|
283 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
518 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
519 |
*/
|
520 |
else if (/**/preg_match ("/^recurring_payment_profile_created#x2F;i", $paypal["txn_type"])/**/
|
|
|
521 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
522 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
523 |
+
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
524 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/)
|
525 |
+
/* "payer_email" is not passed in `recurring_payment_profile_created` ?? */
|
526 |
{
|
527 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
528 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
|
611 |
We need these to update: `s2member_last_payment_time`.
|
612 |
*/
|
613 |
else if (/**/preg_match ("/^(subscr_payment|recurring_payment)#x2F;i", $paypal["txn_type"])/**/
|
|
|
614 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
615 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
616 |
+
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
617 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"]) /* Status OK? */
|
618 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
619 |
&& $paypal["payer_email"] && $paypal["txn_id"] && $paypal["mc_gross"]/**/)
|
620 |
{
|
677 |
These Hooks/Filters will remain, so you can use them now; if you need to.
|
678 |
*/
|
679 |
else if (/**/preg_match ("/^(subscr_failed|recurring_payment_failed|recurring_payment_skipped)#x2F;i", $paypal["txn_type"])/**/
|
|
|
680 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
681 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
682 |
+
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
683 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
684 |
&& $paypal["payer_email"]/**/)
|
685 |
{
|
711 |
*/
|
712 |
else if (/**/preg_match ("/^(subscr_cancel|recurring_payment_profile_cancel)#x2F;i", $paypal["txn_type"])/**/
|
713 |
&& !(preg_match ("/^recurring_payment_profile_cancel#x2F;i", $paypal["txn_type"]) && preg_match ("/^failed#x2F;i", $paypal["initial_payment_status"]))/**/
|
|
|
714 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
715 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
716 |
&& ($paypal["period1"] || ($paypal["period1"] = ws_plugin__s2member_paypal_pro_period1 ($paypal)))/**/
|
717 |
&& ($paypal["period3"] || ($paypal["period3"] = ws_plugin__s2member_paypal_pro_period3 ($paypal)))/**/
|
718 |
+
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
719 |
&& $paypal["payer_email"]/**/)
|
720 |
{
|
721 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
764 |
|| (preg_match ("/^recurring_payment_profile_cancel#x2F;i", $paypal["txn_type"]) && preg_match ("/^failed#x2F;i", $paypal["initial_payment_status"]))/**/
|
765 |
|| (preg_match ("/^new_case#x2F;i", $paypal["txn_type"]) && preg_match ("/^chargeback#x2F;i", $paypal["case_type"]))/**/
|
766 |
|| (!$paypal["txn_type"] && preg_match ("/^(refunded|reversed)#x2F;i", $paypal["payment_status"]))/**/)/**/
|
|
|
767 |
&& ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
|
768 |
+
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
769 |
+
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/)
|
770 |
{
|
771 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
772 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
|
909 |
}
|
910 |
else
|
911 |
{
|
912 |
+
$paypal["s2member_log"][] = "Ignoring this IPN request. The txn_type/status does not require any action on the part of s2Member.";
|
913 |
}
|
914 |
}
|
915 |
else /* Else a custom conditional has been applied by filters. */
|
includes/functions/paypal-return.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Handles PayPal® Return URL processing.
|
18 |
This is used ONLY in PayPal® Standard Integration.
|
@@ -31,14 +31,16 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
31 |
$paypal["s2member_log"][] = "Return-Data received on: " . date ("D M j, Y g:i:s a T");
|
32 |
$paypal["s2member_log"][] = "s2Member POST vars verified through a POST back to PayPal®.";
|
33 |
/**/
|
34 |
-
|
|
|
|
|
35 |
{ /* The business address validation was removed from this routine, because PayPal® always fills that with the primary
|
36 |
email address. In cases where an alternate PayPal® address is being paid, validation was not possible. */
|
37 |
$paypal["s2member_log"][] = "s2Member originating domain ( _SERVER[HTTP_HOST] ) validated.";
|
38 |
/*
|
39 |
Custom conditionals can be applied by filters.
|
40 |
*/
|
41 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
42 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_return_conditionals", false, get_defined_vars ()))
|
43 |
{
|
44 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -47,9 +49,10 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
47 |
*/
|
48 |
if (/**/preg_match ("/^web_accept#x2F;i", $paypal["txn_type"])/**/
|
49 |
&& preg_match ("/^sp\:[0-9,]+\:[0-9]+#x2F;", $paypal["item_number"])/**/
|
|
|
50 |
&& $paypal["txn_id"]/**/)
|
51 |
{
|
52 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
53 |
do_action ("ws_plugin__s2member_during_paypal_return_before_sp_access", get_defined_vars ());
|
54 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
55 |
/**/
|
@@ -80,13 +83,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
80 |
}
|
81 |
}
|
82 |
/**/
|
83 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
84 |
do_action ("ws_plugin__s2member_during_paypal_return_during_sp_access", get_defined_vars ());
|
85 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
86 |
/**/
|
87 |
$paypal["s2member_log"][] = "Redirecting Customer to the Specific Post/Page.";
|
88 |
/**/
|
89 |
-
header("Location: " . $sp_access_url);
|
90 |
}
|
91 |
else /* Otherwise, the ID must have been invalid. Or the Post/Page was deleted. */
|
92 |
{
|
@@ -100,7 +103,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
100 |
echo '</script>' . "\n";
|
101 |
}
|
102 |
/**/
|
103 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
104 |
do_action ("ws_plugin__s2member_during_paypal_return_after_sp_access", get_defined_vars ());
|
105 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
106 |
}
|
@@ -110,12 +113,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
110 |
( option_name1, option_selection1 ); which allow account modifications.
|
111 |
*/
|
112 |
else if (/**/preg_match ("/^(web_accept|subscr_signup|subscr_payment)#x2F;i", $paypal["txn_type"])/**/
|
|
|
113 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
114 |
-
&& preg_match
|
115 |
{ /* With Auto-Return/PDT, PayPal will send subscr_payment instead of subscr_signup to the return URL.
|
116 |
So we need to look for (web_accept|subscr_signup|subscr_payment), and treat them as the same. */
|
117 |
/**/
|
118 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
119 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup", get_defined_vars ());
|
120 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
121 |
/**/
|
@@ -129,7 +133,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
129 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified. PayPal® will not allow the
|
130 |
modify=2 parameter to be used in those scenarios, because technically there is nothing to update. The only thing to be updated is the account. */
|
131 |
{
|
132 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
133 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_w_update_vars", get_defined_vars ());
|
134 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
135 |
/**/
|
@@ -166,7 +170,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
166 |
/**/
|
167 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated w/ advanced update routines.";
|
168 |
/**/
|
169 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
170 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_w_update_vars", get_defined_vars ());
|
171 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
172 |
/**/
|
@@ -201,7 +205,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
201 |
echo '</script>' . "\n";
|
202 |
}
|
203 |
/**/
|
204 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
205 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_w_update_vars", get_defined_vars ());
|
206 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
207 |
}
|
@@ -210,7 +214,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
210 |
*/
|
211 |
else /* Else this is a normal Subscription signup, we are not updating an existing Subscription. */
|
212 |
{
|
213 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
214 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
215 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
216 |
/**/
|
@@ -224,7 +228,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
224 |
/**/
|
225 |
$paypal["s2member_log"][] = "Registration Cookies set on (web_accept|subscr_signup|subscr_payment) w/o update vars.";
|
226 |
/**/
|
227 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
228 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
229 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
230 |
/**/
|
@@ -235,12 +239,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
235 |
echo "window.location = '" . esc_js (add_query_arg ("action", "register", wp_login_url ())) . "';" . "\n";
|
236 |
echo '</script>' . "\n";
|
237 |
/**/
|
238 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
239 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
240 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
241 |
}
|
242 |
/**/
|
243 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
244 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup", get_defined_vars ());
|
245 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
246 |
}
|
@@ -251,7 +255,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
251 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
252 |
&& $paypal["subscr_id"]/**/)
|
253 |
{
|
254 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
255 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_modify", get_defined_vars ());
|
256 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
257 |
/**/
|
@@ -285,7 +289,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
285 |
/**/
|
286 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated on Subscription modification.";
|
287 |
/**/
|
288 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
289 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_modify", get_defined_vars ());
|
290 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
291 |
/**/
|
@@ -320,18 +324,18 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
320 |
echo '</script>' . "\n";
|
321 |
}
|
322 |
/**/
|
323 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
324 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_modify", get_defined_vars ());
|
325 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
326 |
}
|
327 |
else
|
328 |
{
|
329 |
-
$paypal["s2member_log"][] = "Unexpected txn_type. The PayPal® txn_type did not match a required action.";
|
330 |
/**/
|
331 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
332 |
/**/
|
333 |
echo '<script type="text/javascript">' . "\n";
|
334 |
-
echo "alert('ERROR: Unexpected txn_type. Please contact Support for assistance.\\n\\nThe PayPal® txn_type did not match a required action.');" . "\n";
|
335 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
336 |
echo '</script>' . "\n";
|
337 |
}
|
@@ -353,13 +357,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
353 |
}
|
354 |
else if (!isset ($_GET["tx"]) && (empty ($_POST) || $_POST["auth"]))
|
355 |
{
|
356 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
357 |
do_action ("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars ());
|
358 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
359 |
/**/
|
360 |
$paypal["s2member_log"][] = "No Return-Data from PayPal®. Customer must wait for Email Confirmation.";
|
361 |
/**/
|
362 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
363 |
do_action ("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars ());
|
364 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
365 |
/**/
|
@@ -371,7 +375,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
371 |
echo "window.location = '" . esc_js (get_bloginfo ("url")) . "';";
|
372 |
echo '</script>' . "\n";
|
373 |
/**/
|
374 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
375 |
do_action ("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars ());
|
376 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
377 |
}
|
@@ -399,14 +403,14 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
399 |
if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
400 |
file_put_contents ($logs_dir . "/paypal-rtn.log", var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
401 |
/**/
|
402 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
403 |
do_action ("ws_plugin__s2member_during_paypal_return", get_defined_vars ());
|
404 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
405 |
/**/
|
406 |
exit ();
|
407 |
}
|
408 |
/**/
|
409 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
410 |
do_action ("ws_plugin__s2member_after_paypal_return", get_defined_vars ());
|
411 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
412 |
}
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Handles PayPal® Return URL processing.
|
18 |
This is used ONLY in PayPal® Standard Integration.
|
31 |
$paypal["s2member_log"][] = "Return-Data received on: " . date ("D M j, Y g:i:s a T");
|
32 |
$paypal["s2member_log"][] = "s2Member POST vars verified through a POST back to PayPal®.";
|
33 |
/**/
|
34 |
+
$payment_status_issues = "/^(failed|denied|expired|refunded|reversed|reversal|canceled_reversal|voided)#x2F;i";
|
35 |
+
/**/
|
36 |
+
if (preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)#x2F;", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"]))
|
37 |
{ /* The business address validation was removed from this routine, because PayPal® always fills that with the primary
|
38 |
email address. In cases where an alternate PayPal® address is being paid, validation was not possible. */
|
39 |
$paypal["s2member_log"][] = "s2Member originating domain ( _SERVER[HTTP_HOST] ) validated.";
|
40 |
/*
|
41 |
Custom conditionals can be applied by filters.
|
42 |
*/
|
43 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
44 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_return_conditionals", false, get_defined_vars ()))
|
45 |
{
|
46 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
49 |
*/
|
50 |
if (/**/preg_match ("/^web_accept#x2F;i", $paypal["txn_type"])/**/
|
51 |
&& preg_match ("/^sp\:[0-9,]+\:[0-9]+#x2F;", $paypal["item_number"])/**/
|
52 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
53 |
&& $paypal["txn_id"]/**/)
|
54 |
{
|
55 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
56 |
do_action ("ws_plugin__s2member_during_paypal_return_before_sp_access", get_defined_vars ());
|
57 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
58 |
/**/
|
83 |
}
|
84 |
}
|
85 |
/**/
|
86 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
87 |
do_action ("ws_plugin__s2member_during_paypal_return_during_sp_access", get_defined_vars ());
|
88 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
89 |
/**/
|
90 |
$paypal["s2member_log"][] = "Redirecting Customer to the Specific Post/Page.";
|
91 |
/**/
|
92 |
+
header ("Location: " . $sp_access_url);
|
93 |
}
|
94 |
else /* Otherwise, the ID must have been invalid. Or the Post/Page was deleted. */
|
95 |
{
|
103 |
echo '</script>' . "\n";
|
104 |
}
|
105 |
/**/
|
106 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
107 |
do_action ("ws_plugin__s2member_during_paypal_return_after_sp_access", get_defined_vars ());
|
108 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
109 |
}
|
113 |
( option_name1, option_selection1 ); which allow account modifications.
|
114 |
*/
|
115 |
else if (/**/preg_match ("/^(web_accept|subscr_signup|subscr_payment)#x2F;i", $paypal["txn_type"])/**/
|
116 |
+
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
117 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
118 |
+
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/)
|
119 |
{ /* With Auto-Return/PDT, PayPal will send subscr_payment instead of subscr_signup to the return URL.
|
120 |
So we need to look for (web_accept|subscr_signup|subscr_payment), and treat them as the same. */
|
121 |
/**/
|
122 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
123 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup", get_defined_vars ());
|
124 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
125 |
/**/
|
133 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified. PayPal® will not allow the
|
134 |
modify=2 parameter to be used in those scenarios, because technically there is nothing to update. The only thing to be updated is the account. */
|
135 |
{
|
136 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
137 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_w_update_vars", get_defined_vars ());
|
138 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
139 |
/**/
|
170 |
/**/
|
171 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated w/ advanced update routines.";
|
172 |
/**/
|
173 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
174 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_w_update_vars", get_defined_vars ());
|
175 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
176 |
/**/
|
205 |
echo '</script>' . "\n";
|
206 |
}
|
207 |
/**/
|
208 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
209 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_w_update_vars", get_defined_vars ());
|
210 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
211 |
}
|
214 |
*/
|
215 |
else /* Else this is a normal Subscription signup, we are not updating an existing Subscription. */
|
216 |
{
|
217 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
218 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
219 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
220 |
/**/
|
228 |
/**/
|
229 |
$paypal["s2member_log"][] = "Registration Cookies set on (web_accept|subscr_signup|subscr_payment) w/o update vars.";
|
230 |
/**/
|
231 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
232 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
233 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
234 |
/**/
|
239 |
echo "window.location = '" . esc_js (add_query_arg ("action", "register", wp_login_url ())) . "';" . "\n";
|
240 |
echo '</script>' . "\n";
|
241 |
/**/
|
242 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
243 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
244 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
245 |
}
|
246 |
/**/
|
247 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
248 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup", get_defined_vars ());
|
249 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
250 |
}
|
255 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])/**/
|
256 |
&& $paypal["subscr_id"]/**/)
|
257 |
{
|
258 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
259 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_modify", get_defined_vars ());
|
260 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
261 |
/**/
|
289 |
/**/
|
290 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated on Subscription modification.";
|
291 |
/**/
|
292 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
293 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_modify", get_defined_vars ());
|
294 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
295 |
/**/
|
324 |
echo '</script>' . "\n";
|
325 |
}
|
326 |
/**/
|
327 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
328 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_modify", get_defined_vars ());
|
329 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
330 |
}
|
331 |
else
|
332 |
{
|
333 |
+
$paypal["s2member_log"][] = "Unexpected txn_type. The PayPal® txn_type/status did not match a required action.";
|
334 |
/**/
|
335 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
336 |
/**/
|
337 |
echo '<script type="text/javascript">' . "\n";
|
338 |
+
echo "alert('ERROR: Unexpected txn_type/status. Please contact Support for assistance.\\n\\nThe PayPal® txn_type/status did not match a required action.');" . "\n";
|
339 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
340 |
echo '</script>' . "\n";
|
341 |
}
|
357 |
}
|
358 |
else if (!isset ($_GET["tx"]) && (empty ($_POST) || $_POST["auth"]))
|
359 |
{
|
360 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
361 |
do_action ("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars ());
|
362 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
363 |
/**/
|
364 |
$paypal["s2member_log"][] = "No Return-Data from PayPal®. Customer must wait for Email Confirmation.";
|
365 |
/**/
|
366 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
367 |
do_action ("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars ());
|
368 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
369 |
/**/
|
375 |
echo "window.location = '" . esc_js (get_bloginfo ("url")) . "';";
|
376 |
echo '</script>' . "\n";
|
377 |
/**/
|
378 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
379 |
do_action ("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars ());
|
380 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
381 |
}
|
403 |
if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
404 |
file_put_contents ($logs_dir . "/paypal-rtn.log", var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
405 |
/**/
|
406 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
407 |
do_action ("ws_plugin__s2member_during_paypal_return", get_defined_vars ());
|
408 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
409 |
/**/
|
410 |
exit ();
|
411 |
}
|
412 |
/**/
|
413 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
|
414 |
do_action ("ws_plugin__s2member_after_paypal_return", get_defined_vars ());
|
415 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
416 |
}
|
includes/functions/paypal-utilities.inc.php
CHANGED
@@ -41,7 +41,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_postvars"))
|
|
41 |
/**/
|
42 |
$endpoint = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com";
|
43 |
/**/
|
44 |
-
if (preg_match ("/^SUCCESS/i", ($response = trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback
|
45 |
{
|
46 |
foreach (preg_split ("/[\r\n]+/", preg_replace ("/^SUCCESS/i", "", $response)) as $varline)
|
47 |
{
|
@@ -67,15 +67,15 @@ if (!function_exists ("ws_plugin__s2member_paypal_postvars"))
|
|
67 |
/**/
|
68 |
$endpoint = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com";
|
69 |
/**/
|
70 |
-
if ($_GET["s2member_paypal_proxy"] &&
|
71 |
{
|
72 |
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
73 |
}
|
74 |
-
else if ($_GET["s2member_paypal_proxy"] && $_GET["s2member_paypal_proxy_verification"] === md5 (ws_plugin__s2member_xencrypt
|
75 |
{
|
76 |
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
77 |
}
|
78 |
-
else if (strtolower (trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback
|
79 |
{
|
80 |
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
81 |
}
|
41 |
/**/
|
42 |
$endpoint = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com";
|
43 |
/**/
|
44 |
+
if (preg_match ("/^SUCCESS/i", ($response = trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback, array ("timeout" => 20))))))
|
45 |
{
|
46 |
foreach (preg_split ("/[\r\n]+/", preg_replace ("/^SUCCESS/i", "", $response)) as $varline)
|
47 |
{
|
67 |
/**/
|
68 |
$endpoint = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com";
|
69 |
/**/
|
70 |
+
if ($_GET["s2member_paypal_proxy"] && preg_match ("/^" . preg_quote (preg_replace ("/\:[0-9]+#x2F;", "", $_SERVER["HTTP_HOST"]), "/") . "(\:[0-9]+)?#x2F;i", ws_plugin__s2member_decrypt ($_GET["s2member_paypal_proxy_verification"])))
|
71 |
{
|
72 |
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
73 |
}
|
74 |
+
else if ($_GET["s2member_paypal_proxy"] && $_GET["s2member_paypal_proxy_verification"] === md5 (ws_plugin__s2member_xencrypt (preg_replace ("/\:[0-9]+#x2F;", "", $_SERVER["HTTP_HOST"]))))
|
75 |
{
|
76 |
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
77 |
}
|
78 |
+
else if (strtolower (trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback, array ("timeout" => 20)))) === "verified")
|
79 |
{
|
80 |
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
81 |
}
|
includes/functions/register-access.inc.php
CHANGED
@@ -361,7 +361,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
|
|
361 |
if (($transient = md5 ("s2member_transient_ipn_subscr_payment_" . $subscr_id)) && is_array ($subscr_payment = get_transient ($transient)))
|
362 |
{
|
363 |
$proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment");
|
364 |
-
ws_plugin__s2member_remote (add_query_arg ($proxy, get_bloginfo ("url")), stripslashes_deep ($subscr_payment));
|
365 |
delete_transient ($transient);
|
366 |
}
|
367 |
/**/
|
361 |
if (($transient = md5 ("s2member_transient_ipn_subscr_payment_" . $subscr_id)) && is_array ($subscr_payment = get_transient ($transient)))
|
362 |
{
|
363 |
$proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment");
|
364 |
+
ws_plugin__s2member_remote (add_query_arg ($proxy, get_bloginfo ("url")), stripslashes_deep ($subscr_payment), array ("timeout" => 20));
|
365 |
delete_transient ($transient);
|
366 |
}
|
367 |
/**/
|
includes/functions/tracking-codes.inc.php
CHANGED
@@ -45,9 +45,9 @@ if (!function_exists ("ws_plugin__s2member_display_signup_tracking_codes"))
|
|
45 |
do_action ("ws_plugin__s2member_during_display_signup_tracking_codes", get_defined_vars ());
|
46 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
47 |
/**/
|
48 |
-
if
|
49 |
{
|
50 |
-
echo $code . "\n"; /* No PHP
|
51 |
}
|
52 |
else /* Otherwise, it's safe to allow PHP code. */
|
53 |
{
|
@@ -109,9 +109,9 @@ if (!function_exists ("ws_plugin__s2member_display_sp_tracking_codes"))
|
|
109 |
do_action ("ws_plugin__s2member_during_display_sp_tracking_codes", get_defined_vars ());
|
110 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
111 |
/**/
|
112 |
-
if
|
113 |
{
|
114 |
-
echo $code . "\n"; /* No PHP
|
115 |
}
|
116 |
else /* Otherwise, it's safe to allow PHP code. */
|
117 |
{
|
45 |
do_action ("ws_plugin__s2member_during_display_signup_tracking_codes", get_defined_vars ());
|
46 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
47 |
/**/
|
48 |
+
if (ws_plugin__s2member_is_multisite_farm ())
|
49 |
{
|
50 |
+
echo $code . "\n"; /* No PHP here. */
|
51 |
}
|
52 |
else /* Otherwise, it's safe to allow PHP code. */
|
53 |
{
|
109 |
do_action ("ws_plugin__s2member_during_display_sp_tracking_codes", get_defined_vars ());
|
110 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
111 |
/**/
|
112 |
+
if (ws_plugin__s2member_is_multisite_farm ())
|
113 |
{
|
114 |
+
echo $code . "\n"; /* No PHP here. */
|
115 |
}
|
116 |
else /* Otherwise, it's safe to allow PHP code. */
|
117 |
{
|
includes/functions/utilities.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function that handles a remote request.
|
18 |
This extends wp_remote_request() through the `WP_Http` class.
|
@@ -207,6 +207,16 @@ if (!function_exists ("ws_plugin__s2member_trim_quot_deep"))
|
|
207 |
}
|
208 |
}
|
209 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
Function checks if a post is in a child category.
|
211 |
*/
|
212 |
if (!function_exists ("ws_plugin__s2member_in_descendant_category"))
|
@@ -506,4 +516,46 @@ if (!function_exists ("ws_plugin__s2member_form_whips_2_url"))
|
|
506 |
return false;
|
507 |
}
|
508 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
?>
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function that handles a remote request.
|
18 |
This extends wp_remote_request() through the `WP_Http` class.
|
207 |
}
|
208 |
}
|
209 |
/*
|
210 |
+
Determines whether or not this is a Multisite Farm.
|
211 |
+
*/
|
212 |
+
if (!function_exists ("ws_plugin__s2member_is_multisite_farm"))
|
213 |
+
{
|
214 |
+
function ws_plugin__s2member_is_multisite_farm ()
|
215 |
+
{
|
216 |
+
return (is_multisite () && defined ("MULTISITE_FARM") && MULTISITE_FARM);
|
217 |
+
}
|
218 |
+
}
|
219 |
+
/*
|
220 |
Function checks if a post is in a child category.
|
221 |
*/
|
222 |
if (!function_exists ("ws_plugin__s2member_in_descendant_category"))
|
516 |
return false;
|
517 |
}
|
518 |
}
|
519 |
+
/*
|
520 |
+
Functions that handles CSS compression routines.
|
521 |
+
*/
|
522 |
+
if (!function_exists ("ws_plugin__s2member_compress_css"))
|
523 |
+
{
|
524 |
+
function ws_plugin__s2member_compress_css ($css = FALSE)
|
525 |
+
{
|
526 |
+
$c6 = "/(\:#| #)([A-Z0-9]{6})/i";
|
527 |
+
$css = preg_replace ("/\/\*(.*?)\*\//s", "", $css);
|
528 |
+
$css = preg_replace ("/[\r\n\t]+/", "", $css);
|
529 |
+
$css = preg_replace ("/ {2,}/", " ", $css);
|
530 |
+
$css = preg_replace ("/ , | ,|, /", ",", $css);
|
531 |
+
$css = preg_replace ("/ \> | \>|\> /", ">", $css);
|
532 |
+
$css = preg_replace ("/\[ /", "[", $css);
|
533 |
+
$css = preg_replace ("/ \]/", "]", $css);
|
534 |
+
$css = preg_replace ("/ \!\= | \!\=|\!\= /", "!=", $css);
|
535 |
+
$css = preg_replace ("/ \|\= | \|\=|\|\= /", "|=", $css);
|
536 |
+
$css = preg_replace ("/ \^\= | \^\=|\^\= /", "^=", $css);
|
537 |
+
$css = preg_replace ("/ \$\= | \$\=|\$\= /", "$=", $css);
|
538 |
+
$css = preg_replace ("/ \*\= | \*\=|\*\= /", "*=", $css);
|
539 |
+
$css = preg_replace ("/ ~\= | ~\=|~\= /", "~=", $css);
|
540 |
+
$css = preg_replace ("/ \= | \=|\= /", "=", $css);
|
541 |
+
$css = preg_replace ("/ \+ | \+|\+ /", "+", $css);
|
542 |
+
$css = preg_replace ("/ ~ | ~|~ /", "~", $css);
|
543 |
+
$css = preg_replace ("/ \{ | \{|\{ /", "{", $css);
|
544 |
+
$css = preg_replace ("/ \} | \}|\} /", "}", $css);
|
545 |
+
$css = preg_replace ("/ \: | \:|\: /", ":", $css);
|
546 |
+
$css = preg_replace ("/ ; | ;|; /", ";", $css);
|
547 |
+
$css = preg_replace ("/;\}/", "}", $css);
|
548 |
+
/**/
|
549 |
+
return preg_replace_callback ($c6, "ws_plugin__s2member_compress_css_c3", $css);
|
550 |
+
}
|
551 |
+
}
|
552 |
+
if (!function_exists ("ws_plugin__s2member_compress_css_c3"))
|
553 |
+
{
|
554 |
+
function ws_plugin__s2member_compress_css_c3 ($m = FALSE)
|
555 |
+
{
|
556 |
+
if ($m[2][0] === $m[2][1] && $m[2][2] === $m[2][3] && $m[2][4] === $m[2][5])
|
557 |
+
return $m[1] . $m[2][0] . $m[2][2] . $m[2][4];
|
558 |
+
return $m[0];
|
559 |
+
}
|
560 |
+
}
|
561 |
?>
|
includes/mailchimp/nc-mcapi.inc.php
CHANGED
@@ -21,9 +21,9 @@ class NC_MCAPI {
|
|
21 |
var $apiUrl;
|
22 |
|
23 |
/**
|
24 |
-
* Default to a
|
25 |
*/
|
26 |
-
var $timeout =
|
27 |
|
28 |
/**
|
29 |
* Default to a 8K chunk size
|
@@ -1740,6 +1740,7 @@ class NC_MCAPI {
|
|
1740 |
$host_uri = $host . $this->apiUrl["path"] . "?" . $this->apiUrl["query"] . "&method=" . urlencode ($method);
|
1741 |
$url = ($this->secure) ? "https://" . $host_uri : "http://" . $host_uri;
|
1742 |
$args["user-agent"] = "MCAPI/" . $this->version;
|
|
|
1743 |
$params["apikey"] = $this->api_key;
|
1744 |
$post_vars = $params;
|
1745 |
|
21 |
var $apiUrl;
|
22 |
|
23 |
/**
|
24 |
+
* Default to a 5 second timeout on server calls
|
25 |
*/
|
26 |
+
var $timeout = 5;
|
27 |
|
28 |
/**
|
29 |
* Default to a 8K chunk size
|
1740 |
$host_uri = $host . $this->apiUrl["path"] . "?" . $this->apiUrl["query"] . "&method=" . urlencode ($method);
|
1741 |
$url = ($this->secure) ? "https://" . $host_uri : "http://" . $host_uri;
|
1742 |
$args["user-agent"] = "MCAPI/" . $this->version;
|
1743 |
+
$args["timeout"] = $this->timeout;
|
1744 |
$params["apikey"] = $this->api_key;
|
1745 |
$post_vars = $params;
|
1746 |
|
includes/menu-pages/api-ops.inc.php
CHANGED
@@ -80,11 +80,11 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
80 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
81 |
echo '<ul>' . "\n";
|
82 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
83 |
-
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' .
|
84 |
echo '</ul>' . "\n";
|
85 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
86 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
87 |
-
echo '<code>custom="' .
|
88 |
echo '</td>' . "\n";
|
89 |
/**/
|
90 |
echo '</tr>' . "\n";
|
@@ -136,11 +136,11 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
136 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
137 |
echo '<ul>' . "\n";
|
138 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
139 |
-
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' .
|
140 |
echo '</ul>' . "\n";
|
141 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
142 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
143 |
-
echo '<code>custom="' .
|
144 |
echo '</td>' . "\n";
|
145 |
/**/
|
146 |
echo '</tr>' . "\n";
|
@@ -196,11 +196,11 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
196 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
197 |
echo '<ul>' . "\n";
|
198 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
199 |
-
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' .
|
200 |
echo '</ul>' . "\n";
|
201 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
202 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
203 |
-
echo '<code>custom="' .
|
204 |
echo '</td>' . "\n";
|
205 |
/**/
|
206 |
echo '</tr>' . "\n";
|
@@ -254,11 +254,11 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
254 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
255 |
echo '<ul>' . "\n";
|
256 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
257 |
-
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode. like this: <code>custom="' .
|
258 |
echo '</ul>' . "\n";
|
259 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
260 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
261 |
-
echo '<code>custom="' .
|
262 |
echo '</td>' . "\n";
|
263 |
/**/
|
264 |
echo '</tr>' . "\n";
|
@@ -315,11 +315,11 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
315 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
316 |
echo '<ul>' . "\n";
|
317 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
318 |
-
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' .
|
319 |
echo '</ul>' . "\n";
|
320 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
321 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
322 |
-
echo '<code>custom="' .
|
323 |
echo '</td>' . "\n";
|
324 |
/**/
|
325 |
echo '</tr>' . "\n";
|
@@ -376,11 +376,11 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
376 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
377 |
echo '<ul>' . "\n";
|
378 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
379 |
-
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' .
|
380 |
echo '</ul>' . "\n";
|
381 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
382 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
383 |
-
echo '<code>custom="' .
|
384 |
echo '</td>' . "\n";
|
385 |
/**/
|
386 |
echo '</tr>' . "\n";
|
80 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
81 |
echo '<ul>' . "\n";
|
82 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
83 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
84 |
echo '</ul>' . "\n";
|
85 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
86 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
87 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
88 |
echo '</td>' . "\n";
|
89 |
/**/
|
90 |
echo '</tr>' . "\n";
|
136 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
137 |
echo '<ul>' . "\n";
|
138 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
139 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
140 |
echo '</ul>' . "\n";
|
141 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
142 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
143 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
144 |
echo '</td>' . "\n";
|
145 |
/**/
|
146 |
echo '</tr>' . "\n";
|
196 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
197 |
echo '<ul>' . "\n";
|
198 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
199 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
200 |
echo '</ul>' . "\n";
|
201 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
202 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
203 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
204 |
echo '</td>' . "\n";
|
205 |
/**/
|
206 |
echo '</tr>' . "\n";
|
254 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
255 |
echo '<ul>' . "\n";
|
256 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
257 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode. like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
258 |
echo '</ul>' . "\n";
|
259 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
260 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
261 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
262 |
echo '</td>' . "\n";
|
263 |
/**/
|
264 |
echo '</tr>' . "\n";
|
315 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
316 |
echo '<ul>' . "\n";
|
317 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
318 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
319 |
echo '</ul>' . "\n";
|
320 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
321 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
322 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
323 |
echo '</td>' . "\n";
|
324 |
/**/
|
325 |
echo '</tr>' . "\n";
|
376 |
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
377 |
echo '<ul>' . "\n";
|
378 |
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
379 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
380 |
echo '</ul>' . "\n";
|
381 |
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
382 |
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
383 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
384 |
echo '</td>' . "\n";
|
385 |
/**/
|
386 |
echo '</tr>' . "\n";
|
includes/menu-pages/code-samples/level-file-downloads.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
http://www.example.com/?s2member_file_download=access-s2member-level0/tiger.doc
|
2 |
+
http://www.example.com/?s2member_file_download=access-s2member-level1/zebra.pdf
|
3 |
+
http://www.example.com/?s2member_file_download=access-s2member-level2/elephant.doc
|
4 |
+
http://www.example.com/?s2member_file_download=access-s2member-level3/rhino.pdf
|
5 |
+
http://www.example.com/?s2member_file_download=access-s2member-level4/lion.doc
|
includes/menu-pages/down-ops.inc.php
CHANGED
@@ -38,7 +38,7 @@ if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_section
|
|
38 |
{
|
39 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_restrictions", get_defined_vars ());
|
40 |
/**/
|
41 |
-
echo '<div class="ws-menu-page-group" title="
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n";
|
44 |
echo '<h3>File Download Restrictions ( required, if providing access to protected files )</h3>' . "\n";
|
38 |
{
|
39 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_restrictions", get_defined_vars ());
|
40 |
/**/
|
41 |
+
echo '<div class="ws-menu-page-group" title="Basic Download Restrictions">' . "\n";
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n";
|
44 |
echo '<h3>File Download Restrictions ( required, if providing access to protected files )</h3>' . "\n";
|
includes/menu-pages/menu-pages-min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function(a){a("div.ws-menu-page-group").each(function(c){var b="<ins>+</ins>",d=a(this),e=d.attr("title");var f=a('<div class="ws-menu-page-group-header">'+b+e+"</div>");f.css({"z-index":100-c});f.insertBefore(d),d.hide(),f.click(function(){var g=a("ins",this),h=a(this).next();if(h.css("display")==="none"){a(this).addClass("open"),g.html("-"),h.show()}else{a(this).removeClass("open"),g.html("+"),h.hide()}return false});if(c===0){a('<div class="ws-menu-page-groups-show">+</div>').insertBefore(f).click(function(){a("div.ws-menu-page-group-header").each(function(){var g=a("ins",this),h=a(this).next();a(this).addClass("open"),g.html("-"),h.show();return});return false});a('<div class="ws-menu-page-groups-hide">-</div>').insertBefore(f).click(function(){a("div.ws-menu-page-group-header").each(function(){var g=a("ins",this),h=a(this).next();a(this).removeClass("open"),g.html("+"),h.hide();return});return false})}if(d.attr("default-state")==="open"){f.trigger("click")}return});a("div.ws-menu-page-hr:first").css({"margin-top":"10px","margin-bottom":"20px"});a("div.ws-menu-page-section:first > h3").css({"margin-top":"0"});a("div.ws-menu-page-group > div.ws-menu-page-section:first-child > h3").css({"margin-top":"0"});a("div.ws-menu-page-group-header:first").css({"margin-top":"0","margin-right":"140px"});a("div.ws-menu-page-group:first").css({"margin-right":"145px"});a("div.ws-menu-page-readme > div.readme > div.section:last-child").css({"border-bottom-width":"0"});a("input.ws-menu-page-media-btn").filter(function(){return(a(this).attr("rel"))?true:false}).click(function(){$this=a(this),window.send_to_editor=function(d){var e,c;if((e=a("input#"+$this.attr("rel"))).length>0){var b=e.css("background-color"),f=a.trim(a(d).attr("src"));f=(!f)?a.trim(a("img",d).attr("src")):f;e.val(f),e.css({"background-color":"#FFFFCC"}),setTimeout(function(){e.css({"background-color":b})},2000);tb_remove();return}else{if((c=a("textarea#"+$this.attr("rel"))).length>0){var b=c.css("background-color"),f=a.trim(a(d).attr("src"));f=(!f)?a.trim(a("img",d).attr("src")):f;c.val(a.trim(c.val())+"\n"+f),c.css({"background-color":"#FFFFCC"}),setTimeout(function(){c.css({"background-color":b})},2000);tb_remove();return}}};tb_show("","./media-upload.php?type=image&TB_iframe=true");return false})});
|
includes/menu-pages/menu-pages-s-min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function(b){var a=esc_html=function(c){return String(c).replace(/"/g,""").replace(/\</g,"<").replace(/\>/g,">")};if(location.href.match(/page\=ws-plugin--s2member-options/)){ws_plugin__s2member_generateSecurityKey=function(){var f=function(h,g){h=(arguments.length<1)?0:h;g=(arguments.length<2)?2147483647:g;return Math.floor(Math.random()*(g-h+1))+h};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";for(var d=0,c="";d<56;d++){c+=e.substr(f(0,e.length-1),1)}b("input#ws-plugin--s2member-sec-encryption-key").val(c);return false};ws_plugin__s2member_enableSecurityKey=function(){if(confirm("Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you've been testing s2Member, feel free to change this Key before you go live. Just don't go live, and then change it. You'll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you've used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.")){b("input#ws-plugin--s2member-sec-encryption-key").attr("disabled",false)}return false};ws_plugin__s2member_securityKeyHistory=function(){b("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false}}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){b("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var d=b(this),e=d.val();var c=b("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(e==2){c.show()}else{c.hide()}})}else{if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){b("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var e=b(this),f=e.val();var d=b("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var c=b("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(f<=0){d.css("display","none"),c.attr("src",c.attr("src").replace(/\/checked\.png#x2F;,"/unchecked.png"))}else{if(f==1){d.css("display",""),c.attr("src",c.attr("src").replace(/\/unchecked\.png#x2F;,"/checked.png"))}else{if(f==2){d.css("display",""),c.attr("src",c.attr("src").replace(/\/checked\.png#x2F;,"/unchecked.png"))}}}})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){b("select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term").change(function(){var d=this.id.replace(/^ws-plugin--s2member-(.+?)-term#x2F;g,"$1");var c=(b(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;b("p#ws-plugin--s2member-"+d+"-trial-line").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-trial-then").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-20p-rule").css("display",(c?"none":""));(c)?b("input#ws-plugin--s2member-"+form+"-trial-period").val(0):null});b("input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps").keyup(function(){this.value=b.trim(b.trim(this.value).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase())});ws_plugin__s2member_paypalButtonGenerate=function(f){var c='[s2Member-PayPal-Button %%attrs%% image="default" /]',q="",t={};t.level0='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]); ?>';t.level1='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]); ?>';t.level2='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]); ?>';t.level3='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]); ?>';t.level4='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]); ?>';var o=b("input#ws-plugin--s2member-"+f+"-shortcode");var g=b("textarea#ws-plugin--s2member-"+f+"-button");var k=b("select#ws-plugin--s2member-modification-level");var h=(f==="modification")?k.val().split(":",2)[1]:f.replace(/^level/,"");var l=t["level"+h].replace(/"/g,"");var d=b("input#ws-plugin--s2member-"+f+"-trial-period").val().replace(/[^0-9]/g,"");var j=b("select#ws-plugin--s2member-"+f+"-trial-term").val().replace(/[^A-Z]/g,"");var m=b("input#ws-plugin--s2member-"+f+"-amount").val().replace(/[^0-9\.]/g,"");var s=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var u=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var r=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var e=b.trim(b("input#ws-plugin--s2member-"+f+"-page-style").val().replace(/"/g,""));var i=b("select#ws-plugin--s2member-"+f+"-currency").val().replace(/[^A-Z]/g,"");var n=b.trim(b.trim(b("input#ws-plugin--s2member-"+f+"-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());d=(r==="BN")?"0":d;var p=(r==="BN"&&u!=="L")?h+":"+n+":"+s+" "+u:h+":"+n;p=p.replace(/\:+#x2F;g,"");if(j==="D"&&d>7){alert("Oops, a slight problem:\n\nMaximum Free Days is: 7.\nIf you want to offer more than 7 days free, please choose Weeks or Months from the drop-down.");return false}else{if(j==="W"&&d>52){alert("Oops, a slight problem:\n\nMaximum Free Weeks is: 52.\nIf you want to offer more than 52 weeks free, please choose Months from the drop-down.");return false}else{if(j==="M"&&d>12){alert("Oops, a slight problem:\n\nMaximum Free Months is: 12.\nIf you want to offer more than 12 months free, please choose Years from the drop-down.");return false}else{if(j==="Y"&&d>1){alert("Oops, a slight problem:\n\nMax Trial Period Years is: 1. *This is a PayPal® limitation.");return false}else{if(!m||isNaN(m)||m<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(m>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}}}}}}g.val(g.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(d)<=0)?g.val(g.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(r==="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(r==="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="(src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(r!=="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(r!=="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;q+='level="'+a(h)+'" ccaps="'+a(n)+'" desc="'+a(l)+'" ps="'+a(e)+'" cc="'+a(i)+'" custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"';q+=' tp="'+a(d)+'" tt="'+a(j)+'" ra="'+a(m)+'" rp="'+a(s)+'" rt="'+a(u)+'" rr="'+a(r)+'"';q+=(f==="modification")?' modify="1"':"";o.val(c.replace(/%%attrs%%/,q));g.val(g.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(l)+'"'));g.val(g.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(p)+'"'));g.val(g.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(e)+'"'));g.val(g.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(i)+'"'));g.val(g.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));g.val(g.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((f==="modification")?"1":"0")+'"'));g.val(g.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(m)+'"'));g.val(g.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+a(r)+'"'));g.val(g.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+a(d)+'"'));g.val(g.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+a(j)+'"'));g.val(g.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+a(m)+'"'));g.val(g.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+a(s)+'"'));g.val(g.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+a(u)+'"'));b("div#ws-plugin--s2member-"+f+"-button-prev").html(g.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g,""));(f==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");o.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var q='[s2Member-PayPal-Button %%attrs%% image="default" /]',p="";var n=b("input#ws-plugin--s2member-sp-shortcode");var e=b("textarea#ws-plugin--s2member-sp-button");var f=b("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-additional-ids").val()||[];var o=b("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var k=b("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var j=b.trim(b("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var m=b.trim(b("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var d=b("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!f){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}else{if(!k||isNaN(k)||k<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(k>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}else{if(!j){alert("Oops, a slight problem:\n\nPlease type a Description for this Button.");return false}}}}for(var g=0,c=f;g<h.length;g++){if(h[g]&&h[g]!==f){c+=","+h[g]}}var l="sp:"+c+":"+o;p+='ids="'+a(c)+'" exp="'+a(o)+'" desc="'+a(j)+'" ps="'+a(m)+'" cc="'+a(d)+'"';p+=' custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>" ra="'+a(k)+'" sp="1"';n.val(q.replace(/%%attrs%%/,p));e.val(e.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(j)+'"'));e.val(e.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(l)+'"'));e.val(e.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(m)+'"'));e.val(e.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(d)+'"'));e.val(e.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));e.val(e.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(k)+'"'));b("div#ws-plugin--s2member-sp-button-prev").html(e.val().replace(/\<form/,'<form target="_blank"'));alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");n.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var j=b("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var c=b("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var d=b("p#ws-plugin--s2member-sp-link"),g=b("img#ws-plugin--s2member-sp-link-loading");if(!j){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}for(var e=0,f=j;e<h.length;e++){if(h[e]&&h[e]!==j){f+=","+h[e]}}d.hide(),g.show(),b.post(ajaxurl,{action:"s2member_sp_access_link",s2member_sp_access_link:'<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link")); ?>',s2member_sp_access_link_ids:f,s2member_sp_access_link_hours:c},function(i){d.show().html('<a href="'+a(i)+'" target="_blank" rel="external">'+esc_html(i)+"</a>"),g.hide()});return false}}}}}});
|
includes/menu-pages/menu-pages-s.js
CHANGED
@@ -12,6 +12,11 @@ These routines are all specific to this software.
|
|
12 |
*/
|
13 |
jQuery (document).ready (function($)
|
14 |
{
|
|
|
|
|
|
|
|
|
|
|
15 |
if (location.href.match (/page\=ws-plugin--s2member-options/))
|
16 |
{
|
17 |
ws_plugin__s2member_generateSecurityKey = function() /* Generates a unique Security Key. */
|
@@ -113,7 +118,7 @@ jQuery (document).ready (function($)
|
|
113 |
var modLevel = $ ('select#ws-plugin--s2member-modification-level');
|
114 |
/**/
|
115 |
var level = (button === 'modification') ? modLevel.val ().split (':', 2)[1] : button.replace (/^level/, '');
|
116 |
-
var label = labels['level' + level].replace (/"/g,
|
117 |
var trialPeriod = $ ('input#ws-plugin--s2member-' + button + '-trial-period').val ().replace (/[^0-9]/g, '');
|
118 |
var trialTerm = $ ('select#ws-plugin--s2member-' + button + '-trial-term').val ().replace (/[^A-Z]/g, '');
|
119 |
var regAmount = $ ('input#ws-plugin--s2member-' + button + '-amount').val ().replace (/[^0-9\.]/g, '');
|
@@ -165,29 +170,27 @@ jQuery (document).ready (function($)
|
|
165 |
(regRecur !== 'BN') ? code.val (code.val ().replace (/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g, " $1_xclick-subscriptions$3")) : null;
|
166 |
(regRecur !== 'BN') ? code.val (code.val ().replace (/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g, " <!--$1-->")) : null;
|
167 |
/**/
|
168 |
-
shortCodeTemplateAttrs += 'level="' + level + '" ccaps="' + cCaps + '" desc="' + label + '" ps="' + pageStyle + '" cc="' + currencyCode + '" custom="<?php echo
|
169 |
-
shortCodeTemplateAttrs += ' tp="' + trialPeriod + '" tt="' + trialTerm + '" ra="' + regAmount + '" rp="' + regPeriod + '" rt="' + regTerm + '" rr="' + regRecur + '"';
|
170 |
-
shortCodeTemplateAttrs += (button === 'modification') ? ' modify="1"' : ''; /* For
|
171 |
shortCode.val (shortCodeTemplate.replace (/%%attrs%%/, shortCodeTemplateAttrs));
|
172 |
/**/
|
173 |
-
code.val (code.val ().replace (/ name\="item_name" value\="(.*?)"/, ' name="item_name" value="' + label + '"'));
|
174 |
-
code.val (code.val ().replace (/ name\="item_number" value\="(.*?)"/, ' name="item_number" value="' + levelCcapsPer + '"'));
|
175 |
-
code.val (code.val ().replace (/ name\="page_style" value\="(.*?)"/, ' name="page_style" value="' + pageStyle + '"'));
|
176 |
-
code.val (code.val ().replace (/ name\="currency_code" value\="(.*?)"/, ' name="currency_code" value="' + currencyCode + '"'));
|
177 |
-
code.val (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo
|
178 |
-
code.val (code.val ().replace (/ name\="modify" value\="(.*?)"/, ' name="modify" value="' +
|
179 |
-
code.val (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + regAmount + '"'));
|
180 |
-
code.val (code.val ().replace (/ name\="src" value\="(.*?)"/, ' name="src" value="' + regRecur + '"'));
|
181 |
-
code.val (code.val ().replace (/ name\="p1" value\="(.*?)"/, ' name="p1" value="' + trialPeriod + '"'));
|
182 |
-
code.val (code.val ().replace (/ name\="t1" value\="(.*?)"/, ' name="t1" value="' + trialTerm + '"'));
|
183 |
-
code.val (code.val ().replace (/ name\="a3" value\="(.*?)"/, ' name="a3" value="' + regAmount + '"'));
|
184 |
-
code.val (code.val ().replace (/ name\="p3" value\="(.*?)"/, ' name="p3" value="' + regPeriod + '"'));
|
185 |
-
code.val (code.val ().replace (/ name\="t3" value\="(.*?)"/, ' name="t3" value="' + regTerm + '"'));
|
186 |
/**/
|
187 |
$ ('div#ws-plugin--s2member-' + button + '-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"').replace (/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g, ''));
|
188 |
/**/
|
189 |
-
<?php do_action ("ws_plugin__s2member_during_menu_pages_js_during_paypal_button_generate", get_defined_vars ()); ?>
|
190 |
-
/**/
|
191 |
(button === 'modification') ? alert ('Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate.') : alert ('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
|
192 |
/**/
|
193 |
shortCode.each (function() /* Focus and select the recommended Shortcode. */
|
@@ -240,21 +243,19 @@ jQuery (document).ready (function($)
|
|
240 |
/**/
|
241 |
var spIdsHours = 'sp:' + ids + ':' + hours; /* Combined sp:ids:expiration hours. */
|
242 |
/**/
|
243 |
-
shortCodeTemplateAttrs += 'ids="' + ids + '" exp="' + hours + '" desc="' + desc + '" ps="' + pageStyle + '" cc="' + currencyCode + '"';
|
244 |
-
shortCodeTemplateAttrs += ' custom="<?php echo
|
245 |
shortCode.val (shortCodeTemplate.replace (/%%attrs%%/, shortCodeTemplateAttrs));
|
246 |
/**/
|
247 |
-
code.val (code.val ().replace (/ name\="item_name" value\="(.*?)"/, ' name="item_name" value="' + desc + '"'));
|
248 |
-
code.val (code.val ().replace (/ name\="item_number" value\="(.*?)"/, ' name="item_number" value="' + spIdsHours + '"'));
|
249 |
-
code.val (code.val ().replace (/ name\="page_style" value\="(.*?)"/, ' name="page_style" value="' + pageStyle + '"'));
|
250 |
-
code.val (code.val ().replace (/ name\="currency_code" value\="(.*?)"/, ' name="currency_code" value="' + currencyCode + '"'));
|
251 |
-
code.val (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo
|
252 |
-
code.val (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + regAmount + '"'));
|
253 |
/**/
|
254 |
$ ('div#ws-plugin--s2member-sp-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"'));
|
255 |
/**/
|
256 |
-
<?php do_action ("ws_plugin__s2member_during_menu_pages_js_during_paypal_sp_button_generate", get_defined_vars ()); ?>
|
257 |
-
/**/
|
258 |
alert ('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
|
259 |
/**/
|
260 |
shortCode.each (function() /* Focus and select the recommended Shortcode. */
|
@@ -284,7 +285,7 @@ jQuery (document).ready (function($)
|
|
284 |
/**/
|
285 |
$link.hide (), $loading.show (), $.post (ajaxurl, {action: 's2member_sp_access_link', s2member_sp_access_link: '<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link")); ?>', s2member_sp_access_link_ids: ids, s2member_sp_access_link_hours: hours}, function(response)
|
286 |
{
|
287 |
-
$link.show ().html ('<a href="' + response + '" target="_blank" rel="external">' + response + '</a>'), $loading.hide ();
|
288 |
});
|
289 |
/**/
|
290 |
return false;
|
12 |
*/
|
13 |
jQuery (document).ready (function($)
|
14 |
{
|
15 |
+
var esc_attr = esc_html = function(str) /* Convert special characters. */
|
16 |
+
{
|
17 |
+
return String (str).replace (/"/g, '"').replace (/\</g, '<').replace (/\>/g, '>');
|
18 |
+
};
|
19 |
+
/**/
|
20 |
if (location.href.match (/page\=ws-plugin--s2member-options/))
|
21 |
{
|
22 |
ws_plugin__s2member_generateSecurityKey = function() /* Generates a unique Security Key. */
|
118 |
var modLevel = $ ('select#ws-plugin--s2member-modification-level');
|
119 |
/**/
|
120 |
var level = (button === 'modification') ? modLevel.val ().split (':', 2)[1] : button.replace (/^level/, '');
|
121 |
+
var label = labels['level' + level].replace (/"/g, ""); /* Labels may NOT contain any double-quotes. */
|
122 |
var trialPeriod = $ ('input#ws-plugin--s2member-' + button + '-trial-period').val ().replace (/[^0-9]/g, '');
|
123 |
var trialTerm = $ ('select#ws-plugin--s2member-' + button + '-trial-term').val ().replace (/[^A-Z]/g, '');
|
124 |
var regAmount = $ ('input#ws-plugin--s2member-' + button + '-amount').val ().replace (/[^0-9\.]/g, '');
|
170 |
(regRecur !== 'BN') ? code.val (code.val ().replace (/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g, " $1_xclick-subscriptions$3")) : null;
|
171 |
(regRecur !== 'BN') ? code.val (code.val ().replace (/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g, " <!--$1-->")) : null;
|
172 |
/**/
|
173 |
+
shortCodeTemplateAttrs += 'level="' + esc_attr (level) + '" ccaps="' + esc_attr (cCaps) + '" desc="' + esc_attr (label) + '" ps="' + esc_attr (pageStyle) + '" cc="' + esc_attr (currencyCode) + '" custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"';
|
174 |
+
shortCodeTemplateAttrs += ' tp="' + esc_attr (trialPeriod) + '" tt="' + esc_attr (trialTerm) + '" ra="' + esc_attr (regAmount) + '" rp="' + esc_attr (regPeriod) + '" rt="' + esc_attr (regTerm) + '" rr="' + esc_attr (regRecur) + '"';
|
175 |
+
shortCodeTemplateAttrs += (button === 'modification') ? ' modify="1"' : ''; /* For Modification Buttons. */
|
176 |
shortCode.val (shortCodeTemplate.replace (/%%attrs%%/, shortCodeTemplateAttrs));
|
177 |
/**/
|
178 |
+
code.val (code.val ().replace (/ name\="item_name" value\="(.*?)"/, ' name="item_name" value="' + esc_attr (label) + '"'));
|
179 |
+
code.val (code.val ().replace (/ name\="item_number" value\="(.*?)"/, ' name="item_number" value="' + esc_attr (levelCcapsPer) + '"'));
|
180 |
+
code.val (code.val ().replace (/ name\="page_style" value\="(.*?)"/, ' name="page_style" value="' + esc_attr (pageStyle) + '"'));
|
181 |
+
code.val (code.val ().replace (/ name\="currency_code" value\="(.*?)"/, ' name="currency_code" value="' + esc_attr (currencyCode) + '"'));
|
182 |
+
code.val (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));
|
183 |
+
code.val (code.val ().replace (/ name\="modify" value\="(.*?)"/, ' name="modify" value="' + ( (button === 'modification') ? '1' : '0') + '"'));
|
184 |
+
code.val (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + esc_attr (regAmount) + '"'));
|
185 |
+
code.val (code.val ().replace (/ name\="src" value\="(.*?)"/, ' name="src" value="' + esc_attr (regRecur) + '"'));
|
186 |
+
code.val (code.val ().replace (/ name\="p1" value\="(.*?)"/, ' name="p1" value="' + esc_attr (trialPeriod) + '"'));
|
187 |
+
code.val (code.val ().replace (/ name\="t1" value\="(.*?)"/, ' name="t1" value="' + esc_attr (trialTerm) + '"'));
|
188 |
+
code.val (code.val ().replace (/ name\="a3" value\="(.*?)"/, ' name="a3" value="' + esc_attr (regAmount) + '"'));
|
189 |
+
code.val (code.val ().replace (/ name\="p3" value\="(.*?)"/, ' name="p3" value="' + esc_attr (regPeriod) + '"'));
|
190 |
+
code.val (code.val ().replace (/ name\="t3" value\="(.*?)"/, ' name="t3" value="' + esc_attr (regTerm) + '"'));
|
191 |
/**/
|
192 |
$ ('div#ws-plugin--s2member-' + button + '-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"').replace (/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g, ''));
|
193 |
/**/
|
|
|
|
|
194 |
(button === 'modification') ? alert ('Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate.') : alert ('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
|
195 |
/**/
|
196 |
shortCode.each (function() /* Focus and select the recommended Shortcode. */
|
243 |
/**/
|
244 |
var spIdsHours = 'sp:' + ids + ':' + hours; /* Combined sp:ids:expiration hours. */
|
245 |
/**/
|
246 |
+
shortCodeTemplateAttrs += 'ids="' + esc_attr (ids) + '" exp="' + esc_attr (hours) + '" desc="' + esc_attr (desc) + '" ps="' + esc_attr (pageStyle) + '" cc="' + esc_attr (currencyCode) + '"';
|
247 |
+
shortCodeTemplateAttrs += ' custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>" ra="' + esc_attr (regAmount) + '" sp="1"';
|
248 |
shortCode.val (shortCodeTemplate.replace (/%%attrs%%/, shortCodeTemplateAttrs));
|
249 |
/**/
|
250 |
+
code.val (code.val ().replace (/ name\="item_name" value\="(.*?)"/, ' name="item_name" value="' + esc_attr (desc) + '"'));
|
251 |
+
code.val (code.val ().replace (/ name\="item_number" value\="(.*?)"/, ' name="item_number" value="' + esc_attr (spIdsHours) + '"'));
|
252 |
+
code.val (code.val ().replace (/ name\="page_style" value\="(.*?)"/, ' name="page_style" value="' + esc_attr (pageStyle) + '"'));
|
253 |
+
code.val (code.val ().replace (/ name\="currency_code" value\="(.*?)"/, ' name="currency_code" value="' + esc_attr (currencyCode) + '"'));
|
254 |
+
code.val (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));
|
255 |
+
code.val (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + esc_attr (regAmount) + '"'));
|
256 |
/**/
|
257 |
$ ('div#ws-plugin--s2member-sp-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"'));
|
258 |
/**/
|
|
|
|
|
259 |
alert ('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
|
260 |
/**/
|
261 |
shortCode.each (function() /* Focus and select the recommended Shortcode. */
|
285 |
/**/
|
286 |
$link.hide (), $loading.show (), $.post (ajaxurl, {action: 's2member_sp_access_link', s2member_sp_access_link: '<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link")); ?>', s2member_sp_access_link_ids: ids, s2member_sp_access_link_hours: hours}, function(response)
|
287 |
{
|
288 |
+
$link.show ().html ('<a href="' + esc_attr (response) + '" target="_blank" rel="external">' + esc_html (response) + '</a>'), $loading.hide ();
|
289 |
});
|
290 |
/**/
|
291 |
return false;
|
includes/menu-pages/menu-pages.css
CHANGED
@@ -17,6 +17,11 @@ div.ws-menu-page
|
|
17 |
margin-bottom: 20px;
|
18 |
background: url('<?php echo $i; ?>/brand-bg.png') no-repeat top right;
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
20 |
div.ws-menu-page > h2
|
21 |
{
|
22 |
padding-right: 0;
|
17 |
margin-bottom: 20px;
|
18 |
background: url('<?php echo $i; ?>/brand-bg.png') no-repeat top right;
|
19 |
}
|
20 |
+
div.ws-menu-page a.ws-dotted-link
|
21 |
+
{
|
22 |
+
text-decoration: none;
|
23 |
+
border-bottom: 1px dotted;
|
24 |
+
}
|
25 |
div.ws-menu-page > h2
|
26 |
{
|
27 |
padding-right: 0;
|
includes/menu-pages/menu-pages.js
CHANGED
@@ -10,53 +10,53 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
10 |
/*
|
11 |
These routines address common layout styles for menu pages.
|
12 |
*/
|
13 |
-
jQuery(document).ready (function($)
|
14 |
{
|
15 |
-
|
16 |
{
|
17 |
-
var ins = '<ins>+</ins>', group =
|
18 |
/**/
|
19 |
-
var header =
|
20 |
/**/
|
21 |
header.css ({'z-index': 100 - index}); /* Stack them sequentially, top to bottom. */
|
22 |
/**/
|
23 |
header.insertBefore (group), group.hide (), header.click (function()
|
24 |
{
|
25 |
-
var ins =
|
26 |
/**/
|
27 |
if (group.css ('display') === 'none')
|
28 |
{
|
29 |
-
|
30 |
}
|
31 |
else
|
32 |
{
|
33 |
-
|
34 |
}
|
35 |
/**/
|
36 |
return false;
|
37 |
});
|
38 |
if (index === 0) /* These are the buttons for showing/hiding all groups. */
|
39 |
{
|
40 |
-
|
41 |
{
|
42 |
-
|
43 |
{
|
44 |
-
var ins =
|
45 |
/**/
|
46 |
-
|
47 |
/**/
|
48 |
return;
|
49 |
});
|
50 |
/**/
|
51 |
return false;
|
52 |
});
|
53 |
-
|
54 |
{
|
55 |
-
|
56 |
{
|
57 |
-
var ins =
|
58 |
/**/
|
59 |
-
|
60 |
/**/
|
61 |
return;
|
62 |
});
|
@@ -71,32 +71,32 @@ jQuery(document).ready (function($)
|
|
71 |
return;
|
72 |
});
|
73 |
/**/
|
74 |
-
|
75 |
/**/
|
76 |
-
|
77 |
/**/
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
/**/
|
82 |
-
|
83 |
/**/
|
84 |
-
|
85 |
{
|
86 |
-
return
|
87 |
})/**/
|
88 |
.click (function() /* Attach click events to media buttons with send_to_editor(). */
|
89 |
{
|
90 |
-
$this =
|
91 |
{
|
92 |
var $inp, $txt; /* Looking for input|textarea. */
|
93 |
/**/
|
94 |
-
if (($inp =
|
95 |
{
|
96 |
-
var oBg = $inp.css ('background-color'), src = $.trim
|
97 |
-
src = (!src) ? $.trim
|
98 |
/**/
|
99 |
-
$inp.val (src), $inp.css ({'background-color': '#FFFFCC'}), setTimeout(function()
|
100 |
{
|
101 |
$inp.css ({'background-color': oBg});
|
102 |
}, 2000);
|
@@ -105,12 +105,12 @@ jQuery(document).ready (function($)
|
|
105 |
/**/
|
106 |
return;
|
107 |
}
|
108 |
-
else if (($txt =
|
109 |
{
|
110 |
-
var oBg = $txt.css ('background-color'), src = $.trim
|
111 |
-
src = (!src) ? $.trim
|
112 |
/**/
|
113 |
-
$txt.val ($.trim ($txt.val ()) + '\n' + src), $txt.css ({'background-color': '#FFFFCC'}), setTimeout(function()
|
114 |
{
|
115 |
$txt.css ({'background-color': oBg});
|
116 |
}, 2000);
|
@@ -121,7 +121,7 @@ jQuery(document).ready (function($)
|
|
121 |
}
|
122 |
};
|
123 |
/**/
|
124 |
-
tb_show('', './media-upload.php?type=image&TB_iframe=true');
|
125 |
/**/
|
126 |
return false;
|
127 |
});
|
10 |
/*
|
11 |
These routines address common layout styles for menu pages.
|
12 |
*/
|
13 |
+
jQuery (document).ready (function($)
|
14 |
{
|
15 |
+
$ ('div.ws-menu-page-group').each (function(index)
|
16 |
{
|
17 |
+
var ins = '<ins>+</ins>', group = $ (this), title = group.attr ('title');
|
18 |
/**/
|
19 |
+
var header = $ ('<div class="ws-menu-page-group-header">' + ins + title + '</div>');
|
20 |
/**/
|
21 |
header.css ({'z-index': 100 - index}); /* Stack them sequentially, top to bottom. */
|
22 |
/**/
|
23 |
header.insertBefore (group), group.hide (), header.click (function()
|
24 |
{
|
25 |
+
var ins = $ ('ins', this), group = $ (this).next ();
|
26 |
/**/
|
27 |
if (group.css ('display') === 'none')
|
28 |
{
|
29 |
+
$ (this).addClass ('open'), ins.html ('-'), group.show ();
|
30 |
}
|
31 |
else
|
32 |
{
|
33 |
+
$ (this).removeClass ('open'), ins.html ('+'), group.hide ();
|
34 |
}
|
35 |
/**/
|
36 |
return false;
|
37 |
});
|
38 |
if (index === 0) /* These are the buttons for showing/hiding all groups. */
|
39 |
{
|
40 |
+
$ ('<div class="ws-menu-page-groups-show">+</div>').insertBefore (header).click (function()
|
41 |
{
|
42 |
+
$ ('div.ws-menu-page-group-header').each (function()
|
43 |
{
|
44 |
+
var ins = $ ('ins', this), group = $ (this).next ();
|
45 |
/**/
|
46 |
+
$ (this).addClass ('open'), ins.html ('-'), group.show ();
|
47 |
/**/
|
48 |
return;
|
49 |
});
|
50 |
/**/
|
51 |
return false;
|
52 |
});
|
53 |
+
$ ('<div class="ws-menu-page-groups-hide">-</div>').insertBefore (header).click (function()
|
54 |
{
|
55 |
+
$ ('div.ws-menu-page-group-header').each (function()
|
56 |
{
|
57 |
+
var ins = $ ('ins', this), group = $ (this).next ();
|
58 |
/**/
|
59 |
+
$ (this).removeClass ('open'), ins.html ('+'), group.hide ();
|
60 |
/**/
|
61 |
return;
|
62 |
});
|
71 |
return;
|
72 |
});
|
73 |
/**/
|
74 |
+
$ ('div.ws-menu-page-hr:first').css ({'margin-top': '10px', 'margin-bottom': '20px'});
|
75 |
/**/
|
76 |
+
$ ('div.ws-menu-page-section:first > h3').css ({'margin-top': '0'});
|
77 |
/**/
|
78 |
+
$ ('div.ws-menu-page-group > div.ws-menu-page-section:first-child > h3').css ({'margin-top': '0'});
|
79 |
+
$ ('div.ws-menu-page-group-header:first').css ({'margin-top': '0', 'margin-right': '140px'});
|
80 |
+
$ ('div.ws-menu-page-group:first').css ({'margin-right': '145px'});
|
81 |
/**/
|
82 |
+
$ ('div.ws-menu-page-readme > div.readme > div.section:last-child').css ({'border-bottom-width': '0'});
|
83 |
/**/
|
84 |
+
$ ('input.ws-menu-page-media-btn').filter (function() /* Only those that have a rel attribute. */
|
85 |
{
|
86 |
+
return ($ (this).attr ('rel')) ? true : false; /* Must have rel targeting an input id. */
|
87 |
})/**/
|
88 |
.click (function() /* Attach click events to media buttons with send_to_editor(). */
|
89 |
{
|
90 |
+
$this = $ (this), window.send_to_editor = function(html)
|
91 |
{
|
92 |
var $inp, $txt; /* Looking for input|textarea. */
|
93 |
/**/
|
94 |
+
if (($inp = $ ('input#' + $this.attr ('rel'))).length > 0)
|
95 |
{
|
96 |
+
var oBg = $inp.css ('background-color'), src = $.trim ($ (html).attr ('src'));
|
97 |
+
src = (!src) ? $.trim ($ ('img', html).attr ('src')) : src;
|
98 |
/**/
|
99 |
+
$inp.val (src), $inp.css ({'background-color': '#FFFFCC'}), setTimeout (function()
|
100 |
{
|
101 |
$inp.css ({'background-color': oBg});
|
102 |
}, 2000);
|
105 |
/**/
|
106 |
return;
|
107 |
}
|
108 |
+
else if (($txt = $ ('textarea#' + $this.attr ('rel'))).length > 0)
|
109 |
{
|
110 |
+
var oBg = $txt.css ('background-color'), src = $.trim ($ (html).attr ('src'));
|
111 |
+
src = (!src) ? $.trim ($ ('img', html).attr ('src')) : src;
|
112 |
/**/
|
113 |
+
$txt.val ($.trim ($txt.val ()) + '\n' + src), $txt.css ({'background-color': '#FFFFCC'}), setTimeout (function()
|
114 |
{
|
115 |
$txt.css ({'background-color': oBg});
|
116 |
}, 2000);
|
121 |
}
|
122 |
};
|
123 |
/**/
|
124 |
+
tb_show ('', './media-upload.php?type=image&TB_iframe=true');
|
125 |
/**/
|
126 |
return false;
|
127 |
});
|
includes/menu-pages/paypal-buttons.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
PayPal® Button Generating page.
|
18 |
*/
|
@@ -70,21 +70,21 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
70 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level1_buttons_before_shortcode", get_defined_vars ());
|
71 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
72 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
73 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
74 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
75 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label
|
76 |
echo '<input id="ws-plugin--s2member-level1-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
77 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
78 |
echo '<textarea id="ws-plugin--s2member-level1-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
79 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
80 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
81 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
82 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label
|
83 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url
|
84 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_notify=1
|
85 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_return=1
|
86 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
87 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
88 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
89 |
echo '</textarea><br />' . "\n";
|
90 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
@@ -141,21 +141,21 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
141 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level2_buttons_before_shortcode", get_defined_vars ());
|
142 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
143 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
144 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
145 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
146 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label
|
147 |
echo '<input id="ws-plugin--s2member-level2-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
148 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
149 |
echo '<textarea id="ws-plugin--s2member-level2-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
150 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
151 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
152 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
153 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label
|
154 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url
|
155 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_notify=1
|
156 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_return=1
|
157 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
158 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
159 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
160 |
echo '</textarea><br />' . "\n";
|
161 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
@@ -212,21 +212,21 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
212 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level3_buttons_before_shortcode", get_defined_vars ());
|
213 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
214 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
215 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
216 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
217 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label
|
218 |
echo '<input id="ws-plugin--s2member-level3-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
219 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
220 |
echo '<textarea id="ws-plugin--s2member-level3-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
221 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
222 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
223 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
224 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label
|
225 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url
|
226 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_notify=1
|
227 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_return=1
|
228 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
229 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
230 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
231 |
echo '</textarea><br />' . "\n";
|
232 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
@@ -283,21 +283,21 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
283 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level4_buttons_before_shortcode", get_defined_vars ());
|
284 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
285 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
286 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
287 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
288 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label
|
289 |
echo '<input id="ws-plugin--s2member-level4-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
290 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
291 |
echo '<textarea id="ws-plugin--s2member-level4-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
292 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
293 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
294 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
295 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label
|
296 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url
|
297 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_notify=1
|
298 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_return=1
|
299 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
300 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
301 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
302 |
echo '</textarea><br />' . "\n";
|
303 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
@@ -359,22 +359,22 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
359 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
360 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
361 |
$ws_plugin__s2member_temp_s = preg_replace ("/\/]#x2F;", 'modify="1" /]', $ws_plugin__s2member_temp_s);
|
362 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
363 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
364 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label
|
365 |
echo '<input id="ws-plugin--s2member-modification-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
366 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
367 |
echo '<textarea id="ws-plugin--s2member-modification-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
368 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
369 |
$ws_plugin__s2member_temp_s = preg_replace ('/name\="modify" value\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__s2member_temp_s);
|
370 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
371 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
372 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label
|
373 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url
|
374 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_notify=1
|
375 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_return=1
|
376 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
377 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/",
|
378 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
379 |
echo '</textarea><br />' . "\n";
|
380 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
@@ -412,8 +412,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
412 |
echo 'Button Code<br />For Cancellations:<br /><br />' . "\n";
|
413 |
echo '<div id="ws-plugin--s2member-cancellation-button-prev">' . "\n";
|
414 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-cancellation-button.html"));
|
415 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
416 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
417 |
echo preg_replace ("/\<a/", '<a target="_blank"', $ws_plugin__s2member_temp_s);
|
418 |
echo '</div>' . "\n";
|
419 |
echo '</label>' . "\n";
|
@@ -437,8 +437,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
437 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
438 |
echo '<textarea id="ws-plugin--s2member-cancellation-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
439 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-cancellation-button.html"));
|
440 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
441 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
442 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
443 |
echo '</textarea><br />' . "\n";
|
444 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
@@ -528,17 +528,17 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
528 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_sp_buttons_before_shortcode", get_defined_vars ());
|
529 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
530 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-button-shortcode.html"));
|
531 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
532 |
echo '<input id="ws-plugin--s2member-sp-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
533 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
534 |
echo '<textarea id="ws-plugin--s2member-sp-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
535 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.html"));
|
536 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com
|
537 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business
|
538 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url
|
539 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_notify=1
|
540 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (get_bloginfo ("url") . "/?s2member_paypal_return=1
|
541 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (
|
542 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
543 |
echo '</textarea><br />' . "\n";
|
544 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
PayPal® Button Generating page.
|
18 |
*/
|
70 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level1_buttons_before_shortcode", get_defined_vars ());
|
71 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
72 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
73 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
74 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
75 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
76 |
echo '<input id="ws-plugin--s2member-level1-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
77 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
78 |
echo '<textarea id="ws-plugin--s2member-level1-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
79 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
80 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
81 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
82 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
83 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
84 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
85 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
86 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
87 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
88 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
89 |
echo '</textarea><br />' . "\n";
|
90 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
141 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level2_buttons_before_shortcode", get_defined_vars ());
|
142 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
143 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
144 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
145 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
146 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
147 |
echo '<input id="ws-plugin--s2member-level2-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
148 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
149 |
echo '<textarea id="ws-plugin--s2member-level2-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
150 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
151 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
152 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
153 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
154 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
155 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
156 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
157 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
158 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
159 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
160 |
echo '</textarea><br />' . "\n";
|
161 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
212 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level3_buttons_before_shortcode", get_defined_vars ());
|
213 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
214 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
215 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
216 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
217 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
218 |
echo '<input id="ws-plugin--s2member-level3-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
219 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
220 |
echo '<textarea id="ws-plugin--s2member-level3-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
221 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
222 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
223 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
224 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
225 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
226 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
227 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
228 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
229 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
230 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
231 |
echo '</textarea><br />' . "\n";
|
232 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
283 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level4_buttons_before_shortcode", get_defined_vars ());
|
284 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
285 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
286 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
287 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
288 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
289 |
echo '<input id="ws-plugin--s2member-level4-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
290 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
291 |
echo '<textarea id="ws-plugin--s2member-level4-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
292 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
293 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
294 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
295 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
296 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
297 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
298 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
299 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
300 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
301 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
302 |
echo '</textarea><br />' . "\n";
|
303 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
359 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
360 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
361 |
$ws_plugin__s2member_temp_s = preg_replace ("/\/]#x2F;", 'modify="1" /]', $ws_plugin__s2member_temp_s);
|
362 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
363 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
364 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
365 |
echo '<input id="ws-plugin--s2member-modification-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
366 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
367 |
echo '<textarea id="ws-plugin--s2member-modification-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
368 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
369 |
$ws_plugin__s2member_temp_s = preg_replace ('/name\="modify" value\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__s2member_temp_s);
|
370 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
371 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
372 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
373 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
374 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
375 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
376 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
377 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
378 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
379 |
echo '</textarea><br />' . "\n";
|
380 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
412 |
echo 'Button Code<br />For Cancellations:<br /><br />' . "\n";
|
413 |
echo '<div id="ws-plugin--s2member-cancellation-button-prev">' . "\n";
|
414 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-cancellation-button.html"));
|
415 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
416 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
417 |
echo preg_replace ("/\<a/", '<a target="_blank"', $ws_plugin__s2member_temp_s);
|
418 |
echo '</div>' . "\n";
|
419 |
echo '</label>' . "\n";
|
437 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
438 |
echo '<textarea id="ws-plugin--s2member-cancellation-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
439 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-cancellation-button.html"));
|
440 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
441 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
442 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
443 |
echo '</textarea><br />' . "\n";
|
444 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
528 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_sp_buttons_before_shortcode", get_defined_vars ());
|
529 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
530 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-button-shortcode.html"));
|
531 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
532 |
echo '<input id="ws-plugin--s2member-sp-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
|
533 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
534 |
echo '<textarea id="ws-plugin--s2member-sp-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
535 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.html"));
|
536 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
537 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
538 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
539 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
540 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
541 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
542 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
543 |
echo '</textarea><br />' . "\n";
|
544 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
includes/menu-pages/paypal-ops.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
PayPal® Options page.
|
18 |
*/
|
@@ -42,15 +42,15 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-email-section">' . "\n";
|
44 |
echo '<a href="https://www.paypal.com/us/mrb/pal=K8S5Y97AKWYY8" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/paypal-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
|
45 |
-
echo '<h3>PayPal®
|
46 |
echo '<p>This plugin works in conjunction with <a href="https://www.paypal.com/us/mrb/pal=K8S5Y97AKWYY8" target="_blank" rel="external">PayPal® Website Payments Standard</a>, for businesses. You do NOT need a PayPal® Pro account. You just need to upgrade your Personal PayPal® account to a Business status, which is free. A PayPal® account can be <a href="http://pages.ebay.com/help/buy/questions/upgrade-paypal-account.html" target="_blank" rel="external">upgraded</a> from a Personal account to a Business account, simply by going to the `Profile` button under the `My Account` tab, selecting the `Personal Business Information` button, and then clicking the `Upgrade Your Account` button.</p>' . "\n";
|
47 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_details", get_defined_vars ());
|
48 |
/**/
|
49 |
-
echo '<table class="form-table
|
50 |
echo '<tbody>' . "\n";
|
51 |
echo '<tr>' . "\n";
|
52 |
/**/
|
53 |
-
echo '<th
|
54 |
echo '<label for="ws-plugin--s2member-paypal-business">' . "\n";
|
55 |
echo 'Your PayPal® EMail Address:' . "\n";
|
56 |
echo '</label>' . "\n";
|
@@ -69,8 +69,16 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
69 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_details_after_business", get_defined_vars ());
|
70 |
/**/
|
71 |
echo '<tr>' . "\n";
|
|
|
|
|
72 |
/**/
|
73 |
-
echo '<
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
echo '<label for="ws-plugin--s2member-paypal-sandbox">' . "\n";
|
75 |
echo 'Sandbox Testing?' . "\n";
|
76 |
echo '</label>' . "\n";
|
@@ -105,6 +113,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
105 |
echo '</tbody>' . "\n";
|
106 |
echo '</table>' . "\n";
|
107 |
/**/
|
|
|
|
|
108 |
echo '<p><em><strong>*Sandbox Tip*</strong> If you\'re testing your site through a PayPal® Sandbox account, please remember that Email Confirmations from s2Member will NOT be received after a test purchase. s2Member sends its Confirmation Emails to the PayPal® Email Address of the Customer. Since PayPal® Sandbox addresses are usually bogus ( for testing ), you will have to run live transactions before Email Confirmations from s2Member are received. That being said, all other s2Member functionality CAN be tested through a PayPal® Sandbox account. Email Confirmations are the only hang-up.</em></p>' . "\n";
|
109 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_details_after_sandbox_tip", get_defined_vars ());
|
110 |
echo '</div>' . "\n";
|
@@ -125,18 +135,24 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
125 |
echo '<p>Log into your PayPal® account and navigate to this section:<br /><code>Account Profile -> Instant Payment Notification Preferences</code></p>' . "\n";
|
126 |
echo '<p>Edit your IPN settings & turn IPN Notifications: <strong><code>On</code></strong></p>' . "\n";
|
127 |
echo '<p>You\'ll need your IPN URL, which is:<br /><code>' . get_bloginfo ("url") . '/?s2member_paypal_notify=1</code></p>' . "\n";
|
|
|
|
|
|
|
|
|
128 |
echo '<p><em><strong>*Quick Tip*</strong> In addition to the default IPN Settings inside your PayPal® account, the IPN URL is also set on a per-transaction basis by the special PayPal® Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal® account, that\'s OK. s2Member dynamically sets the IPN URL for each transaction. The result is that the IPN URL configured from within your PayPal® account, becomes the default, which is then overwritten on a per-transaction basis. In fact, PayPal® recently updated their system to support IPN URL preservation. One PayPal® account can handle multiple sites, all using different IPN URLs.</em></p>' . "\n";
|
129 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_quick_tip", get_defined_vars ());
|
130 |
-
echo '<p><em><strong>*
|
131 |
-
echo
|
132 |
/**/
|
133 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
134 |
/**/
|
135 |
-
echo '<h3>IPN w/ Proxy Key ( optional, for 3rd-party integrations )</h3>' . "\n";
|
|
|
136 |