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

Version Description

= v160801 =

(Maintenance Release) Upgrade immediately.

Download this release

Release Info

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

Code changes from version 170221 to 170524

Files changed (71) hide show
  1. readme.txt +34 -4
  2. s2member.php +5 -5
  3. src/includes/classes/admin-notices.inc.php +2 -2
  4. src/includes/classes/files-in.inc.php +1 -1
  5. src/includes/classes/querys.inc.php +10 -10
  6. src/includes/classes/registrations.inc.php +1 -1
  7. src/includes/classes/sc-eots-in.inc.php +3 -1
  8. src/includes/classes/utils-defuse.inc.php +131 -0
  9. src/includes/classes/utils-encryption.inc.php +224 -228
  10. src/includes/classes/utils-time.inc.php +11 -10
  11. src/includes/functions/class-autoloader.inc.php +1 -0
  12. src/includes/menu-pages/api-ops.inc.php +2 -0
  13. src/includes/menu-pages/down-ops.inc.php +2 -0
  14. src/includes/menu-pages/els-ops.inc.php +2 -0
  15. src/includes/menu-pages/gen-ops.inc.php +2 -0
  16. src/includes/menu-pages/help.inc.php +2 -0
  17. src/includes/menu-pages/integrations.inc.php +2 -0
  18. src/includes/menu-pages/logs.inc.php +2 -0
  19. src/includes/menu-pages/menu-pages-s.min.js +2 -1
  20. src/includes/menu-pages/menu-pages.css +105 -106
  21. src/includes/menu-pages/menu-pages.js +3 -3
  22. src/includes/menu-pages/menu-pages.min.js +1 -1
  23. src/includes/menu-pages/mms-ops.inc.php +2 -0
  24. src/includes/menu-pages/paypal-buttons.inc.php +2 -0
  25. src/includes/menu-pages/paypal-ops.inc.php +3 -1
  26. src/includes/menu-pages/res-ops.inc.php +2 -0
  27. src/includes/menu-pages/scripting.inc.php +4 -2
  28. src/includes/menu-pages/start.inc.php +2 -0
  29. src/includes/menu-pages/trk-ops.inc.php +2 -0
  30. src/includes/syscon.inc.php +19 -2
  31. src/includes/translations/s2member.pot +48 -48
  32. src/vendor/autoload.php +1 -1
  33. src/vendor/composer/autoload_classmap.php +14 -0
  34. src/vendor/composer/autoload_files.php +10 -0
  35. src/vendor/composer/autoload_real.php +17 -3
  36. src/vendor/composer/installed.json +113 -1
  37. src/vendor/defuse/php-encryption/LICENSE +21 -0
  38. src/vendor/defuse/php-encryption/dist/Makefile +37 -0
  39. src/vendor/defuse/php-encryption/dist/box.json +25 -0
  40. src/vendor/defuse/php-encryption/dist/signingkey.asc +52 -0
  41. src/vendor/defuse/php-encryption/src/Core.php +434 -0
  42. src/vendor/defuse/php-encryption/src/Crypto.php +372 -0
  43. src/vendor/defuse/php-encryption/src/DerivedKeys.php +37 -0
  44. src/vendor/defuse/php-encryption/src/Encoding.php +212 -0
  45. src/vendor/defuse/php-encryption/src/Exception/BadFormatException.php +7 -0
  46. src/vendor/defuse/php-encryption/src/Exception/CryptoException.php +7 -0
  47. src/vendor/defuse/php-encryption/src/Exception/EnvironmentIsBrokenException.php +7 -0
  48. src/vendor/defuse/php-encryption/src/Exception/IOException.php +7 -0
  49. src/vendor/defuse/php-encryption/src/Exception/WrongKeyOrModifiedCiphertextException.php +7 -0
  50. src/vendor/defuse/php-encryption/src/File.php +755 -0
  51. src/vendor/defuse/php-encryption/src/Key.php +84 -0
  52. src/vendor/defuse/php-encryption/src/KeyOrPassword.php +119 -0
  53. src/vendor/defuse/php-encryption/src/KeyProtectedByPassword.php +112 -0
  54. src/vendor/defuse/php-encryption/src/RuntimeTests.php +242 -0
  55. src/vendor/paragonie/random_compat/LICENSE +22 -0
  56. src/vendor/paragonie/random_compat/build-phar.sh +5 -0
  57. src/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey +5 -0
  58. src/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc +11 -0
  59. src/vendor/paragonie/random_compat/lib/byte_safe_strings.php +181 -0
  60. src/vendor/paragonie/random_compat/lib/cast_to_int.php +74 -0
  61. src/vendor/paragonie/random_compat/lib/error_polyfill.php +49 -0
  62. src/vendor/paragonie/random_compat/lib/random.php +223 -0
  63. src/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php +88 -0
  64. src/vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php +167 -0
  65. src/vendor/paragonie/random_compat/lib/random_bytes_libsodium.php +88 -0
  66. src/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php +92 -0
  67. src/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php +77 -0
  68. src/vendor/paragonie/random_compat/lib/random_int.php +190 -0
  69. src/vendor/paragonie/random_compat/other/build_phar.php +57 -0
  70. src/vendor/paragonie/random_compat/psalm-autoload.php +9 -0
  71. src/vendor/paragonie/random_compat/psalm.xml +15 -0
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
=== s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) ===
2
3
- Version: 170221
4
- Stable tag: 170221
5
6
SSL Compatible: yes
7
bbPress® Compatible: yes
@@ -17,11 +17,11 @@ Authorize.Net® Compatible: yes w/s2Member® Pro
17
Google® Checkout Compatible: yes w/s2Member® Pro
18
ClickBank® Compatible: yes w/s2Member® Pro
19
20
- Tested up to: 4.8-alpha
21
Requires at least: 4.2
22
23
Requires PHP: 5.2
24
- Tested up to PHP: 7.0.15
25
26
Copyright: © 2009 WebSharks, Inc.
27
License: GNU General Public License v2 or later.
@@ -171,6 +171,36 @@ Released under the terms of the [GNU General Public License](http://www.gnu.org/
171
172
== Changelog ==
173
174
= v170221 =
175
176
- (s2Member/s2Member Pro) **JW Player v7:** This release adds support for JW Player v7 in the `[s2Stream /]` shortcode. See [Issue #774](https://github.com/websharks/s2member/issues/774).
1
=== s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) ===
2
3
+ Version: 170524
4
+ Stable tag: 170524
5
6
SSL Compatible: yes
7
bbPress® Compatible: yes
17
Google® Checkout Compatible: yes w/s2Member® Pro
18
ClickBank® Compatible: yes w/s2Member® Pro
19
20
+ Tested up to: 4.9-alpha
21
Requires at least: 4.2
22
23
Requires PHP: 5.2
24
+ Tested up to PHP: 7.0.17
25
26
Copyright: © 2009 WebSharks, Inc.
27
License: GNU General Public License v2 or later.
171
172
== Changelog ==
173
174
+ = v170524 =
175
+
176
+ - (s2Member/s2Member Pro) **PHP v7 Compat. Enhancements**: This release adds an integration with the [Defuse encryption library](https://github.com/defuse/php-encryption) for PHP, making it possible for s2Member to move away from the `mcrypt_*()` family of functions in versions of PHP >= 7.0.4, where the mcrypt library has been deprecated — `mcrypt_*()` will eventually be removed entirely.
177
+
178
+ Starting with this release of s2Member, if you're running s2Member on PHP v7.0.4+, the Defuse library will be used automatically instead of mcrypt. See [Issue #1079](https://github.com/websharks/s2member/pull/1079).
179
+
180
+ **Note:** Backward compatibility with mcrypt functions will remain for now, especially for the decryption of any data that was previously encrypted using RIJNDAEL-256; i.e., data encrypted by a previous release of the s2Member software. s2Member is capable of automatically determining the algorithm originally used to encrypt, which allows it to decrypt data using Defuse, else RIJNDAEL-256, else XOR as a last-ditch fallback.
181
+
182
+ **API Functions:** `s2member_encrypt()` & `s2member_decrypt()`. These two API Functions provided by s2Member are impacted by this change. Starting with this release, if you're running s2Member on PHP v7.0.4+, the Defuse library is used automatically instead of the older mcrypt extension. Not to worry though; the `s2member_decrypt()` function is still capable of decrypting data encrypted by previous versions of the s2Member software.
183
+
184
+ - (s2Member/s2Member Pro) **UI Fix:** All menu page notices should be given the `notice` class and the additional `notice-[type]` class instead of the older generic `updated` and `error` classes. Fixed in this release. Related to [Issue #1034](https://github.com/websharks/s2member/issues/1034)
185
+
186
+ - (s2Member/s2Member Pro) **UI Fix:** Plugins displaying Dashboard-wide notices using the older `updated` and `error` classes should be handled better to avoid displaying them below the s2Member header (on s2Member menu pages) and with non-default WordPress styles. See: [Issue #1034](https://github.com/websharks/s2member/issues/1034)
187
+
188
+ - (s2Member/s2Member Pro) **UI Fix:** Improving color highlighting in input fields following a media library insertion; e.g., when adding a custom logo to the login/registration page.
189
+
190
+ - (s2Member Pro) **Bug Fix:** Merchants using PayPal Pro (Payflow Edition) to charge a fixed non-recurring fee following an initial 100% free trial period, were seeing their member accounts EOTd after the trial ended, instead of the EOT Time being set to the end of the fixed term period. Props @patdumond, James Hall, and many others for reporting this in the forums and at GitHub. See [Issue #1077](https://github.com/websharks/s2member/issues/1077).
191
+
192
+ - (s2Member Pro) **Bug Fix:** Updating PHP syntax in Simple Export tool, for compatibility w/ modern versions of PHP. Props @patdumond for reporting and helping us locate the underlying cause of this problem. See [Issue #1055](https://github.com/websharks/s2member/issues/1055).
193
+
194
+ - (s2Member Pro) **Stripe Bug Fix:** This releases corrects a seemingly rare conflict between s2Member and Stripe on certain mobile devices and in certain scenarios. In a case we examined, there was a problematic CSS `z-index` setting in the s2Member source code that was, at times, causing problems in the stacking order, which resulted in a user's inability to enter details into the Stripe popup form. In this release, s2Member's customization of the `z-index` stacking order has been removed entirely, as it is no longer necessary in the latest revision of the Stripe popup, which already handles `z-index` adequately. Props @jaspuduf for reporting and for helping us diagnose the problem. See [Issue #1057](https://github.com/websharks/s2member/issues/1057).
195
+
196
+ - (s2Member/s2Member Pro) **Security Enhancement:** This release removes the `%%user_pass%%` Replacement Code from the API Registration Notification email that is sent to a site owner; i.e., when/if it is configured by a site owner. Props @patdumond see [Issue #954](https://github.com/websharks/s2member/issues/954). This Replacement Code was removed as a security precaution.
197
+
198
+ - (s2Member/s2Member Pro) **Bug Fix:** Resolving internal warning: 'PHP Warning: Parameter 2 to c_ws_plugin__s2member_querys::_query_level_access_coms() expected to be a reference, value given'. This was resolved by removing the strict 'by reference' requirement from the list of parameters requested by s2Member.
199
+
200
+ - (s2Member/s2Member Pro) **Bug Fix:** Resolving internal warning: 'PHP Warning: Illegal string offset 'user_id' in s2member/src/includes/classes/sc-eots-in.inc.php'. This was resolved by typecasting `$attr` to an array in cases where WordPress core passes this as a string; e.g., when there are no attributes.
201
+
202
+ - (s2Member Pro) **Bug Fix:** Incorrect default option value for `reject_prepaid=""` attribute in Stripe Pro-Forms. See: [Issue #1089](https://github.com/websharks/s2member/issues/1089)
203
+
204
= v170221 =
205
206
- (s2Member/s2Member Pro) **JW Player v7:** This release adds support for JW Player v7 in the `[s2Stream /]` shortcode. See [Issue #774](https://github.com/websharks/s2member/issues/774).
s2member.php CHANGED
@@ -20,8 +20,8 @@
20
*/
21
/* -- This section for WordPress parsing. ------------------------------------------------------------------------------
22
23
- Version: 170221
24
- Stable tag: 170221
25
26
SSL Compatible: yes
27
bbPress Compatible: yes
@@ -40,7 +40,7 @@ Tested up to: 4.8-alpha
40
Requires at least: 4.2
41
42
Requires PHP: 5.2
43
- Tested up to PHP: 7.0.15
44
45
Copyright: © 2009 WebSharks, Inc.
46
License: GNU General Public License
@@ -77,7 +77,7 @@ if(!defined('WPINC')) // MUST have WordPress.
77
*
78
* @var string
79
*/
80
- ${__FILE__}['tmp'] = '170221'; //version//
81
if(!defined('WS_PLUGIN__S2MEMBER_VERSION'))
82
define('WS_PLUGIN__S2MEMBER_VERSION', ${__FILE__}['tmp']);
83
/**
@@ -110,7 +110,7 @@ if(!defined('WS_PLUGIN__S2MEMBER_MIN_WP_VERSION'))
110
*
111
* @var string
112
*/
113
- ${__FILE__}['tmp'] = '170221'; //version//
114
if(!defined('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION'))
115
define('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION', ${__FILE__}['tmp']);
116
/*
20
*/
21
/* -- This section for WordPress parsing. ------------------------------------------------------------------------------
22
23
+ Version: 170524
24
+ Stable tag: 170524
25
26
SSL Compatible: yes
27
bbPress Compatible: yes
40
Requires at least: 4.2
41
42
Requires PHP: 5.2
43
+ Tested up to PHP: 7.0.17
44
45
Copyright: © 2009 WebSharks, Inc.
46
License: GNU General Public License
77
*
78
* @var string
79
*/
80
+ ${__FILE__}['tmp'] = '170524'; //version//
81
if(!defined('WS_PLUGIN__S2MEMBER_VERSION'))
82
define('WS_PLUGIN__S2MEMBER_VERSION', ${__FILE__}['tmp']);
83
/**
110
*
111
* @var string
112
*/
113
+ ${__FILE__}['tmp'] = '170524'; //version//
114
if(!defined('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION'))
115
define('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION', ${__FILE__}['tmp']);
116
/*
src/includes/classes/admin-notices.inc.php CHANGED
@@ -83,13 +83,13 @@ if(!class_exists('c_ws_plugin__s2member_admin_notices'))
83
{
84
if($dismiss && !empty($dismissal_link))
85
$notice = $dismissal_link.$notice;
86
- echo '<div class="error fade"><p>'.$notice.'</p></div>';
87
}
88
else if($notice && is_string($notice))
89
{
90
if($dismiss && !empty($dismissal_link))
91
$notice = $dismissal_link.$notice;
92
- echo '<div class="updated fade"><p>'.$notice.'</p></div>';
93
}
94
do_action('ws_plugin__s2member_after_display_admin_notice', get_defined_vars());
95
}
83
{
84
if($dismiss && !empty($dismissal_link))
85
$notice = $dismissal_link.$notice;
86
+ echo '<div class="notice notice-error"><p>'.$notice.'</p></div>';
87
}
88
else if($notice && is_string($notice))
89
{
90
if($dismiss && !empty($dismissal_link))
91
$notice = $dismissal_link.$notice;
92
+ echo '<div class="notice notice-info"><p>'.$notice.'</p></div>';
93
}
94
do_action('ws_plugin__s2member_after_display_admin_notice', get_defined_vars());
95
}
src/includes/classes/files-in.inc.php CHANGED
@@ -293,7 +293,7 @@ if(!class_exists('c_ws_plugin__s2member_files_in'))
293
294
$file = $GLOBALS['WS_PLUGIN__']['s2member']['c']['files_dir'].'/'.$req['file_download'];
295
$pathinfo = (!$using_amazon_storage && $file) ? pathinfo($file) : array();
296
- $mimetype = ($mimetypes[$extension]) ? $mimetypes[$extension] : 'application/octet-stream';
297
$disposition = (($inline) ? 'inline' : 'attachment').'; filename="'.c_ws_plugin__s2member_utils_strings::esc_dq($basename).'"; filename*=UTF-8\'\''.rawurlencode($basename);
298
$length = (!$using_amazon_storage && $file) ? filesize($file) : -1;
299
293
294
$file = $GLOBALS['WS_PLUGIN__']['s2member']['c']['files_dir'].'/'.$req['file_download'];
295
$pathinfo = (!$using_amazon_storage && $file) ? pathinfo($file) : array();
296
+ $mimetype = !empty($mimetypes[$extension]) ? $mimetypes[$extension] : 'application/octet-stream';
297
$disposition = (($inline) ? 'inline' : 'attachment').'; filename="'.c_ws_plugin__s2member_utils_strings::esc_dq($basename).'"; filename*=UTF-8\'\''.rawurlencode($basename);
298
$length = (!$using_amazon_storage && $file) ? filesize($file) : -1;
299
src/includes/classes/querys.inc.php CHANGED
@@ -49,9 +49,9 @@ if(!class_exists('c_ws_plugin__s2member_querys'))
49
*
50
* @attaches-to ``add_action('pre_get_posts');``
51
*
52
- * @param WP_Query $wp_query Expects ``$wp_query`` by reference.
53
*/
54
- public static function force_query_level_access(&$wp_query = NULL)
55
{
56
foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $__v;
57
do_action('ws_plugin__s2member_before_force_query_level_access', get_defined_vars());
@@ -75,7 +75,7 @@ if(!class_exists('c_ws_plugin__s2member_querys'))
75
*
76
* @attaches-to ``add_action('pre_get_posts');``
77
*
78
- * @param WP_Query $wp_query Expects ``$wp_query`` by reference, from the Filter.
79
* @param bool $force Optional. Defaults to false. If true, we bypass all standard conditions.
80
* However, s2Member will NEVER bypass `supress_filters`.
81
*
@@ -87,7 +87,7 @@ if(!class_exists('c_ws_plugin__s2member_querys'))
87
*
88
* @see Workaround for bbPress and the `s` key. See: <http://bit.ly/1obLpv4>
89
*/
90
- public static function query_level_access(&$wp_query = NULL, $force = FALSE)
91
{
92
global $wpdb; // Global DB object reference.
93
@@ -263,9 +263,9 @@ if(!class_exists('c_ws_plugin__s2member_querys'))
263
* @package s2Member\Queries
264
* @since 3.5
265
*
266
- * @param WP_Query $wp_query Expects ``$wp_query`` by reference.
267
*/
268
- public static function _query_level_access_sys(&$wp_query = NULL)
269
{
270
global $wpdb; // Global DB object reference.
271
@@ -340,11 +340,11 @@ if(!class_exists('c_ws_plugin__s2member_querys'))
340
* @attaches-to ``add_filter('comment_feed_where');``
341
*
342
* @param string $cwhere Expects the SQL `WHERE` portion to be passed through by the Filter.
343
- * @param WP_Query $wp_query Expects ``$wp_query`` by reference, from the Filter.
344
*
345
* @return string The revised ``$cwhere`` string.
346
*/
347
- public static function _query_level_access_coms($cwhere = '', &$wp_query = NULL)
348
{
349
global $wpdb; // Global DB object reference.
350
@@ -368,11 +368,11 @@ if(!class_exists('c_ws_plugin__s2member_querys'))
368
* @package s2Member\Queries
369
* @since 110912
370
*
371
- * @param WP_Query $wp_query Expects ``$wp_query`` by reference.
372
*
373
* @return bool True if it's an AJAX search via `admin-ajax.php`, else false.
374
*/
375
- public static function _is_admin_ajax_search(&$wp_query = NULL)
376
{
377
global $wpdb; // Global DB object reference.
378
49
*
50
* @attaches-to ``add_action('pre_get_posts');``
51
*
52
+ * @param WP_Query $wp_query Expects ``$wp_query``.
53
*/
54
+ public static function force_query_level_access($wp_query = NULL)
55
{
56
foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $__v;
57
do_action('ws_plugin__s2member_before_force_query_level_access', get_defined_vars());
75
*
76
* @attaches-to ``add_action('pre_get_posts');``
77
*
78
+ * @param WP_Query $wp_query Expects ``$wp_query`` from the Filter.
79
* @param bool $force Optional. Defaults to false. If true, we bypass all standard conditions.
80
* However, s2Member will NEVER bypass `supress_filters`.
81
*
87
*
88
* @see Workaround for bbPress and the `s` key. See: <http://bit.ly/1obLpv4>
89
*/
90
+ public static function query_level_access($wp_query = NULL, $force = FALSE)
91
{
92
global $wpdb; // Global DB object reference.
93
263
* @package s2Member\Queries
264
* @since 3.5
265
*
266
+ * @param WP_Query $wp_query Expects ``$wp_query``.
267
*/
268
+ public static function _query_level_access_sys($wp_query = NULL)
269
{
270
global $wpdb; // Global DB object reference.
271
340
* @attaches-to ``add_filter('comment_feed_where');``
341
*
342
* @param string $cwhere Expects the SQL `WHERE` portion to be passed through by the Filter.
343
+ * @param WP_Query $wp_query Expects ``$wp_query`` from the Filter.
344
*
345
* @return string The revised ``$cwhere`` string.
346
*/
347
+ public static function _query_level_access_coms($cwhere = '', $wp_query = NULL)
348
{
349
global $wpdb; // Global DB object reference.
350
368
* @package s2Member\Queries
369
* @since 110912
370
*
371
+ * @param WP_Query $wp_query Expects ``$wp_query``.
372
*
373
* @return bool True if it's an AJAX search via `admin-ajax.php`, else false.
374
*/
375
+ public static function _is_admin_ajax_search($wp_query = NULL)
376
{
377
global $wpdb; // Global DB object reference.
378
src/includes/classes/registrations.inc.php CHANGED
@@ -1138,7 +1138,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
1138
$msg .= 'user_full_name: %%user_full_name%%'."\n";
1139
$msg .= 'user_email: %%user_email%%'."\n";
1140
$msg .= 'user_login: %%user_login%%'."\n";
1141
- $msg .= 'user_pass: %%user_pass%%'."\n";
1142
$msg .= 'user_ip: %%user_ip%%'."\n";
1143
$msg .= 'user_id: %%user_id%%'."\n";
1144
1138
$msg .= 'user_full_name: %%user_full_name%%'."\n";
1139
$msg .= 'user_email: %%user_email%%'."\n";
1140
$msg .= 'user_login: %%user_login%%'."\n";
1141
+ //$msg .= 'user_pass: %%user_pass%%'."\n";
1142
$msg .= 'user_ip: %%user_ip%%'."\n";
1143
$msg .= 'user_id: %%user_id%%'."\n";
1144
src/includes/classes/sc-eots-in.inc.php CHANGED
@@ -50,6 +50,8 @@ if(!class_exists('c_ws_plugin__s2member_sc_eots_in'))
50
51
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
52
53
$mode = ''; // Initialize shortcode mode and validate.
54
if(!empty($attr['mode']) && in_array(strtolower($attr['mode']), array('fixed', 'next'), TRUE))
55
$mode = strtolower($attr['mode']); // A specific mode; i.e., `fixed`, `next`.
@@ -76,7 +78,7 @@ if(!class_exists('c_ws_plugin__s2member_sc_eots_in'))
76
'next_format' => $mode ? '%%date%%' : '<strong class="s2member-sc-eot-label -next">'._x('Next Payment:', 's2member-front', 's2member').'</strong> <span class="s2member-sc-eot-date -next">%%date%%</span>',
77
'empty_format' => $mode ? (in_array($subscr_gateway, array('stripe', 'paypal', 'clickbank'), TRUE) ? _x('N/A', 's2member-front', 's2member') : _x('—', 's2member-front', 's2member')) : '',
78
),
79
- c_ws_plugin__s2member_utils_strings::trim_qts_deep((array)$attr)
80
);
81
foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $__v;
82
do_action('ws_plugin__s2member_before_sc_eot_details_after_shortcode_atts', get_defined_vars());
50
51
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
52
53
+ $attr = (array) $attr; // Force an array.
54
+
55
$mode = ''; // Initialize shortcode mode and validate.
56
if(!empty($attr['mode']) && in_array(strtolower($attr['mode']), array('fixed', 'next'), TRUE))
57
$mode = strtolower($attr['mode']); // A specific mode; i.e., `fixed`, `next`.
78
'next_format' => $mode ? '%%date%%' : '<strong class="s2member-sc-eot-label -next">'._x('Next Payment:', 's2member-front', 's2member').'</strong> <span class="s2member-sc-eot-date -next">%%date%%</span>',
79
'empty_format' => $mode ? (in_array($subscr_gateway, array('stripe', 'paypal', 'clickbank'), TRUE) ? _x('N/A', 's2member-front', 's2member') : _x('—', 's2member-front', 's2member')) : '',
80
),
81
+ c_ws_plugin__s2member_utils_strings::trim_qts_deep($attr)
82
);
83
foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $__v;
84
do_action('ws_plugin__s2member_before_sc_eot_details_after_shortcode_atts', get_defined_vars());
src/includes/classes/utils-defuse.inc.php ADDED
@@ -0,0 +1,131 @@
1
+ <?php
2
+ // @codingStandardsIgnoreFile
3
+ /**
4
+ * Encryption utilities.
5
+ *
6
+ * @since 170418 Defuse.
7
+ */
8
+ use Defuse\Crypto\Key;
9
+ use Defuse\Crypto\Crypto;
10
+ use c_ws_plugin__s2member_utils_strings as s;
11
+
12
+ if (!defined('WPINC')) { // MUST have.
13
+ exit('Do not access this file directly.');
14
+ }
15
+ if (!class_exists('c_ws_plugin__s2member_utils_defuse')) {
16
+ /**
17
+ * Encryption utilities.
18
+ *
19
+ * @since 170418 Defuse.
20
+ */
21
+ class c_ws_plugin__s2member_utils_defuse
22
+ {
23
+ /**
24
+ * Defuse key.
25
+ *
26
+ * @since 170418 Defuse.
27
+ *
28
+ * @param string $key A custom key.
29
+ *
30
+ * @return string Defuse encryption key.
31
+ */
32
+ public static function key($key = '')
33
+ {
34
+ $key = (string) $key;
35
+
36
+ if (isset($key[0])) { // Custom?
37
+ if (strpos($key, 'def00000') === 0) {
38
+ return $key; // Defuse key.
39
+ }
40
+ $sec_key = c_ws_plugin__s2member_utils_encryption::key($key);
41
+ $def_combo_keys = $GLOBALS['WS_PLUGIN__']['s2member']['o']['def_custom_combo_encryption_keys'];
42
+
43
+ if ($sec_key && !empty($def_combo_keys[$sec_key])) {
44
+ return $def_combo_keys[$sec_key]; // Use existing key.
45
+ }
46
+ try { // Catch Defuse exceptions.
47
+ if (!($def_key = Key::createNewRandomKey()->saveToAsciiSafeString())) {
48
+ throw new Exception('Defuse keygen failure.');
49
+ }
50
+ } catch (Throwable $Exception) {
51
+ throw new Exception($Exception->getMessage());
52
+ }
53
+ $def_combo_keys[$sec_key] = $def_key;
54
+ array_unshift($def_combo_keys, 'update-signal');
55
+ $options['ws_plugin__s2member_def_custom_combo_encryption_keys'] = $def_combo_keys;
56
+ c_ws_plugin__s2member_menu_pages::update_all_options($options, true, false, false, false, false);
57
+ //
58
+ } else { // Default behavior is to use the configured key.
59
+ $sec_key = c_ws_plugin__s2member_utils_encryption::key();
60
+ $def_combo_key = $GLOBALS['WS_PLUGIN__']['s2member']['o']['def_combo_encryption_key'];
61
+
62
+ if ($sec_key && $def_combo_key && strpos($def_combo_key, $sec_key."\n") === 0
63
+ && ($def_key = str_replace($sec_key."\n", '', $def_combo_key))) {
64
+ return $def_key; // Use existing key.
65
+ }
66
+ try { // Catch Defuse exceptions.
67
+ if (!($def_key = Key::createNewRandomKey()->saveToAsciiSafeString())) {
68
+ throw new Exception('Defuse keygen failure.');
69
+ }
70
+ } catch (Throwable $Exception) {
71
+ throw new Exception($Exception->getMessage());
72
+ }
73
+ $options['ws_plugin__s2member_def_combo_encryption_key'] = $sec_key."\n".$def_key;
74
+ c_ws_plugin__s2member_menu_pages::update_all_options($options, true, false, false, false, false);
75
+ }
76
+ return $def_key;
77
+ }
78
+
79
+ /**
80
+ * Defuse encryption.
81
+ *
82
+ * @since 170418 Defuse.
83
+ *
84
+ * @param string $string String to encrypt.
85
+ * @param string $key A custom key passed to `::key()`.
86
+ *
87
+ * @return string Encrypted string w/ a URL-safe base64 wrapper.
88
+ */
89
+ public static function encrypt($string, $key = '')
90
+ {
91
+ $string = (string) $string;
92
+
93
+ if (!isset($string[0])) {
94
+ return ''; // Not possible.
95
+ } // Empty string is an empty string.
96
+
97
+ try { // Catch Defuse exceptions.
98
+ $Key = Key::loadFromAsciiSafeString(self::key($key));
99
+ $encrypted = Crypto::encrypt($string, $Key, false);
100
+ return $base64 = s::base64_url_safe_encode($encrypted);
101
+ } catch (Throwable $Exception) {
102
+ throw new Exception($Exception->getMessage());
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Defuse decryption.
108
+ *
109
+ * @since 170418 Defuse.
110
+ *
111
+ * @param string $base64 String to decrypt.
112
+ * @param string $key A custom key passed to `::key()`.
113
+ *
114
+ * @return string Decrypted string.
115
+ */
116
+ public static function decrypt($base64, $key = '')
117
+ {
118
+ if (!is_string($base64) || !isset($base64[0])) {
119
+ return ''; // Not possible.
120
+ } // Fail when not a string or empty.
121
+
122
+ try { // Catch Defuse exceptions.
123
+ $Key = Key::loadFromAsciiSafeString(self::key($key));
124
+ $encrypted = s::base64_url_safe_decode($base64);
125
+ return $string = Crypto::decrypt($encrypted, $Key, false);
126
+ } catch (Throwable $Exception) {
127
+ return ''; // Soft failure.
128
+ }
129
+ }
130
+ }
131
+ }
src/includes/classes/utils-encryption.inc.php CHANGED
@@ -3,233 +3,229 @@
3
/**
4
* Encryption utilities.
5
*
6
- * Copyright: © 2009-2011
7
- * {@link http://websharks-inc.com/ WebSharks, Inc.}
8
- * (coded in the USA)
9
- *
10
- * Released under the terms of the GNU General Public License.
11
- * You should have received a copy of the GNU General Public License,
12
- * along with this software. In the main directory, see: /licensing/
13
- * If not, see: {@link http://www.gnu.org/licenses/}.
14
- *
15
- * @package s2Member\Utilities
16
- * @since 3.5
17
*/
18
- if(!defined('WPINC')) // MUST have WordPress.
19
- exit ('Do not access this file directly.');
20
-
21
- if(!class_exists('c_ws_plugin__s2member_utils_encryption'))
22
- {
23
- /**
24
- * Encryption utilities.
25
- *
26
- * @package s2Member\Utilities
27
- * @since 3.5
28
- */
29
- class c_ws_plugin__s2member_utils_encryption
30
- {
31
- /**
32
- * Determines the proper encryption/decryption Key to use.
33
- *
34
- * @package s2Member\Utilities
35
- * @since 111106
36
- *
37
- * @param string $key Optional. Attempt to force a specific Key. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
38
- *
39
- * @return string Proper encryption/decryption Key. If ``$key`` is passed in, and it validates, we'll return that. Otherwise use a default Key.
40
- */
41
- public static function key($key = '')
42
- {
43
- if(($key = trim((string)$key)))
44
- return $key;
45
-
46
- if(($key = trim($GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key'])))
47
- return $key;
48
-
49
- if(($key = trim(wp_salt())))
50
- return $key;
51
-
52
- return ($key = md5($_SERVER['HTTP_HOST']));
53
- }
54
-
55
- /**
56
- * A unique, unguessable, non-numeric, caSe-insensitive key (20 chars max).
57
- *
58
- * @since 150124 Adding gift code generation.
59
- *
60
- * @note 32-bit systems usually have `PHP_INT_MAX` = `2147483647`.
61
- * We limit `mt_rand()` to a max of `999999999`.
62
- *
63
- * @note A max possible length of 20 chars assumes this function
64
- * will not be called after `Sat, 20 Nov 2286 17:46:39 GMT`.
65
- * At which point a UNIX timestamp will grow in size.
66
- *
67
- * @note Key always begins with a `k` to prevent PHP's `is_numeric()`
68
- * function from ever thinking it's a number in a different representation.
69
- * See: <http://php.net/manual/en/function.is-numeric.php> for further details.
70
- *
71
- * @return string A unique, unguessable, non-numeric, caSe-insensitive key (20 chars max).
72
- */
73
- public static function uunnci_key_20_max()
74
- {
75
- $microtime_19_max = number_format(microtime(TRUE), 9, '.', '');
76
- // e.g., `9999999999`.`999999999` (max decimals: `9`, max overall precision: `19`).
77
- // Assuming timestamp is never > 10 digits; i.e., before `Sat, 20 Nov 2286 17:46:39 GMT`.
78
-
79
- list($seconds_10_max, $microseconds_9_max) = explode('.', $microtime_19_max, 2);
80
- // e.g., `array(`9999999999`, `999999999`)`. Max total digits combined: `19`.
81
-
82
- $seconds_base36 = base_convert($seconds_10_max, '10', '36'); // e.g., max `9999999999`, to base 36.
83
- $microseconds_base36 = base_convert($microseconds_9_max, '10', '36'); // e.g., max `999999999`, to base 36.
84
- $mt_rand_base36 = base_convert(mt_rand(1, 999999999), '10', '36'); // e.g., max `999999999`, to base 36.
85
- $key = 'k'.$mt_rand_base36.$seconds_base36.$microseconds_base36; // e.g., `kgjdgxr4ldqpdrgjdgxr`.
86
-
87
- return $key; // Max possible value: `kgjdgxr4ldqpdrgjdgxr` (20 chars).
88
- }
89
-
90
- /**
91
- * RIJNDAEL 256: two-way encryption/decryption, with a URL-safe base64 wrapper.
92
- *
93
- * Falls back on XOR encryption/decryption when/if mcrypt is not possible.
94
- *
95
- * @package s2Member\Utilities
96
- * @since 3.5
97
- *
98
- * @param string $string A string of data to encrypt.
99
- * @param string $key Optional. Key used for encryption. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
100
- * @param bool $w_md5_cs Optional. Defaults to true. When true, an MD5 checksum is used in the encrypted string *(recommended)*.
101
- *
102
- * @return string Encrypted string.
103
- */
104
- public static function encrypt($string = '', $key = '', $w_md5_cs = TRUE)
105
- {
106
- if(function_exists('mcrypt_encrypt') && in_array('rijndael-256', mcrypt_list_algorithms()) && in_array('cbc', mcrypt_list_modes()))
107
- {
108
- $string = is_string($string) ? $string : '';
109
- $string = isset($string[0]) ? '~r2|'.$string : '';
110
-
111
- $key = c_ws_plugin__s2member_utils_encryption::key($key);
112
- $key = substr($key, 0, mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));
113
-
114
- $iv = c_ws_plugin__s2member_utils_strings::random_str_gen(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), FALSE);
115
-
116
- if(isset($string[0]) && is_string($e = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $string, MCRYPT_MODE_CBC, $iv)) && isset($e[0]))
117
- $e = '~r2:'.$iv.($w_md5_cs ? ':'.md5($e) : '').'|'.$e;
118
-
119
- return isset($e) && is_string($e) && isset($e[0])
120
- ? ($base64 = c_ws_plugin__s2member_utils_strings::base64_url_safe_encode($e))
121
- : ''; // Default to empty string.
122
- }
123
- return c_ws_plugin__s2member_utils_encryption::xencrypt($string, $key, $w_md5_cs);
124
- }
125
-
126
- /**
127
- * RIJNDAEL 256: two-way encryption/decryption, with a URL-safe base64 wrapper.
128
- *
129
- * Falls back on XOR encryption/decryption when mcrypt is not available.
130
- *
131
- * @package s2Member\Utilities
132
- * @since 3.5
133
- *
134
- * @param string $base64 A string of data to decrypt. Should still be base64 encoded.
135
- * @param string $key Optional. Key used originally for encryption. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
136
- *
137
- * @return string Decrypted string.
138
- */
139
- public static function decrypt($base64 = '', $key = '')
140
- {
141
- $base64 = is_string($base64) ? $base64 : '';
142
- $e = isset($base64[0]) ? c_ws_plugin__s2member_utils_strings::base64_url_safe_decode($base64) : '';
143
-
144
- if(function_exists('mcrypt_decrypt') && in_array('rijndael-256', mcrypt_list_algorithms()) && in_array('cbc', mcrypt_list_modes()))
145
- if(isset($e[0]) && preg_match('/^~r2\:([a-zA-Z0-9]+)(?:\:([a-zA-Z0-9]+))?\|(.*)#x2F;s', $e, $iv_md5_e))
146
- {
147
- $key = c_ws_plugin__s2member_utils_encryption::key($key);
148
- $key = substr($key, 0, mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));
149
-
150
- if(isset($iv_md5_e[3][0]) && (empty($iv_md5_e[2]) || $iv_md5_e[2] === md5($iv_md5_e[3])))
151
- $d = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $iv_md5_e[3], MCRYPT_MODE_CBC, $iv_md5_e[1]);
152
-
153
- if(isset($d) && is_string($d) && isset($d[0]))
154
- if(strlen($d = preg_replace('/^~r2\|/', '', $d, 1, $r2)) && $r2)
155
- $d = rtrim($d, "\0\4"); // See: <http://www.asciitable.com/>.
156
- else $d = ''; // Force empty string; bad decryption.
157
-
158
- return isset($d) && is_string($d) && isset($d[0])
159
- ? ($string = $d) // Decrypted string.
160
- : ''; // Default to empty string.
161
- }
162
- return c_ws_plugin__s2member_utils_encryption::xdecrypt($base64, $key);
163
- }
164
-
165
- /**
166
- * XOR two-way encryption/decryption, with a base64 wrapper.
167
- *
168
- * @package s2Member\Utilities
169
- * @since 3.5
170
- *
171
- * @param string $string A string of data to encrypt.
172
- * @param string $key Optional. Key used for encryption. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
173
- * @param bool $w_md5_cs Optional. Defaults to true. When true, an MD5 checksum is used in the encrypted string *(recommended)*.
174
- *
175
- * @return string Encrypted string.
176
- */
177
- public static function xencrypt($string = '', $key = '', $w_md5_cs = TRUE)
178
- {
179
- $string = is_string($string) ? $string : '';
180
- $string = isset($string[0]) ? '~xe|'.$string : '';
181
-
182
- $key = c_ws_plugin__s2member_utils_encryption::key($key);
183
-
184
- for($i = 1, $e = ''; $i <= strlen($string); $i++)
185
- {
186
- $char = substr($string, $i - 1, 1);
187
- $keychar = substr($key, ($i % strlen($key)) - 1, 1);
188
- $e .= chr(ord($char) + ord($keychar));
189
- }
190
- $e = isset($e[0]) ? '~xe'.($w_md5_cs ? ':'.md5($e) : '').'|'.$e : '';
191
-
192
- return isset($e) && is_string($e) && isset($e[0])
193
- ? ($base64 = c_ws_plugin__s2member_utils_strings::base64_url_safe_encode($e))
194
- : ''; // Default to empty string.
195
- }
196
-
197
- /**
198
- * XOR two-way encryption/decryption, with a base64 wrapper.
199
- *
200
- * @package s2Member\Utilities
201
- * @since 3.5
202
- *
203
- * @param string $base64 A string of data to decrypt. Should still be base64 encoded.
204
- * @param string $key Optional. Key used originally for encryption. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
205
- *
206
- * @return string Decrypted string.
207
- */
208
- public static function xdecrypt($base64 = '', $key = '')
209
- {
210
- $base64 = is_string($base64) ? $base64 : '';
211
- $e = isset($base64[0]) ? c_ws_plugin__s2member_utils_strings::base64_url_safe_decode($base64) : '';
212
-
213
- if(isset($e[0]) && preg_match('/^~xe(?:\:([a-zA-Z0-9]+))?\|(.*)#x2F;s', $e, $md5_e))
214
- {
215
- $key = c_ws_plugin__s2member_utils_encryption::key($key);
216
-
217
- if(isset($md5_e[2][0]) && (empty($md5_e[1]) || $md5_e[1] === md5($md5_e[2])))
218
- for($i = 1, $d = ''; $i <= strlen($md5_e[2]); $i++)
219
- {
220
- $char = substr($md5_e[2], $i - 1, 1);
221
- $keychar = substr($key, ($i % strlen($key)) - 1, 1);
222
- $d .= chr(ord($char) - ord($keychar));
223
- }
224
- if(isset($d) && is_string($d) && isset($d[0]))
225
- if(!strlen($d = preg_replace('/^~xe\|/', '', $d, 1, $xe)) || !$xe)
226
- $d = ''; // Force empty string; bad decryption.
227
-
228
- return isset($d) && is_string($d) && isset($d[0])
229
- ? ($string = $d) // Decrypted string.
230
- : ''; // Default to empty string.
231
- }
232
- return ''; // Default to empty string.
233
- }
234
- }
235
}
3
/**
4
* Encryption utilities.
5
*
6
+ * @since 3.5 Nearly the first release.
7
*/
8
+ if (!defined('WPINC')) { // MUST have.
9
+ exit('Do not access this file directly.');
10
+ }
11
+ if (!class_exists('c_ws_plugin__s2member_utils_encryption')) {
12
+ /**
13
+ * Encryption utilities.
14
+ *
15
+ * @since 3.5 Nearly the first release.
16
+ */
17
+ class c_ws_plugin__s2member_utils_encryption
18
+ {
19
+ /**
20
+ * Encryption key.
21
+ *
22
+ * @since 111106 Get key.
23
+ *
24
+ * @param string $key Custom key.
25
+ *
26
+ * @return string Encryption key.
27
+ */
28
+ public static function key($key = '')
29
+ {
30
+ if (($key = trim((string) $key))) {
31
+ return $key;
32
+ } elseif (($key = $GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key'])) {
33
+ return $key;
34
+ } elseif (($key = wp_salt())) {
35
+ return $key;
36
+ }
37
+ return $key = md5($_SERVER['HTTP_HOST']);
38
+ }
39
+
40
+ /**
41
+ * A unique, unguessable, non-numeric, caSe-insensitive key (20 chars max).
42
+ *
43
+ * @since 150124 Adding gift code generation.
44
+ *
45
+ * @note 32-bit systems usually have `PHP_INT_MAX` = `2147483647`.
46
+ * We limit `mt_rand()` to a max of `999999999`.
47
+ *
48
+ * @note A max possible length of 20 chars assumes this function
49
+ * will not be called after `Sat, 20 Nov 2286 17:46:39 GMT`.
50
+ * At which point a UNIX timestamp will grow in size.
51
+ *
52
+ * @note Key always begins with a `k` to prevent PHP's `is_numeric()`
53
+ * function from ever thinking it's a number in a different representation.
54
+ * See: <http://php.net/manual/en/function.is-numeric.php> for further details.
55
+ *
56
+ * @return string A unique, unguessable, non-numeric, caSe-insensitive key (20 chars max).
57
+ */
58
+ public static function uunnci_key_20_max()
59
+ {
60
+ $microtime_19_max = number_format(microtime(true), 9, '.', '');
61
+ // e.g., `9999999999`.`999999999` (max decimals: `9`, max overall precision: `19`).
62
+ // Assuming timestamp is never > 10 digits; i.e., before `Sat, 20 Nov 2286 17:46:39 GMT`.
63
+
64
+ list($seconds_10_max, $microseconds_9_max) = explode('.', $microtime_19_max, 2);
65
+ // e.g., `array(`9999999999`, `999999999`)`. Max total digits combined: `19`.
66
+
67
+ $seconds_base36 = base_convert($seconds_10_max, '10', '36'); // e.g., max `9999999999`, to base 36.
68
+ $microseconds_base36 = base_convert($microseconds_9_max, '10', '36'); // e.g., max `999999999`, to base 36.
69
+ $mt_rand_base36 = base_convert(mt_rand(1, 999999999), '10', '36'); // e.g., max `999999999`, to base 36.
70
+ $key = 'k'.$mt_rand_base36.$seconds_base36.$microseconds_base36; // e.g., `kgjdgxr4ldqpdrgjdgxr`.
71
+
72
+ return $key; // Max possible value: `kgjdgxr4ldqpdrgjdgxr` (20 chars).
73
+ }
74
+
75
+ /**
76
+ * Encrypt w/ best possible technique.
77
+ *
78
+ * @since 3.5 Nearly the first release.
79
+ *
80
+ * @param string $string String to encrypt.
81
+ * @param string $key Optional custom encryption key.
82
+ * @param bool $w_md5_cs Defaults to true. When true, an MD5 checksum.
83
+ * @param bool|null $allow_defuse Allow Defuse encryption as a better alternative?
84
+ *
85
+ * @return string Encrypted string.
86
+ */
87
+ public static function encrypt($string = '', $key = '', $w_md5_cs = true, $allow_defuse = null)
88
+ {
89
+ $allow_defuse = isset($allow_defuse) ? $allow_defuse
90
+ : apply_filters('c_ws_plugin__s2member_allow_defuse', true);
91
+
92
+ if ($allow_defuse && version_compare(PHP_VERSION, '7.0.4', '>=')) {
93
+ return c_ws_plugin__s2member_utils_defuse::encrypt($string, $key);
94
+ } // This is a new/improved way of handling encryption.
95
+
96
+ if (function_exists('mcrypt_encrypt')
97
+ && in_array('rijndael-256', @mcrypt_list_algorithms())
98
+ && in_array('cbc', @mcrypt_list_modes())) {
99
+ //
100
+ $string = is_string($string) ? $string : '';
101
+ $string = isset($string[0]) ? '~r2|'.$string : '';
102
+
103
+ $key = self::key($key); // Get encryption key.
104
+ $key = substr($key, 0, @mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));
105
+ $iv = c_ws_plugin__s2member_utils_strings::random_str_gen(@mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), false);
106
+
107
+ if (isset($string[0]) && is_string($e = @mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $string, MCRYPT_MODE_CBC, $iv)) && isset($e[0])) {
108
+ $e = '~r2:'.$iv.($w_md5_cs ? ':'.md5($e) : '').'|'.$e;
109
+ }
110
+ return isset($e) && is_string($e) && isset($e[0])
111
+ ? ($base64 = c_ws_plugin__s2member_utils_strings::base64_url_safe_encode($e))
112
+ : ''; // Default to empty string.
113
+ }
114
+ return self::xencrypt($string, $key, $w_md5_cs);
115
+ }
116
+
117
+ /**
118
+ * Decrypt w/ best possible technique.
119
+ *
120
+ * @since 3.5 Nearly the first release.
121
+ *
122
+ * @param string $base64 String to decrypt (base64).
123
+ * @param string $key Optional custom decryption key.
124
+ * @param bool|null $allow_defuse Allow Defuse encryption as a better alternative?
125
+ *
126
+ * @return string Decrypted string, else empty string.
127
+ */
128
+ public static function decrypt($base64 = '', $key = '', $allow_defuse = null)
129
+ {
130
+ if (!is_string($base64) || !isset($base64[0])) {
131
+ return ''; // Not possible.
132
+ } // Fail when not a string or empty.
133
+
134
+ $allow_defuse = isset($allow_defuse) ? $allow_defuse
135
+ : apply_filters('c_ws_plugin__s2member_allow_defuse', true);
136
+
137
+ if ($allow_defuse && version_compare(PHP_VERSION, '7.0.4', '>=')
138
+ && ($_d = c_ws_plugin__s2member_utils_defuse::decrypt($base64, $key))) {
139
+ return $string = $_d; // Defuse success.
140
+ } // This is a new/improved way of handling decryption.
141
+
142
+ if (function_exists('mcrypt_decrypt')
143
+ && in_array('rijndael-256', @mcrypt_list_algorithms())
144
+ && in_array('cbc', @mcrypt_list_modes())) {
145
+ //
146
+ $e = c_ws_plugin__s2member_utils_strings::base64_url_safe_decode($base64);
147
+
148
+ if (preg_match('/^~r2\:([a-zA-Z0-9]+)(?:\:([a-zA-Z0-9]+))?\|(.*)#x2F;s', $e, $iv_md5_e)) {
149
+ $key = self::key($key); // Get encryption key.
150
+ $key = substr($key, 0, @mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));
151
+
152
+ if (isset($iv_md5_e[3][0]) && (empty($iv_md5_e[2]) || $iv_md5_e[2] === md5($iv_md5_e[3]))) {
153
+ $d = @mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $iv_md5_e[3], MCRYPT_MODE_CBC, $iv_md5_e[1]);
154
+ }
155
+ if (!isset($d)) { // Failed above?
156
+ return ''; // Empty string on failure.
157
+ } elseif (!strlen($d = preg_replace('/^~r2\|/', '', $d, 1, $r2)) || !$r2) {
158
+ return ''; // Empty string on failure.
159
+ }
160
+ return $string = rtrim($d, "\0\4");
161
+ }
162
+ }
163
+ return self::xdecrypt($base64, $key);
164
+ }
165
+
166
+ /**
167
+ * XOR two-way encryption/decryption, with a base64 wrapper.
168
+ *
169
+ * @since 3.5 Nearly the first release.
170
+ *
171
+ * @param string $string A string of data to encrypt.
172
+ * @param string $key Optional. Key used for encryption. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
173
+ * @param bool $w_md5_cs Optional. Defaults to true. When true, an MD5 checksum is used in the encrypted string *(recommended)*.
174
+ *
175
+ * @return string Encrypted string.
176
+ */
177
+ public static function xencrypt($string = '', $key = '', $w_md5_cs = true)
178
+ {
179
+ $string = is_string($string) ? $string : '';
180
+ $string = isset($string[0]) ? '~xe|'.$string : '';
181
+ $key = self::key($key); // Get encryption key.
182
+
183
+ for ($i = 1, $e = ''; $i <= strlen($string); ++$i) {
184
+ $char = substr($string, $i - 1, 1);
185
+ $keychar = substr($key, ($i % strlen($key)) - 1, 1);
186
+ $e .= chr(ord($char) + ord($keychar));
187
+ }
188
+ $e = isset($e[0]) ? '~xe'.($w_md5_cs ? ':'.md5($e) : '').'|'.$e : '';
189
+ return $base64 = isset($e[0]) ? ($base64 = c_ws_plugin__s2member_utils_strings::base64_url_safe_encode($e)) : '';
190
+ }
191
+
192
+ /**
193
+ * XOR decryption.
194
+ *
195
+ * @since 3.5 Nearly the first release.
196
+ *
197
+ * @param string $base64 String to decrypt (base64).
198
+ * @param string $key Optional custom decryption key.
199
+ *
200
+ * @return string Decrypted string.
201
+ */
202
+ public static function xdecrypt($base64 = '', $key = '')
203
+ {
204
+ if (!is_string($base64) || !isset($base64[0])) {
205
+ return ''; // Not possible.
206
+ } // Fail when not a string or empty.
207
+
208
+ $e = c_ws_plugin__s2member_utils_strings::base64_url_safe_decode($base64);
209
+
210
+ if (preg_match('/^~xe(?:\:([a-zA-Z0-9]+))?\|(.*)#x2F;s', $e, $md5_e)) {
211
+ $key = self::key($key); // Get encryption key.
212
+
213
+ if (isset($md5_e[2][0]) && (empty($md5_e[1]) || $md5_e[1] === md5($md5_e[2]))) {
214
+ for ($i = 1, $d = ''; $i <= strlen($md5_e[2]); ++$i) {
215
+ $char = substr($md5_e[2], $i - 1, 1);
216
+ $keychar = substr($key, ($i % strlen($key)) - 1, 1);
217
+ $d .= chr(ord($char) - ord($keychar));
218
+ } // Reverse XOR encryption.
219
+ } // Else the checksum was not a match.
220
+
221
+ if (!isset($d)) { // Failed above?
222
+ return ''; // Empty string on failure.
223
+ } elseif (!strlen($d = preg_replace('/^~xe\|/', '', $d, 1, $xe)) || !$xe) {
224
+ return ''; // Empty string on failure.
225
+ }
226
+ return $string = $d; // Decryption success.
227
+ }
228
+ return ''; // Empty string on failure.
229
+ }
230
+ }
231
}
src/includes/classes/utils-time.inc.php CHANGED
@@ -172,17 +172,18 @@ if(!class_exists('c_ws_plugin__s2member_utils_time'))
172
{
173
$registration_time = strtotime($user->user_registered);
174
$last_payment_time = get_user_option('s2member_last_payment_time', $user_id);
175
$last_payment_time = (int)$lpt ? (int)$lpt : (int)$last_payment_time;
176
$last_paid_access_cap_time = 0; // Initialize the last access cap time.
177
- if(($access_cap_times = c_ws_plugin__s2member_access_cap_times::get_access_cap_times($user_id)))
178
- foreach(array_reverse($access_cap_times, TRUE) as $_time => $_cap)
179
- if(strpos($_cap, '-') !== 0 && $_cap !== 'level0')
180
- {
181
$last_paid_access_cap_time = (integer)$_time;
182
break; // Got what we need; stop here.
183
}
184
- unset($_time, $_cap); // Housekeeping.
185
-
186
if(($period1 = trim(strtoupper($period1))))
187
{
188
list($num, $span) = preg_split('/ /', $period1, 2);
@@ -215,13 +216,13 @@ if(!class_exists('c_ws_plugin__s2member_utils_time'))
215
$p3_days = (int)$num * (int)$days;
216
$p3_time = $p3_days * 86400;
217
}
218
- if(!$last_payment_time) // No last payment time; i.e., has paid nothing yet?
219
$auto_eot_time = ($last_paid_access_cap_time ? $last_paid_access_cap_time : $registration_time) + $p1_time + $eot_grace_time;
220
221
- else if($p1_time && $last_payment_time <= ($last_paid_access_cap_time ? $last_paid_access_cap_time : $registration_time) + $p1_time)
222
- $auto_eot_time = $last_payment_time + $p1_time + $eot_grace_time;
223
224
- else $auto_eot_time = $last_payment_time + $p3_time + $eot_grace_time;
225
}
226
else if($eotper) // Otherwise, if we have a specific EOT period; calculate from today.
227
{
172
{
173
$registration_time = strtotime($user->user_registered);
174
$last_payment_time = get_user_option('s2member_last_payment_time', $user_id);
175
+ $free_trial_expired_time = (int)get_user_option('s2member_free_trial_expired_time', $user_id);
176
$last_payment_time = (int)$lpt ? (int)$lpt : (int)$last_payment_time;
177
$last_paid_access_cap_time = 0; // Initialize the last access cap time.
178
+
179
+ if(($access_cap_times = c_ws_plugin__s2member_access_cap_times::get_access_cap_times($user_id))) {
180
+ foreach(array_reverse($access_cap_times, TRUE) as $_time => $_cap) {
181
+ if(strpos($_cap, '-') !== 0 && $_cap !== 'level0') {
182
$last_paid_access_cap_time = (integer)$_time;
183
break; // Got what we need; stop here.
184
}
185
+ } // unset($_time, $_cap); // Housekeeping.
186
+ }
187
if(($period1 = trim(strtoupper($period1))))
188
{
189
list($num, $span) = preg_split('/ /', $period1, 2);
216
$p3_days = (int)$num * (int)$days;
217
$p3_time = $p3_days * 86400;
218
}
219
+ if(!$last_payment_time && !$free_trial_expired_time)
220
$auto_eot_time = ($last_paid_access_cap_time ? $last_paid_access_cap_time : $registration_time) + $p1_time + $eot_grace_time;
221
222
+ else if($p1_time && max($last_payment_time, $free_trial_expired_time) <= ($last_paid_access_cap_time ? $last_paid_access_cap_time : $registration_time) + $p1_time)
223
+ $auto_eot_time = max($last_payment_time, $free_trial_expired_time) + $p1_time + $eot_grace_time;
224
225
+ else $auto_eot_time = max($last_payment_time, $free_trial_expired_time) + $p3_time + $eot_grace_time;
226
}
227
else if($eotper) // Otherwise, if we have a specific EOT period; calculate from today.
228
{
src/includes/functions/class-autoloader.inc.php CHANGED
@@ -84,4 +84,5 @@ if(!function_exists('ws_plugin__s2member_classes'))
84
}
85
86
spl_autoload_register('ws_plugin__s2member_classes');
87
}
84
}
85
86
spl_autoload_register('ws_plugin__s2member_classes');
87
+ require_once dirname(dirname(dirname(__FILE__))).'/vendor/autoload.php';
88
}
src/includes/menu-pages/api-ops.inc.php CHANGED
@@ -31,6 +31,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_api_ops"))
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
src/includes/menu-pages/down-ops.inc.php CHANGED
@@ -31,6 +31,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
src/includes/menu-pages/els-ops.inc.php CHANGED
@@ -31,6 +31,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_els_ops"))
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
src/includes/menu-pages/gen-ops.inc.php CHANGED
@@ -31,6 +31,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
src/includes/menu-pages/help.inc.php CHANGED
@@ -31,6 +31,8 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_help"))
31
public function __construct ()
32
{
33
echo '<div class="wrap ws-menu-page">' . "\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display ();
31
public function __construct ()
32
{
33
echo '<div class="wrap ws-menu-page">' . "\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display ();
src/includes/menu-pages/integrations.inc.php CHANGED
@@ -31,6 +31,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_integrations"))
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
src/includes/menu-pages/logs.inc.php CHANGED
@@ -31,6 +31,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
31
public function __construct()
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
src/includes/menu-pages/menu-pages-s.min.js CHANGED
@@ -1 +1,2 @@
1
- jQuery(document).ready(function($){var esc_attr=esc_html=function(string){if(/[&\<\>"']/.test(string=String(string))){string=string.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),string=string.replace(/"/g,"&quot;").replace(/'/g,"&#039;")}return string};ws_plugin__s2member_generateSecurityKey=function(obj){if(!obj){obj="#ws-plugin--s2member-sec-encryption-key"}var mt_rand=function(min,max){min=(arguments.length<1)?0:min;max=(arguments.length<2)?2147483647:max;return Math.floor(Math.random()*(max-min+1))+min};var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%^&*()";for(var i=0,key="";i<64;i++){key+=chars.substr(mt_rand(0,chars.length-1),1)}$(obj).val(key);return false};if(location.href.match(/page\=ws-plugin--s2member/)){$("input.ws-plugin--s2member-update-roles-button, input.ws-plugin--s2member-reset-roles-button").click(function(){var $this=$(this);$this.val("one moment please ...");var levels='<?php echo (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; ?>';var resetUpdate=($this.hasClass("ws-plugin--s2member-reset-roles-button"))?"Reset":"Update";$.post(ajaxurl,{action:"ws_plugin__s2member_update_roles_via_ajax",ws_plugin__s2member_update_roles_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-update-roles-via-ajax")); ?>'},function(response){if(response==="1"){alert("s2Member's Roles/Capabilities "+((resetUpdate.toLowerCase()==="reset")?"have been successfully reset":"updated successfully")+".\nYour installation of s2Member has Membership Levels 0-"+levels+"."),$this.val(resetUpdate+" Roles/Capabilities")}else{if(response==="l"){alert("Sorry, your request failed.\ns2Member's Roles/Capabilities are locked by Filter:\nws_plugin__s2member_lock_roles_caps"),$this.val(resetUpdate+" Roles/Capabilities")}else{alert("Sorry, your request failed.\nAccess denied. Do you have the ability to `create_users`?"),$this.val(resetUpdate+" Roles/Capabilities")}}});return false})}if(location.href.match(/page\=ws-plugin--s2member-logs/)){$("input#ws-plugin--s2member-gateway-debug-logs-extensive-1").click(function(){var $this=$(this),thisChecked=(this.checked)?true:false;if(thisChecked){$("input#ws-plugin--s2member-gateway-debug-logs-1").attr("checked","checked")}});var $toggles=$("a.ws-plugin--s2member-log-file-viewport-toggle");$toggles.click(function(){$("textarea#ws-plugin--s2member-log-file-viewer").each(function(){var $viewer=$(this);if($viewer.attr("data-state")!=="expanded"){$viewer.css({height:($viewer.prop("scrollHeight")+50)+"px","overflow-y":"auto"});$toggles.html("&#8657; normalize viewport &#10073;");$viewer.attr("data-state","expanded")}else{$viewer.css({height:"auto","overflow-y":"scroll"});$toggles.html("&#8659; expand viewport &#8659;");$viewer.attr("data-state","scrolling")}});return false})}if(location.href.match(/page\=ws-plugin--s2member-mms-ops/)){$("select#ws-plugin--s2member-mms-registration-file").change(function(){if($(this).val()==="wp-signup"){var gv=$("select#ws-plugin--s2member-mms-registration-grants").val(),l0v=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").show(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").hide(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").show();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[((gv==="all")?"show":"hide")]();$("input#ws-plugin--s2member-mms-registration-blogs-level0").val(((gv==="all")?((l0v>0)?l0v:"1"):"0"))}else{if($(this).val()==="wp-login"){var gv=$("select#ws-plugin--s2member-mms-registration-grants").val(),l0v=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").hide(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").show(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").hide();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0").hide();$("input#ws-plugin--s2member-mms-registration-blogs-level0").val("0")}}}).trigger("change");$("select#ws-plugin--s2member-mms-registration-grants").change(function(){$("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}if(location.href.match(/page\=ws-plugin--s2member-gen-ops/)){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 unhappy Customers. Data corruption WILL occur! For 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.")){$("input#ws-plugin--s2member-sec-encryption-key").removeAttr("disabled")}return false};ws_plugin__s2member_securityKeyHistory=function(){$("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false};$("select#ws-plugin--s2member-new-user-emails-enabled").change(function(){var $pluggable=$("input#ws-plugin--s2member-pluggables-wp-new-user-notification"),$this=$(this),$newUserEmails=$("div#ws-plugin--s2member-new-user-emails");if($pluggable.val()==="0"||$this.val()==="0"){($pluggable.val()==="0")?$this.attr("disabled","disabled"):$this.removeAttr("disabled");$(":input",$newUserEmails).attr("disabled","disabled"),$newUserEmails.css("opacity","0.5")}else{$this.removeAttr("disabled"),$(":input",$newUserEmails).removeAttr("disabled"),$newUserEmails.css("opacity","")}}).trigger("change");$("select#ws-plugin--s2member-login-reg-design-enabled").change(function(){var $this=$(this),$loginRegDesign=$("div#ws-plugin--s2member-login-reg-design");if($this.val()==="0"){$(":input",$loginRegDesign).attr("disabled","disabled"),$loginRegDesign.css("opacity","0.5"),$loginRegDesign.hide()}else{$(":input",$loginRegDesign).removeAttr("disabled"),$loginRegDesign.css("opacity",""),$loginRegDesign.show()}}).trigger("change");$("select#ws-plugin--s2member-custom-reg-password").change(function(){var $this=$(this),$newUserNotification=$("div#ws-plugin--s2member-new-user-email-details");if($this.val()==="1"){$newUserNotification.css("opacity","0.5")}else{$newUserNotification.css("opacity","")}}).trigger("change");if($("input#ws-plugin--s2member-custom-reg-fields").length&&$("div#ws-plugin--s2member-custom-reg-field-configuration").length){(function(){var i,fieldDefaults,tools,table,$tools,$table;var $fields=$("input#ws-plugin--s2member-custom-reg-fields");var $configuration=$("div#ws-plugin--s2member-custom-reg-field-configuration");var fields=($fields.val())?$.JSON.parse($fields.val()):[];fields=(fields instanceof Array)?fields:[];fieldDefaults={section:"no",sectitle:"",id:"",label:"",type:"text",deflt:"",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""};for(i=0;i<fields.length;i++){fields[i]=$.extend(true,{},fieldDefaults,fields[i])}tools='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>',table='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>';$configuration.html(tools+table);$tools=$("div#ws-plugin--s2member-custom-reg-field-configuration-tools"),$table=$("table#ws-plugin--s2member-custom-reg-field-configuration-table");ws_plugin__s2member_customRegFieldSectionChange=function(select){var section=$(select).val();var sectitle_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle";(section==="yes")?$(sectitle_trs).css("display",""):$(sectitle_trs).css("display","none")};ws_plugin__s2member_customRegFieldTypeChange=function(select){var type=$(select).val();var deflt_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt",options_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options",expected_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";(type.match(/^(text|textarea)#x2F;))?$(deflt_trs).css("display",""):$(deflt_trs).css("display","none");(type.match(/^(select|selects|checkboxes|radios)#x2F;))?$(options_trs).css("display",""):$(options_trs).css("display","none");(type.match(/^(text|textarea)#x2F;))?$(expected_trs).css("display",""):$(expected_trs).css("display","none")};ws_plugin__s2member_customRegFieldDelete=function(index){var newFields=new Array();for(var i=0;i<fields.length;i++){if(i!==index){newFields.push(fields[i])}}fields=newFields,updateFields(),buildTable()};ws_plugin__s2member_customRegFieldMoveUp=function(index){if(typeof fields[index]==="object"&&typeof fields[index-1]==="object"){var prevFieldObj=fields[index-1],thisFieldObj=fields[index];fields[index-1]=thisFieldObj,fields[index]=prevFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldMoveDown=function(index){if(typeof fields[index]==="object"&&typeof fields[index+1]==="object"){var nextFieldObj=fields[index+1],thisFieldObj=fields[index];fields[index+1]=thisFieldObj,fields[index]=nextFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldCreate=function(){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field))){fields.push(field),updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(fields.length-1);alert('Field created successfully.\n* Remember to "Save All Changes".')},500)}};ws_plugin__s2member_customRegFieldUpdate=function(index){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field,index))){fields[index]=field,updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+index;alert('Field updated successfully.\n* Remember to "Save All Changes".')},500)}};ws_plugin__s2member_customRegFieldAdd=function(){buildTools(true)};ws_plugin__s2member_customRegFieldEdit=function(index){buildTools(false,index),scrollReset()};ws_plugin__s2member_customRegFieldCancel=function(){buildTools(),scrollReset()};var validateField=function(field,index){var editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,errors=[],options,i;if(typeof field!=="object"||typeof(field=$.extend(true,{},fieldDefaults,field))!=="object"){alert("Invalid field object. Please try again.");return false}field.sectitle=(field.section==="yes")?field.sectitle:"";field.deflt=(field.type.match(/^(text|textarea)#x2F;))?field.deflt:"";field.deflt=(field.type.match(/^(text)#x2F;))?field.deflt.replace(/[\r\n\t ]+/g," "):field.deflt;field.options=(field.type.match(/^(select|selects|checkboxes|radios)#x2F;))?field.options:"";field.expected=(field.type.match(/^(text|textarea)#x2F;))?field.expected:"";if(!field.id){errors.push("Unique Field ID:\nThis is required. Please try again.")}else{if(fieldIdExists(field.id)&&(!editing||field.id!==fields[index].id)){errors.push("Unique Field ID:\nThat Field ID already exists. Please try again.")}}if(!field.label){errors.push("Field Label/Description:\nThis is required. Please try again.")}if(field.type.match(/^(select|selects|checkboxes|radios)#x2F;)&&!field.options){errors.push("Option Configuration File:\nThis is required. Please try again.")}else{if(field.type.match(/^(select|selects|checkboxes|radios)#x2F;)){for(i=0;i<(options=field.options.split(/[\r\n]+/)).length;i++){if(!(options[i]=$.trim(options[i])).match(/^([^\|]*)(\|)([^\|]*)(\|default)?#x2F;)){errors.push("Option Configuration File:\nInvalid configuration at line #"+(i+1)+".");break}}field.options=$.trim(options.join("\n"))}}if(!(field.levels=field.levels.replace(/ /g,""))){errors.push("Applicable Levels:\nThis is required. Please try again.")}else{if(!field.levels.match(/^(all|[0-9,]+)#x2F;)){errors.push("Applicable Levels:\nShould be comma-delimited Levels, or just type: all.\n(examples: 0,1,2,3,4 or type the word: all)")}}if(field.classes&&field.classes.match(/[^a-z 0-9 _ \-]/i)){errors.push("CSS Classes:\nContains invalid characters. Please try again.\n(only: alphanumerics, underscores, hyphens, spaces)")}if(field.styles&&field.styles.match(/["\=\>\<]/)){errors.push('CSS Styles:\nContains invalid characters. Please try again.\n(do NOT use these characters: = " < >)')}if(field.attrs&&field.attrs.match(/[\>\<]/)){errors.push("Other Attributes:\nContains invalid characters. Please try again.\n(do NOT use these characters: < >)")}if(errors.length>0){alert(errors.join("\n\n"));return false}else{return field}};var updateFields=function(){$fields.val(((fields.length>0)?$.JSON.stringify(fields):""))};var fieldId2Var=function(fieldId){return(typeof fieldId==="string")?$.trim(fieldId).toLowerCase().replace(/[^a-z0-9]/g,"_"):""};var fieldTypeDesc=function(type){var types={text:"Text (single line)",textarea:"Textarea (multi-line)",select:"Select Menu (drop-down)",selects:"Select Menu (multi-option)",checkbox:"Checkbox (single)",pre_checkbox:"Checkbox (pre-checked)",checkboxes:"Checkboxes (multi-option)",radios:"Radio Buttons (multi-option)"};if(typeof types[type]==="string"){return types[type]}return""};var fieldIdExists=function(fieldId){for(var i=0;i<fields.length;i++){if(fields[i].id===fieldId){return true}}};var scrollReset=function(){scrollTo(0,$("div.ws-plugin--s2member-custom-reg-fields-section").offset()["top"]-100)};var buildTools=function(adding,index){var i=0,html="",form="",w=0,h=0,editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,displayForm=(adding||editing)?true:false,field=(editing)?$.extend(true,{},fieldDefaults,fields[index]):fieldDefaults;html+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>';tb_remove(),$("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove();if(displayForm){form+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">';form+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">';form+="<tbody>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">Starts A New Section?</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<select property="section" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section" onchange="ws_plugin__s2member_customRegFieldSectionChange(this);">';form+='<option value="no"'+((field.section==="no")?' selected="selected"':"")+'">No (this Field flows normally)</option>';form+='<option value="yes"'+((field.section==="yes")?' selected="selected"':"")+'">Yes (this Field begins a new section)</option>';form+="</select><br />";form+="<small>Optional. Allows Fields to be grouped into sections.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+'><td colspan="2"><hr /></td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+">";form+='<td colspan="2">';form+="Title for this new section? (optional)<br />";form+='<input type="text" property="sectitle" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle" value="'+esc_attr(field.sectitle)+'" /><br />';form+="<small>If empty, a simple divider will be used by default.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-type"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<select property="type" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);">';form+='<option value="text"'+((field.type==="text")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("text"))+"</option>";form+='<option value="textarea"'+((field.type==="textarea")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("textarea"))+"</option>";form+='<option value="select"'+((field.type==="select")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("select"))+"</option>";form+='<option value="selects"'+((field.type==="selects")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("selects"))+"</option>";form+='<option value="checkbox"'+((field.type==="checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkbox"))+"</option>";form+='<option value="pre_checkbox"'+((field.type==="pre_checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("pre_checkbox"))+"</option>";form+='<option value="checkboxes"'+((field.type==="checkboxes")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkboxes"))+"</option>";form+='<option value="radios"'+((field.type==="radios")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("radios"))+"</option>";form+="</select><br />";form+="<small>The options below may change, based on the Field Type you choose here.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-label"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<input type="text" property="label" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" value="'+esc_attr(field.label)+'" /><br />';form+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-id"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<input type="text" property="id" maxlength="25" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" value="'+esc_attr(field.id)+'" /><br />';form+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />";form+='<small>e.g., <code>[s2Get user_field="country_code" /]</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-required"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<option value="yes"'+((field.required==="yes")?' selected="selected"':"")+'">Yes (required)</option>';form+='<option value="no"'+((field.required==="no")?' selected="selected"':"")+'">No (optional)</option>';form+="</select><br />";form+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';form+="<small>* Administrators are exempt from this requirement.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)#x2F;))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)#x2F;))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">Default Text Value: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)#x2F;))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="deflt" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt" rows="1">'+esc_html(field.deflt)+"</textarea><br />";form+="<small>Default value before user input is received.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)#x2F;))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)#x2F;))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * (one option per line)</label><br />';form+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)#x2F;))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="options" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options" rows="3">'+esc_html(field.options)+"</textarea><br />";form+="Here is a quick example:<br />";form+="<small>You can also specify a <em>default</em> option:</small><br />";form+="<code>US|United States|default</code><br />";form+="<code>CA|Canada</code><br />";form+="<code>VI|Virgin Islands (U.S.)</code>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)#x2F;))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)#x2F;))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)#x2F;))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';form+='<option value=""'+((field.expected==="")?' selected="selected"':"")+'">Anything Goes</option>';form+='<option disabled="disabled"></option>';form+='<optgroup label="Specific Input Types">';form+='<option value="numeric-wp-commas"'+((field.expected==="numeric-wp-commas")?' selected="selected"':"")+'">Numeric (with or without decimals, commas allowed)</option>';form+='<option value="numeric"'+((field.expected==="numeric")?' selected="selected"':"")+'">Numeric (with or without decimals, no commas)</option>';form+='<option value="integer"'+((field.expected==="integer")?' selected="selected"':"")+'">Integer (whole number, without any decimals)</option>';form+='<option value="integer-gt-0"'+((field.expected==="integer-gt-0")?' selected="selected"':"")+'">Integer > 0 (whole number, no decimals, greater than 0)</option>';form+='<option value="float"'+((field.expected==="float")?' selected="selected"':"")+'">Float (floating point number, decimals required)</option>';form+='<option value="float-gt-0"'+((field.expected==="float-gt-0")?' selected="selected"':"")+'">Float > 0 (floating point number, decimals required, greater than 0)</option>';form+='<option value="date"'+((field.expected==="date")?' selected="selected"':"")+'">Date (required date format: dd/mm/yyyy)</option>';form+='<option value="email"'+((field.expected==="email")?' selected="selected"':"")+'">Email (require valid email)</option>';form+='<option value="url"'+((field.expected==="url")?' selected="selected"':"")+'">Full URL (starting with http or https)</option>';form+='<option value="domain"'+((field.expected==="domain")?' selected="selected"':"")+'">Domain Name (domain name only, without http)</option>';form+='<option value="phone"'+((field.expected==="phone")?' selected="selected"':"")+'">Phone # (10 digits w/possible hyphens,spaces,brackets)</option>';form+='<option value="uszip"'+((field.expected==="uszip")?' selected="selected"':"")+'">US Zipcode (5-9 digits w/possible hyphen)</option>';form+='<option value="cazip"'+((field.expected==="cazip")?' selected="selected"':"")+'">Canadian Zipcode (6 alpha-numerics w/possible space)</option>';form+='<option value="uczip"'+((field.expected==="uczip")?' selected="selected"':"")+'">US/Canadian Zipcode (either a US or Canadian zipcode)</option>';form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Any Character Combination">';for(i=1;i<=25;i++){form+='<option value="any-'+i+'"'+((field.expected==="any-"+i)?' selected="selected"':"")+'">Any Character Combination ('+i+" character minimum)</option>";form+='<option value="any-'+i+'-e"'+((field.expected==="any-"+i+"-e")?' selected="selected"':"")+'">Any Character Combination (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-punctuation-'+i+'"'+((field.expected==="alphanumerics-spaces-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ('+i+" character minimum)</option>";form+='<option value="alphanumerics-spaces-punctuation-'+i+'-e"'+((field.expected==="alphanumerics-spaces-punctuation-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics &amp; Spaces Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-'+i+'"'+((field.expected==="alphanumerics-spaces-"+i)?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ('+i+" character minimum)</option>";form+='<option value="alphanumerics-spaces-'+i+'-e"'+((field.expected==="alphanumerics-spaces-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics &amp; Spaces (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics &amp; Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-punctuation-'+i+'"'+((field.expected==="alphanumerics-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ('+i+" character minimum)</option>";form+='<option value="alphanumerics-punctuation-'+i+'-e"'+((field.expected==="alphanumerics-punctuation-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-'+i+'"'+((field.expected==="alphanumerics-"+i)?' selected="selected"':"")+'">Alphanumerics ('+i+" character minimum)</option>";form+='<option value="alphanumerics-'+i+'-e"'+((field.expected==="alphanumerics-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphabetics Only">';for(i=1;i<=25;i++){form+='<option value="alphabetics-'+i+'"'+((field.expected==="alphabetics-"+i)?' selected="selected"':"")+'">Alphabetics ('+i+" character minimum)</option>";form+='<option value="alphabetics-'+i+'-e"'+((field.expected==="alphabetics-"+i+"-e")?' selected="selected"':"")+'">Alphabetics (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Numeric Digits Only">';for(i=1;i<=25;i++){form+='<option value="numerics-'+i+'"'+((field.expected==="numerics-"+i)?' selected="selected"':"")+'">Numeric Digits ('+i+" digit minimum)</option>";form+='<option value="numerics-'+i+'-e"'+((field.expected==="numerics-"+i+"-e")?' selected="selected"':"")+'">Numeric Digits (exactly '+i+" digit"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+="</select><br />";form+="<small>Only Users/Members will be required to meet this criteria.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<input type="text" property="levels" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" value="'+esc_attr(field.levels)+'" /><br />';form+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />";form+="<small>This allows you to enable this field - only at specific Membership Levels.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<option value="yes"'+((field.editable==="yes")?' selected="selected"':"")+'">Yes (editable)</option>';form+='<option value="no"'+((field.editable==="no")?' selected="selected"':"")+'">No (uneditable after registration)</option>';form+='<option value="no-invisible"'+((field.editable==="no-invisible")?' selected="selected"':"")+'">No (uneditable &amp; totally invisible after registration)</option>';form+='<option value="no-always-invisible"'+((field.editable==="no-always-invisible")?' selected="selected"':"")+'">No (uneditable &amp; totally invisible, both during &amp; after registration)</option>';form+='<option value="yes-invisible"'+((field.editable==="yes-invisible")?' selected="selected"':"")+'">Yes (editable after registration / invisible during registration)</option>';form+="</select><br />";form+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<input type="text" property="classes" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" value="'+esc_attr(field.classes)+'" /><br />';form+="<small>Example: <code>my-style-1 my-style-2</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<input type="text" property="styles" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" value="'+esc_attr(field.styles)+'" /><br />';form+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<input type="text" property="attrs" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" value="'+esc_attr(field.attrs)+'" /><br />';form+='<small>Example: <code>onkeyup="" onblur=""</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">';form+='<td align="left">';form+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';form+="</td>";form+='<td align="right">';form+='<input type="button" value="'+((editing)?"Update This Field":"Create Registration Field")+'" onclick="'+((editing)?"ws_plugin__s2member_customRegFieldUpdate("+index+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />';form+="</td>";form+="</tr>";form+="</tbody>";form+="</table>";form+="<div>";$("body").append(form);tb_show(((editing)?"Editing Registration/Profile Field":"New Custom Registration/Profile Field"),"#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form");$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}$tools.html(html)};var buildTable=function(){var l=fields.length,i=0,html="",eo="o";html+="<tbody>";html+="<tr>";html+="<th>Order</th>";html+="<th>Field Type</th>";html+="<th>Unique ID</th>";html+="<th>Required</th>";html+="<th>Levels</th>";html+="<th>- Tools -</th>";html+="</tr>";if(fields.length>0){for(i=0;i<fields.length;i++){html+='<tr class="'+esc_attr((eo=(eo==="o")?"e":"o"))+((fields[i].section==="yes")?" s":"")+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+i+'">';html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+i+'); return false;"></a></td>';html+='<td nowrap="nowrap">'+esc_html(fieldTypeDesc(fields[i].type))+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].id)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].required)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].levels)+"</td>";html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+i+'); return false;"></a></td>';html+="</tr>"}}else{html+="<tr>";html+='<td colspan="6">No Custom Fields are configured.</td>';html+="</tr>"}html+="</tbody>";$table.html(html)};buildTools(),buildTable()})()}}if(location.href.match(/page\=ws-plugin--s2member-res-ops/)){$("input#ws-plugin--s2member-brute-force-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's Brute Force Restriction Logs have all been reset."),$this.val("Reset Brute Force Logs")});return false});$("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's IP Restriction Logs have all been reset."),$this.val("Reset IP Restriction Logs")});return false});$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').change(function(){var thisChange=$(this).val();$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="all"&&this.checked){$this.nextAll(checkboxes).attr({checked:"checked",disabled:"disabled"})}else{if(val==="all"&&!this.checked){$this.nextAll(checkboxes).removeAttr("disabled");(thisChange==="all")?$this.nextAll(checkboxes).removeAttr("checked"):null}}})}).last().trigger("change")}if(location.href.match(/page\=ws-plugin--s2member-down-ops/)){var updateCloudFrontPrivateKey=function(){var $hiddenPrivateKey=$("input#ws-plugin--s2member-amazon-cf-files-private-key");var $visiblePrivateKeyEntry=$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry");var hiddenPrivateKeyValue=$.trim($hiddenPrivateKey.val()),visiblePrivateKeyEntryValue=$.trim($visiblePrivateKeyEntry.val());if((hiddenPrivateKeyValue&&!visiblePrivateKeyEntryValue)||visiblePrivateKeyEntryValue.match(/[^\r\n\u25CF]/)){$hiddenPrivateKey.val(visiblePrivateKeyEntryValue),$visiblePrivateKeyEntry.val(visiblePrivateKeyEntryValue.replace(/[^\r\n]/g,String.fromCharCode(9679)))}};$("form#ws-plugin--s2member-options-form").submit(updateCloudFrontPrivateKey);$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontPrivateKey).trigger("change");var updateCloudFrontDistroCfgs=function(){var $hiddenPrivateKey=$("input#ws-plugin--s2member-amazon-cf-files-private-key");var $visiblePrivateKeyId=$("input#ws-plugin--s2member-amazon-cf-files-private-key-id");var $autoConfigDistros=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros");var $autoConfigDistrosStatus=$("input#ws-plugin--s2member-amazon-cf-files-distros-auto-config-status");var autoConfigDistrosStatusValue=$.trim($autoConfigDistrosStatus.val());var hiddenPrivateKeyValue=$.trim($hiddenPrivateKey.val()),visiblePrivateKeyIdValue=$.trim($visiblePrivateKeyId.val());var hiddenPrivateKeyPrevConfigValue=$.trim($hiddenPrivateKey.attr("data-s-prev-config-value")),visiblePrivateKeyIdPrevConfigValue=$.trim($visiblePrivateKeyId.attr("data-s-prev-config-value"));if(autoConfigDistrosStatusValue==="configured"&&((visiblePrivateKeyIdPrevConfigValue&&visiblePrivateKeyIdValue!==visiblePrivateKeyIdPrevConfigValue)||(hiddenPrivateKeyPrevConfigValue&&hiddenPrivateKeyValue!==hiddenPrivateKeyPrevConfigValue))){alert("s2Member will need to delete and re-configure your Amazon CloudFront distributions if you change this. When you're done editing, click (Save All Changes) below.");$autoConfigDistros.attr("checked","checked")}else{if(autoConfigDistrosStatusValue!=="configured"&&visiblePrivateKeyIdValue&&hiddenPrivateKeyValue){alert("s2Member will need to auto-configure your Amazon CloudFront distributions for you. When you're done editing, click (Save All Changes) below.");$autoConfigDistros.attr("checked","checked")}}};$("input#ws-plugin--s2member-amazon-cf-files-private-key-id").change(updateCloudFrontDistroCfgs);$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontDistroCfgs);$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames").change(function(){var $this=$(this),thisChecked=(this.checked)?true:false;var $autoConfigDistros=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros");var $autoConfigDistroCnames=$("div#ws-plugin--s2member-amazon-cf-files-auto-configure-distro-cnames");(thisChecked)?$autoConfigDistroCnames.show():$autoConfigDistroCnames.hide();(thisChecked)?$autoConfigDistros.attr("checked","checked"):null}).trigger("change")}if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){$("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var $this=$(this),val=$this.val();var $viaCron=$("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(val==2){$viaCron.show()}else{$viaCron.hide()}})}if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){$("div.ws-menu-page select[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-term#x2F;)}).change(function(){var button=this.id.replace(/^ws-plugin--s2member-(.+?)-term#x2F;g,"$1");var trialDisabled=($(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;$("p#ws-plugin--s2member-"+button+"-trial-line").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-trial-then").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-20p-rule").css("display",(trialDisabled?"none":""));(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-period").val(0):null;(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-amount").val("0.00"):null});$("div.ws-menu-page input[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification|ccap)-ccaps#x2F;)}).keyup(function(){var value=this.value.replace(/^(-all|-al|-a|-)[;,]*/gi,""),_all=(this.value.match(/^(-all|-al|-a|-)[;,]*/i))?"-all,":"";if(value.match(/[^a-z_0-9,]/)){this.value=_all+$.trim($.trim(value).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(button){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="",labels={};eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_dq($labels); ?>");var shortCode=$("input#ws-plugin--s2member-"+button+"-shortcode");var code=$("textarea#ws-plugin--s2member-"+button+"-button");var modLevel=$("select#ws-plugin--s2member-modification-level");var level=(button==="modification")?modLevel.val().split(":",2)[1]:button.replace(/^level/,"");var label=labels["level"+level].replace(/"/g,"");var desc=$.trim($("input#ws-plugin--s2member-"+button+"-desc").val().replace(/"/g,""));var trialAmount=$("input#ws-plugin--s2member-"+button+"-trial-amount").val().replace(/[^0-9\.]/g,"");var trialPeriod=$("input#ws-plugin--s2member-"+button+"-trial-period").val().replace(/[^0-9]/g,"");var trialTerm=$("select#ws-plugin--s2member-"+button+"-trial-term").val().replace(/[^A-Z]/g,"");var regAmount=$("input#ws-plugin--s2member-"+button+"-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var regRecurTimes="",regRecurRetry="1";var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-"+button+"-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-"+button+"-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i))?((cCaps)?"-all,":"-all")+cCaps.toLowerCase():cCaps.toLowerCase();trialPeriod=(regRecur==="BN")?"0":trialPeriod;trialAmount=(!trialAmount||isNaN(trialAmount)||trialAmount<0.01||trialPeriod<=0)?"0":trialAmount;var levelCcapsPer=(regRecur==="BN"&&regTerm!=="L")?level+":"+cCaps+":"+regPeriod+" "+regTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+#x2F;g,"");if(trialAmount!=="0"&&(isNaN(trialAmount)||trialAmount<0)){alert("— Oops, a slight problem: —\n\nWhen provided, Trial Amount must be >= 0.00");return false}else{if(trialAmount!=="0"&&trialAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Trial Amount is: 10000.00");return false}else{if(trialTerm==="D"&&trialPeriod>90){alert("— Oops, a slight problem: —\n\nMaximum Trial Days is: 90.\nIf you want to offer more than 90 days, please choose Weeks or Months from the drop-down.");return false}else{if(trialTerm==="W"&&trialPeriod>52){alert("— Oops, a slight problem: —\n\nMaximum Trial Weeks is: 52.\nIf you want to offer more than 52 weeks, please choose Months from the drop-down.");return false}else{if(trialTerm==="M"&&trialPeriod>24){alert("— Oops, a slight problem: —\n\nMaximum Trial Months is: 24.\nIf you want to offer more than 24 months, please choose Years from the drop-down.");return false}else{if(trialTerm==="Y"&&trialPeriod>5){alert("— Oops, a slight problem: —\n\nMax Trial Period Years is: 5.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}}}}}}code.html(code.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(trialPeriod)<=0)?code.html(code.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="(src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;shortCodeTemplateAttrs+=(button==="modification")?'modify="1" ':"";shortCodeTemplateAttrs+='level="'+esc_attr(level)+'" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';shortCodeTemplateAttrs+=' ta="'+esc_attr(trialAmount)+'" tp="'+esc_attr(trialPeriod)+'" tt="'+esc_attr(trialTerm)+'" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'" rrt="'+esc_attr(regRecurTimes)+'" rra="'+esc_attr(regRecurRetry)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((button==="modification")?"1":"0")+'"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+esc_attr(regRecur)+'"'));code.html(code.val().replace(/ name\="srt" value\="(.*?)"/,' name="srt" value="'+esc_attr(regRecurTimes)+'"'));code.html(code.val().replace(/ name\="sra" value\="(.*?)"/,' name="sra" value="'+esc_attr(regRecurRetry)+'"'));code.html(code.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+esc_attr(trialAmount)+'"'));code.html(code.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+esc_attr(trialPeriod)+'"'));code.html(code.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+esc_attr(trialTerm)+'"'));code.html(code.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+esc_attr(regPeriod)+'"'));code.html(code.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+esc_attr(regTerm)+'"'));$("div#ws-plugin--s2member-"+button+"-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+"~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (c_ws_plugin__s2member_utils_ip::current())); ?>").replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));(button==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Modification Buttons should be displayed to existing Users/Members, and they should be logged-in, BEFORE clicking this Button."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalCcapButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-ccap-shortcode");var code=$("textarea#ws-plugin--s2member-ccap-button");var desc=$.trim($("input#ws-plugin--s2member-ccap-desc").val().replace(/"/g,""));var regAmount=$("input#ws-plugin--s2member-ccap-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-ccap-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-ccap-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-ccap-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-ccap-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-ccap-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i))?((cCaps)?"-all,":"-all")+cCaps.toLowerCase():cCaps.toLowerCase();var levelCcapsPer=(regRecur==="BN"&&regTerm!=="L")?"*:"+cCaps+":"+regPeriod+" "+regTerm:"*:"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+#x2F;g,"");if(!cCaps||cCaps==="-all"){alert("— Oops, a slight problem: —\n\nPlease provide at least one Custom Capability.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}shortCodeTemplateAttrs+='level="*" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-ccap-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+"~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (c_ws_plugin__s2member_utils_ip::current())); ?>").replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-sp-shortcode");var code=$("textarea#ws-plugin--s2member-sp-button");var leading=$("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var regAmount=$("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var desc=$.trim($("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!leading){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 → Restriction Options → Specific Post/Page Access.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}var spIdsHours="sp:"+ids+":"+hours;shortCodeTemplateAttrs+='sp="1" ids="'+esc_attr(ids)+'" exp="'+esc_attr(hours)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(spIdsHours)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-sp-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+"~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (c_ws_plugin__s2member_utils_ip::current())); ?>").replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your WordPress Editor.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalRegLinkGenerate=function(){var level=$("select#ws-plugin--s2member-reg-link-level").val().replace(/[^0-9]/g,"");var subscrID=$.trim($("input#ws-plugin--s2member-reg-link-subscr-id").val());var custom=$.trim($("input#ws-plugin--s2member-reg-link-custom").val());var cCaps=$.trim($.trim($("input#ws-plugin--s2member-reg-link-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());var fixedTerm=$.trim($("input#ws-plugin--s2member-reg-link-fixed-term").val().replace(/[^A-Z 0-9]/gi,"").toUpperCase());var $link=$("p#ws-plugin--s2member-reg-link"),$loading=$("img#ws-plugin--s2member-reg-link-loading");var levelCcapsPer=(fixedTerm&&!fixedTerm.match(/L#x2F;))?level+":"+cCaps+":"+fixedTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+#x2F;g,"");if(!subscrID){alert("— Oops, a slight problem: —\n\nPaid Subscr. ID is a required value.");return false}else{if(!custom||custom.indexOf('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($_SERVER["HTTP_HOST"]); ?>')!==0){alert("— Oops, a slight problem: —\n\nThe Custom Value MUST start with your domain name.");return false}else{if(fixedTerm&&!fixedTerm.match(/^[1-9]+ (D|W|M|Y|L)#x2F;)){alert("— Oops, a slight problem: —\n\nThe Fixed Term Length is not formatted properly.");return false}}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_reg_access_link_via_ajax",ws_plugin__s2member_reg_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-reg-access-link-via-ajax")); ?>',s2member_reg_access_link_subscr_gateway:"paypal",s2member_reg_access_link_subscr_id:subscrID,s2member_reg_access_link_custom:custom,s2member_reg_access_link_item_number:levelCcapsPer},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var leading=$("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var $link=$("p#ws-plugin--s2member-sp-link"),$loading=$("img#ws-plugin--s2member-sp-link-loading");if(!leading){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 → Restriction Options → Specific Post/Page Access.");return false}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:ids,s2member_sp_access_link_hours:hours},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false}}if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){$("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var $this=$(this),val=$this.val();var $rows=$("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var $prevImg=$("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(val<=0){$rows.css("display","none"),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png#x2F;,"/unchecked.png"))}else{if(val==1){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/unchecked\.png#x2F;,"/checked.png"))}else{if(val==2){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png#x2F;,"/unchecked.png"))}}}});$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').change(function(){var thisChange=$(this).val(),checkedIndexes=[];$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="removal-deletion"&&this.checked){$this.nextAll(checkboxes).slice(0,2).attr({checked:"checked",disabled:"disabled"})}else{if(val==="removal-deletion"&&!this.checked){$this.nextAll(checkboxes).slice(0,2).removeAttr("disabled");(thisChange==="removal-deletion")?$this.nextAll(checkboxes).slice(0,2).removeAttr("checked"):null}else{if(val==="modification"&&this.checked){$this.nextAll(checkboxes).slice(0,3).attr({checked:"checked",disabled:"disabled"})}else{if(val==="modification"&&!this.checked){(thisChange==="modification")?$this.nextAll(checkboxes).slice(0,3).removeAttr("checked"):null;$this.nextAll(checkboxes).slice(0,3).removeAttr("disabled")}}}}}).each(function(index){(this.checked)?checkedIndexes.push(index):null});$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").removeAttr("disabled");if($.inArray(3,checkedIndexes)===-1&&$.inArray(4,checkedIndexes)===-1&&$.inArray(5,checkedIndexes)===-1&&$.inArray(6,checkedIndexes)===-1){$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").attr("disabled","disabled")}}).last().trigger("change")}});
1
+ jQuery(document).ready(function($){var esc_attr=esc_html=function(e){return/[&\<\>"']/.test(e=String(e))&&(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;").replace(/'/g,"&#039;")),e};if(ws_plugin__s2member_generateSecurityKey=function(e){e||(e="#ws-plugin--s2member-sec-encryption-key");for(var t=function(e,t){return e=arguments.length<1?0:e,t=arguments.length<2?2147483647:t,Math.floor(Math.random()*(t-e+1))+e},s="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%^&*()",l=0,r="";l<64;l++)r+=s.substr(t(0,s.length-1),1);return $(e).val(r),!1},location.href.match(/page\=ws-plugin--s2member/)&&$("input.ws-plugin--s2member-update-roles-button, input.ws-plugin--s2member-reset-roles-button").click(function(){var e=$(this);e.val("one moment please ...");var t='<?php echo (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; ?>',s=e.hasClass("ws-plugin--s2member-reset-roles-button")?"Reset":"Update";return $.post(ajaxurl,{action:"ws_plugin__s2member_update_roles_via_ajax",ws_plugin__s2member_update_roles_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-update-roles-via-ajax")); ?>'},function(l){"1"===l?(alert("s2Member's Roles/Capabilities "+("reset"===s.toLowerCase()?"have been successfully reset":"updated successfully")+".\nYour installation of s2Member has Membership Levels 0-"+t+"."),e.val(s+" Roles/Capabilities")):"l"===l?(alert("Sorry, your request failed.\ns2Member's Roles/Capabilities are locked by Filter:\nws_plugin__s2member_lock_roles_caps"),e.val(s+" Roles/Capabilities")):(alert("Sorry, your request failed.\nAccess denied. Do you have the ability to `create_users`?"),e.val(s+" Roles/Capabilities"))}),!1}),location.href.match(/page\=ws-plugin--s2member-logs/)){$("input#ws-plugin--s2member-gateway-debug-logs-extensive-1").click(function(){var e=($(this),!!this.checked);e&&$("input#ws-plugin--s2member-gateway-debug-logs-1").attr("checked","checked")});var $toggles=$("a.ws-plugin--s2member-log-file-viewport-toggle");$toggles.click(function(){return $("textarea#ws-plugin--s2member-log-file-viewer").each(function(){var e=$(this);"expanded"!==e.attr("data-state")?(e.css({height:e.prop("scrollHeight")+50+"px","overflow-y":"auto"}),$toggles.html("&#8657; normalize viewport &#10073;"),e.attr("data-state","expanded")):(e.css({height:"auto","overflow-y":"scroll"}),$toggles.html("&#8659; expand viewport &#8659;"),e.attr("data-state","scrolling"))}),!1})}if(location.href.match(/page\=ws-plugin--s2member-mms-ops/)&&($("select#ws-plugin--s2member-mms-registration-file").change(function(){if("wp-signup"===$(this).val()){var e=$("select#ws-plugin--s2member-mms-registration-grants").val(),t=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").show(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").hide(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").show(),$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")["all"===e?"show":"hide"](),$("input#ws-plugin--s2member-mms-registration-blogs-level0").val("all"===e?t>0?t:"1":"0")}else if("wp-login"===$(this).val()){var e=$("select#ws-plugin--s2member-mms-registration-grants").val(),t=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").hide(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").show(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").hide(),$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0").hide(),$("input#ws-plugin--s2member-mms-registration-blogs-level0").val("0")}}).trigger("change"),$("select#ws-plugin--s2member-mms-registration-grants").change(function(){$("select#ws-plugin--s2member-mms-registration-file").trigger("change")})),location.href.match(/page\=ws-plugin--s2member-gen-ops/)&&(ws_plugin__s2member_enableSecurityKey=function(){return 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 unhappy Customers. Data corruption WILL occur! For 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.")&&$("input#ws-plugin--s2member-sec-encryption-key").removeAttr("disabled"),!1},ws_plugin__s2member_securityKeyHistory=function(){return $("div#ws-plugin--s2member-sec-encryption-key-history").toggle(),!1},$("select#ws-plugin--s2member-new-user-emails-enabled").change(function(){var e=$("input#ws-plugin--s2member-pluggables-wp-new-user-notification"),t=$(this),s=$("div#ws-plugin--s2member-new-user-emails");"0"===e.val()||"0"===t.val()?("0"===e.val()?t.attr("disabled","disabled"):t.removeAttr("disabled"),$(":input",s).attr("disabled","disabled"),s.css("opacity","0.5")):(t.removeAttr("disabled"),$(":input",s).removeAttr("disabled"),s.css("opacity",""))}).trigger("change"),$("select#ws-plugin--s2member-login-reg-design-enabled").change(function(){var e=$(this),t=$("div#ws-plugin--s2member-login-reg-design");"0"===e.val()?($(":input",t).attr("disabled","disabled"),t.css("opacity","0.5"),t.hide()):($(":input",t).removeAttr("disabled"),t.css("opacity",""),t.show())}).trigger("change"),$("select#ws-plugin--s2member-custom-reg-password").change(function(){var e=$(this),t=$("div#ws-plugin--s2member-new-user-email-details");"1"===e.val()?t.css("opacity","0.5"):t.css("opacity","")}).trigger("change"),$("input#ws-plugin--s2member-custom-reg-fields").length&&$("div#ws-plugin--s2member-custom-reg-field-configuration").length&&!function(){var e,t,s,l,r,o,a=$("input#ws-plugin--s2member-custom-reg-fields"),i=$("div#ws-plugin--s2member-custom-reg-field-configuration"),n=a.val()?$.JSON.parse(a.val()):[];for(n=n instanceof Array?n:[],t={section:"no",sectitle:"",id:"",label:"",type:"text",deflt:"",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""},e=0;e<n.length;e++)n[e]=$.extend(!0,{},t,n[e]);s='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>',l='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>',i.html(s+l),r=$("div#ws-plugin--s2member-custom-reg-field-configuration-tools"),o=$("table#ws-plugin--s2member-custom-reg-field-configuration-table"),ws_plugin__s2member_customRegFieldSectionChange=function(e){var t=$(e).val(),s="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle";"yes"===t?$(s).css("display",""):$(s).css("display","none")},ws_plugin__s2member_customRegFieldTypeChange=function(e){var t=$(e).val(),s="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt",l="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options",r="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";t.match(/^(text|textarea)#x2F;)?$(s).css("display",""):$(s).css("display","none"),t.match(/^(select|selects|checkboxes|radios)#x2F;)?$(l).css("display",""):$(l).css("display","none"),t.match(/^(text|textarea)#x2F;)?$(r).css("display",""):$(r).css("display","none")},ws_plugin__s2member_customRegFieldDelete=function(e){for(var t=new Array,s=0;s<n.length;s++)s!==e&&t.push(n[s]);n=t,m(),b()},ws_plugin__s2member_customRegFieldMoveUp=function(e){if("object"==typeof n[e]&&"object"==typeof n[e-1]){var t=n[e-1],s=n[e];n[e-1]=s,n[e]=t,m(),b()}},ws_plugin__s2member_customRegFieldMoveDown=function(e){if("object"==typeof n[e]&&"object"==typeof n[e+1]){var t=n[e+1],s=n[e];n[e+1]=s,n[e]=t,m(),b()}},ws_plugin__s2member_customRegFieldCreate=function(){var e=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),t={};$(":input[property]",e).each(function(){var e=$(this),s=e.attr("property"),l=$.trim(e.val());t[s]=l}),(t=c(t))&&(n.push(t),m(),g(),b(),d(),setTimeout(function(){"tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(n.length-1);alert('Field created successfully.\n* Remember to "Save All Changes".')},500))},ws_plugin__s2member_customRegFieldUpdate=function(e){var t=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),s={};$(":input[property]",t).each(function(){var e=$(this),t=e.attr("property"),l=$.trim(e.val());s[t]=l}),(s=c(s,e))&&(n[e]=s,m(),g(),b(),d(),setTimeout(function(){alert('Field updated successfully.\n* Remember to "Save All Changes".')},500))},ws_plugin__s2member_customRegFieldAdd=function(){g(!0)},ws_plugin__s2member_customRegFieldEdit=function(e){g(!1,e),d()},ws_plugin__s2member_customRegFieldCancel=function(){g(),d()};var c=function(e,s){var l,r,o="number"==typeof s&&"object"==typeof n[s],a=[];if("object"!=typeof e||"object"!=typeof(e=$.extend(!0,{},t,e)))return alert("Invalid field object. Please try again."),!1;if(e.sectitle="yes"===e.section?e.sectitle:"",e.deflt=e.type.match(/^(text|textarea)#x2F;)?e.deflt:"",e.deflt=e.type.match(/^(text)#x2F;)?e.deflt.replace(/[\r\n\t ]+/g," "):e.deflt,e.options=e.type.match(/^(select|selects|checkboxes|radios)#x2F;)?e.options:"",e.expected=e.type.match(/^(text|textarea)#x2F;)?e.expected:"",e.id?!u(e.id)||o&&e.id===n[s].id||a.push("Unique Field ID:\nThat Field ID already exists. Please try again."):a.push("Unique Field ID:\nThis is required. Please try again."),e.label||a.push("Field Label/Description:\nThis is required. Please try again."),e.type.match(/^(select|selects|checkboxes|radios)#x2F;)&&!e.options)a.push("Option Configuration File:\nThis is required. Please try again.");else if(e.type.match(/^(select|selects|checkboxes|radios)#x2F;)){for(r=0;r<(l=e.options.split(/[\r\n]+/)).length;r++)if(!(l[r]=$.trim(l[r])).match(/^([^\|]*)(\|)([^\|]*)(\|default)?#x2F;)){a.push("Option Configuration File:\nInvalid configuration at line #"+(r+1)+".");break}e.options=$.trim(l.join("\n"))}return(e.levels=e.levels.replace(/ /g,""))?e.levels.match(/^(all|[0-9,]+)#x2F;)||a.push("Applicable Levels:\nShould be comma-delimited Levels, or just type: all.\n(examples: 0,1,2,3,4 or type the word: all)"):a.push("Applicable Levels:\nThis is required. Please try again."),e.classes&&e.classes.match(/[^a-z 0-9 _ \-]/i)&&a.push("CSS Classes:\nContains invalid characters. Please try again.\n(only: alphanumerics, underscores, hyphens, spaces)"),e.styles&&e.styles.match(/["\=\>\<]/)&&a.push('CSS Styles:\nContains invalid characters. Please try again.\n(do NOT use these characters: = " < >)'),e.attrs&&e.attrs.match(/[\>\<]/)&&a.push("Other Attributes:\nContains invalid characters. Please try again.\n(do NOT use these characters: < >)"),a.length>0?(alert(a.join("\n\n")),!1):e},m=function(){a.val(n.length>0?$.JSON.stringify(n):"")},p=function(e){var t={text:"Text (single line)",textarea:"Textarea (multi-line)",select:"Select Menu (drop-down)",selects:"Select Menu (multi-option)",checkbox:"Checkbox (single)",pre_checkbox:"Checkbox (pre-checked)",checkboxes:"Checkboxes (multi-option)",radios:"Radio Buttons (multi-option)"};return"string"==typeof t[e]?t[e]:""},u=function(e){for(var t=0;t<n.length;t++)if(n[t].id===e)return!0},d=function(){scrollTo(0,$("div.ws-plugin--s2member-custom-reg-fields-section").offset().top-100)},g=function(e,s){var l=0,o="",a="",i="number"==typeof s&&"object"==typeof n[s],c=!(!e&&!i),m=i?$.extend(!0,{},t,n[s]):t;if(o+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>',tb_remove(),$("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove(),c){for(a+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">',a+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">',a+="<tbody>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">Starts A New Section?</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">',a+='<td colspan="2">',a+='<select property="section" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section" onchange="ws_plugin__s2member_customRegFieldSectionChange(this);">',a+='<option value="no"'+("no"===m.section?' selected="selected"':"")+'">No (this Field flows normally)</option>',a+='<option value="yes"'+("yes"===m.section?' selected="selected"':"")+'">Yes (this Field begins a new section)</option>',a+="</select><br />",a+="<small>Optional. Allows Fields to be grouped into sections.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+("yes"===m.section?"":' style="display:none;"')+'><td colspan="2"><hr /></td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+("yes"===m.section?"":' style="display:none;"')+">",a+='<td colspan="2">',a+="Title for this new section? (optional)<br />",a+='<input type="text" property="sectitle" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle" value="'+esc_attr(m.sectitle)+'" /><br />',a+="<small>If empty, a simple divider will be used by default.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-type"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">',a+='<td colspan="2">',a+='<select property="type" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);">',a+='<option value="text"'+("text"===m.type?' selected="selected"':"")+'">'+esc_html(p("text"))+"</option>",a+='<option value="textarea"'+("textarea"===m.type?' selected="selected"':"")+'">'+esc_html(p("textarea"))+"</option>",a+='<option value="select"'+("select"===m.type?' selected="selected"':"")+'">'+esc_html(p("select"))+"</option>",a+='<option value="selects"'+("selects"===m.type?' selected="selected"':"")+'">'+esc_html(p("selects"))+"</option>",a+='<option value="checkbox"'+("checkbox"===m.type?' selected="selected"':"")+'">'+esc_html(p("checkbox"))+"</option>",a+='<option value="pre_checkbox"'+("pre_checkbox"===m.type?' selected="selected"':"")+'">'+esc_html(p("pre_checkbox"))+"</option>",a+='<option value="checkboxes"'+("checkboxes"===m.type?' selected="selected"':"")+'">'+esc_html(p("checkboxes"))+"</option>",a+='<option value="radios"'+("radios"===m.type?' selected="selected"':"")+'">'+esc_html(p("radios"))+"</option>",a+="</select><br />",a+="<small>The options below may change, based on the Field Type you choose here.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-label"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">',a+='<td colspan="2">',a+='<input type="text" property="label" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" value="'+esc_attr(m.label)+'" /><br />',a+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-id"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">',a+='<td colspan="2">',a+='<input type="text" property="id" maxlength="25" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" value="'+esc_attr(m.id)+'" /><br />',a+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />",a+='<small>e.g., <code>[s2Get user_field="country_code" /]</code></small>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-required"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">',a+='<td colspan="2">',a+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">',a+='<option value="yes"'+("yes"===m.required?' selected="selected"':"")+'">Yes (required)</option>',a+='<option value="no"'+("no"===m.required?' selected="selected"':"")+'">No (optional)</option>',a+="</select><br />",a+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />',a+="<small>* Administrators are exempt from this requirement.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+(m.type.match(/^(text|textarea)#x2F;)?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+(m.type.match(/^(text|textarea)#x2F;)?"":' style="display:none;"')+">",a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">Default Text Value: (optional)</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+(m.type.match(/^(text|textarea)#x2F;)?"":' style="display:none;"')+">",a+='<td colspan="2">',a+='<textarea property="deflt" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt" rows="1">'+esc_html(m.deflt)+"</textarea><br />",a+="<small>Default value before user input is received.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+(m.type.match(/^(select|selects|checkboxes|radios)#x2F;)?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+(m.type.match(/^(select|selects|checkboxes|radios)#x2F;)?"":' style="display:none;"')+">",a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * (one option per line)</label><br />',a+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+(m.type.match(/^(select|selects|checkboxes|radios)#x2F;)?"":' style="display:none;"')+">",a+='<td colspan="2">',a+='<textarea property="options" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options" rows="3">'+esc_html(m.options)+"</textarea><br />",a+="Here is a quick example:<br />",a+="<small>You can also specify a <em>default</em> option:</small><br />",a+="<code>US|United States|default</code><br />",a+="<code>CA|Canada</code><br />",a+="<code>VI|Virgin Islands (U.S.)</code>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+(m.type.match(/^(text|textarea)#x2F;)?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+(m.type.match(/^(text|textarea)#x2F;)?"":' style="display:none;"')+">",a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+(m.type.match(/^(text|textarea)#x2F;)?"":' style="display:none;"')+">",a+='<td colspan="2">',a+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">',a+='<option value=""'+(""===m.expected?' selected="selected"':"")+'">Anything Goes</option>',a+='<option disabled="disabled"></option>',a+='<optgroup label="Specific Input Types">',a+='<option value="numeric-wp-commas"'+("numeric-wp-commas"===m.expected?' selected="selected"':"")+'">Numeric (with or without decimals, commas allowed)</option>',a+='<option value="numeric"'+("numeric"===m.expected?' selected="selected"':"")+'">Numeric (with or without decimals, no commas)</option>',a+='<option value="integer"'+("integer"===m.expected?' selected="selected"':"")+'">Integer (whole number, without any decimals)</option>',a+='<option value="integer-gt-0"'+("integer-gt-0"===m.expected?' selected="selected"':"")+'">Integer > 0 (whole number, no decimals, greater than 0)</option>',a+='<option value="float"'+("float"===m.expected?' selected="selected"':"")+'">Float (floating point number, decimals required)</option>',a+='<option value="float-gt-0"'+("float-gt-0"===m.expected?' selected="selected"':"")+'">Float > 0 (floating point number, decimals required, greater than 0)</option>',a+='<option value="date"'+("date"===m.expected?' selected="selected"':"")+'">Date (required date format: dd/mm/yyyy)</option>',a+='<option value="email"'+("email"===m.expected?' selected="selected"':"")+'">Email (require valid email)</option>',a+='<option value="url"'+("url"===m.expected?' selected="selected"':"")+'">Full URL (starting with http or https)</option>',a+='<option value="domain"'+("domain"===m.expected?' selected="selected"':"")+'">Domain Name (domain name only, without http)</option>',a+='<option value="phone"'+("phone"===m.expected?' selected="selected"':"")+'">Phone # (10 digits w/possible hyphens,spaces,brackets)</option>',a+='<option value="uszip"'+("uszip"===m.expected?' selected="selected"':"")+'">US Zipcode (5-9 digits w/possible hyphen)</option>',a+='<option value="cazip"'+("cazip"===m.expected?' selected="selected"':"")+'">Canadian Zipcode (6 alpha-numerics w/possible space)</option>',a+='<option value="uczip"'+("uczip"===m.expected?' selected="selected"':"")+'">US/Canadian Zipcode (either a US or Canadian zipcode)</option>',a+="</optgroup>",a+='<option disabled="disabled"></option>',a+='<optgroup label="Any Character Combination">',l=1;l<=25;l++)a+='<option value="any-'+l+'"'+(m.expected==="any-"+l?' selected="selected"':"")+'">Any Character Combination ('+l+" character minimum)</option>",a+='<option value="any-'+l+'-e"'+(m.expected==="any-"+l+"-e"?' selected="selected"':"")+'">Any Character Combination (exactly '+l+" character"+(l>1?"s":"")+")</option>";for(a+="</optgroup>",a+='<option disabled="disabled"></option>',a+='<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">',l=1;l<=25;l++)a+='<option value="alphanumerics-spaces-punctuation-'+l+'"'+(m.expected==="alphanumerics-spaces-punctuation-"+l?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ('+l+" character minimum)</option>",a+='<option value="alphanumerics-spaces-punctuation-'+l+'-e"'+(m.expected==="alphanumerics-spaces-punctuation-"+l+"-e"?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation (exactly '+l+" character"+(l>1?"s":"")+")</option>";for(a+="</optgroup>",a+='<option disabled="disabled"></option>',a+='<optgroup label="Alphanumerics &amp; Spaces Only">',l=1;l<=25;l++)a+='<option value="alphanumerics-spaces-'+l+'"'+(m.expected==="alphanumerics-spaces-"+l?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ('+l+" character minimum)</option>",a+='<option value="alphanumerics-spaces-'+l+'-e"'+(m.expected==="alphanumerics-spaces-"+l+"-e"?' selected="selected"':"")+'">Alphanumerics &amp; Spaces (exactly '+l+" character"+(l>1?"s":"")+")</option>";for(a+="</optgroup>",a+='<option disabled="disabled"></option>',a+='<optgroup label="Alphanumerics &amp; Punctuation Only">',l=1;l<=25;l++)a+='<option value="alphanumerics-punctuation-'+l+'"'+(m.expected==="alphanumerics-punctuation-"+l?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ('+l+" character minimum)</option>",a+='<option value="alphanumerics-punctuation-'+l+'-e"'+(m.expected==="alphanumerics-punctuation-"+l+"-e"?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation (exactly '+l+" character"+(l>1?"s":"")+")</option>";for(a+="</optgroup>",a+='<option disabled="disabled"></option>',a+='<optgroup label="Alphanumerics Only">',l=1;l<=25;l++)a+='<option value="alphanumerics-'+l+'"'+(m.expected==="alphanumerics-"+l?' selected="selected"':"")+'">Alphanumerics ('+l+" character minimum)</option>",a+='<option value="alphanumerics-'+l+'-e"'+(m.expected==="alphanumerics-"+l+"-e"?' selected="selected"':"")+'">Alphanumerics (exactly '+l+" character"+(l>1?"s":"")+")</option>";for(a+="</optgroup>",a+='<option disabled="disabled"></option>',a+='<optgroup label="Alphabetics Only">',l=1;l<=25;l++)a+='<option value="alphabetics-'+l+'"'+(m.expected==="alphabetics-"+l?' selected="selected"':"")+'">Alphabetics ('+l+" character minimum)</option>",a+='<option value="alphabetics-'+l+'-e"'+(m.expected==="alphabetics-"+l+"-e"?' selected="selected"':"")+'">Alphabetics (exactly '+l+" character"+(l>1?"s":"")+")</option>";for(a+="</optgroup>",a+='<option disabled="disabled"></option>',a+='<optgroup label="Numeric Digits Only">',l=1;l<=25;l++)a+='<option value="numerics-'+l+'"'+(m.expected==="numerics-"+l?' selected="selected"':"")+'">Numeric Digits ('+l+" digit minimum)</option>",a+='<option value="numerics-'+l+'-e"'+(m.expected==="numerics-"+l+"-e"?' selected="selected"':"")+'">Numeric Digits (exactly '+l+" digit"+(l>1?"s":"")+")</option>";a+="</optgroup>",a+="</select><br />",a+="<small>Only Users/Members will be required to meet this criteria.</small><br />",a+="<small>* Administrators are exempt from this.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">',a+='<td colspan="2">',a+='<input type="text" property="levels" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" value="'+esc_attr(m.levels)+'" /><br />',a+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />",a+="<small>This allows you to enable this field - only at specific Membership Levels.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">',a+='<td colspan="2">',a+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">',a+='<option value="yes"'+("yes"===m.editable?' selected="selected"':"")+'">Yes (editable)</option>',a+='<option value="no"'+("no"===m.editable?' selected="selected"':"")+'">No (uneditable after registration)</option>',a+='<option value="no-invisible"'+("no-invisible"===m.editable?' selected="selected"':"")+'">No (uneditable &amp; totally invisible after registration)</option>',a+='<option value="no-always-invisible"'+("no-always-invisible"===m.editable?' selected="selected"':"")+'">No (uneditable &amp; totally invisible, both during &amp; after registration)</option>',a+='<option value="yes-invisible"'+("yes-invisible"===m.editable?' selected="selected"':"")+'">Yes (editable after registration / invisible during registration)</option>',a+="</select><br />",a+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />",a+="<small>* Administrators are exempt from this.</small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: (optional)</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">',a+='<td colspan="2">',a+='<input type="text" property="classes" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" value="'+esc_attr(m.classes)+'" /><br />',a+="<small>Example: <code>my-style-1 my-style-2</code></small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: (optional)</label>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">',a+='<td colspan="2">',a+='<input type="text" property="styles" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" value="'+esc_attr(m.styles)+'" /><br />',a+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>",a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">',a+='<td colspan="2">',a+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: (optional)</label>',
2
+ a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">',a+='<td colspan="2">',a+='<input type="text" property="attrs" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" value="'+esc_attr(m.attrs)+'" /><br />',a+='<small>Example: <code>onkeyup="" onblur=""</code></small>',a+="</td>",a+="</tr>",a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons"><td colspan="2">&nbsp;</td></tr>',a+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">',a+='<td align="left">',a+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />',a+="</td>",a+='<td align="right">',a+='<input type="button" value="'+(i?"Update This Field":"Create Registration Field")+'" onclick="'+(i?"ws_plugin__s2member_customRegFieldUpdate("+s+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />',a+="</td>",a+="</tr>",a+="</tbody>",a+="</table>",a+="<div>",$("body").append(a),tb_show(i?"Editing Registration/Profile Field":"New Custom Registration/Profile Field","#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form"),$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}r.html(o)},b=function(){var e=(n.length,0),t="",s="o";if(t+="<tbody>",t+="<tr>",t+="<th>Order</th>",t+="<th>Field Type</th>",t+="<th>Unique ID</th>",t+="<th>Required</th>",t+="<th>Levels</th>",t+="<th>- Tools -</th>",t+="</tr>",n.length>0)for(e=0;e<n.length;e++)t+='<tr class="'+esc_attr(s="o"===s?"e":"o")+("yes"===n[e].section?" s":"")+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+e+'">',t+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+e+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+e+'); return false;"></a></td>',t+='<td nowrap="nowrap">'+esc_html(p(n[e].type))+"</td>",t+='<td nowrap="nowrap">'+esc_html(n[e].id)+"</td>",t+='<td nowrap="nowrap">'+esc_html(n[e].required)+"</td>",t+='<td nowrap="nowrap">'+esc_html(n[e].levels)+"</td>",t+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+e+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+e+'); return false;"></a></td>',t+="</tr>";else t+="<tr>",t+='<td colspan="6">No Custom Fields are configured.</td>',t+="</tr>";t+="</tbody>",o.html(t)};g(),b()}()),location.href.match(/page\=ws-plugin--s2member-res-ops/)&&($("input#ws-plugin--s2member-brute-force-restrictions-reset-button").click(function(){var e=$(this);return e.val("one moment please ..."),$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(t){alert("s2Member's Brute Force Restriction Logs have all been reset."),e.val("Reset Brute Force Logs")}),!1}),$("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var e=$(this);return e.val("one moment please ..."),$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(t){alert("s2Member's IP Restriction Logs have all been reset."),e.val("Reset IP Restriction Logs")}),!1}),$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').change(function(){var e=$(this).val();$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').each(function(){var t=$(this),s=t.val(),l='input[type="checkbox"]';"all"===s&&this.checked?t.nextAll(l).attr({checked:"checked",disabled:"disabled"}):"all"!==s||this.checked||(t.nextAll(l).removeAttr("disabled"),"all"===e?t.nextAll(l).removeAttr("checked"):null)})}).last().trigger("change")),location.href.match(/page\=ws-plugin--s2member-down-ops/)){var updateCloudFrontPrivateKey=function(){var e=$("input#ws-plugin--s2member-amazon-cf-files-private-key"),t=$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry"),s=$.trim(e.val()),l=$.trim(t.val());(s&&!l||l.match(/[^\r\n\u25CF]/))&&(e.val(l),t.val(l.replace(/[^\r\n]/g,String.fromCharCode(9679))))};$("form#ws-plugin--s2member-options-form").submit(updateCloudFrontPrivateKey),$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontPrivateKey).trigger("change");var updateCloudFrontDistroCfgs=function(){var e=$("input#ws-plugin--s2member-amazon-cf-files-private-key"),t=$("input#ws-plugin--s2member-amazon-cf-files-private-key-id"),s=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros"),l=$("input#ws-plugin--s2member-amazon-cf-files-distros-auto-config-status"),r=$.trim(l.val()),o=$.trim(e.val()),a=$.trim(t.val()),i=$.trim(e.attr("data-s-prev-config-value")),n=$.trim(t.attr("data-s-prev-config-value"));"configured"===r&&(n&&a!==n||i&&o!==i)?(alert("s2Member will need to delete and re-configure your Amazon CloudFront distributions if you change this. When you're done editing, click (Save All Changes) below."),s.attr("checked","checked")):"configured"!==r&&a&&o&&(alert("s2Member will need to auto-configure your Amazon CloudFront distributions for you. When you're done editing, click (Save All Changes) below."),s.attr("checked","checked"))};$("input#ws-plugin--s2member-amazon-cf-files-private-key-id").change(updateCloudFrontDistroCfgs),$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontDistroCfgs),$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames").change(function(){var e=($(this),!!this.checked),t=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros"),s=$("div#ws-plugin--s2member-amazon-cf-files-auto-configure-distro-cnames");e?s.show():s.hide(),e?t.attr("checked","checked"):null}).trigger("change")}location.href.match(/page\=ws-plugin--s2member-paypal-ops/)&&$("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var e=$(this),t=e.val(),s=$("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");2==t?s.show():s.hide()}),location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)&&($("div.ws-menu-page select[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-term#x2F;)}).change(function(){var e=this.id.replace(/^ws-plugin--s2member-(.+?)-term#x2F;g,"$1"),t="BN"===$(this).val().split("-")[2].replace(/[^0-1BN]/g,"")?1:0;$("p#ws-plugin--s2member-"+e+"-trial-line").css("display",t?"none":""),$("span#ws-plugin--s2member-"+e+"-trial-then").css("display",t?"none":""),$("span#ws-plugin--s2member-"+e+"-20p-rule").css("display",t?"none":""),t?$("input#ws-plugin--s2member-"+e+"-trial-period").val(0):null,t?$("input#ws-plugin--s2member-"+e+"-trial-amount").val("0.00"):null}),$("div.ws-menu-page input[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification|ccap)-ccaps#x2F;)}).keyup(function(){var e=this.value.replace(/^(-all|-al|-a|-)[;,]*/gi,""),t=this.value.match(/^(-all|-al|-a|-)[;,]*/i)?"-all,":"";e.match(/[^a-z_0-9,]/)&&(this.value=t+$.trim($.trim(e).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase()))}),ws_plugin__s2member_paypalButtonGenerate=function(button){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="",labels={};eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_dq($labels); ?>");var shortCode=$("input#ws-plugin--s2member-"+button+"-shortcode"),code=$("textarea#ws-plugin--s2member-"+button+"-button"),modLevel=$("select#ws-plugin--s2member-modification-level"),level="modification"===button?modLevel.val().split(":",2)[1]:button.replace(/^level/,""),label=labels["level"+level].replace(/"/g,""),desc=$.trim($("input#ws-plugin--s2member-"+button+"-desc").val().replace(/"/g,"")),trialAmount=$("input#ws-plugin--s2member-"+button+"-trial-amount").val().replace(/[^0-9\.]/g,""),trialPeriod=$("input#ws-plugin--s2member-"+button+"-trial-period").val().replace(/[^0-9]/g,""),trialTerm=$("select#ws-plugin--s2member-"+button+"-trial-term").val().replace(/[^A-Z]/g,""),regAmount=$("input#ws-plugin--s2member-"+button+"-amount").val().replace(/[^0-9\.]/g,""),regPeriod=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[0].replace(/[^0-9]/g,""),regTerm=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[1].replace(/[^A-Z]/g,""),regRecur=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[2].replace(/[^0-1BN]/g,""),regRecurTimes="",regRecurRetry="1",localeCode="",digital="0",noShipping="1",pageStyle=$.trim($("input#ws-plugin--s2member-"+button+"-page-style").val().replace(/"/g,"")),currencyCode=$("select#ws-plugin--s2member-"+button+"-currency").val().replace(/[^A-Z]/g,""),cCaps=$.trim($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());cCaps=$.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i)?(cCaps?"-all,":"-all")+cCaps.toLowerCase():cCaps.toLowerCase(),trialPeriod="BN"===regRecur?"0":trialPeriod,trialAmount=!trialAmount||isNaN(trialAmount)||trialAmount<.01||trialPeriod<=0?"0":trialAmount;var levelCcapsPer="BN"===regRecur&&"L"!==regTerm?level+":"+cCaps+":"+regPeriod+" "+regTerm:level+":"+cCaps;return levelCcapsPer=levelCcapsPer.replace(/\:+#x2F;g,""),"0"!==trialAmount&&(isNaN(trialAmount)||trialAmount<0)?(alert("— Oops, a slight problem: —\n\nWhen provided, Trial Amount must be >= 0.00"),!1):"0"!==trialAmount&&trialAmount>1e4&&"USD"===currencyCode.toUpperCase()?(alert("— Oops, a slight problem: —\n\nMaximum Trial Amount is: 10000.00"),!1):"D"===trialTerm&&trialPeriod>90?(alert("— Oops, a slight problem: —\n\nMaximum Trial Days is: 90.\nIf you want to offer more than 90 days, please choose Weeks or Months from the drop-down."),!1):"W"===trialTerm&&trialPeriod>52?(alert("— Oops, a slight problem: —\n\nMaximum Trial Weeks is: 52.\nIf you want to offer more than 52 weeks, please choose Months from the drop-down."),!1):"M"===trialTerm&&trialPeriod>24?(alert("— Oops, a slight problem: —\n\nMaximum Trial Months is: 24.\nIf you want to offer more than 24 months, please choose Years from the drop-down."),!1):"Y"===trialTerm&&trialPeriod>5?(alert("— Oops, a slight problem: —\n\nMax Trial Period Years is: 5."),!1):!regAmount||isNaN(regAmount)||regAmount<.01?(alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01"),!1):regAmount>1e4&&"USD"===currencyCode.toUpperCase()?(alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00"),!1):desc?(code.html(code.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1")),parseInt(trialPeriod)<=0?code.html(code.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null,"BN"===regRecur?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null,"BN"===regRecur?code.html(code.val().replace(/ (\<input type\="hidden" name\="(src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null,"BN"!==regRecur?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null,"BN"!==regRecur?code.html(code.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null,shortCodeTemplateAttrs+="modification"===button?'modify="1" ':"",shortCodeTemplateAttrs+='level="'+esc_attr(level)+'" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"',shortCodeTemplateAttrs+=' ta="'+esc_attr(trialAmount)+'" tp="'+esc_attr(trialPeriod)+'" tt="'+esc_attr(trialTerm)+'" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'" rrt="'+esc_attr(regRecurTimes)+'" rra="'+esc_attr(regRecurRetry)+'"',shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs)),code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"')),code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"')),code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"')),code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"')),code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"')),code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"')),code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"')),code.html(code.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+("modification"===button?"1":"0")+'"')),code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"')),code.html(code.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+esc_attr(regRecur)+'"')),code.html(code.val().replace(/ name\="srt" value\="(.*?)"/,' name="srt" value="'+esc_attr(regRecurTimes)+'"')),code.html(code.val().replace(/ name\="sra" value\="(.*?)"/,' name="sra" value="'+esc_attr(regRecurRetry)+'"')),code.html(code.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+esc_attr(trialAmount)+'"')),code.html(code.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+esc_attr(trialPeriod)+'"')),code.html(code.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+esc_attr(trialTerm)+'"')),code.html(code.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+esc_attr(regAmount)+'"')),code.html(code.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+esc_attr(regPeriod)+'"')),code.html(code.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+esc_attr(regTerm)+'"')),$("div#ws-plugin--s2member-"+button+"-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round((new Date).getTime())+"~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (c_ws_plugin__s2member_utils_ip::current())); ?>").replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,"")),"modification"===button?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Modification Buttons should be displayed to existing Users/Members, and they should be logged-in, BEFORE clicking this Button."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page."),shortCode.each(function(){this.focus(),this.select()}),!1):(alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button."),!1)},ws_plugin__s2member_paypalCcapButtonGenerate=function(){var e='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',t="",s=$("input#ws-plugin--s2member-ccap-shortcode"),l=$("textarea#ws-plugin--s2member-ccap-button"),r=$.trim($("input#ws-plugin--s2member-ccap-desc").val().replace(/"/g,"")),o=$("input#ws-plugin--s2member-ccap-amount").val().replace(/[^0-9\.]/g,""),a=$("select#ws-plugin--s2member-ccap-term").val().split("-")[0].replace(/[^0-9]/g,""),i=$("select#ws-plugin--s2member-ccap-term").val().split("-")[1].replace(/[^A-Z]/g,""),n=$("select#ws-plugin--s2member-ccap-term").val().split("-")[2].replace(/[^0-1BN]/g,""),c="",m="0",p="1",u=$.trim($("input#ws-plugin--s2member-ccap-page-style").val().replace(/"/g,"")),d=$("select#ws-plugin--s2member-ccap-currency").val().replace(/[^A-Z]/g,""),g=$.trim($.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());g=$.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i)?(g?"-all,":"-all")+g.toLowerCase():g.toLowerCase();var b="BN"===n&&"L"!==i?"*:"+g+":"+a+" "+i:"*:"+g;return b=b.replace(/\:+#x2F;g,""),g&&"-all"!==g?!o||isNaN(o)||o<.01?(alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01"),!1):o>1e4&&"USD"===d.toUpperCase()?(alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00"),!1):r?(t+='level="*" ccaps="'+esc_attr(g)+'" desc="'+esc_attr(r)+'" ps="'+esc_attr(u)+'" lc="'+esc_attr(c)+'" cc="'+esc_attr(d)+'" dg="'+esc_attr(m)+'" ns="'+esc_attr(p)+'"',t+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(o)+'" rp="'+esc_attr(a)+'" rt="'+esc_attr(i)+'" rr="'+esc_attr(n)+'"',s.val(e.replace(/%%attrs%%/,t)),l.html(l.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(c)+'"')),l.html(l.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(p)+'"')),l.html(l.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(r)+'"')),l.html(l.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(b)+'"')),l.html(l.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(u)+'"')),l.html(l.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(d)+'"')),l.html(l.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"')),l.html(l.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(o)+'"')),$("div#ws-plugin--s2member-ccap-button-prev").html(l.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round((new Date).getTime())+"~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (c_ws_plugin__s2member_utils_ip::current())); ?>").replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,"")),alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button."),s.each(function(){this.focus(),this.select()}),!1):(alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button."),!1):(alert("— Oops, a slight problem: —\n\nPlease provide at least one Custom Capability."),!1)},ws_plugin__s2member_paypalSpButtonGenerate=function(){var e='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',t="",s=$("input#ws-plugin--s2member-sp-shortcode"),l=$("textarea#ws-plugin--s2member-sp-button"),r=$("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,""),o=$("select#ws-plugin--s2member-sp-additional-ids").val()||[],a=$("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,""),i=$("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,""),n=$.trim($("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,"")),c="",m="0",p="1",u=$.trim($("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,"")),d=$("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!r)return 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 → Restriction Options → Specific Post/Page Access."),!1;if(!i||isNaN(i)||i<.01)return alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01"),!1;if(i>1e4&&"USD"===d.toUpperCase())return alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00"),!1;if(!n)return alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button."),!1;for(var g=0,b=r;g<o.length;g++)o[g]&&o[g]!==r&&(b+=","+o[g]);var f="sp:"+b+":"+a;return t+='sp="1" ids="'+esc_attr(b)+'" exp="'+esc_attr(a)+'" desc="'+esc_attr(n)+'" ps="'+esc_attr(u)+'" lc="'+esc_attr(c)+'" cc="'+esc_attr(d)+'" dg="'+esc_attr(m)+'" ns="'+esc_attr(p)+'"',t+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(i)+'"',s.val(e.replace(/%%attrs%%/,t)),l.html(l.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(c)+'"')),l.html(l.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(p)+'"')),l.html(l.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(n)+'"')),l.html(l.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(f)+'"')),l.html(l.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(u)+'"')),l.html(l.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(d)+'"')),l.html(l.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"')),l.html(l.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(i)+'"')),$("div#ws-plugin--s2member-sp-button-prev").html(l.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round((new Date).getTime())+"~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr (c_ws_plugin__s2member_utils_ip::current())); ?>").replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,"")),alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your WordPress Editor."),s.each(function(){this.focus(),this.select()}),!1},ws_plugin__s2member_paypalRegLinkGenerate=function(){var e=$("select#ws-plugin--s2member-reg-link-level").val().replace(/[^0-9]/g,""),t=$.trim($("input#ws-plugin--s2member-reg-link-subscr-id").val()),s=$.trim($("input#ws-plugin--s2member-reg-link-custom").val()),l=$.trim($.trim($("input#ws-plugin--s2member-reg-link-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase()),r=$.trim($("input#ws-plugin--s2member-reg-link-fixed-term").val().replace(/[^A-Z 0-9]/gi,"").toUpperCase()),o=$("p#ws-plugin--s2member-reg-link"),a=$("img#ws-plugin--s2member-reg-link-loading"),i=r&&!r.match(/L#x2F;)?e+":"+l+":"+r:e+":"+l;return i=i.replace(/\:+#x2F;g,""),t?s&&0===s.indexOf('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($_SERVER["HTTP_HOST"]); ?>')?r&&!r.match(/^[1-9]+ (D|W|M|Y|L)#x2F;)?(alert("— Oops, a slight problem: —\n\nThe Fixed Term Length is not formatted properly."),!1):(o.hide(),a.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_reg_access_link_via_ajax",ws_plugin__s2member_reg_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-reg-access-link-via-ajax")); ?>',s2member_reg_access_link_subscr_gateway:"paypal",s2member_reg_access_link_subscr_id:t,s2member_reg_access_link_custom:s,s2member_reg_access_link_item_number:i},function(e){o.show().html('<a href="'+esc_attr(e)+'" target="_blank" rel="external">'+esc_html(e)+"</a>"),a.hide()}),!1):(alert("— Oops, a slight problem: —\n\nThe Custom Value MUST start with your domain name."),!1):(alert("— Oops, a slight problem: —\n\nPaid Subscr. ID is a required value."),!1)},ws_plugin__s2member_paypalSpLinkGenerate=function(){var e=$("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,""),t=$("select#ws-plugin--s2member-sp-link-additional-ids").val()||[],s=$("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,""),l=$("p#ws-plugin--s2member-sp-link"),r=$("img#ws-plugin--s2member-sp-link-loading");if(!e)return 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 → Restriction Options → Specific Post/Page Access."),!1;for(var o=0,a=e;o<t.length;o++)t[o]&&t[o]!==e&&(a+=","+t[o]);return l.hide(),r.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:a,s2member_sp_access_link_hours:s},function(e){l.show().html('<a href="'+esc_attr(e)+'" target="_blank" rel="external">'+esc_html(e)+"</a>"),r.hide()}),!1}),location.href.match(/page\=ws-plugin--s2member-els-ops/)&&($("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var e=$(this),t=e.val(),s=$("tr.ws-plugin--s2member-custom-reg-opt-in-label-row"),l=$("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");t<=0?(s.css("display","none"),l.attr("src",l.attr("src").replace(/\/checked\.png#x2F;,"/unchecked.png"))):1==t?(s.css("display",""),l.attr("src",l.attr("src").replace(/\/unchecked\.png#x2F;,"/checked.png"))):2==t&&(s.css("display",""),l.attr("src",l.attr("src").replace(/\/checked\.png#x2F;,"/unchecked.png")))}),$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').change(function(){var e=$(this).val(),t=[];$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').each(function(){var t=$(this),s=t.val(),l='input[type="checkbox"]';"removal-deletion"===s&&this.checked?t.nextAll(l).slice(0,2).attr({checked:"checked",disabled:"disabled"}):"removal-deletion"!==s||this.checked?"modification"===s&&this.checked?t.nextAll(l).slice(0,3).attr({checked:"checked",disabled:"disabled"}):"modification"!==s||this.checked||("modification"===e?t.nextAll(l).slice(0,3).removeAttr("checked"):null,t.nextAll(l).slice(0,3).removeAttr("disabled")):(t.nextAll(l).slice(0,2).removeAttr("disabled"),"removal-deletion"===e?t.nextAll(l).slice(0,2).removeAttr("checked"):null)}).each(function(e){this.checked?t.push(e):null}),$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").removeAttr("disabled"),$.inArray(3,t)===-1&&$.inArray(4,t)===-1&&$.inArray(5,t)===-1&&$.inArray(6,t)===-1&&$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").attr("disabled","disabled")}).last().trigger("change"))});
src/includes/menu-pages/menu-pages.css CHANGED
@@ -41,14 +41,7 @@ body[class*='s2member'] #wpwrap::before
41
background : linear-gradient(to bottom, rgba(241, 241, 241, 1) 0%, rgba(241, 241, 241, 0.8) 20%, rgba(241, 241, 241, 0) 100%);
42
}
43
/*
44
- Align these with menu page.
45
- */
46
- div.updated.fade, div.error.fade
47
- {
48
- margin : 25px 25px 25px 5px;
49
- }
50
- /*
51
- These CSS selectors address common layout styles.
52
*/
53
div.ws-menu-page
54
{
@@ -56,35 +49,41 @@ div.ws-menu-page
56
min-width : 800px;
57
margin : 25px 25px 25px 5px;
58
}
59
- div.ws-menu-page > :not(.fade) p,
60
- div.ws-menu-page > :not(.fade) code
61
{
62
font-size : inherit;
63
}
64
- div.ws-menu-page > :not(.fade) a
65
{
66
color : #336695;
67
}
68
- div.ws-menu-page > :not(.fade) a:hover,
69
- div.ws-menu-page > :not(.fade) a:active
70
{
71
color : #027E02;
72
}
73
- div.ws-menu-page > :not(.fade) p:first-child,
74
- div.ws-menu-page > :not(.fade) pre:first-child
75
{
76
margin-top : 0;
77
}
78
- div.ws-menu-page > :not(.fade) p:last-child,
79
- div.ws-menu-page > :not(.fade) pre:last-child
80
{
81
margin-bottom : 0;
82
}
83
- div.ws-menu-page > :not(.fade) h3 + p
84
{
85
margin-top : 0;
86
}
87
- div.ws-menu-page > :not(.fade) a.ws-dotted-link
88
{
89
text-decoration : none;
90
border-bottom : 1px dotted;
@@ -135,19 +134,19 @@ div.ws-menu-page > h2:after
135
136
background : url('<?php echo $i; ?>/s2___end.png') no-repeat right bottom;
137
}
138
- div.ws-menu-page > :not(.fade) code
139
{
140
border-radius : 3px;
141
padding : 1px 5px 1px 5px;
142
background : rgba(255, 255, 255, 0.25);
143
font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
144
}
145
- div.ws-menu-page > :not(.fade) pre.code
146
{
147
padding : 0;
148
background : none;
149
}
150
- div.ws-menu-page > :not(.fade) pre.code > code
151
{
152
font-size : 90%;
153
color : #EEEEEE;
@@ -160,8 +159,8 @@ div.ws-menu-page > :not(.fade) pre.code > code
160
display : block;
161
box-shadow : 0 0 5px 1px #000000 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
162
}
163
- div.ws-menu-page > :not(.fade) code.highlight-php,
164
- div.ws-menu-page > :not(.fade) code.highlight-shortcodes
165
{
166
font-size : 90%;
167
color : #000000;
@@ -176,11 +175,11 @@ div.ws-menu-page > :not(.fade) code.highlight-shortcodes
176
display : block;
177
box-shadow : 0 0 5px 1px rgba(0, 0, 0, 0.38) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
178
}
179
- div.ws-menu-page > :not(.fade) img
180
{
181
border : 0;
182
}
183
- div.ws-menu-page > :not(.fade) img.ws-menu-page-bordered
184
{
185
border-radius : 4px;
186
padding : 10px;
@@ -188,50 +187,50 @@ div.ws-menu-page > :not(.fade) img.ws-menu-page-bordered
188
border : 1px solid #AFAFAF;
189
box-shadow : 0 0 2px 1px #D8D8D8 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
190
}
191
- div.ws-menu-page > :not(.fade) .ws-menu-page-right
192
{
193
margin-left : 25px;
194
float : right;
195
}
196
- div.ws-menu-page > :not(.fade) .ws-menu-page-left
197
{
198
margin-right : 25px;
199
float : left;
200
}
201
- div.ws-menu-page > :not(.fade) .ws-menu-page-center
202
{
203
margin-left : auto;
204
margin-right : auto;
205
display : block;
206
}
207
- div.ws-menu-page > :not(.fade) ul.ws-menu-page-li-margins > li,
208
- div.ws-menu-page > :not(.fade) ol.ws-menu-page-li-margins > li
209
{
210
margin-top : 8px;
211
margin-bottom : 8px;
212
}
213
- div.ws-menu-page > :not(.fade) ul.ws-menu-page-li-margins > li:first-child,
214
- div.ws-menu-page > :not(.fade) ol.ws-menu-page-li-margins > li:first-child
215
{
216
margin-top : 0;
217
}
218
- div.ws-menu-page > :not(.fade) ul.ws-menu-page-li-margins > li:last-child,
219
- div.ws-menu-page > :not(.fade) ol.ws-menu-page-li-margins > li:last-child
220
{
221
margin-bottom : 0;
222
}
223
- div.ws-menu-page > :not(.fade) div.ws-menu-page-hr
224
{
225
height : 1px;
226
line-height : 1px;
227
- background : #DDDDDD;
228
margin : 10px 0 10px 0;
229
}
230
- div.ws-menu-page > :not(.fade) .ws-menu-page-error
231
{
232
color : #962722;
233
}
234
- div.ws-menu-page > :not(.fade) .ws-menu-page-hilite
235
{
236
font-size : 102%;
237
background : #DFF0DF;
@@ -239,7 +238,7 @@ div.ws-menu-page > :not(.fade) .ws-menu-page-hilite
239
border-radius : 3px;
240
padding : 0 0.2em;
241
}
242
- div.ws-menu-page > :not(.fade) .ws-menu-page-bright-hilite
243
{
244
font-size : 102%;
245
background : #EBF084;
@@ -247,7 +246,7 @@ div.ws-menu-page > :not(.fade) .ws-menu-page-bright-hilite
247
border-radius : 3px;
248
padding : 0 0.2em;
249
}
250
- div.ws-menu-page > :not(.fade) .ws-menu-page-warning-hilite
251
{
252
color : #FFFFFF;
253
background : #AC3204;
@@ -255,7 +254,7 @@ div.ws-menu-page > :not(.fade) .ws-menu-page-warning-hilite
255
border-radius : 3px;
256
padding : 0 0.2em;
257
}
258
- div.ws-menu-page > :not(.fade) .ws-menu-page-error-hilite
259
{
260
color : #FFFFFF;
261
background : #962722;
@@ -263,18 +262,18 @@ div.ws-menu-page > :not(.fade) .ws-menu-page-error-hilite
263
border-radius : 3px;
264
padding : 0 0.2em;
265
}
266
- div.ws-menu-page > :not(.fade) img.ws-menu-page-img-16
267
{
268
border : 0;
269
width : 16px;
270
height : 16px;
271
}
272
- div.ws-menu-page > :not(.fade) .form-table td
273
{
274
font-size : inherit;
275
line-height : inherit;
276
}
277
- div.ws-menu-page > :not(.fade) label
278
{
279
text-shadow : none;
280
@@ -282,12 +281,12 @@ div.ws-menu-page > :not(.fade) label
282
-moz-user-select : none;
283
user-select : none;
284
}
285
- div.ws-menu-page > :not(.fade) select,
286
- div.ws-menu-page > :not(.fade) select:focus,
287
- div.ws-menu-page > :not(.fade) textarea,
288
- div.ws-menu-page > :not(.fade) textarea:focus,
289
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
290
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
291
{
292
margin : 0;
293
width : 100%;
@@ -299,78 +298,78 @@ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):no
299
300
box-sizing : border-box;
301
}
302
- div.ws-menu-page > :not(.fade) textarea,
303
- div.ws-menu-page > :not(.fade) textarea:focus,
304
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
305
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
306
{
307
font-size : 1em; /* Font size again, for CodeMirror too. */
308
font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
309
}
310
- div.ws-menu-page > :not(.fade) textarea,
311
- div.ws-menu-page > :not(.fade) textarea:focus
312
{
313
height : auto; /* Textareas auto. */
314
white-space : pre; /* Preserve whitespace. */
315
}
316
- div.ws-menu-page > :not(.fade) select,
317
- div.ws-menu-page > :not(.fade) select:focus,
318
- div.ws-menu-page > :not(.fade) textarea,
319
- div.ws-menu-page > :not(.fade) textarea:focus,
320
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
321
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
322
{
323
border : 0;
324
padding : 5px;
325
border-radius : 4px;
326
box-shadow : 0 0 1px 1px rgba(37, 47, 26, 0.75) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
327
}
328
- div.ws-menu-page > :not(.fade) select,
329
- div.ws-menu-page > :not(.fade) textarea,
330
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox'])
331
{
332
color : #F7F7F7;
333
background : #73834B;
334
}
335
- div.ws-menu-page > :not(.fade) select:focus,
336
- div.ws-menu-page > :not(.fade) textarea:focus,
337
- div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
338
{
339
background : #637041;
340
}
341
- div.ws-menu-page > :not(.fade) input::-webkit-input-placeholder
342
{
343
padding-top : .1em;
344
font-style : italic;
345
color : rgba(255, 255, 255, 0.2);
346
}
347
- div.ws-menu-page > :not(.fade) input::-moz-placeholder
348
{
349
padding-top : .1em;
350
font-style : italic;
351
color : rgba(255, 255, 255, 0.2);
352
}
353
- div.ws-menu-page > :not(.fade) input:-moz-placeholder
354
{
355
padding-top : .1em;
356
font-style : italic;
357
color : rgba(255, 255, 255, 0.2);
358
}
359
- div.ws-menu-page > :not(.fade) input:-ms-input-placeholder
360
{
361
padding-top : .1em;
362
font-style : italic;
363
color : rgba(255, 255, 255, 0.2);
364
}
365
- div.ws-menu-page > :not(.fade) input[disabled],
366
- div.ws-menu-page > :not(.fade) select[disabled],
367
- div.ws-menu-page > :not(.fade) textarea[disabled]
368
{
369
opacity : 0.5;
370
}
371
- div.ws-menu-page > :not(.fade) button,
372
- div.ws-menu-page > :not(.fade) input[type='button'],
373
- div.ws-menu-page > :not(.fade) input[type='submit']
374
{
375
line-height : 1em;
376
font-size : 120%;
@@ -392,88 +391,88 @@ div.ws-menu-page > :not(.fade) input[type='submit']
392
-moz-user-select : none;
393
user-select : none;
394
}
395
- div.ws-menu-page > :not(.fade) button:hover,
396
- div.ws-menu-page > :not(.fade) input[type='button']:hover,
397
- div.ws-menu-page > :not(.fade) input[type='submit']:hover
398
{
399
background : #0D1F2F;
400
}
401
- div.ws-menu-page > :not(.fade) button:active,
402
- div.ws-menu-page > :not(.fade) input[type='button']:active,
403
- div.ws-menu-page > :not(.fade) input[type='submit']:active
404
{
405
-webkit-transform : scale(0.98, 0.98);
406
transform : scale(0.98, 0.98);
407
}
408
- div.ws-menu-page > :not(.fade) button[type='submit'],
409
- div.ws-menu-page > :not(.fade) input[type='submit']
410
{
411
font-size : 150%;
412
font-weight : 600;
413
background : #5F7523;
414
}
415
- div.ws-menu-page > :not(.fade) button[type='submit']:hover,
416
- div.ws-menu-page > :not(.fade) input[type='submit']:hover
417
{
418
background : #4C6324;
419
}
420
- div.ws-menu-page > :not(.fade) p.submit button[type='submit'],
421
- div.ws-menu-page > :not(.fade) p.submit input[type='submit']
422
{
423
width : 100%;
424
}
425
- div.ws-menu-page > :not(.fade) input[type='file']
426
{
427
width : auto !important;
428
}
429
- div.ws-menu-page > :not(.fade) .pro-preview
430
{
431
opacity : 0.5;
432
}
433
- div.ws-menu-page > :not(.fade) .info,
434
- div.ws-menu-page > :not(.fade) .notice,
435
- div.ws-menu-page > :not(.fade) .warning,
436
- div.ws-menu-page > :not(.fade) .error:not(.fade)
437
{
438
border-radius : 5px;
439
padding : 10px;
440
margin : 0 0 25px 0;
441
}
442
- div.ws-menu-page > :not(.fade) .info
443
{
444
background : #C9E0FA;
445
border : 1px solid #35558A;
446
}
447
- div.ws-menu-page > :not(.fade) .notice
448
{
449
background : #FFFBCC;
450
border : 1px solid #E6DB55;
451
}
452
- div.ws-menu-page > :not(.fade) .warning
453
{
454
background : #FADDAB;
455
border : 1px solid #D29A04;
456
}
457
- div.ws-menu-page > :not(.fade) .error:not(.fade)
458
{
459
background : #FABBC6;
460
border : 1px solid #711E1E;
461
}
462
- div.ws-menu-page > :not(.fade) .monospace
463
{
464
font-family : 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
465
}
466
- div.ws-menu-page > :not(.fade) textarea.monospace
467
{
468
white-space : pre;
469
}
470
- div.ws-menu-page > :not(.fade) .clearfix:before,
471
- div.ws-menu-page > :not(.fade) .clearfix:after
472
{
473
display : table;
474
content : ' ';
475
}
476
- div.ws-menu-page > :not(.fade) .clearfix:after
477
{
478
clear : both;
479
}
41
background : linear-gradient(to bottom, rgba(241, 241, 241, 1) 0%, rgba(241, 241, 241, 0.8) 20%, rgba(241, 241, 241, 0) 100%);
42
}
43
/*
44
+ Common layout styles.
45
*/
46
div.ws-menu-page
47
{
49
min-width : 800px;
50
margin : 25px 25px 25px 5px;
51
}
52
+ div.ws-menu-page > .notice,
53
+ div.ws-menu-page > .updated,
54
+ div.ws-menu-page > .error
55
+ {
56
+ margin : 25px 25px 25px 5px;
57
+ }
58
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) p,
59
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) code
60
{
61
font-size : inherit;
62
}
63
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) a
64
{
65
color : #336695;
66
}
67
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) a:hover,
68
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) a:active
69
{
70
color : #027E02;
71
}
72
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) p:first-child,
73
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) pre:first-child
74
{
75
margin-top : 0;
76
}
77
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) p:last-child,
78
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) pre:last-child
79
{
80
margin-bottom : 0;
81
}
82
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) h3 + p
83
{
84
margin-top : 0;
85
}
86
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) a.ws-dotted-link
87
{
88
text-decoration : none;
89
border-bottom : 1px dotted;
134
135
background : url('<?php echo $i; ?>/s2___end.png') no-repeat right bottom;
136
}
137
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) code
138
{
139
border-radius : 3px;
140
padding : 1px 5px 1px 5px;
141
background : rgba(255, 255, 255, 0.25);
142
font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
143
}
144
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) pre.code
145
{
146
padding : 0;
147
background : none;
148
}
149
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) pre.code > code
150
{
151
font-size : 90%;
152
color : #EEEEEE;
159
display : block;
160
box-shadow : 0 0 5px 1px #000000 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
161
}
162
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) code.highlight-php,
163
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) code.highlight-shortcodes
164
{
165
font-size : 90%;
166
color : #000000;
175
display : block;
176
box-shadow : 0 0 5px 1px rgba(0, 0, 0, 0.38) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
177
}
178
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) img
179
{
180
border : 0;
181
}
182
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) img.ws-menu-page-bordered
183
{
184
border-radius : 4px;
185
padding : 10px;
187
border : 1px solid #AFAFAF;
188
box-shadow : 0 0 2px 1px #D8D8D8 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
189
}
190
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-right
191
{
192
margin-left : 25px;
193
float : right;
194
}
195
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-left
196
{
197
margin-right : 25px;
198
float : left;
199
}
200
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-center
201
{
202
margin-left : auto;
203
margin-right : auto;
204
display : block;
205
}
206
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) ul.ws-menu-page-li-margins > li,
207
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) ol.ws-menu-page-li-margins > li
208
{
209
margin-top : 8px;
210
margin-bottom : 8px;
211
}
212
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) ul.ws-menu-page-li-margins > li:first-child,
213
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) ol.ws-menu-page-li-margins > li:first-child
214
{
215
margin-top : 0;
216
}
217
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) ul.ws-menu-page-li-margins > li:last-child,
218
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) ol.ws-menu-page-li-margins > li:last-child
219
{
220
margin-bottom : 0;
221
}
222
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) div.ws-menu-page-hr
223
{
224
height : 1px;
225
line-height : 1px;
226
+ background : #bdca9a;
227
margin : 10px 0 10px 0;
228
}
229
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-error
230
{
231
color : #962722;
232
}
233
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-hilite
234
{
235
font-size : 102%;
236
background : #DFF0DF;
238
border-radius : 3px;
239
padding : 0 0.2em;
240
}
241
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-bright-hilite
242
{
243
font-size : 102%;
244
background : #EBF084;
246
border-radius : 3px;
247
padding : 0 0.2em;
248
}
249
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-warning-hilite
250
{
251
color : #FFFFFF;
252
background : #AC3204;
254
border-radius : 3px;
255
padding : 0 0.2em;
256
}
257
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .ws-menu-page-error-hilite
258
{
259
color : #FFFFFF;
260
background : #962722;
262
border-radius : 3px;
263
padding : 0 0.2em;
264
}
265
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) img.ws-menu-page-img-16
266
{
267
border : 0;
268
width : 16px;
269
height : 16px;
270
}
271
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .form-table td
272
{
273
font-size : inherit;
274
line-height : inherit;
275
}
276
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) label
277
{
278
text-shadow : none;
279
281
-moz-user-select : none;
282
user-select : none;
283
}
284
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) select,
285
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) select:focus,
286
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea,
287
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea:focus,
288
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
289
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
290
{
291
margin : 0;
292
width : 100%;
298
299
box-sizing : border-box;
300
}
301
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea,
302
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea:focus,
303
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
304
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
305
{
306
font-size : 1em; /* Font size again, for CodeMirror too. */
307
font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
308
}
309
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea,
310
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea:focus
311
{
312
height : auto; /* Textareas auto. */
313
white-space : pre; /* Preserve whitespace. */
314
}
315
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) select,
316
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) select:focus,
317
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea,
318
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea:focus,
319
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
320
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
321
{
322
border : 0;
323
padding : 5px;
324
border-radius : 4px;
325
box-shadow : 0 0 1px 1px rgba(37, 47, 26, 0.75) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
326
}
327
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) select,
328
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea,
329
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox'])
330
{
331
color : #F7F7F7;
332
background : #73834B;
333
}
334
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) select:focus,
335
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea:focus,
336
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
337
{
338
background : #637041;
339
}
340
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input::-webkit-input-placeholder
341
{
342
padding-top : .1em;
343
font-style : italic;
344
color : rgba(255, 255, 255, 0.2);
345
}
346
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input::-moz-placeholder
347
{
348
padding-top : .1em;
349
font-style : italic;
350
color : rgba(255, 255, 255, 0.2);
351
}
352
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:-moz-placeholder
353
{
354
padding-top : .1em;
355
font-style : italic;
356
color : rgba(255, 255, 255, 0.2);
357
}
358
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input:-ms-input-placeholder
359
{
360
padding-top : .1em;
361
font-style : italic;
362
color : rgba(255, 255, 255, 0.2);
363
}
364
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[disabled],
365
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) select[disabled],
366
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea[disabled]
367
{
368
opacity : 0.5;
369
}
370
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) button,
371
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='button'],
372
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='submit']
373
{
374
line-height : 1em;
375
font-size : 120%;
391
-moz-user-select : none;
392
user-select : none;
393
}
394
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) button:hover,
395
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='button']:hover,
396
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='submit']:hover
397
{
398
background : #0D1F2F;
399
}
400
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) button:active,
401
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='button']:active,
402
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='submit']:active
403
{
404
-webkit-transform : scale(0.98, 0.98);
405
transform : scale(0.98, 0.98);
406
}
407
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) button[type='submit'],
408
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='submit']
409
{
410
font-size : 150%;
411
font-weight : 600;
412
background : #5F7523;
413
}
414
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) button[type='submit']:hover,
415
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='submit']:hover
416
{
417
background : #4C6324;
418
}
419
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) p.submit button[type='submit'],
420
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) p.submit input[type='submit']
421
{
422
width : 100%;
423
}
424
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) input[type='file']
425
{
426
width : auto !important;
427
}
428
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .pro-preview
429
{
430
opacity : 0.5;
431
}
432
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .info,
433
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .notice,
434
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .warning,
435
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .error:not(.notice):not(.updated):not(.error)
436
{
437
border-radius : 5px;
438
padding : 10px;
439
margin : 0 0 25px 0;
440
}
441
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .info
442
{
443
background : #C9E0FA;
444
border : 1px solid #35558A;
445
}
446
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .notice
447
{
448
background : #FFFBCC;
449
border : 1px solid #E6DB55;
450
}
451
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .warning
452
{
453
background : #FADDAB;
454
border : 1px solid #D29A04;
455
}
456
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .error
457
{
458
background : #FABBC6;
459
border : 1px solid #711E1E;
460
}
461
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .monospace
462
{
463
font-family : 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
464
}
465
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) textarea.monospace
466
{
467
white-space : pre;
468
}
469
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .clearfix:before,
470
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .clearfix:after
471
{
472
display : table;
473
content : ' ';
474
}
475
+ div.ws-menu-page > :not(.notice):not(.updated):not(.error) .clearfix:after
476
{
477
clear : both;
478
}
src/includes/menu-pages/menu-pages.js CHANGED
@@ -118,7 +118,7 @@ jQuery(document).ready( // DOM ready handler.
118
src = (!src) ? $.trim($('img', html).attr('src')) : src;
119
120
$inp.val(src),
121
- $inp.css({'background-color': '#FFFFCC'}),
122
setTimeout(function()
123
{
124
$inp.css({'background-color': oBg});
@@ -132,7 +132,7 @@ jQuery(document).ready( // DOM ready handler.
132
src = (!src) ? $.trim($('img', html).attr('src')) : src;
133
134
$txt.val($.trim($txt.val()) + '\n' + src),
135
- $txt.css({'background-color': '#FFFFCC'}),
136
setTimeout(function()
137
{
138
$txt.css({'background-color': oBg});
@@ -168,4 +168,4 @@ jQuery(document).ready( // DOM ready handler.
168
}
169
return true;
170
});
171
- });
118
src = (!src) ? $.trim($('img', html).attr('src')) : src;
119
120
$inp.val(src),
121
+ $inp.css({'background-color': '#485230'}),
122
setTimeout(function()
123
{
124
$inp.css({'background-color': oBg});
132
src = (!src) ? $.trim($('img', html).attr('src')) : src;
133
134
$txt.val($.trim($txt.val()) + '\n' + src),
135
+ $txt.css({'background-color': '#485230'}),
136
setTimeout(function()
137
{
138
$txt.css({'background-color': oBg});
168
}
169
return true;
170
});
171
+ });
src/includes/menu-pages/menu-pages.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){e(window).resize(window.tb_position=function(){var f=(e(window).width()>720)?720:e(window).width(),i=e(window).height(),g=(e("body.admin-bar").length)?28:0;e("#TB_window").css({width:f-50+"px",height:i-45-g+"px",top:25+g+"px","margin-top":0,"margin-left":"-"+parseInt(((f-50)/2),10)+"px"});e("#TB_ajaxContent").css({width:f-50+"px",height:i-75-g+"px",margin:0,padding:0})});var b=e("table.ws-menu-page-table td.ws-menu-page-table-r"),a=e("> .toggler",b),d=e("> .wrapper",b);var c=e("div.ws-menu-page-group");c.each(function(g){var i=e(this),h=i,j=e.trim(h.attr("title")),f=e('<div class="ws-menu-page-group-header">'+j+"</div>");f.css({"z-index":1}),f.insertBefore(h),f.click(function(){var l=e(this),k=l.next();if(l.hasClass("open")){l.add(k).removeClass("open")}else{l.add(k).addClass("open")}return false});if(c.length>1&&g===0){e('<div class="ws-menu-page-groups-hide"><i class="fa fa-chevron-up"></i></div>').insertBefore("div.ws-menu-page-toolbox").click(function(){e("div.ws-menu-page-group-header").each(function(){var l=e(this),k=l.next();l.add(k).removeClass("open")});return false});e('<div class="ws-menu-page-groups-show"><i class="fa fa-chevron-down"></i></div>').insertBefore("div.ws-menu-page-toolbox").click(function(){e("div.ws-menu-page-group-header").each(function(){var l=e(this),k=l.next();l.add(k).addClass("open")});return false})}if(h.attr("default-state")==="open"){f.trigger("click")}});a.click(function(){if(b.hasClass("open")){d.hide(),b.removeClass("open")}else{d.show(),b.addClass("open")}});if(a.attr("default-state")==="open"){a.click()}e("div.ws-menu-page-r-group-header").click(function(){var g=e(this),f=g.next();if(g.hasClass("open")){g.add(f).removeClass("open")}else{g.add(f).addClass("open")}return false});e("div.ws-menu-page-group-header:first, div.ws-menu-page-r-group-header:first").css({"margin-top":"0"});e("div.ws-menu-page-group-header:last, div.ws-menu-page-r-group-header:last, div.ws-menu-page-group:last").css({"margin-bottom":"0"});e("input.ws-menu-page-media-btn").filter(function(){return(e(this).attr("rel"))?true:false}).click(function(){var f=e(this);window.send_to_editor=function(j){var k,i,g=e.trim(f.attr("rel")),h,l;if(g&&(k=e("input#"+g)).length>0){h=k.css("background-color"),l=e.trim(e(j).attr("src"));l=(!l)?e.trim(e("img",j).attr("src")):l;k.val(l),k.css({"background-color":"#FFFFCC"}),setTimeout(function(){k.css({"background-color":h})},2000);tb_remove()}else{if(g&&(i=e("textarea#"+g)).length>0){h=i.css("background-color"),l=e.trim(e(j).attr("src"));l=(!l)?e.trim(e("img",j).attr("src")):l;i.val(e.trim(i.val())+"\n"+l),i.css({"background-color":"#FFFFCC"}),setTimeout(function(){i.css({"background-color":h})},2000);tb_remove()}}};tb_show("","./media-upload.php?type=image&TB_iframe=true");return false});e("form#ws-updates-form").submit(function(){var f="";if(!e.trim(e("input#ws-updates-fname").val())){f+="First Name missing, please try again.\n\n"}if(!e.trim(e("input#ws-updates-lname").val())){f+="Last Name missing, please try again.\n\n"}if(!e.trim(e("input#ws-updates-email").val())){f+="Email missing, please try again.\n\n"}else{if(!e("input#ws-updates-email").val().match(/^([a-z_~0-9\+\-]+)(((\.?)([a-z_~0-9\+\-]+))*)(@)([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})#x2F;i)){f+="Invalid email address, please try again.\n\n"}}if(f=e.trim(f)){alert("— Oops, you missed something: —\n\n"+f);return false}return true})});
1
+ jQuery(document).ready(function(e){e(window).resize(window.tb_position=function(){var a=e(window).width()>720?720:e(window).width(),t=e(window).height(),n=e("body.admin-bar").length?28:0;e("#TB_window").css({width:a-50+"px",height:t-45-n+"px",top:25+n+"px","margin-top":0,"margin-left":"-"+parseInt((a-50)/2,10)+"px"}),e("#TB_ajaxContent").css({width:a-50+"px",height:t-75-n+"px",margin:0,padding:0})});var a=e("table.ws-menu-page-table td.ws-menu-page-table-r"),t=e("> .toggler",a),n=e("> .wrapper",a),s=e("div.ws-menu-page-group");s.each(function(a){var t=e(this),n=t,i=e.trim(n.attr("title")),r=e('<div class="ws-menu-page-group-header">'+i+"</div>");r.css({"z-index":1}),r.insertBefore(n),r.click(function(){var a=e(this),t=a.next();return a.hasClass("open")?a.add(t).removeClass("open"):a.add(t).addClass("open"),!1}),s.length>1&&0===a&&(e('<div class="ws-menu-page-groups-hide"><i class="fa fa-chevron-up"></i></div>').insertBefore("div.ws-menu-page-toolbox").click(function(){return e("div.ws-menu-page-group-header").each(function(){var a=e(this),t=a.next();a.add(t).removeClass("open")}),!1}),e('<div class="ws-menu-page-groups-show"><i class="fa fa-chevron-down"></i></div>').insertBefore("div.ws-menu-page-toolbox").click(function(){return e("div.ws-menu-page-group-header").each(function(){var a=e(this),t=a.next();a.add(t).addClass("open")}),!1})),"open"===n.attr("default-state")&&r.trigger("click")}),t.click(function(){a.hasClass("open")?(n.hide(),a.removeClass("open")):(n.show(),a.addClass("open"))}),"open"===t.attr("default-state")&&t.click(),e("div.ws-menu-page-r-group-header").click(function(){var a=e(this),t=a.next();return a.hasClass("open")?a.add(t).removeClass("open"):a.add(t).addClass("open"),!1}),e("div.ws-menu-page-group-header:first, div.ws-menu-page-r-group-header:first").css({"margin-top":"0"}),e("div.ws-menu-page-group-header:last, div.ws-menu-page-r-group-header:last, div.ws-menu-page-group:last").css({"margin-bottom":"0"}),e("input.ws-menu-page-media-btn").filter(function(){return!!e(this).attr("rel")}).click(function(){var a=e(this);return window.send_to_editor=function(t){var n,s,i,r,o=e.trim(a.attr("rel"));o&&(n=e("input#"+o)).length>0?(i=n.css("background-color"),r=e.trim(e(t).attr("src")),r=r?r:e.trim(e("img",t).attr("src")),n.val(r),n.css({"background-color":"#485230"}),setTimeout(function(){n.css({"background-color":i})},2e3),tb_remove()):o&&(s=e("textarea#"+o)).length>0&&(i=s.css("background-color"),r=e.trim(e(t).attr("src")),r=r?r:e.trim(e("img",t).attr("src")),s.val(e.trim(s.val())+"\n"+r),s.css({"background-color":"#485230"}),setTimeout(function(){s.css({"background-color":i})},2e3),tb_remove())},tb_show("","./media-upload.php?type=image&TB_iframe=true"),!1}),e("form#ws-updates-form").submit(function(){var a="";return e.trim(e("input#ws-updates-fname").val())||(a+="First Name missing, please try again.\n\n"),e.trim(e("input#ws-updates-lname").val())||(a+="Last Name missing, please try again.\n\n"),e.trim(e("input#ws-updates-email").val())?e("input#ws-updates-email").val().match(/^([a-z_~0-9\+\-]+)(((\.?)([a-z_~0-9\+\-]+))*)(@)([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})#x2F;i)||(a+="Invalid email address, please try again.\n\n"):a+="Email missing, please try again.\n\n",!(a=e.trim(a))||(alert("— Oops, you missed something: —\n\n"+a),!1)})});
src/includes/menu-pages/mms-ops.inc.php CHANGED
@@ -35,6 +35,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_mms_ops"))
35
return; // Stop here.
36
}
37
echo '<div class="wrap ws-menu-page">'."\n";
38
39
echo '<div class="ws-menu-page-toolbox">'."\n";
40
c_ws_plugin__s2member_menu_pages_tb::display ();
35
return; // Stop here.
36
}
37
echo '<div class="wrap ws-menu-page">'."\n";
38
+
39
+ echo '<div class="wp-header-end"></div>'."\n";
40
41
echo '<div class="ws-menu-page-toolbox">'."\n";
42
c_ws_plugin__s2member_menu_pages_tb::display ();
src/includes/menu-pages/paypal-buttons.inc.php CHANGED
@@ -32,6 +32,8 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
32
{
33
echo '<div class="wrap ws-menu-page">' . "\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display ();
37
echo '</div>'."\n";
32
{
33
echo '<div class="wrap ws-menu-page">' . "\n";
34
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
+
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display ();
39
echo '</div>'."\n";
src/includes/menu-pages/paypal-ops.inc.php CHANGED
@@ -30,7 +30,9 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_paypal_ops"))
30
{
31
public function __construct()
32
{
33
- echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
30
{
31
public function __construct()
32
{
33
+ echo '<div class="wrap ws-menu-page">'."\n";
34
+
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
src/includes/menu-pages/res-ops.inc.php CHANGED
@@ -32,6 +32,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_res_ops"))
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
37
echo '</div>'."\n";
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
+
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
39
echo '</div>'."\n";
src/includes/menu-pages/scripting.inc.php CHANGED
@@ -32,9 +32,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
32
{
33
public function __construct ()
34
{
35
- echo '<div class="wrap ws-menu-page">' . "\n";
36
37
- echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display ();
39
echo '</div>'."\n";
40
32
{
33
public function __construct ()
34
{
35
+ echo '<div class="wrap ws-menu-page">' . "\n";
36
37
+ echo '<div class="wp-header-end"></div>'."\n";
38
+
39
+ echo '<div class="ws-menu-page-toolbox">'."\n";
40
c_ws_plugin__s2member_menu_pages_tb::display ();
41
echo '</div>'."\n";
42
src/includes/menu-pages/start.inc.php CHANGED
@@ -32,6 +32,8 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_start"))
32
{
33
echo '<div class="wrap ws-menu-page">' . "\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display ();
37
echo '</div>'."\n";
32
{
33
echo '<div class="wrap ws-menu-page">' . "\n";
34
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
+
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display ();
39
echo '</div>'."\n";
src/includes/menu-pages/trk-ops.inc.php CHANGED
@@ -32,6 +32,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_trk_ops"))
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
echo '<div class="ws-menu-page-toolbox">'."\n";
36
c_ws_plugin__s2member_menu_pages_tb::display();
37
echo '</div>'."\n";
32
{
33
echo '<div class="wrap ws-menu-page">'."\n";
34
35
+ echo '<div class="wp-header-end"></div>'."\n";
36
+
37
echo '<div class="ws-menu-page-toolbox">'."\n";
38
c_ws_plugin__s2member_menu_pages_tb::display();
39
echo '</div>'."\n";
src/includes/syscon.inc.php CHANGED
@@ -136,6 +136,11 @@ if(!function_exists('ws_plugin__s2member_configure_options_and_their_defaults'))
136
137
$default_options['sec_encryption_key'] = '';
138
$default_options['sec_encryption_key_history'] = array();
139
$default_options['s_badge_status_enabled'] = '0';
140
141
$default_options['max_ip_restriction'] = '5';
@@ -393,6 +398,15 @@ if(!function_exists('ws_plugin__s2member_configure_options_and_their_defaults'))
393
else if($key === 'sec_encryption_key_history' && (!is_array($value) || empty($value)))
394
$value = $default_options[$key];
395
396
else if($key === 's_badge_status_enabled' && (!is_string($value) || !is_numeric($value)))
397
$value = $default_options[$key];
398
@@ -604,11 +618,14 @@ if(!function_exists('ws_plugin__s2member_configure_options_and_their_defaults'))
604
else if($key === 'wp_footer_code' && (!is_string($value) || !strlen($value)))
605
$value = $default_options[$key];
606
}
607
- if($options !== FALSE && is_string($options['sec_encryption_key']) && strlen($options['sec_encryption_key']) && !in_array($options['sec_encryption_key'], $GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history']))
608
- {
609
array_unshift($GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history'], $options['sec_encryption_key']);
610
$GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history'] = array_slice($GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history'], 0, 10);
611
}
612
$GLOBALS['WS_PLUGIN__']['s2member']['o'] = apply_filters_ref_array('ws_plugin__s2member_options_before_checksum', array(&$GLOBALS['WS_PLUGIN__']['s2member']['o']));
613
614
$GLOBALS['WS_PLUGIN__']['s2member']['o']['options_checksum'] = md5($checksum_prefix.serialize(array_merge($GLOBALS['WS_PLUGIN__']['s2member']['o'], array('options_checksum' => 0))));
136
137
$default_options['sec_encryption_key'] = '';
138
$default_options['sec_encryption_key_history'] = array();
139
+
140
+ $default_options['def_combo_encryption_key'] = '';
141
+ $default_options['def_combo_encryption_key_history'] = array();
142
+ $default_options['def_custom_combo_encryption_keys'] = array();
143
+
144
$default_options['s_badge_status_enabled'] = '0';
145
146
$default_options['max_ip_restriction'] = '5';
398
else if($key === 'sec_encryption_key_history' && (!is_array($value) || empty($value)))
399
$value = $default_options[$key];
400
401
+ else if($key === 'def_combo_encryption_key' && (!is_string($value) || !strlen($value)))
402
+ $value = $default_options[$key];
403
+
404
+ else if($key === 'def_combo_encryption_key_history' && (!is_array($value) || empty($value)))
405
+ $value = $default_options[$key];
406
+
407
+ else if($key === 'def_custom_combo_encryption_keys' && (!is_array($value) || empty($value)))
408
+ $value = $default_options[$key];
409
+
410
else if($key === 's_badge_status_enabled' && (!is_string($value) || !is_numeric($value)))
411
$value = $default_options[$key];
412
618
else if($key === 'wp_footer_code' && (!is_string($value) || !strlen($value)))
619
$value = $default_options[$key];
620
}
621
+ if($options !== FALSE && is_string($options['sec_encryption_key']) && strlen($options['sec_encryption_key']) && !in_array($options['sec_encryption_key'], $GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history'])) {
622
array_unshift($GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history'], $options['sec_encryption_key']);
623
$GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history'] = array_slice($GLOBALS['WS_PLUGIN__']['s2member']['o']['sec_encryption_key_history'], 0, 10);
624
}
625
+ if($options !== FALSE && is_string($options['def_combo_encryption_key']) && strlen($options['def_combo_encryption_key']) && !in_array($options['def_combo_encryption_key'], $GLOBALS['WS_PLUGIN__']['s2member']['o']['def_combo_encryption_key_history'])) {
626
+ array_unshift($GLOBALS['WS_PLUGIN__']['s2member']['o']['def_combo_encryption_key_history'], $options['def_combo_encryption_key']);
627
+ $GLOBALS['WS_PLUGIN__']['s2member']['o']['def_combo_encryption_key_history'] = array_slice($GLOBALS['WS_PLUGIN__']['s2member']['o']['def_combo_encryption_key_history'], 0, 10);
628
+ }
629
$GLOBALS['WS_PLUGIN__']['s2member']['o'] = apply_filters_ref_array('ws_plugin__s2member_options_before_checksum', array(&$GLOBALS['WS_PLUGIN__']['s2member']['o']));
630
631
$GLOBALS['WS_PLUGIN__']['s2member']['o']['options_checksum'] = md5($checksum_prefix.serialize(array_merge($GLOBALS['WS_PLUGIN__']['s2member']['o'], array('options_checksum' => 0))));
src/includes/translations/s2member.pot CHANGED
@@ -2,9 +2,9 @@
2
# This file is distributed under the same license as the package.
3
msgid ""
4
msgstr ""
5
- "Project-Id-Version: 170221\n"
6
"Report-Msgid-Bugs-To: http://wordpress.org/tag/s2member\n"
7
- "POT-Creation-Date: 2017-02-21 00:41:55+00:00\n"
8
"MIME-Version: 1.0\n"
9
"Content-Type: text/plain; charset=UTF-8\n"
10
"Content-Transfer-Encoding: 8bit\n"
@@ -1975,7 +1975,7 @@ msgctxt "s2member-front"
1975
msgid "No Billing Method; please try again."
1976
msgstr ""
1977
1978
- #: pro/src/includes/syscon.inc.php:95 src/includes/syscon.inc.php:241
1979
msgctxt "s2member-front"
1980
msgid "Congratulations! (your membership has been approved)"
1981
msgstr ""
@@ -1997,7 +1997,7 @@ msgid ""
1997
"%s"
1998
msgstr ""
1999
2000
- #: pro/src/includes/syscon.inc.php:99 src/includes/syscon.inc.php:253
2001
msgctxt "s2member-front"
2002
msgid "Thank You! (instructions for access)"
2003
msgstr ""
@@ -3881,7 +3881,7 @@ msgid "as a Member"
3881
msgstr ""
3882
3883
#: src/includes/classes/email-configs.inc.php:254
3884
- #: src/includes/syscon.inc.php:215
3885
msgctxt "s2member-front"
3886
msgid ""
3887
"Your Username/Password for:\n"
@@ -4549,27 +4549,27 @@ msgctxt "s2member-front"
4549
msgid "If you need assistance, please <a href=\"%s\" target=\"_blank\">contact support</a>."
4550
msgstr ""
4551
4552
- #: src/includes/classes/sc-eots-in.inc.php:74
4553
msgctxt "s2member-front"
4554
msgid "Access Expires:"
4555
msgstr ""
4556
4557
- #: src/includes/classes/sc-eots-in.inc.php:75
4558
msgctxt "s2member-front"
4559
msgid "Access Expired:"
4560
msgstr ""
4561
4562
- #: src/includes/classes/sc-eots-in.inc.php:76
4563
msgctxt "s2member-front"
4564
msgid "Next Payment:"
4565
msgstr ""
4566
4567
- #: src/includes/classes/sc-eots-in.inc.php:77
4568
msgctxt "s2member-front"
4569
msgid "N/A"
4570
msgstr ""
4571
4572
- #: src/includes/classes/sc-eots-in.inc.php:77
4573
msgctxt "s2member-front"
4574
msgid "—"
4575
msgstr ""
@@ -4745,115 +4745,115 @@ msgid_plural "about %s years"
4745
msgstr[0] ""
4746
msgstr[1] ""
4747
4748
- #: src/includes/classes/utils-time.inc.php:277
4749
msgctxt "s2member-front"
4750
msgid "Daily"
4751
msgstr ""
4752
4753
- #: src/includes/classes/utils-time.inc.php:277
4754
msgctxt "s2member-front"
4755
msgid "Weekly"
4756
msgstr ""
4757
4758
- #: src/includes/classes/utils-time.inc.php:277
4759
msgctxt "s2member-front"
4760
msgid "Monthly"
4761
msgstr ""
4762
4763
- #: src/includes/classes/utils-time.inc.php:277
4764
msgctxt "s2member-front"
4765
msgid "Yearly"
4766
msgstr ""
4767
4768
- #: src/includes/classes/utils-time.inc.php:277
4769
- #: src/includes/classes/utils-time.inc.php:288
4770
msgctxt "s2member-front"
4771
msgid "Lifetime"
4772
msgstr ""
4773
4774
- #: src/includes/classes/utils-time.inc.php:281
4775
msgctxt "s2member-front"
4776
msgid "Bi-Weekly"
4777
msgstr ""
4778
4779
- #: src/includes/classes/utils-time.inc.php:282
4780
msgctxt "s2member-front"
4781