/**
  * s2Member's PayPal Auto-Return/PDT handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     $paypal["s2member_log"][] = "No Return-Data. Customer MUST wait for Email Confirmation.";
     $paypal["s2member_log"][] = "Note. This can sometimes happen when/if you are offering an Initial/Trial Period. There are times when a Payment Gateway will NOT supply s2Member with any data immediately after checkout. When/if this happens, s2Member must process the transaction via IPN only (i.e. behind-the-scene), and the Customer must wait for Email Confirmation in these cases.";
     $paypal["s2member_log"][] = var_export($_REQUEST, true);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     if ($custom_success_redirection) {
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL: " . $custom_success_redirection . ".";
         wp_redirect($custom_success_redirection);
     } else {
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after asking Customer to check their email).";
         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! (you MUST check your email before proceeding).</strong><br /><br />* Note: It can take <em>(up to 15 minutes)</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_no_tx_data", $paypal, get_defined_vars());
 }
 /**
  * s2Member's PayPal® Auto-Return/PDT handler ( inner processing routine ).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in ( extracted ) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     /* Extract all vars passed in from: ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``. */
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_before_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $paypal["s2member_log"][] = "Customer must wait for Email Confirmation `proxy_use`: ( `ty-email` ).";
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_during_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($custom_success_redirection) {
         /* Using a custom success redirection URL? */
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL on success: " . $custom_success_redirection . ". However, the Customer MUST wait for Email Confirmation `proxy_use`: ( `ty-email` ).";
     } else {
         /* Else we use the default redirection URL for this scenario, which is the Home Page. */
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page. Customer must wait for Email Confirmation `proxy_use`: ( `ty-email` ).";
     }
     /**/
     echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! ( you MUST check your email before proceeding ).</strong><br /><br />* Note: It can take <em>( up to 15 minutes )</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), $custom_success_redirection ? _x("Check Your Email ( Then Click Here )", "s2member-front", "s2member") : esc_html("Back To Home Page", "s2member"), $custom_success_redirection ? $custom_success_redirection : home_url("/"));
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_after_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_proxy_ty_email", $paypal, get_defined_vars());
 }
 /**
  * s2Member's PayPal Auto-Return/PDT handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars, EXTR_OVERWRITE | EXTR_REFS);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_before_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     $paypal["s2member_log"][] = "Customer MUST wait for Email Confirmation—`proxy_use`: ( `ty-email` ).";
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_during_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     if ($custom_success_redirection) {
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL on success: " . $custom_success_redirection . ".";
         wp_redirect($custom_success_redirection);
     } else {
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after asking Customer to check their email).";
         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! (you MUST check your email before proceeding).</strong><br /><br />* Note: It can take <em>(up to 15 minutes)</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>* Sandbox Mode *:</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_after_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_proxy_ty_email", $paypal, get_defined_vars());
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
         c_ws_plugin__s2member_pro_menu_pages::mms_ops_page_display();
         return;
         // Stop here.
     }
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>Multisite Config</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     if (is_multisite() && is_main_site()) {
         echo '<img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/large-icon.png" title="s2Member (a Membership management system for WordPress)" alt="" style="float:right; margin:25px 0 0 25px; border:0;" />' . "\n";
         if (file_exists($ws_plugin__s2member_temp = dirname(dirname(dirname(__FILE__))) . "/readme-ms.txt")) {
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             if (!function_exists("NC_Markdown")) {
                 include_once dirname(dirname(__FILE__)) . "/externals/markdown/nc-markdown.inc.php";
             }
             $ws_plugin__s2member_temp = file_get_contents($ws_plugin__s2member_temp);
             $ws_plugin__s2member_temp = preg_replace("/(\\=)( )(.+?)( )(\\=)/", "<h3>\$3</h3>", $ws_plugin__s2member_temp);
             $ws_plugin__s2member_temp = NC_Markdown($ws_plugin__s2member_temp);
             echo '<div style="max-width:1024px;">';
             echo preg_replace("/(\\<a)( href)/i", "\$1" . ' target="_blank" rel="nofollow external"' . "\$2", $ws_plugin__s2member_temp);
             echo '</div>';
         }
     } else {
         echo '<p style="margin-top:0;">Your WordPress installation does not have Multisite Networking enabled.<br />Which is perfectly OK :-) Multisite Networking is 100% completely optional.</p>' . "\n";
         echo '<img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/large-icon.png" title="s2Member (a Membership management system for WordPress)" alt="" style="float:right; margin:25px 0 0 25px; border:0;" />' . "\n";
         if (file_exists($ws_plugin__s2member_temp = dirname(dirname(dirname(__FILE__))) . "/readme-ms.txt")) {
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             if (!function_exists("NC_Markdown")) {
                 include_once dirname(dirname(__FILE__)) . "/externals/markdown/nc-markdown.inc.php";
             }
             $ws_plugin__s2member_temp = file_get_contents($ws_plugin__s2member_temp);
             $ws_plugin__s2member_temp = preg_replace("/(\\=)( )(.+?)( )(\\=)/", "<h3>\$3</h3>", $ws_plugin__s2member_temp);
             $ws_plugin__s2member_temp = NC_Markdown($ws_plugin__s2member_temp);
             echo '<div style="max-width:1024px;">';
             echo preg_replace("/(\\<a)( href)/i", "\$1" . ' target="_blank" rel="nofollow external"' . "\$2", $ws_plugin__s2member_temp);
             echo '</div>';
         }
     }
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
 /**
  * s2Member's PayPal® Auto-Return/PDT handler ( inner processing routine ).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in ( extracted ) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     /* Extract all vars passed in from: ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``. */
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $paypal["s2member_log"][] = "No Return-Data. Customer must wait for Email Confirmation.";
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($custom_success_redirection) {
         /* Using a custom success redirection URL? */
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL on success: " . $custom_success_redirection . ". However, the Customer MUST wait for Email Confirmation.";
     } else {
         /* Else we use the default redirection URL for this scenario, which is the Home Page. */
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page. Customer must wait for Email Confirmation.";
     }
     /**/
     $paypal["s2member_log"][] = "Note. This can sometimes happen when/if you are offering a free Trial Period. There are times when a Payment Gateway will NOT supply s2Member with any data immediately after checkout. When/if this happens, s2Member must process the transaction via IPN only ( i.e. behind-the-scene ), and the Customer must wait for Email Confirmation in these cases.";
     $paypal["s2member_log"][] = var_export($_REQUEST, true);
     /* Recording _POST + _GET vars for analysis and debugging. */
     /**/
     echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! ( you MUST check your email before proceeding ).</strong><br /><br />* Note: It can take <em>( up to 15 minutes )</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), $custom_success_redirection ? _x("Check Your Email ( Then Click Here )", "s2member-front", "s2member") : _x("Back To Home Page", "s2member-front", "s2member"), $custom_success_redirection ? $custom_success_redirection : home_url("/"));
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_no_tx_data", $paypal, get_defined_vars());
 }
 /**
  * String with all version details *( for PHP, WordPress®, s2Member, and Pro )*.
  *
  * @package s2Member\Utilities
  * @since 3.5
  *
  * @return str String with `PHP vX.XX :: WordPress® vX.XX :: s2Member® vX.XX :: s2Member® Pro vX.XX`.
  */
 public static function ver_details()
 {
     $details = "PHP v" . PHP_VERSION . " :: WordPress® v" . get_bloginfo("version") . " :: s2Member® v" . WS_PLUGIN__S2MEMBER_VERSION;
     $details .= c_ws_plugin__s2member_utils_conds::pro_is_installed() ? " :: s2Member® Pro v" . WS_PLUGIN__S2MEMBER_PRO_VERSION : "";
     /**/
     return $details;
     /* Return all details. */
 }
Ejemplo n.º 7
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>API / Tracking</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form" autocomplete="off">' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-options-save")) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n";
     do_action("ws_plugin__s2member_during_trk_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_signup_tracking", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_signup_tracking", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Signup Tracking Codes">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-tracking-section">' . "\n";
         echo '<h3>Signup Tracking Codes (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, after a "new", "paying" Member completes Signup through your Payment Gateway. This is marked `Signup`, because Signup Tracking Codes will be displayed each time a "new", "paying" Member signs up. Depending on your fee structure, this may include a payment that establishes their Subscription, or it may not.</p>' . "\n";
         echo '<p>Signup Tracking Codes will only be displayed once for each Member. Signup Tracking Codes are displayed right after a "new", "paying" Member signs up successfully through your Payment Gateway, regardless of whether any money has actually been transacted. In other words, Signup Tracking Codes are displayed anytime a "new", "paying" Member signs up; even if you provided them with something 100% free <em>(i.e., even if no money is being transacted)</em>.</p>' . "\n";
         echo '<p>s2Member will display your Signup Tracking Codes in one of four possible locations... <strong>1.</strong> If possible, on the Thank-You Return Page, after returning from your Payment Gateway. <strong>2.</strong> Otherwise, if possible, on the Registration Form; after returning from your Payment Gateway. <em>Note. If you offer a 100% free Trial Period, Tracking Codes will be displayed in location #2 when using PayPal Standard Button integration.</em> <strong>3.</strong> Otherwise, if possible, on the Login Form after Registration is completed. <strong>4.</strong> Otherwise, in the footer of your WordPress theme, as soon as possible <em>(immediately with s2Member Pro-Form integration)</em>; or after the Customer\'s very first login.</p>' . "\n";
         echo '<p>Signup Tracking Codes are displayed for all types of Membership Level Access. Including Recurring Subscriptions <em>(with or without a Free Trial Period)</em>, Non-Recurring Subscriptions <em>(with or without a Free Trial Period)</em>, Lifetime Subscriptions, and even Fixed-Term Subscriptions. All of these are supported by s2Member\'s Button/Form Generators.</p>' . "\n";
         echo '<p>Signup Tracking Codes will NOT be processed for Free Subscribers that register without going through your Payment Gateway at all (i.e., they simply register on-site; and there is no checkout whatsoever). Signup Tracking Codes will NOT be processed when an "existing" User/Member pays for a new Subscription <em>(see: Modification Tracking Codes for that scenario)</em>.' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' And, Signup Tracking Codes will NOT be processed on Buy Now transactions for Independent Custom Capabilities <em>(see: Capability Tracking Codes for that scenario)</em>.') . '</p>' . "\n";
         echo '<p><em><strong>AD BLOCKERS:</strong> If a web browser has ad blockers enabled (i.e., the web browser has an ad blocking extension or add-on), Tracking Codes from popular online advertising companies (including many affiliate networks) may NOT be shown. Ad blockers can prevent your Tracking Codes from being loaded in a customer\'s browser. If you\'d like to avoid this problem, consider integrating with s2Member\'s API Notifications instead of with Tracking Codes. API Notifications occur silently behind-the-scenes (more reliably), whereas Tracking Codes are loaded in a customer\'s browser. For more information, please see: <strong>s2Member ⥱ API / Notifications</strong>.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_signup_tracking", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-signup-tracking-codes">' . "\n";
         echo 'Integrate Signup Tracking Codes:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_signup_tracking_codes" id="ws-plugin--s2member-signup-tracking-codes" rows="8" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"]) . '</textarea><br />' . "\n";
         echo 'Any valid XHTML / JavaScript' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' (or even PHP)') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google Analytics code works just fine, AdSense performance tracking, as well as Yahoo tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. Payment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e., there is only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e., it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remains constant throughout any &amp; all future payments. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e., it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%initial%%</code> = The Initial Fee charged during signup. If you offered a 100% Free Trial Period, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent, whenever they initially signed up, no matter what. If a Customer signs up, under the terms of a 100% Free Trial Period, this will be 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. If you offer something 100% free, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) that the Subscription is for.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D (this means 1 Day)\\n%%initial_term%% = 1 W (this means 1 Week)\\n%%initial_term%% = 1 M (this means 1 Month)\\n%%initial_term%% = 1 Y (this means 1 Year)\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D (this means 1 Day)\\n%%regular_term%% = 1 W (this means 1 Week)\\n%%regular_term%% = 1 M (this means 1 Month)\\n%%regular_term%% = 1 Y (this means 1 Year)\\n%%regular_term%% = 1 L (this means 1 Lifetime)\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period (or duration) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro-Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Tip:</strong> With <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Add-on / Prices")) . '" target="_blank" rel="external">s2Member Pro-Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <strong>s2Member ⥱ Pro Coupon Codes ⥱ Affiliate Coupon Codes</strong>. This is a VERY powerful feature.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_signup_tracking", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_modification_tracking", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_modification_tracking", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Modification Tracking Codes">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-modification-tracking-section">' . "\n";
         echo '<h3>Modification Tracking Codes (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, each time a Subscription Modification occurs. This is marked `Modification`, because Modification Tracking Codes are displayed each time an "existing" User/Member <em>(even if they are/were a Free Subscriber)</em> signs up for a paid Subscription <em>(i.e., a Modification takes place against an existing account within WordPress)</em>, or an "existing" Member modifies their paid Subscription terms <em>(again, a Modification takes places against an existing account within WordPress)</em>. Depending on your fee structure, this may include a payment that establishes their Subscription, or it may not.</p>' . "\n";
         echo '<p>Modification Tracking Codes are displayed right after a Member signs up and/or modifies billing terms successfully through your Payment Gateway, regardless of whether any money has actually been transacted. In other words, Modification Tracking Codes are displayed even if you provided them with something for free <em>(i.e., even if no money is being transacted)</em>.</p>' . "\n";
         echo '<p>s2Member will display your Modification Tracking Codes in one of three possible locations... <strong>1.</strong> If possible, on the Thank-You Return Page, after returning from your Payment Gateway. <strong>2.</strong> Otherwise, if possible, on the Login Form after returning from your Payment Gateway <em>(i.e., when the Customer is asked to log back in)</em>. <strong>3.</strong> Otherwise, in the footer of your WordPress theme, as soon as possible <em>(immediately with s2Member Pro-Form integration)</em>; or after the Customer\'s next login.</p>' . "\n";
         echo '<p>Modification Tracking Codes are displayed for all types of Membership Level Access. Including Recurring Subscriptions <em>(with or without a Free Trial Period)</em>, Non-Recurring Subscriptions <em>(with or without a Free Trial Period)</em>, Lifetime Subscriptions, and even Fixed-Term Subscriptions. All of these are supported by s2Member\'s Button/Form Generators.</p>' . "\n";
         echo '<p>Modification Tracking Codes will NOT be processed when a "new" User/Member signs up <em>(see: Signup Tracking Codes for that scenario)</em>.' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' And, Modification Tracking Codes will NOT be processed on Buy Now transactions for Independent Custom Capabilities <em>(see: Capability Tracking Codes for that scenario)</em>.') . '</p>' . "\n";
         echo '<p><em><strong>AD BLOCKERS:</strong> If a web browser has ad blockers enabled (i.e., the web browser has an ad blocking extension or add-on), Tracking Codes from popular online advertising companies (including many affiliate networks) may NOT be shown. Ad blockers can prevent your Tracking Codes from being loaded in a customer\'s browser. If you\'d like to avoid this problem, consider integrating with s2Member\'s API Notifications instead of with Tracking Codes. API Notifications occur silently behind-the-scenes (more reliably), whereas Tracking Codes are loaded in a customer\'s browser. For more information, please see: <strong>s2Member ⥱ API / Notifications</strong>.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_modification_tracking", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-modification-tracking-codes">' . "\n";
         echo 'Integrate Modification Tracking Codes:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_modification_tracking_codes" id="ws-plugin--s2member-modification-tracking-codes" rows="8" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["modification_tracking_codes"]) . '</textarea><br />' . "\n";
         echo 'Any valid XHTML / JavaScript' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' (or even PHP)') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google Analytics code works just fine, AdSense performance tracking, as well as Yahoo tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. Payment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e., there is only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e., it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remains constant throughout any &amp; all future payments. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e., it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%initial%%</code> = The Initial Fee charged during signup. If you offered a 100% Free Trial Period, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent, whenever they initially signed up, no matter what. If a Customer signs up, under the terms of a 100% Free Trial Period, this will be 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. If you offer something 100% free, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) that the Subscription is for.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D (this means 1 Day)\\n%%initial_term%% = 1 W (this means 1 Week)\\n%%initial_term%% = 1 M (this means 1 Month)\\n%%initial_term%% = 1 Y (this means 1 Year)\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D (this means 1 Day)\\n%%regular_term%% = 1 W (this means 1 Week)\\n%%regular_term%% = 1 M (this means 1 Month)\\n%%regular_term%% = 1 Y (this means 1 Year)\\n%%regular_term%% = 1 L (this means 1 Lifetime)\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period (or duration) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro-Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member ⥱ General Options ⥱ Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Tip:</strong> With <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Add-on / Prices")) . '" target="_blank" rel="external">s2Member Pro-Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <strong>s2Member ⥱ Pro Coupon Codes ⥱ Affiliate Coupon Codes</strong>. This is a VERY powerful feature.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_modification_tracking", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_ccap_tracking", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_ccap_tracking", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Capability Tracking Codes">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-ccap-tracking-section">' . "\n";
         echo '<h3>Capability Tracking Codes (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, each time Independent Custom Capabilities are purchased. This is marked `Capability`, because Capability Tracking Codes are displayed each time an "existing" User/Member <em>(even if they are/were a Free Subscriber)</em> pays you for Independent Custom Capabilities through a Buy Now transaction. This is the only circumstance in which your Capability Tracking Codes will be displayed.</p>' . "\n";
         echo '<p>s2Member will display your Capability Tracking Codes in one of three possible locations... <strong>1.</strong> If possible, on the Thank-You Return Page, after returning from your Payment Gateway. <strong>2.</strong> Otherwise, if possible, on the Login Form after returning from your Payment Gateway <em>(i.e., when the Customer is asked to log back in)</em>. <strong>3.</strong> Otherwise, in the footer of your WordPress theme, as soon as possible <em>(immediately with s2Member Pro-Form integration)</em>; or after the Customer\'s next login.</p>' . "\n";
         echo '<p><em><strong>AD BLOCKERS:</strong> If a web browser has ad blockers enabled (i.e., the web browser has an ad blocking extension or add-on), Tracking Codes from popular online advertising companies (including many affiliate networks) may NOT be shown. Ad blockers can prevent your Tracking Codes from being loaded in a customer\'s browser. If you\'d like to avoid this problem, consider integrating with s2Member\'s API Notifications instead of with Tracking Codes. API Notifications occur silently behind-the-scenes (more reliably), whereas Tracking Codes are loaded in a customer\'s browser. For more information, please see: <strong>s2Member ⥱ API / Notifications</strong>.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_ccap_tracking", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-ccap-tracking-codes">' . "\n";
         echo 'Integrate Capability Tracking Codes:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_ccap_tracking_codes" id="ws-plugin--s2member-ccap-tracking-codes" rows="8" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ccap_tracking_codes"]) . '</textarea><br />' . "\n";
         echo 'Any valid XHTML / JavaScript' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' (or even PHP)') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google Analytics code works just fine, AdSense performance tracking, as well as Yahoo tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%txn_id%%</code> = The Payment Transaction ID, which is always unique for each payment received.</li>' . "\n";
         echo '<li><code>%%txn_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe. Each Stripe Customer has this Customer ID; and also a Transaction ID associated with their purchase [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%txn_cid%% is simply set to the %%txn_id%% value; i.e., it is a duplicate of %%txn_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Transaction ID. See %%txn_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%amount%%</code> = The Amount of the payment. If you offer something 100% free, this will be <code>0</code>.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>*level:custom_capabilities:fixed term</em></code>) that the payment is for. [ <a href="#" onclick="alert(\'With Independent Custom Capabilities, the `level` portion of this string will be an asterisk ( `*` ), since the Membership Level is irrelevant, and remains `as it was`.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro-Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member ⥱ General Options ⥱ Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Tip:</strong> With <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Add-on / Prices")) . '" target="_blank" rel="external">s2Member Pro-Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <strong>s2Member ⥱ Pro Coupon Codes ⥱ Affiliate Coupon Codes</strong>. This is a VERY powerful feature.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_ccap_tracking", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_sp_tracking", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_sp_tracking", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Specific Post/Page Tracking Codes">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-tracking-section">' . "\n";
         echo '<h3>Tracking Codes For Specific Post/Page Access (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, after a Customer completes a successful transaction through your Payment Gateway; specifically for Post/Page Access. These Codes are NOT injected for any type of Membership Level Access' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' or Independent Custom Capabilities') . '. These are only for Specific Post/Page transactions. The Tracking Codes that you enter below, will be displayed in one of two possible locations... <strong>1.</strong> If possible, on the Thank-You Return Page, after returning from your Payment Gateway. <strong>2.</strong> Otherwise, in the footer of your WordPress theme, as soon as possible <em>(immediately with s2Member Pro-Form integration)</em>.</p>' . "\n";
         echo '<p><em><strong>AD BLOCKERS:</strong> If a web browser has ad blockers enabled (i.e., the web browser has an ad blocking extension or add-on), Tracking Codes from popular online advertising companies (including many affiliate networks) may NOT be shown. Ad blockers can prevent your Tracking Codes from being loaded in a customer\'s browser. If you\'d like to avoid this problem, consider integrating with s2Member\'s API Notifications instead of with Tracking Codes. API Notifications occur silently behind-the-scenes (more reliably), whereas Tracking Codes are loaded in a customer\'s browser. For more information, please see: <strong>s2Member ⥱ API / Notifications</strong>.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_sp_tracking", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-sp-tracking-codes">' . "\n";
         echo 'Specific Post/Page Tracking Codes:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_sp_tracking_codes" id="ws-plugin--s2member-sp-tracking-codes" rows="8" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_tracking_codes"]) . '</textarea><br />' . "\n";
         echo 'Any valid XHTML / JavaScript' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' (or even PHP)') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google Analytics code works just fine, AdSense performance tracking, as well as Yahoo tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%txn_id%%</code> = The Paid Transaction ID. Payment Gateways assign a unique identifier for every purchase.</li>' . "\n";
         echo '<li><code>%%txn_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe. Each Stripe Customer has this Customer ID; and also a Transaction ID associated with their purchase [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%txn_cid%% is simply set to the %%txn_id%% value; i.e., it is a duplicate of %%txn_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Transaction ID. See %%txn_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%amount%%</code> = The full Amount that you charged for Specific Post/Page Access. If you offer something 100% free, this will be <code>0</code>.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> (translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code>).</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro-Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Tip:</strong> With <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Add-on / Prices")) . '" target="_blank" rel="external">s2Member Pro-Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <strong>s2Member ⥱ Pro Coupon Codes ⥱ Affiliate Coupon Codes</strong>. This is a VERY powerful feature.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_sp_tracking", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_integrations_divider", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_integrations_divider", get_defined_vars());
         echo '<div style="border-bottom:1px solid #DFDFDF; margin:-20px 0 20px 0; padding:0;">&nbsp;</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_integrations_divider", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_idev", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_idev", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Integrating iDevAffiliate">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-idev-section">' . "\n";
         echo '<h3>Integrating iDevAffiliate (affiliate program management)</h3>' . "\n";
         echo '<a href="http://www.s2member.com/idev-affiliate" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/idev-logo.gif" class="ws-menu-page-right ws-menu-page-bordered" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
         echo '<p>Adding affiliate tracking software to your site is one of the most effective ways to achieve more sales, more traffic, and more search engine ranking. <a href="http://www.s2member.com/idev-affiliate" target="_blank" rel="external">iDevAffiliate</a> (an affiliate management portal), installs in just minutes, and can be integrated seamlessly with s2Member. We recommend <a href="http://www.s2member.com/idev-affiliate" target="_blank" rel="external">iDevAffiliate Standard</a> ( $99 ) because of its proven track record, and its ability to integrate with s2Member using a variety of techniques. The most popular being a Hidden Image Tag.</p>' . "\n";
         echo '<p>If you choose to <a href="http://www.s2member.com/idev-affiliate" target="_blank" rel="external">install iDevAffiliate</a>, you will need to configure your <strong>iDevAffiliate ⥱ Shopping Cart Integration</strong>. Please choose <code>Generic Tracking Pixel</code>. Then, grab your Hidden Image Tag, and pop the code provided by iDevAffiliate into one of the fields for Tracking Codes <em>(at the top of this page)</em>. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided some examples below, one for each of s2Member\'s Tracking Code integrations.</p>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_idev", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Signup Tracking Code, for iDevAffiliate integration:</strong></p>' . "\n";
         echo '<p>idev_saleamt=<strong>%%initial%%</strong><br />idev_ordernum=<strong>%%subscr_id%%</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/idev-signup-tracking-code.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Modification Tracking Code, for iDevAffiliate integration:</strong></p>' . "\n";
         echo '<p>idev_saleamt=<strong>%%initial%%</strong><br />idev_ordernum=<strong>%%subscr_id%%</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/idev-modification-tracking-code.x-php")) . '</p>' . "\n";
         if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Capability Tracking Code, for iDevAffiliate integration:</strong></p>' . "\n";
             echo '<p>idev_saleamt=<strong>%%amount%%</strong><br />idev_ordernum=<strong>%%txn_id%%</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/idev-ccap-tracking-code.x-php")) . '</p>' . "\n";
         }
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Specific Post/Page Tracking Code, for iDevAffiliate integration:</strong></p>' . "\n";
         echo '<p>idev_saleamt=<strong>%%amount%%</strong><br />idev_ordernum=<strong>%%txn_id%%</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/idev-sp-tracking-code.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p>Your <code>profile</code> ID will be assigned by iDevAffiliate. Be sure to replace <code>profile=123</code> with your own profile ID.</p>' . "\n";
         echo '<p><em><strong>Tip:</strong> iDevAffiliate also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <strong>s2Member ⥱ API Notifications.</strong> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scenes, as opposed to being loaded in a browser. It\'s a bit more powerful (and reliable), but also more advanced.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Tip:</strong> With <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Add-on / Prices")) . '" target="_blank" rel="external">s2Member Pro-Forms</a>, it\'s possible to integrate Affiliate Coupon Codes with iDevAffiliate. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <strong>s2Member ⥱ Pro Coupon Codes ⥱ Affiliate Coupon Codes</strong>. This is a VERY powerful feature.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_idev", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_shareasale", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_shareasale", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Integrating ShareASale">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-shareasale-section">' . "\n";
         echo '<h3>Integrating ShareASale (affiliate program management)</h3>' . "\n";
         echo '<a href="http://www.s2member.com/shareasale" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/sas-logo.png" class="ws-menu-page-right ws-menu-page-bordered" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
         echo '<p>Established in 2000, <a href="http://www.s2member.com/shareasale" target="_blank" rel="external">ShareASale</a> provides award winning technology and service; which will enable you to connect with a network of established affiliates, as well as recruit new ones. Joining ShareASale, maximizes your ability to reach the greatest number of affiliates, with the least amount of work. At ShareASale, you\'ll have access to an existing affiliate-base. You place your site on the market, and let their existing affiliates promote your products/services.</p>' . "\n";
         echo '<p>If you <a href="http://www.s2member.com/shareasale" target="_blank" rel="external">become a Merchant at ShareASale</a>, you will need to configure your <strong>ShareASale ⥱ Sale Tracking</strong>. Grab your Hidden Image Tag, and pop the code provided by ShareASale into one of the fields for Tracking Codes <em>(at the top of this page)</em>. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided some examples below, one for each of s2Member\'s Tracking Code integrations.</p>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_shareasale", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Signup Tracking Code, for ShareASale integration:</strong></p>' . "\n";
         echo '<p>amount=<strong>%%initial%%</strong><br />tracking=<strong>%%subscr_id%%</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sas-signup-tracking-code.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Modification Tracking Code, for ShareASale integration:</strong></p>' . "\n";
         echo '<p>amount=<strong>%%initial%%</strong><br />tracking=<strong>%%subscr_id%%</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sas-modification-tracking-code.x-php")) . '</p>' . "\n";
         if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Capability Tracking Code, for ShareASale integration:</strong></p>' . "\n";
             echo '<p>amount=<strong>%%amount%%</strong><br />tracking=<strong>%%txn_id%%</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sas-ccap-tracking-code.x-php")) . '</p>' . "\n";
         }
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Specific Post/Page Tracking Code, for ShareASale integration:</strong></p>' . "\n";
         echo '<p>amount=<strong>%%amount%%</strong><br />tracking=<strong>%%txn_id%%</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sas-sp-tracking-code.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p>Your <code>merchantID</code> will be assigned by ShareASale. Be sure to replace <code>merchantID=123</code> with the one they assign you.</p>' . "\n";
         echo '<p><em><strong>Tip:</strong> ShareASale also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <strong>s2Member ⥱ API Notifications.</strong> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scenes, as opposed to being loaded in a browser. It\'s a bit more powerful (and reliable), but also more advanced.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Tip:</strong> With <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Add-on / Prices")) . '" target="_blank" rel="external">s2Member Pro-Forms</a>, it\'s possible to integrate Affiliate Coupon Codes with ShareASale. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <strong>s2Member ⥱ Pro Coupon Codes ⥱ Affiliate Coupon Codes</strong>. This is a VERY powerful feature.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_shareasale", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_trk_ops_page_during_left_sections_display_other_methods", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_before_other_methods", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Other Tracking Methods Available">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-other-methods-section">' . "\n";
         echo '<h3>Other Tracking Methods Are Available (there\'s always a way)</h3>' . "\n";
         echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `Modification`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page` Notifications that are available to you through the s2Member API. The s2Member API Notifications make it possible to integrate with 3rd party applications; like list servers, affiliate programs, and other back-office routines; in more advanced ways.</p>' . "\n";
         echo '<p>Since s2Member API Notifications operate silently on the back-end, they tend to be more reliable and also more versatile. That being said, nothing replaces the simplicity of Tracking Codes. The more advanced API Notifications are NOT always the best tool for the job. For instance, API Notifications will NOT work with Google Analytics, or 1 pixel &lt;img&gt; tags. They operate silently behind-the-scenes, using HTTP connections, as opposed to being loaded in a browser.</p>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_other_methods", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Tip:</strong> With <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Add-on / Prices")) . '" target="_blank" rel="external">s2Member Pro-Forms</a>, it\'s possible to integrate Affiliate Coupon Codes with iDevAffiliate. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <strong>s2Member ⥱ Pro Coupon Codes ⥱ Affiliate Coupon Codes</strong>. This is a VERY powerful feature.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_trk_ops_page_during_left_sections_after_other_methods", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_trk_ops_page_after_left_sections", get_defined_vars());
     echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
 /**
  * Configures all new Users.
  *
  * The Hook `user_register` is also fired by calling:
  * ``c_ws_plugin__s2member_registrations::ms_create_existing_user()`` and/or ``wpmu_create_user()``.
  *
  * This function also receives hand-offs from s2Member's handlers for these two Hooks:
  * `wpmu_activate_user` and `wpmu_activate_blog`.
  *
  * @package s2Member\Registrations
  * @since 3.5
  *
  * @attaches-to ``add_action("user_register");``
  *
  * @param int|str $user_id A numeric WordPress User ID.
  * @param str $password Optional in most cases. A User's plain text Password. If unspecified, attempts are made to collect the plain text Password from other sources.
  * @param array $meta Optional in most cases. Defaults to false. An array of meta data for a User/Member.
  * @return null No return value. Returns `null` in possible every scenario.
  *
  * @todo Impossible to delete cookies when fired inside: `/wp-activate.php`?
  */
 public static function configure_user_registration($user_id = FALSE, $password = FALSE, $meta = FALSE)
 {
     global $wpdb;
     global $pagenow;
     // We need this to detect the current administration page.
     global $current_site, $current_blog;
     // Adds support for Multisite Networking.
     static $email_config, $processed;
     // Static vars prevent duplicate processing.
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_configure_user_registration", get_defined_vars());
     unset($__refs, $__v);
     // With Multisite Networking, we need this to run on `user_register` ahead of `wpmu_activate_[user|blog]`.
     if (!isset($email_config) && ($email_config = true)) {
         // Anytime this routine is fired; we configure email.
         c_ws_plugin__s2member_email_configs::email_config();
     }
     // Configures `From:` email header.
     $_p = isset($_POST) ? $_POST : null;
     $rvs = isset($GLOBALS["ws_plugin__s2member_registration_vars"]) ? $GLOBALS["ws_plugin__s2member_registration_vars"] : null;
     if (!$processed) {
         if (is_array($_p) || is_array($meta) || is_array($rvs)) {
             if (!(is_multisite() && is_blog_admin() && $pagenow === "user-new.php" && isset($_p["noconfirmation"]) && is_super_admin() && !is_array($meta))) {
                 if (!(preg_match("/\\/wp-activate\\.php/", $_SERVER["REQUEST_URI"]) && !is_array($meta))) {
                     if (!(c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_activation_page() && !is_array($meta))) {
                         if (!(c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op("create_user") && !is_array($rvs))) {
                             if ($user_id && is_object($user = new WP_User($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && ($processed = true)) {
                                 settype($_p, "array") . settype($meta, "array") . settype($rvs, "array");
                                 $_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_p));
                                 $meta = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($meta));
                                 $rvs = c_ws_plugin__s2member_utils_strings::trim_deep($rvs);
                                 foreach ($_p as $_key => $_value) {
                                     // Scan ``$_p`` vars; adding `custom_reg_field` keys.
                                     if (preg_match("/^ws_plugin__s2member_user_new_/", $_key)) {
                                         // Look for keys.
                                         if ($_key = str_replace("_user_new_", "_custom_reg_field_", $_key)) {
                                             $_p[$_key] = $_value;
                                         }
                                     }
                                 }
                                 // Add each of these key conversions.
                                 unset($_key, $_value);
                                 if (!is_admin() && (isset($_p["ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_subscr_id"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_custom"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_ccaps"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_notes"]))) {
                                     exit(_x("s2Member security violation. You attempted to POST administrative variables that will NOT be trusted in a NON-administrative zone!", "s2member-front", "s2member"));
                                 }
                                 $_pmr = array_merge($_p, $meta, $rvs);
                                 // Merge all of these arrays together now, in this specific order.
                                 unset($_p, $meta, $rvs);
                                 // These variables can all be unset now; we have them all in the ``$_pmr`` array.
                                 $custom_reg_display_name = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"];
                                 // Can be configured by the site owner.
                                 if (!is_admin() && (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !c_ws_plugin__s2member_pro_remote_ops::is_remote_op("create_user")) && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
                                     /* This routine could be processed through `/wp-login.php?action=register`, `/wp-activate.php`, or `/activate` via BuddyPress`.
                                     			This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
                                     			If processed through `/wp-activate.php`, it could've originated inside the admin — via `/user-new.php`. */
                                     $processed = "yes";
                                     // Mark this as yes.
                                     $current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
                                     @(list($level, $ccaps, $eotper) = preg_split("/\\:/", $item_number, 3));
                                     $role = "s2member_level" . $level;
                                     // Membership Level.
                                     $email = $user->user_email;
                                     $login = $user->user_login;
                                     $ip = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_registration_ip"];
                                     $ip = !$ip ? $_SERVER["REMOTE_ADDR"] : $ip;
                                     // Else use environment variable.
                                     $cv = preg_split("/\\|/", $custom);
                                     if (!($auto_eot_time = "") && $eotper) {
                                         // If a specific EOT Period is included.
                                         $auto_eot_time = c_ws_plugin__s2member_utils_time::auto_eot_time("", "", "", $eotper);
                                     }
                                     $notes = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_notes"];
                                     $opt_in = !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] ? true : false;
                                     $opt_in = !$opt_in && !empty($_pmr["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : $opt_in;
                                     if (!($fname = $user->first_name)) {
                                         if (!empty($_pmr["ws_plugin__s2member_custom_reg_field_first_name"])) {
                                             $fname = (string) $_pmr["ws_plugin__s2member_custom_reg_field_first_name"];
                                         }
                                     }
                                     if (!$fname) {
                                         // Also try BuddyPress.
                                         if (!empty($_pmr["field_1"])) {
                                             // BuddyPress?
                                             $fname = trim(preg_replace("/ (.*)\$/", "", (string) $_pmr["field_1"]));
                                         }
                                     }
                                     if (!($lname = $user->last_name)) {
                                         if (!empty($_pmr["ws_plugin__s2member_custom_reg_field_last_name"])) {
                                             $lname = (string) $_pmr["ws_plugin__s2member_custom_reg_field_last_name"];
                                         }
                                     }
                                     if (!$lname) {
                                         // Also try BuddyPress.
                                         if (!empty($_pmr["field_1"]) && preg_match("/^(.+?) (.+)\$/", (string) $_pmr["field_1"])) {
                                             $lname = trim(preg_replace("/^(.+?) (.+)\$/", "\$2", (string) $_pmr["field_1"]));
                                         }
                                     }
                                     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_names"] && !$fname && $login) {
                                         $fname = trim($login);
                                         $lname = "";
                                     }
                                     // Username and empty Last Name.
                                     $name = trim($fname . " " . $lname);
                                     // Both names.
                                     if (!($pass = $password)) {
                                         // Try s2Member's generator.
                                         if (!empty($GLOBALS["ws_plugin__s2member_generate_password_return"])) {
                                             $pass = (string) $GLOBALS["ws_plugin__s2member_generate_password_return"];
                                         }
                                     }
                                     if (!$pass) {
                                         // Also try BuddyPress Password.
                                         if (!empty($_pmr["signup_password"])) {
                                             // BuddyPress?
                                             $pass = (string) $_pmr["signup_password"];
                                         }
                                     }
                                     if ($pass) {
                                         !headers_sent() ? delete_user_setting("default_password_nag", $user_id) : null;
                                         update_user_option($user_id, "default_password_nag", false, true);
                                     }
                                     update_user_option($user_id, "s2member_registration_ip", $ip);
                                     update_user_option($user_id, "s2member_auto_eot_time", $auto_eot_time);
                                     update_user_option($user_id, "s2member_subscr_gateway", $subscr_gateway);
                                     update_user_option($user_id, "s2member_subscr_id", $subscr_id);
                                     update_user_option($user_id, "s2member_custom", $custom);
                                     update_user_option($user_id, "s2member_notes", $notes);
                                     if (!$user->first_name && $fname) {
                                         update_user_meta($user_id, "first_name", $fname);
                                     }
                                     if (!$user->last_name && $lname) {
                                         update_user_meta($user_id, "last_name", $lname);
                                     }
                                     if (!$user->display_name || $user->display_name === $user->user_login) {
                                         if ($custom_reg_display_name === "full" && $name) {
                                             wp_update_user(array("ID" => $user_id, "display_name" => $name));
                                         } else {
                                             if ($custom_reg_display_name === "first" && $fname) {
                                                 wp_update_user(array("ID" => $user_id, "display_name" => $fname));
                                             } else {
                                                 if ($custom_reg_display_name === "last" && $lname) {
                                                     wp_update_user(array("ID" => $user_id, "display_name" => $lname));
                                                 } else {
                                                     if ($custom_reg_display_name === "login" && $login) {
                                                         wp_update_user(array("ID" => $user_id, "display_name" => $login));
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     if (is_multisite()) {
                                         if (!is_main_site() && strtotime($user->user_registered) >= strtotime("-10 seconds")) {
                                             remove_user_from_blog($user_id, $current_site->blog_id);
                                         }
                                         // No Main Site Role.
                                         if (!get_user_meta($user_id, "s2member_originating_blog", true)) {
                                             // Recorded yet?
                                             update_user_meta($user_id, "s2member_originating_blog", $current_blog->blog_id);
                                         }
                                     }
                                     if ($current_role !== $role) {
                                         // Only if NOT the current Role.
                                         $user->set_role($role);
                                     }
                                     // s2Member.
                                     if ($ccaps && preg_match("/^-all/", str_replace("+", "", $ccaps))) {
                                         foreach ($user->allcaps as $cap => $cap_enabled) {
                                             if (preg_match("/^access_s2member_ccap_/", $cap)) {
                                                 $user->remove_cap($ccap = $cap);
                                             }
                                         }
                                     }
                                     if ($ccaps && preg_replace("/^-all[\r\n\t\\s;,]*/", "", str_replace("+", "", $ccaps))) {
                                         foreach (preg_split("/[\r\n\t\\s;,]+/", preg_replace("/^-all[\r\n\t\\s;,]*/", "", str_replace("+", "", $ccaps))) as $ccap) {
                                             if (strlen($ccap = trim(strtolower(preg_replace("/[^a-z_0-9]/i", "", $ccap))))) {
                                                 $user->add_cap("access_s2member_ccap_" . $ccap);
                                             }
                                         }
                                     }
                                     if (!($fields = array()) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) {
                                         foreach (json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field) {
                                             $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
                                             $field_id_class = preg_replace("/_/", "-", $field_var);
                                             if (isset($_pmr["ws_plugin__s2member_custom_reg_field_" . $field_var])) {
                                                 $fields[$field_var] = $_pmr["ws_plugin__s2member_custom_reg_field_" . $field_var];
                                             }
                                         }
                                     }
                                     unset($field, $field_var, $field_id_class);
                                     // Housekeeping.
                                     if (!empty($fields)) {
                                         // Only if NOT empty.
                                         update_user_option($user_id, "s2member_custom_fields", $fields);
                                     }
                                     if ($level > 0) {
                                         $pr_times = get_user_option("s2member_paid_registration_times", $user_id);
                                         $pr_times["level"] = empty($pr_times["level"]) ? time() : $pr_times["level"];
                                         $pr_times["level" . $level] = empty($pr_times["level" . $level]) ? time() : $pr_times["level" . $level];
                                         update_user_option($user_id, "s2member_paid_registration_times", $pr_times);
                                         // Update now.
                                     }
                                     if (($transient = "s2m_" . md5("s2member_transient_ipn_signup_vars_" . $subscr_id)) && is_array($ipn_signup_vars = get_transient($transient))) {
                                         update_user_option($user_id, "s2member_ipn_signup_vars", $ipn_signup_vars);
                                         // For future reference.
                                         delete_transient($transient);
                                         // This can be deleted now.
                                     }
                                     if (($transient = "s2m_" . md5("s2member_transient_ipn_subscr_payment_" . $subscr_id)) && is_array($subscr_payment = get_transient($transient)) && !empty($subscr_payment["subscr_gateway"])) {
                                         $proxy = array("s2member_paypal_proxy" => stripslashes((string) $subscr_payment["subscr_gateway"]), "s2member_paypal_proxy_verification" => c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen());
                                         c_ws_plugin__s2member_utils_urls::remote(site_url("/?s2member_paypal_notify=1"), array_merge(stripslashes_deep($subscr_payment), $proxy), array("timeout" => 20));
                                         delete_transient($transient);
                                         // This can be deleted now.
                                     }
                                     if (($transient = "s2m_" . md5("s2member_transient_ipn_subscr_eot_" . $subscr_id)) && is_array($subscr_eot = get_transient($transient)) && !empty($subscr_eot["subscr_gateway"])) {
                                         $proxy = array("s2member_paypal_proxy" => stripslashes((string) $subscr_eot["subscr_gateway"]), "s2member_paypal_proxy_verification" => c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen());
                                         c_ws_plugin__s2member_utils_urls::remote(site_url("/?s2member_paypal_notify=1"), array_merge(stripslashes_deep($subscr_eot), $proxy), array("timeout" => 20));
                                         delete_transient($transient);
                                         // This can be deleted now.
                                     }
                                     if (!headers_sent()) {
                                         // Only if headers are NOT yet sent. Here we establish both Signup and Payment Tracking Cookies.
                                         @setcookie("s2member_tracking", $s2member_tracking = c_ws_plugin__s2member_utils_encryption::encrypt($subscr_id), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_tracking", $s2member_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["s2member_tracking"] = $s2member_tracking);
                                     }
                                     foreach (array_keys(get_defined_vars()) as $__v) {
                                         $__refs[$__v] =& ${$__v};
                                     }
                                     do_action("ws_plugin__s2member_during_configure_user_registration_front_side_paid", get_defined_vars());
                                     do_action("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars());
                                     unset($__refs, $__v);
                                 } else {
                                     if (!is_admin() && (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !c_ws_plugin__s2member_pro_remote_ops::is_remote_op("create_user"))) {
                                         /* This routine could be processed through `/wp-login.php?action=register`, `/wp-activate.php`, or `/activate` via BuddyPress`.
                                         			This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
                                         			If processed through `/wp-activate.php`, it could've originated inside the admin, via `/user-new.php`. */
                                         $processed = "yes";
                                         // Mark this as yes.
                                         $current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
                                         $role = "";
                                         // Initialize ``$role`` to an empty string here, before processing.
                                         $role = !$role && ($level = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) > 0 ? "s2member_level" . $level : $role;
                                         $role = !$role && ($level = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) === "0" ? "subscriber" : $role;
                                         $role = !$role && $current_role ? $current_role : $role;
                                         // Use existing Role?
                                         $role = !$role ? get_option("default_role") : $role;
                                         // Otherwise default.
                                         $level = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"];
                                         $level = !$level && preg_match("/^(administrator|editor|author|contributor)\$/i", $role) ? $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] : $level;
                                         $level = !$level && preg_match("/^s2member_level[1-9][0-9]*\$/i", $role) ? preg_replace("/^s2member_level/", "", $role) : $level;
                                         $level = !$level && preg_match("/^subscriber\$/i", $role) ? "0" : $level;
                                         $level = !$level ? "0" : $level;
                                         $ccaps = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_ccaps"];
                                         $email = $user->user_email;
                                         $login = $user->user_login;
                                         $ip = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_registration_ip"];
                                         $ip = !$ip ? $_SERVER["REMOTE_ADDR"] : $ip;
                                         // Else use environment variable.
                                         $custom = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_custom"];
                                         $subscr_id = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_subscr_id"];
                                         $subscr_gateway = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway"];
                                         $cv = preg_split("/\\|/", (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_custom"]);
                                         $auto_eot_time = ($eot = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"]) ? strtotime($eot) : "";
                                         $notes = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_notes"];
                                         $opt_in = !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] ? true : false;
                                         $opt_in = !$opt_in && !empty($_pmr["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : $opt_in;
                                         if (!($fname = $user->first_name)) {
                                             if (!empty($_pmr["ws_plugin__s2member_custom_reg_field_first_name"])) {
                                                 $fname = (string) $_pmr["ws_plugin__s2member_custom_reg_field_first_name"];
                                             }
                                         }
                                         if (!$fname) {
                                             // Also try BuddyPress.
                                             if (!empty($_pmr["field_1"])) {
                                                 // BuddyPress?
                                                 $fname = trim(preg_replace("/ (.*)\$/", "", (string) $_pmr["field_1"]));
                                             }
                                         }
                                         if (!($lname = $user->last_name)) {
                                             if (!empty($_pmr["ws_plugin__s2member_custom_reg_field_last_name"])) {
                                                 $lname = (string) $_pmr["ws_plugin__s2member_custom_reg_field_last_name"];
                                             }
                                         }
                                         if (!$lname) {
                                             // Also try BuddyPress.
                                             if (!empty($_pmr["field_1"]) && preg_match("/^(.+?) (.+)\$/", (string) $_pmr["field_1"])) {
                                                 $lname = trim(preg_replace("/^(.+?) (.+)\$/", "\$2", (string) $_pmr["field_1"]));
                                             }
                                         }
                                         if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_names"] && !$fname && $login) {
                                             $fname = trim($login);
                                             $lname = "";
                                         }
                                         // Username and empty Last Name.
                                         $name = trim($fname . " " . $lname);
                                         // Both names.
                                         if (!($pass = $password)) {
                                             // Try s2Member's generator.
                                             if (!empty($GLOBALS["ws_plugin__s2member_generate_password_return"])) {
                                                 $pass = (string) $GLOBALS["ws_plugin__s2member_generate_password_return"];
                                             }
                                         }
                                         if (!$pass) {
                                             // Also try BuddyPress Password.
                                             if (!empty($_pmr["signup_password"])) {
                                                 // BuddyPress?
                                                 $pass = (string) $_pmr["signup_password"];
                                             }
                                         }
                                         if ($pass) {
                                             !headers_sent() ? delete_user_setting("default_password_nag", $user_id) : null;
                                             update_user_option($user_id, "default_password_nag", false, true);
                                         }
                                         update_user_option($user_id, "s2member_registration_ip", $ip);
                                         update_user_option($user_id, "s2member_auto_eot_time", $auto_eot_time);
                                         update_user_option($user_id, "s2member_subscr_gateway", $subscr_gateway);
                                         update_user_option($user_id, "s2member_subscr_id", $subscr_id);
                                         update_user_option($user_id, "s2member_custom", $custom);
                                         update_user_option($user_id, "s2member_notes", $notes);
                                         if (!$user->first_name && $fname) {
                                             update_user_meta($user_id, "first_name", $fname);
                                         }
                                         if (!$user->last_name && $lname) {
                                             update_user_meta($user_id, "last_name", $lname);
                                         }
                                         if (!$user->display_name || $user->display_name === $user->user_login) {
                                             if ($custom_reg_display_name === "full" && $name) {
                                                 wp_update_user(array("ID" => $user_id, "display_name" => $name));
                                             } else {
                                                 if ($custom_reg_display_name === "first" && $fname) {
                                                     wp_update_user(array("ID" => $user_id, "display_name" => $fname));
                                                 } else {
                                                     if ($custom_reg_display_name === "last" && $lname) {
                                                         wp_update_user(array("ID" => $user_id, "display_name" => $lname));
                                                     } else {
                                                         if ($custom_reg_display_name === "login" && $login) {
                                                             wp_update_user(array("ID" => $user_id, "display_name" => $login));
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                         if (is_multisite()) {
                                             if (!is_main_site() && strtotime($user->user_registered) >= strtotime("-10 seconds")) {
                                                 remove_user_from_blog($user_id, $current_site->blog_id);
                                             }
                                             if (!get_user_meta($user_id, "s2member_originating_blog", true)) {
                                                 update_user_meta($user_id, "s2member_originating_blog", $current_blog->blog_id);
                                             }
                                         }
                                         if ($current_role !== $role) {
                                             // Only if NOT the current Role.
                                             $user->set_role($role);
                                         }
                                         // s2Member.
                                         if ($ccaps && preg_match("/^-all/", str_replace("+", "", $ccaps))) {
                                             foreach ($user->allcaps as $cap => $cap_enabled) {
                                                 if (preg_match("/^access_s2member_ccap_/", $cap)) {
                                                     $user->remove_cap($ccap = $cap);
                                                 }
                                             }
                                         }
                                         if ($ccaps && preg_replace("/^-all[\r\n\t\\s;,]*/", "", str_replace("+", "", $ccaps))) {
                                             foreach (preg_split("/[\r\n\t\\s;,]+/", preg_replace("/^-all[\r\n\t\\s;,]*/", "", str_replace("+", "", $ccaps))) as $ccap) {
                                                 if (strlen($ccap = trim(strtolower(preg_replace("/[^a-z_0-9]/i", "", $ccap))))) {
                                                     $user->add_cap("access_s2member_ccap_" . $ccap);
                                                 }
                                             }
                                         }
                                         if (!($fields = array()) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) {
                                             foreach (json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field) {
                                                 $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
                                                 $field_id_class = preg_replace("/_/", "-", $field_var);
                                                 if (isset($_pmr["ws_plugin__s2member_custom_reg_field_" . $field_var])) {
                                                     $fields[$field_var] = $_pmr["ws_plugin__s2member_custom_reg_field_" . $field_var];
                                                 }
                                             }
                                         }
                                         unset($field, $field_var, $field_id_class);
                                         // Housekeeping.
                                         if (!empty($fields)) {
                                             // Only if NOT empty.
                                             update_user_option($user_id, "s2member_custom_fields", $fields);
                                         }
                                         if ($level > 0) {
                                             $pr_times = get_user_option("s2member_paid_registration_times", $user_id);
                                             $pr_times["level"] = empty($pr_times["level"]) ? time() : $pr_times["level"];
                                             $pr_times["level" . $level] = empty($pr_times["level" . $level]) ? time() : $pr_times["level" . $level];
                                             update_user_option($user_id, "s2member_paid_registration_times", $pr_times);
                                             // Update now.
                                         }
                                         foreach (array_keys(get_defined_vars()) as $__v) {
                                             $__refs[$__v] =& ${$__v};
                                         }
                                         do_action("ws_plugin__s2member_during_configure_user_registration_front_side_free", get_defined_vars());
                                         do_action("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars());
                                         unset($__refs, $__v);
                                     } else {
                                         if (is_blog_admin() && $pagenow === "user-new.php" || c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op("create_user")) {
                                             // Can only be processed through `/user-new.php` in the Admin panel, or through Remote Op: `create_user`.
                                             $processed = "yes";
                                             // Mark this as yes, to indicate that a routine was processed.
                                             $current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
                                             $role = "";
                                             // Initialize $role to an empty string here, before processing.
                                             $role = !$role && ($level = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) > 0 ? "s2member_level" . $level : $role;
                                             $role = !$role && ($level = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) === "0" ? "subscriber" : $role;
                                             $role = !$role && $current_role ? $current_role : $role;
                                             // Use existing Role?
                                             $role = !$role ? get_option("default_role") : $role;
                                             // Otherwise default.
                                             $level = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"];
                                             $level = !$level && preg_match("/^(administrator|editor|author|contributor)\$/i", $role) ? $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] : $level;
                                             $level = !$level && preg_match("/^s2member_level[1-9][0-9]*\$/i", $role) ? preg_replace("/^s2member_level/", "", $role) : $level;
                                             $level = !$level && preg_match("/^subscriber\$/i", $role) ? "0" : $level;
                                             $level = !$level ? "0" : $level;
                                             $ccaps = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_ccaps"];
                                             $email = $user->user_email;
                                             $login = $user->user_login;
                                             $ip = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_registration_ip"];
                                             $custom = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_custom"];
                                             $subscr_id = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_subscr_id"];
                                             $subscr_gateway = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway"];
                                             $cv = preg_split("/\\|/", (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_custom"]);
                                             $auto_eot_time = ($eot = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"]) ? strtotime($eot) : "";
                                             $notes = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_notes"];
                                             $opt_in = !empty($_pmr["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : false;
                                             if (!($fname = $user->first_name)) {
                                                 // `Users -› Add New`.
                                                 if (!empty($_pmr["ws_plugin__s2member_custom_reg_field_first_name"])) {
                                                     $fname = (string) $_pmr["ws_plugin__s2member_custom_reg_field_first_name"];
                                                 }
                                             }
                                             if (!($lname = $user->last_name)) {
                                                 // `Users -› Add New`.
                                                 if (!empty($_pmr["ws_plugin__s2member_custom_reg_field_last_name"])) {
                                                     $lname = (string) $_pmr["ws_plugin__s2member_custom_reg_field_last_name"];
                                                 }
                                             }
                                             if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_names"] && !$fname && $login) {
                                                 $fname = trim($login);
                                                 $lname = "";
                                             }
                                             // Username and empty Last Name.
                                             $name = trim($fname . " " . $lname);
                                             // Both names.
                                             if (!($pass = $password)) {
                                                 // Try s2Member's generator.
                                                 if (!empty($GLOBALS["ws_plugin__s2member_generate_password_return"])) {
                                                     $pass = (string) $GLOBALS["ws_plugin__s2member_generate_password_return"];
                                                 }
                                             }
                                             if (!$pass) {
                                                 // Also try the `Users -› Add New` form.
                                                 if (!empty($_pmr["pass1"])) {
                                                     // Field in `/user-new.php`.
                                                     $pass = (string) $_pmr["pass1"];
                                                 }
                                             }
                                             if ($pass) {
                                                 !headers_sent() ? delete_user_setting("default_password_nag", $user_id) : null;
                                                 update_user_option($user_id, "default_password_nag", false, true);
                                             }
                                             update_user_option($user_id, "s2member_registration_ip", $ip);
                                             update_user_option($user_id, "s2member_auto_eot_time", $auto_eot_time);
                                             update_user_option($user_id, "s2member_subscr_gateway", $subscr_gateway);
                                             update_user_option($user_id, "s2member_subscr_id", $subscr_id);
                                             update_user_option($user_id, "s2member_custom", $custom);
                                             update_user_option($user_id, "s2member_notes", $notes);
                                             if (!$user->first_name && $fname) {
                                                 update_user_meta($user_id, "first_name", $fname);
                                             }
                                             if (!$user->last_name && $lname) {
                                                 update_user_meta($user_id, "last_name", $lname);
                                             }
                                             if (!$user->display_name || $user->display_name === $user->user_login) {
                                                 if ($custom_reg_display_name === "full" && $name) {
                                                     wp_update_user(array("ID" => $user_id, "display_name" => $name));
                                                 } else {
                                                     if ($custom_reg_display_name === "first" && $fname) {
                                                         wp_update_user(array("ID" => $user_id, "display_name" => $fname));
                                                     } else {
                                                         if ($custom_reg_display_name === "last" && $lname) {
                                                             wp_update_user(array("ID" => $user_id, "display_name" => $lname));
                                                         } else {
                                                             if ($custom_reg_display_name === "login" && $login) {
                                                                 wp_update_user(array("ID" => $user_id, "display_name" => $login));
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                             if (is_multisite()) {
                                                 if (!is_main_site() && strtotime($user->user_registered) >= strtotime("-10 seconds")) {
                                                     remove_user_from_blog($user_id, $current_site->blog_id);
                                                 }
                                                 // No Main Site Role.
                                                 if (!get_user_meta($user_id, "s2member_originating_blog", true)) {
                                                     // Recorded yet?
                                                     update_user_meta($user_id, "s2member_originating_blog", $current_blog->blog_id);
                                                 }
                                             }
                                             if ($current_role !== $role) {
                                                 // Only if NOT the current Role.
                                                 $user->set_role($role);
                                             }
                                             // s2Member.
                                             if ($ccaps && preg_match("/^-all/", str_replace("+", "", $ccaps))) {
                                                 foreach ($user->allcaps as $cap => $cap_enabled) {
                                                     if (preg_match("/^access_s2member_ccap_/", $cap)) {
                                                         $user->remove_cap($ccap = $cap);
                                                     }
                                                 }
                                             }
                                             if ($ccaps && preg_replace("/^-all[\r\n\t\\s;,]*/", "", str_replace("+", "", $ccaps))) {
                                                 foreach (preg_split("/[\r\n\t\\s;,]+/", preg_replace("/^-all[\r\n\t\\s;,]*/", "", str_replace("+", "", $ccaps))) as $ccap) {
                                                     if (strlen($ccap = trim(strtolower(preg_replace("/[^a-z_0-9]/i", "", $ccap))))) {
                                                         $user->add_cap("access_s2member_ccap_" . $ccap);
                                                     }
                                                 }
                                             }
                                             if (!($fields = array()) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) {
                                                 foreach (json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field) {
                                                     $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
                                                     $field_id_class = preg_replace("/_/", "-", $field_var);
                                                     if (isset($_pmr["ws_plugin__s2member_custom_reg_field_" . $field_var])) {
                                                         $fields[$field_var] = $_pmr["ws_plugin__s2member_custom_reg_field_" . $field_var];
                                                     }
                                                 }
                                             }
                                             unset($field, $field_var, $field_id_class);
                                             // Housekeeping.
                                             if (!empty($fields)) {
                                                 // Only if NOT empty.
                                                 update_user_option($user_id, "s2member_custom_fields", $fields);
                                             }
                                             if ($level > 0) {
                                                 $pr_times = get_user_option("s2member_paid_registration_times", $user_id);
                                                 $pr_times["level"] = empty($pr_times["level"]) ? time() : $pr_times["level"];
                                                 $pr_times["level" . $level] = empty($pr_times["level" . $level]) ? time() : $pr_times["level" . $level];
                                                 update_user_option($user_id, "s2member_paid_registration_times", $pr_times);
                                                 // Update now.
                                             }
                                             foreach (array_keys(get_defined_vars()) as $__v) {
                                                 $__refs[$__v] =& ${$__v};
                                             }
                                             do_action("ws_plugin__s2member_during_configure_user_registration_admin_side", get_defined_vars());
                                             unset($__refs, $__v);
                                         }
                                     }
                                 }
                                 if ($processed === "yes") {
                                     if ($urls = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"]) {
                                         foreach (preg_split("/[\r\n\t]+/", $urls) as $url) {
                                             // Notify each of the URLs.
                                             if ($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) {
                                                 if ($url = preg_replace("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($role)), $url)) {
                                                     if ($url = preg_replace("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($level)), $url)) {
                                                         if ($url = preg_replace("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($ccaps)), $url)) {
                                                             if ($url = preg_replace("/%%auto_eot_time%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($auto_eot_time)), $url)) {
                                                                 if ($url = preg_replace("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($fname)), $url)) {
                                                                     if ($url = preg_replace("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($lname)), $url)) {
                                                                         if ($url = preg_replace("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($name)), $url)) {
                                                                             if ($url = preg_replace("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($email)), $url)) {
                                                                                 if ($url = preg_replace("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($login)), $url)) {
                                                                                     if ($url = preg_replace("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($pass)), $url)) {
                                                                                         if ($url = preg_replace("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($ip)), $url)) {
                                                                                             if ($url = preg_replace("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($user_id)), $url)) {
                                                                                                 foreach ($fields as $var => $val) {
                                                                                                     // Custom Fields.
                                                                                                     if (!($url = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode(maybe_serialize($val))), $url))) {
                                                                                                         break;
                                                                                                     }
                                                                                                 }
                                                                                                 if ($url = trim(preg_replace("/%%(.+?)%%/i", "", $url))) {
                                                                                                     c_ws_plugin__s2member_utils_urls::remote($url);
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     unset($urls, $url, $var, $val);
                                     // Housekeeping.
                                     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"]) {
                                         $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status();
                                         c_ws_plugin__s2member_email_configs::email_config_release();
                                         $msg = $sbj = "(s2Member / API Notification Email) - Registration";
                                         $msg .= "\n\n";
                                         // Spacing in the message body.
                                         $msg .= "role: %%role%%\n";
                                         $msg .= "level: %%level%%\n";
                                         $msg .= "ccaps: %%ccaps%%\n";
                                         $msg .= "auto_eot_time: %%auto_eot_time%%\n";
                                         $msg .= "user_first_name: %%user_first_name%%\n";
                                         $msg .= "user_last_name: %%user_last_name%%\n";
                                         $msg .= "user_full_name: %%user_full_name%%\n";
                                         $msg .= "user_email: %%user_email%%\n";
                                         $msg .= "user_login: %%user_login%%\n";
                                         $msg .= "user_pass: %%user_pass%%\n";
                                         $msg .= "user_ip: %%user_ip%%\n";
                                         $msg .= "user_id: %%user_id%%\n";
                                         foreach ($fields as $var => $val) {
                                             $msg .= $var . ": %%" . $var . "%%\n";
                                         }
                                         $msg .= "cv0: %%cv0%%\n";
                                         $msg .= "cv1: %%cv1%%\n";
                                         $msg .= "cv2: %%cv2%%\n";
                                         $msg .= "cv3: %%cv3%%\n";
                                         $msg .= "cv4: %%cv4%%\n";
                                         $msg .= "cv5: %%cv5%%\n";
                                         $msg .= "cv6: %%cv6%%\n";
                                         $msg .= "cv7: %%cv7%%\n";
                                         $msg .= "cv8: %%cv8%%\n";
                                         $msg .= "cv9: %%cv9%%";
                                         if ($msg = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) {
                                             if ($msg = preg_replace("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($role), $msg)) {
                                                 if ($msg = preg_replace("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($level), $msg)) {
                                                     if ($msg = preg_replace("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($ccaps), $msg)) {
                                                         if ($msg = preg_replace("/%%auto_eot_time%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($auto_eot_time), $msg)) {
                                                             if ($msg = preg_replace("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($fname), $msg)) {
                                                                 if ($msg = preg_replace("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($lname), $msg)) {
                                                                     if ($msg = preg_replace("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($name), $msg)) {
                                                                         if ($msg = preg_replace("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($email), $msg)) {
                                                                             if ($msg = preg_replace("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($login), $msg)) {
                                                                                 if ($msg = preg_replace("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($pass), $msg)) {
                                                                                     if ($msg = preg_replace("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($ip), $msg)) {
                                                                                         if ($msg = preg_replace("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds($user_id), $msg)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 // Custom Fields.
                                                                                                 if (!($msg = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(maybe_serialize($val)), $msg))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                             if ($sbj && ($msg = trim(preg_replace("/%%(.+?)%%/i", "", $msg)))) {
                                                                                                 // Still have a ``$sbj`` and a ``$msg``?
                                                                                                 foreach (c_ws_plugin__s2member_utils_strings::parse_emails($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"]) as $recipient) {
                                                                                                     wp_mail($recipient, apply_filters("ws_plugin__s2member_registration_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__s2member_registration_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=UTF-8");
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                         if ($email_configs_were_on) {
                                             // Back on?
                                             c_ws_plugin__s2member_email_configs::email_config();
                                         }
                                         unset($sbj, $msg, $var, $val, $recipient, $email_configs_were_on);
                                         // Housekeeping.
                                     }
                                     if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"]) {
                                         if ($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) {
                                             if ($url = preg_replace("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($role)), $url)) {
                                                 if ($url = preg_replace("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($level)), $url)) {
                                                     if ($url = preg_replace("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($ccaps)), $url)) {
                                                         if ($url = preg_replace("/%%auto_eot_time%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($auto_eot_time)), $url)) {
                                                             if ($url = preg_replace("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($fname)), $url)) {
                                                                 if ($url = preg_replace("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($lname)), $url)) {
                                                                     if ($url = preg_replace("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($name)), $url)) {
                                                                         if ($url = preg_replace("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($email)), $url)) {
                                                                             if ($url = preg_replace("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($login)), $url)) {
                                                                                 if ($url = preg_replace("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($pass)), $url)) {
                                                                                     if ($url = preg_replace("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($ip)), $url)) {
                                                                                         if ($url = preg_replace("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($user_id)), $url)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 // Custom Fields.
                                                                                                 if (!($url = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode(maybe_serialize($val))), $url))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                             if ($url = trim($url)) {
                                                                                                 // Preserve remaining Replacements; because the parent routine may perform replacements too.
                                                                                                 $GLOBALS["ws_plugin__s2member_registration_return_url"] = $url;
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     unset($url, $var, $val);
                                     // Housekeeping.
                                     c_ws_plugin__s2member_list_servers::process_list_servers($role, $level, $login, $pass, $email, $fname, $lname, $ip, $opt_in, true, $user_id);
                                     /*
                                     Suppress errors here in case this routine is fired in unexpected locations; or with odd output buffering techniques.
                                     	@todo It may also be impossible to delete cookies when fired inside: `/wp-activate.php`.
                                     */
                                     if (!headers_sent()) {
                                         @setcookie("s2member_subscr_gateway", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_subscr_gateway", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                         @setcookie("s2member_subscr_id", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_subscr_id", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                         @setcookie("s2member_custom", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_custom", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                         @setcookie("s2member_item_number", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_item_number", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                     }
                                     /* If debugging/logging is enabled; we need to append ``$reg_vars`` to the log file.
                                     			Logging now supports Multisite Networking as well. */
                                     $reg_vars = get_defined_vars();
                                     // All defined vars.
                                     // No need to include these in the logs. Unset before log entry.
                                     unset($reg_vars["wpdb"], $reg_vars["current_site"], $reg_vars["current_blog"]);
                                     $logt = c_ws_plugin__s2member_utilities::time_details();
                                     $logv = c_ws_plugin__s2member_utilities::ver_details();
                                     $logm = c_ws_plugin__s2member_utilities::mem_details();
                                     $log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . $_SERVER["HTTP_USER_AGENT"];
                                     $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
                                     $log2 = is_multisite() && !is_main_site() ? "reg-handler-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "reg-handler.log";
                                     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
                                         if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
                                             if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
                                                 file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($reg_vars, true)) . "\n\n", FILE_APPEND);
                                             }
                                         }
                                     }
                                     unset($logt, $logv, $logm, $log4, $_log4, $log2, $logs_dir, $reg_vars);
                                     // Housekeeping.
                                     foreach (array_keys(get_defined_vars()) as $__v) {
                                         $__refs[$__v] =& ${$__v};
                                     }
                                     do_action("ws_plugin__s2member_during_configure_user_registration", get_defined_vars());
                                     unset($__refs, $__v);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_after_configure_user_registration", get_defined_vars());
     unset($__refs, $__v);
     return;
 }
Ejemplo n.º 9
0
 /**
  * Adds option menus / sub-menus.
  *
  * @package s2Member\Menu_Pages
  * @since 3.5
  *
  * @attaches-to ``add_action('admin_menu');``
  */
 public static function add_admin_options()
 {
     do_action('ws_plugin__s2member_before_add_admin_options', get_defined_vars());
     add_filter('plugin_action_links', 'c_ws_plugin__s2member_menu_pages::_add_settings_link', 10, 2);
     if (apply_filters('ws_plugin__s2member_during_add_admin_options_create_menu_items', TRUE, get_defined_vars())) {
         if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() || apply_filters('ws_plugin__s2member_during_add_admin_options_clear_right_side', FALSE, get_defined_vars())) {
             $GLOBALS['WS_PLUGIN__']['s2member']['c']['menu_pages'] = array();
         }
         // Clear right side.
         $menu = apply_filters('ws_plugin__s2member_during_add_admin_options_menu_slug', 'ws-plugin--s2member-start', get_defined_vars());
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_menu_page', TRUE, get_defined_vars())) {
             add_menu_page(c_ws_plugin__s2member_utils_conds::pro_is_installed() ? 's2Member (Pro)' : 's2Member', c_ws_plugin__s2member_utils_conds::pro_is_installed() ? 's2Member (Pro)' : 's2Member', 'create_users', $menu, 'c_ws_plugin__s2member_menu_pages::start_page', $GLOBALS['WS_PLUGIN__']['s2member']['c']['dir_url'] . '/images/brand-favicon.png');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_start_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member Quick-Start Guide', 'Quick-Start Guide', 'create_users', 'ws-plugin--s2member-start', 'c_ws_plugin__s2member_menu_pages::start_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_divider_1', TRUE, get_defined_vars())) {
             add_submenu_page($menu, '', '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', 'create_users', '#');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_mms_ops_page', !is_multisite() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, 's2Member Multisite Configuration', 'Multisite (Config)', 'create_users', 'ws-plugin--s2member-mms-ops', 'c_ws_plugin__s2member_menu_pages::mms_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_gen_ops_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member General Options', 'General Options', 'create_users', 'ws-plugin--s2member-gen-ops', 'c_ws_plugin__s2member_menu_pages::gen_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_res_ops_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member Restriction Options', 'Restriction Options', 'create_users', 'ws-plugin--s2member-res-ops', 'c_ws_plugin__s2member_menu_pages::res_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_down_ops_page', !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, 's2Member Download Options', 'Download Options', 'create_users', 'ws-plugin--s2member-down-ops', 'c_ws_plugin__s2member_menu_pages::down_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_divider_2', TRUE, get_defined_vars())) {
             add_submenu_page($menu, '', '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', 'create_users', '#');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member PayPal Options', 'PayPal Options', 'create_users', 'ws-plugin--s2member-paypal-ops', 'c_ws_plugin__s2member_menu_pages::paypal_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_paypal_buttons_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member PayPal Buttons', 'PayPal Buttons', 'create_users', 'ws-plugin--s2member-paypal-buttons', 'c_ws_plugin__s2member_menu_pages::paypal_buttons_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_divider_3', TRUE, get_defined_vars())) {
             add_submenu_page($menu, '', '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', 'create_users', '#');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_trk_ops_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member API / Tracking', 'API / Tracking', 'create_users', 'ws-plugin--s2member-trk-ops', 'c_ws_plugin__s2member_menu_pages::trk_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_els_ops_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member API / List Servers', 'API / List Servers', 'create_users', 'ws-plugin--s2member-els-ops', 'c_ws_plugin__s2member_menu_pages::els_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_api_ops_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member API / Notifications', 'API / Notifications', 'create_users', 'ws-plugin--s2member-api-ops', 'c_ws_plugin__s2member_menu_pages::api_ops_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_scripting_page', TRUE, get_defined_vars())) {
             add_submenu_page($menu, 's2Member API / Scripting', 'API / Scripting', 'create_users', 'ws-plugin--s2member-scripting', 'c_ws_plugin__s2member_menu_pages::scripting_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_divider_4', TRUE, get_defined_vars())) {
             add_submenu_page($menu, '', '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', 'create_users', '#');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_integrations_page', !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, 's2Member / Other Integrations', 'Other Integrations', 'create_users', 'ws-plugin--s2member-integrations', 'c_ws_plugin__s2member_menu_pages::integrations_page');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_divider_5', TRUE, get_defined_vars())) {
             add_submenu_page($menu, '', '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', 'create_users', '#');
         }
         if (apply_filters('ws_plugin__s2member_during_add_admin_options_add_logs_page', !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, 's2Member Logs', 'Log Files (Debug)', 'create_users', 'ws-plugin--s2member-logs', 'c_ws_plugin__s2member_menu_pages::logs_page');
         }
         do_action('ws_plugin__s2member_during_add_admin_options_additional_pages', get_defined_vars());
     }
     do_action('ws_plugin__s2member_after_add_admin_options', get_defined_vars());
 }
 /**
  * s2Member's PayPal IPN handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_notify_in::paypal_notify()}.
  *
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars, EXTR_OVERWRITE | EXTR_REFS);
     // Extract all vars passed in from: ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``.
     if (!empty($paypal['txn_type']) && preg_match('/^(web_accept|subscr_signup)$/i', $paypal['txn_type']) && (!empty($paypal['item_number']) && preg_match($GLOBALS['WS_PLUGIN__']['s2member']['c']['membership_item_number_w_level_regex'], $paypal['item_number'])) && (!empty($paypal['subscr_id']) || !empty($paypal['txn_id']) && ($paypal['subscr_id'] = $paypal['txn_id'])) && (empty($paypal['payment_status']) || empty($payment_status_issues) || !preg_match($payment_status_issues, $paypal['payment_status'])) && (!empty($paypal['subscr_baid']) || ($paypal['subscr_baid'] = $paypal['subscr_id'])) && (!empty($paypal['subscr_cid']) || ($paypal['subscr_cid'] = $paypal['subscr_id'])) && !empty($paypal['payer_email'])) {
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__s2member_during_paypal_notify_before_subscr_signup', get_defined_vars());
         unset($__refs, $__v);
         if (!get_transient($transient_ipn = 's2m_ipn_' . md5('s2member_transient_' . $_paypal_s)) && set_transient($transient_ipn, time(), 31556926 * 10)) {
             $processing = $modifying = $during = FALSE;
             // Initialize these flags.
             $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ).';
             @(list($paypal['level'], $paypal['ccaps'], $paypal['eotper']) = preg_split('/\\:/', $paypal['item_number'], 3));
             $paypal['ip'] = preg_match('/ip address/i', $paypal['option_name2']) && $paypal['option_selection2'] ? $paypal['option_selection2'] : '';
             $paypal['ip'] = !$paypal['ip'] && preg_match('/^[a-z0-9]+~[0-9\\.]+$/i', $paypal['invoice']) ? preg_replace('/^[a-z0-9]+~/i', '', $paypal['invoice']) : $paypal['ip'];
             $paypal['period1'] = isset($paypal['period1']) && preg_match('/^[1-9]/', $paypal['period1']) ? $paypal['period1'] : '0 D';
             $paypal['mc_amount1'] = isset($paypal['mc_amount1']) && $paypal['mc_amount1'] > 0 ? $paypal['mc_amount1'] : '0.00';
             if (preg_match('/^web_accept$/i', $paypal['txn_type'])) {
                 $paypal['period3'] = $paypal['eotper'] ? $paypal['eotper'] : '1 L';
                 // 1 lifetime.
                 $paypal['mc_amount3'] = $paypal['mc_gross'];
                 // The 'Buy Now' amount is the full gross.
             }
             $paypal['initial_term'] = preg_match('/^[1-9]/', $paypal['period1']) ? $paypal['period1'] : '0 D';
             $paypal['initial'] = isset($paypal['mc_amount1'][0]) && preg_match('/^[1-9]/', $paypal['period1']) ? $paypal['mc_amount1'] : $paypal['mc_amount3'];
             $paypal['regular'] = $paypal['mc_amount3'];
             // This is the regular payment amount that is charged to the customer. always required by PayPal.
             $paypal['regular_term'] = $paypal['period3'];
             // This is just set to keep a standard; this way both initial_term & regular_term are available.
             $paypal['recurring'] = !empty($paypal['recurring']) ? $paypal['mc_amount3'] : '0';
             // If non-recurring, this should be zero, otherwise regular.
             $paypal['currency'] = strtoupper($paypal['mc_currency']);
             // Normalize input currency.
             $paypal['currency_symbol'] = c_ws_plugin__s2member_utils_cur::symbol($paypal['currency']);
             if (!empty($coupon['coupon_code']) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 $coupon_class = new c_ws_plugin__s2member_pro_coupons();
                 $coupon_class->update_uses($coupon['coupon_code']);
             }
             $ipn_signup_vars = $paypal;
             // Create array of IPN signup vars w/o s2member_log.
             unset($ipn_signup_vars['s2member_log']);
             /*
             New Subscription with advanced update vars (option_name1, option_selection1)? These variables are used in Subscr. Modifications.
             */
             if (preg_match('/(referenc|associat|updat|upgrad)/i', $paypal['option_name1']) && $paypal['option_selection1']) {
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 do_action('ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars', get_defined_vars());
                 unset($__refs, $__v);
                 $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ) w/ update vars.';
                 if (($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with($paypal['subscr_id'], $paypal['option_selection1'])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                     if (!$user->has_cap('administrator')) {
                         $processing = $modifying = $during = TRUE;
                         // Yes, we ARE processing this.
                         foreach (array_keys(get_defined_vars()) as $__v) {
                             $__refs[$__v] =& ${$__v};
                         }
                         do_action('ws_plugin__s2member_during_paypal_notify_during_before_subscr_signup_w_update_vars', get_defined_vars());
                         do_action('ws_plugin__s2member_during_collective_mods', $user_id, get_defined_vars(), 'ipn-upgrade-downgrade', 'modification', 's2member_level' . $paypal['level']);
                         unset($__refs, $__v);
                         $fields = get_user_option('s2member_custom_fields', $user_id);
                         $user_reg_ip = get_user_option('s2member_registration_ip', $user_id);
                         $user_reg_ip = $paypal['ip'] = $user_reg_ip ? $user_reg_ip : $paypal['ip'];
                         if (is_multisite() && !is_user_member_of_blog($user_id)) {
                             add_existing_user_to_blog(array('user_id' => $user_id, 'role' => 's2member_level' . $paypal['level']));
                             $user = new WP_User($user_id);
                         }
                         $current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
                         if ($current_role !== 's2member_level' . $paypal['level']) {
                             $user->set_role('s2member_level' . $paypal['level']);
                         }
                         if ($paypal['ccaps'] && preg_match('/^-all/', str_replace('+', '', $paypal['ccaps']))) {
                             foreach ($user->allcaps as $cap => $cap_enabled) {
                                 if (preg_match('/^access_s2member_ccap_/', $cap)) {
                                     $user->remove_cap($ccap = $cap);
                                 }
                             }
                         }
                         if ($paypal['ccaps'] && preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $paypal['ccaps']))) {
                             foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $paypal['ccaps']))) as $ccap) {
                                 if (strlen($ccap = trim(strtolower(preg_replace('/[^a-z_0-9]/i', '', $ccap))))) {
                                     $user->add_cap('access_s2member_ccap_' . $ccap);
                                 }
                             }
                         }
                         update_user_option($user_id, 's2member_subscr_gateway', $paypal['subscr_gateway']);
                         update_user_option($user_id, 's2member_subscr_id', $paypal['subscr_id']);
                         update_user_option($user_id, 's2member_subscr_baid', $paypal['subscr_baid']);
                         update_user_option($user_id, 's2member_subscr_cid', $paypal['subscr_cid']);
                         update_user_option($user_id, 's2member_custom', $paypal['custom']);
                         if (!get_user_option('s2member_registration_ip', $user_id)) {
                             update_user_option($user_id, 's2member_registration_ip', $paypal['ip']);
                         }
                         update_user_option($user_id, 's2member_ipn_signup_vars', $ipn_signup_vars);
                         delete_user_option($user_id, 's2member_file_download_access_log');
                         if ((preg_match('/^web_accept$/i', $paypal['txn_type']) || $paypal['initial'] <= 0 && $paypal['regular'] <= 0) && $paypal['eotper']) {
                             update_user_option($user_id, 's2member_auto_eot_time', $eot_time = c_ws_plugin__s2member_utils_time::auto_eot_time('', '', '', $paypal['eotper'], '', get_user_option('s2member_auto_eot_time', $user_id)));
                             $paypal['s2member_log'][] = 'Automatic EOT (End Of Term) Time set to: ' . date('D M j, Y g:i:s a T', $eot_time) . '.';
                         } else {
                             delete_user_option($user_id, 's2member_auto_eot_time');
                         }
                         $pr_times = get_user_option('s2member_paid_registration_times', $user_id);
                         $pr_times['level'] = !$pr_times['level'] ? time() : $pr_times['level'];
                         // Preserve existing.
                         $pr_times['level' . $paypal['level']] = !$pr_times['level' . $paypal['level']] ? time() : $pr_times['level' . $paypal['level']];
                         update_user_option($user_id, 's2member_paid_registration_times', $pr_times);
                         if (!empty($coupon['full_coupon_code']) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                             $user_coupons = is_array($user_coupons = get_user_option('s2member_coupon_codes', $user_id)) ? $user_coupons : array();
                             $user_coupons = array_unique(array_merge($user_coupons, (array) $coupon['full_coupon_code']));
                             update_user_option($user_id, 's2member_coupon_codes', $user_coupons);
                             $processed_coupons = TRUE;
                             // Flag for routines below.
                         }
                         c_ws_plugin__s2member_user_notes::clear_user_note_lines($user_id, '/^Demoted by s2Member\\:/');
                         c_ws_plugin__s2member_user_notes::clear_user_note_lines($user_id, '/^Paid Subscr\\. ID @ time of demotion\\:/');
                         $paypal['s2member_log'][] = 's2Member Level/Capabilities updated w/ advanced update routines.';
                         $sbj = $GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_email_subject'];
                         // The same for standard and w/ Pro-Forms.
                         $msg = $GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_email_message'];
                         // The same for standard and w/ Pro-Forms.
                         $rec = $GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_email_recipients'];
                         // The same for standard and w/ Pro-Forms.
                         if (($rec = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $rec)) && ($rec = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $rec))) {
                             if (($rec = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $rec)) && ($rec = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $rec))) {
                                 if (($rec = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $rec)) && ($rec = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $rec))) {
                                     if (($rec = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $rec)) && ($rec = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $rec))) {
                                         if (($rec = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $rec)) && ($rec = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $rec))) {
                                             if (($rec = preg_replace('/%%initial_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['initial_term'])), $rec)) && ($rec = preg_replace('/%%regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], $paypal['recurring'])), $rec))) {
                                                 if (($rec = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $rec)) && ($rec = preg_replace('/%%recurring\\/regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring'] ? $paypal['recurring'] . ' / ' . c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], TRUE) : '0 / non-recurring'), $rec))) {
                                                     if (($rec = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $rec)) && ($rec = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $rec))) {
                                                         if (($rec = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name'])), $rec)) && ($rec = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name'])), $rec))) {
                                                             if ($rec = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $rec)) {
                                                                 // **NOTE** c_ws_plugin__s2member_utils_strings::esc_dq() is applied here. (ex. 'N\'ame' <email>).
                                                                 if ($rec = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $rec)) {
                                                                     if (($rec = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $rec))) {
                                                                         if (($rec = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $rec)) && ($rec = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $rec))) {
                                                                             if ($rec = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $rec)) {
                                                                                 if ($rec = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $rec)) {
                                                                                     if ($rec = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $rec)) {
                                                                                         if ($rec = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $rec)) {
                                                                                             if ($rec = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $rec)) {
                                                                                                 if (($sbj = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $sbj)) && ($sbj = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $sbj))) {
                                                                                                     if (($sbj = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $sbj)) && ($sbj = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $sbj))) {
                                                                                                         if (($sbj = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $sbj)) && ($sbj = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $sbj))) {
                                                                                                             if (($sbj = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $sbj)) && ($sbj = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $sbj))) {
                                                                                                                 if (($sbj = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $sbj)) && ($sbj = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $sbj))) {
                                                                                                                     if (($sbj = preg_replace('/%%initial_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['initial_term'])), $sbj)) && ($sbj = preg_replace('/%%regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], $paypal['recurring'])), $sbj))) {
                                                                                                                         if (($sbj = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $sbj)) && ($sbj = preg_replace('/%%recurring\\/regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring'] ? $paypal['recurring'] . ' / ' . c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], TRUE) : '0 / non-recurring'), $sbj))) {
                                                                                                                             if (($sbj = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $sbj)) && ($sbj = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $sbj))) {
                                                                                                                                 if (($sbj = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $sbj)) && ($sbj = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $sbj))) {
                                                                                                                                     if ($sbj = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $sbj)) {
                                                                                                                                         if ($sbj = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $sbj)) {
                                                                                                                                             if (($sbj = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $sbj))) {
                                                                                                                                                 if (($sbj = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $sbj)) && ($sbj = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $sbj))) {
                                                                                                                                                     if ($sbj = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $sbj)) {
                                                                                                                                                         if ($sbj = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $sbj)) {
                                                                                                                                                             if ($sbj = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $sbj)) {
                                                                                                                                                                 if ($sbj = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $sbj)) {
                                                                                                                                                                     if ($sbj = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $sbj)) {
                                                                                                                                                                         if (($msg = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)) && ($msg = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $msg))) {
                                                                                                                                                                             if (($msg = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $msg)) && ($msg = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $msg))) {
                                                                                                                                                                                 if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                                                                                                                                                                     if (($msg = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $msg)) && ($msg = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $msg))) {
                                                                                                                                                                                         if (($msg = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $msg)) && ($msg = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $msg))) {
                                                                                                                                                                                             if (($msg = preg_replace('/%%initial_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['initial_term'])), $msg)) && ($msg = preg_replace('/%%regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], $paypal['recurring'])), $msg))) {
                                                                                                                                                                                                 if (($msg = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $msg)) && ($msg = preg_replace('/%%recurring\\/regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring'] ? $paypal['recurring'] . ' / ' . c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], TRUE) : '0 / non-recurring'), $msg))) {
                                                                                                                                                                                                     if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                                                                                                                                                                                         if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                                                                                                                                                                             if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                                                                                                                                                                                 if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                                                                                                                                                                                     if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                                                                                                                                                                         if (($msg = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $msg)) && ($msg = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $msg))) {
                                                                                                                                                                                                                             if ($msg = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $msg)) {
                                                                                                                                                                                                                                 if ($msg = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $msg)) {
                                                                                                                                                                                                                                     if ($msg = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $msg)) {
                                                                                                                                                                                                                                         if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $msg)) {
                                                                                                                                                                                                                                             if ($msg = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $msg)) {
                                                                                                                                                                                                                                                 if (is_array($fields) && !empty($fields)) {
                                                                                                                                                                                                                                                     foreach ($fields as $var => $val) {
                                                                                                                                                                                                                                                         $rec = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $rec);
                                                                                                                                                                                                                                                         $sbj = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $sbj);
                                                                                                                                                                                                                                                         $msg = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $msg);
                                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                 if (($rec = trim(preg_replace('/%%(.+?)%%/i', '', $rec))) && ($sbj = trim(preg_replace('/%%(.+?)%%/i', '', $sbj))) && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                                                                                                                                                                                     if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
                                                                                                                                                                                                                                                         $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
                                                                                                                                                                                                                                                         $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
                                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                                     foreach (c_ws_plugin__s2member_utils_strings::parse_emails($rec) as $recipient) {
                                                                                                                                                                                                                                                         c_ws_plugin__s2member_email_configs::email_config() . wp_mail($recipient, apply_filters('ws_plugin__s2member_modification_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_modification_email_msg', $msg, get_defined_vars()), 'From: "' . preg_replace('/"/', "'", $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']) . '" <' . $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'] . '>' . "\r\n" . 'Content-Type: text/plain; charset=UTF-8') . c_ws_plugin__s2member_email_configs::email_config_release();
                                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                                     $paypal['s2member_log'][] = 'Modification Confirmation Email sent to: ' . $rec . '.';
                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                         }
                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                             }
                                                                                                                                                                                                                         }
                                                                                                                                                                                                                     }
                                                                                                                                                                                                                 }
                                                                                                                                                                                                             }
                                                                                                                                                                                                         }
                                                                                                                                                                                                     }
                                                                                                                                                                                                 }
                                                                                                                                                                                             }
                                                                                                                                                                                         }
                                                                                                                                                                                     }
                                                                                                                                                                                 }
                                                                                                                                                                             }
                                                                                                                                                                         }
                                                                                                                                                                     }
                                                                                                                                                                 }
                                                                                                                                                             }
                                                                                                                                                         }
                                                                                                                                                     }
                                                                                                                                                 }
                                                                                                                                             }
                                                                                                                                         }
                                                                                                                                     }
                                                                                                                                 }
                                                                                                                             }
                                                                                                                         }
                                                                                                                     }
                                                                                                                 }
                                                                                                             }
                                                                                                         }
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_notification_urls'] && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                             foreach (preg_split('/[' . "\r\n\t" . ']+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_notification_urls']) as $url) {
                                 if (($url = preg_replace('/%%cv([0-9]+)%%/ei', 'urlencode(trim(@$cv[$1]))', $url)) && ($url = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_id'])), $url))) {
                                     if (($url = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_baid'])), $url)) && ($url = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_cid'])), $url))) {
                                         if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                             if (($url = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['initial'])), $url)) && ($url = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['regular'])), $url)) && ($url = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['recurring'])), $url))) {
                                                 if (($url = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['initial_term'])), $url)) && ($url = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['regular_term'])), $url))) {
                                                     if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                                         if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                             if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                                 if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                                     if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                                         if (($url = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->first_name)), $url)) && ($url = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->last_name)), $url))) {
                                                                             if ($url = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($user->first_name . ' ' . $user->last_name))), $url)) {
                                                                                 if ($url = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_email)), $url)) {
                                                                                     if ($url = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_login)), $url)) {
                                                                                         if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_reg_ip)), $url)) {
                                                                                             if ($url = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_id)), $url)) {
                                                                                                 if (is_array($fields) && !empty($fields)) {
                                                                                                     foreach ($fields as $var => $val) {
                                                                                                         if (!($url = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(maybe_serialize($val))), $url))) {
                                                                                                             break;
                                                                                                         }
                                                                                                     }
                                                                                                 }
                                                                                                 if ($url = trim(preg_replace('/%%(.+?)%%/i', '', $url))) {
                                                                                                     c_ws_plugin__s2member_utils_urls::remote($url);
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             $paypal['s2member_log'][] = 'Modification Notification URLs have been processed.';
                         }
                         if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_notification_recipients'] && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                             $msg = $sbj = '(s2Member / API Notification Email) - Modification';
                             $msg .= "\n\n";
                             // Spacing in the message body.
                             $msg .= 'subscr_id: %%subscr_id%%' . "\n";
                             $msg .= 'subscr_baid: %%subscr_baid%%' . "\n";
                             $msg .= 'subscr_cid: %%subscr_cid%%' . "\n";
                             $msg .= 'currency: %%currency%%' . "\n";
                             $msg .= 'currency_symbol: %%currency_symbol%%' . "\n";
                             $msg .= 'initial: %%initial%%' . "\n";
                             $msg .= 'regular: %%regular%%' . "\n";
                             $msg .= 'recurring: %%recurring%%' . "\n";
                             $msg .= 'initial_term: %%initial_term%%' . "\n";
                             $msg .= 'regular_term: %%regular_term%%' . "\n";
                             $msg .= 'item_number: %%item_number%%' . "\n";
                             $msg .= 'item_name: %%item_name%%' . "\n";
                             $msg .= 'first_name: %%first_name%%' . "\n";
                             $msg .= 'last_name: %%last_name%%' . "\n";
                             $msg .= 'full_name: %%full_name%%' . "\n";
                             $msg .= 'payer_email: %%payer_email%%' . "\n";
                             $msg .= 'full_coupon_code: %%full_coupon_code%%' . "\n";
                             $msg .= 'coupon_code: %%coupon_code%%' . "\n";
                             $msg .= 'coupon_affiliate_id: %%coupon_affiliate_id%%' . "\n";
                             $msg .= 'user_first_name: %%user_first_name%%' . "\n";
                             $msg .= 'user_last_name: %%user_last_name%%' . "\n";
                             $msg .= 'user_full_name: %%user_full_name%%' . "\n";
                             $msg .= 'user_email: %%user_email%%' . "\n";
                             $msg .= 'user_login: %%user_login%%' . "\n";
                             $msg .= 'user_ip: %%user_ip%%' . "\n";
                             $msg .= 'user_id: %%user_id%%' . "\n";
                             if (is_array($fields) && !empty($fields)) {
                                 foreach ($fields as $var => $val) {
                                     $msg .= $var . ': %%' . $var . '%%' . "\n";
                                 }
                             }
                             $msg .= 'cv0: %%cv0%%' . "\n";
                             $msg .= 'cv1: %%cv1%%' . "\n";
                             $msg .= 'cv2: %%cv2%%' . "\n";
                             $msg .= 'cv3: %%cv3%%' . "\n";
                             $msg .= 'cv4: %%cv4%%' . "\n";
                             $msg .= 'cv5: %%cv5%%' . "\n";
                             $msg .= 'cv6: %%cv6%%' . "\n";
                             $msg .= 'cv7: %%cv7%%' . "\n";
                             $msg .= 'cv8: %%cv8%%' . "\n";
                             $msg .= 'cv9: %%cv9%%';
                             if (($msg = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)) && ($msg = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $msg))) {
                                 if (($msg = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $msg)) && ($msg = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $msg))) {
                                     if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                         if (($msg = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $msg)) && ($msg = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $msg)) && ($msg = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $msg))) {
                                             if (($msg = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $msg)) && ($msg = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $msg))) {
                                                 if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                                     if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                         if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                             if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                                 if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                     if (($msg = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $msg)) && ($msg = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $msg))) {
                                                                         if ($msg = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $msg)) {
                                                                             if ($msg = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $msg)) {
                                                                                 if ($msg = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $msg)) {
                                                                                     if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $msg)) {
                                                                                         if ($msg = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $msg)) {
                                                                                             if (is_array($fields) && !empty($fields)) {
                                                                                                 foreach ($fields as $var => $val) {
                                                                                                     if (!($msg = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $msg))) {
                                                                                                         break;
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                             if ($sbj && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                                 // Still have a ``$sbj`` and a ``$msg``?
                                                                                                 foreach (c_ws_plugin__s2member_utils_strings::parse_emails($GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_notification_recipients']) as $recipient) {
                                                                                                     wp_mail($recipient, apply_filters('ws_plugin__s2member_modification_notification_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_modification_notification_email_msg', $msg, get_defined_vars()), 'Content-Type: text/plain; charset=UTF-8');
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             $paypal['s2member_log'][] = 'Modification Notification Emails have been processed.';
                         }
                         if ($processing && ($code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['modification_tracking_codes']) && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                             if (($code = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $code)) && ($code = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $code))) {
                                 if (($code = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $code)) && ($code = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $code))) {
                                     if (($code = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $code)) && ($code = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $code))) {
                                         if (($code = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $code)) && ($code = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $code)) && ($code = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $code))) {
                                             if (($code = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $code)) && ($code = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $code))) {
                                                 if (($code = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $code)) && ($code = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $code))) {
                                                     if (($code = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $code)) && ($code = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $code))) {
                                                         if ($code = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $code)) {
                                                             if ($code = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $code)) {
                                                                 if (($code = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $code)) && ($code = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $code)) && ($code = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $code))) {
                                                                     if (($code = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $code)) && ($code = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $code))) {
                                                                         if ($code = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $code)) {
                                                                             if ($code = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $code)) {
                                                                                 if ($code = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $code)) {
                                                                                     if ($code = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $code)) {
                                                                                         if ($code = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $code)) {
                                                                                             if (is_array($fields) && !empty($fields)) {
                                                                                                 foreach ($fields as $var => $val) {
                                                                                                     if (!($code = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $code))) {
                                                                                                         break;
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                             if ($code = trim(preg_replace('/%%(.+?)%%/i', '', $code))) {
                                                                                                 $paypal['s2member_log'][] = 'Storing Modification Tracking Codes into a Transient Queue. These will be processed on-site.';
                                                                                                 set_transient('s2m_' . md5('s2member_transient_modification_tracking_codes_' . $paypal['subscr_id']), $code, 43200);
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         foreach (array_keys(get_defined_vars()) as $__v) {
                             $__refs[$__v] =& ${$__v};
                         }
                         do_action('ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars', get_defined_vars());
                         unset($__refs, $__v);
                     } else {
                         $paypal['s2member_log'][] = 'Unable to modify Subscription. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.';
                     }
                 } else {
                     $paypal['s2member_log'][] = 'Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the `on0` and `os0` variables in your Button Code.';
                 }
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 do_action('ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars', get_defined_vars());
                 unset($__refs, $__v);
             } else {
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 do_action('ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars', get_defined_vars());
                 unset($__refs, $__v);
                 $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ) w/o update vars.';
                 if (($registration_url = c_ws_plugin__s2member_register_access::register_link_gen($paypal['subscr_gateway'], $paypal['subscr_id'], $paypal['custom'], $paypal['item_number'])) && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                     $processing = $during = TRUE;
                     // Yes, we ARE processing this.
                     $sbj = preg_replace('/%%registration_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($registration_url), $GLOBALS['WS_PLUGIN__']['s2member']['o'][($_REQUEST['s2member_paypal_proxy'] && preg_match('/pro-emails/', $_REQUEST['s2member_paypal_proxy_use']) ? 'pro_' : '') . 'signup_email_subject']);
                     $msg = preg_replace('/%%registration_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($registration_url), $GLOBALS['WS_PLUGIN__']['s2member']['o'][($_REQUEST['s2member_paypal_proxy'] && preg_match('/pro-emails/', $_REQUEST['s2member_paypal_proxy_use']) ? 'pro_' : '') . 'signup_email_message']);
                     $rec = preg_replace('/%%registration_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($registration_url), $GLOBALS['WS_PLUGIN__']['s2member']['o'][($_REQUEST['s2member_paypal_proxy'] && preg_match('/pro-emails/', $_REQUEST['s2member_paypal_proxy_use']) ? 'pro_' : '') . 'signup_email_recipients']);
                     if (($rec = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $rec)) && ($rec = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $rec))) {
                         if (($rec = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $rec)) && ($rec = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $rec))) {
                             if (($rec = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $rec)) && ($rec = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $rec))) {
                                 if (($rec = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $rec)) && ($rec = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $rec))) {
                                     if (($rec = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $rec)) && ($rec = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $rec))) {
                                         if (($rec = preg_replace('/%%initial_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['initial_term'])), $rec)) && ($rec = preg_replace('/%%regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], $paypal['recurring'])), $rec))) {
                                             if (($rec = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $rec)) && ($rec = preg_replace('/%%recurring\\/regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring'] ? $paypal['recurring'] . ' / ' . c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], TRUE) : '0 / non-recurring'), $rec))) {
                                                 if (($rec = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $rec)) && ($rec = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $rec))) {
                                                     if (($rec = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name'])), $rec)) && ($rec = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name'])), $rec))) {
                                                         if ($rec = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $rec)) {
                                                             // **NOTE** c_ws_plugin__s2member_utils_strings::esc_dq() is applied here. (ex. "N\"ame" <email>).
                                                             if ($rec = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $rec)) {
                                                                 if ($rec = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $rec)) {
                                                                     if (($rec = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $rec))) {
                                                                         if (($sbj = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $sbj)) && ($sbj = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $sbj))) {
                                                                             if (($sbj = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $sbj)) && ($sbj = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $sbj))) {
                                                                                 if (($sbj = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $sbj)) && ($sbj = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $sbj))) {
                                                                                     if (($sbj = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $sbj)) && ($sbj = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $sbj))) {
                                                                                         if (($sbj = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $sbj)) && ($sbj = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $sbj))) {
                                                                                             if (($sbj = preg_replace('/%%initial_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['initial_term'])), $sbj)) && ($sbj = preg_replace('/%%regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], $paypal['recurring'])), $sbj))) {
                                                                                                 if (($sbj = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $sbj)) && ($sbj = preg_replace('/%%recurring\\/regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring'] ? $paypal['recurring'] . ' / ' . c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], TRUE) : '0 / non-recurring'), $sbj))) {
                                                                                                     if (($sbj = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $sbj)) && ($sbj = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $sbj))) {
                                                                                                         if (($sbj = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $sbj)) && ($sbj = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $sbj))) {
                                                                                                             if ($sbj = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $sbj)) {
                                                                                                                 if ($sbj = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $sbj)) {
                                                                                                                     if ($sbj = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $sbj)) {
                                                                                                                         if (($sbj = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $sbj))) {
                                                                                                                             if (($msg = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)) && ($msg = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $msg))) {
                                                                                                                                 if (($msg = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $msg)) && ($msg = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $msg))) {
                                                                                                                                     if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                                                                                                                         if (($msg = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $msg)) && ($msg = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $msg))) {
                                                                                                                                             if (($msg = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $msg)) && ($msg = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $msg))) {
                                                                                                                                                 if (($msg = preg_replace('/%%initial_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['initial_term'])), $msg)) && ($msg = preg_replace('/%%regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], $paypal['recurring'])), $msg))) {
                                                                                                                                                     if (($msg = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $msg)) && ($msg = preg_replace('/%%recurring\\/regular_cycle%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring'] ? $paypal['recurring'] . ' / ' . c_ws_plugin__s2member_utils_time::period_term($paypal['regular_term'], TRUE) : '0 / non-recurring'), $msg))) {
                                                                                                                                                         if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                                                                                                                                             if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                                                                                                                                 if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                                                                                                                                     if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                                                                                                                                         if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $msg)) {
                                                                                                                                                                             if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                                                                                                                                 if (($rec = trim(preg_replace('/%%(.+?)%%/i', '', $rec))) && ($sbj = trim(preg_replace('/%%(.+?)%%/i', '', $sbj))) && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                                                                                                                     if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
                                                                                                                                                                                         $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
                                                                                                                                                                                         $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
                                                                                                                                                                                     }
                                                                                                                                                                                     foreach (c_ws_plugin__s2member_utils_strings::parse_emails($rec) as $recipient) {
                                                                                                                                                                                         // Go through a possible list of recipients.
                                                                                                                                                                                         c_ws_plugin__s2member_email_configs::email_config() . wp_mail($recipient, apply_filters('ws_plugin__s2member_signup_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_signup_email_msg', $msg, get_defined_vars()), 'From: "' . preg_replace('/"/', "'", $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']) . '" <' . $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'] . '>' . "\r\n" . 'Content-Type: text/plain; charset=UTF-8') . c_ws_plugin__s2member_email_configs::email_config_release();
                                                                                                                                                                                     }
                                                                                                                                                                                     $paypal['s2member_log'][] = 'Signup Confirmation Email sent to: ' . $rec . '.';
                                                                                                                                                                                 }
                                                                                                                                                                             }
                                                                                                                                                                         }
                                                                                                                                                                     }
                                                                                                                                                                 }
                                                                                                                                                             }
                                                                                                                                                         }
                                                                                                                                                     }
                                                                                                                                                 }
                                                                                                                                             }
                                                                                                                                         }
                                                                                                                                     }
                                                                                                                                 }
                                                                                                                             }
                                                                                                                         }
                                                                                                                     }
                                                                                                                 }
                                                                                                             }
                                                                                                         }
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['signup_notification_urls'] && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                         foreach (preg_split('/[' . "\r\n\t" . ']+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['signup_notification_urls']) as $url) {
                             if (($url = preg_replace('/%%cv([0-9]+)%%/ei', 'urlencode(trim(@$cv[$1]))', $url)) && ($url = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_id'])), $url))) {
                                 if (($url = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_baid'])), $url)) && ($url = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_cid'])), $url))) {
                                     if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                         if (($url = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['initial'])), $url)) && ($url = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['regular'])), $url)) && ($url = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['recurring'])), $url))) {
                                             if (($url = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['initial_term'])), $url)) && ($url = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['regular_term'])), $url))) {
                                                 if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                                     if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                         if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                             if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                                 if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['ip'])), $url)) {
                                                                     if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                                         if ($url = trim(preg_replace('/%%(.+?)%%/i', '', $url))) {
                                                                             c_ws_plugin__s2member_utils_urls::remote($url);
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         $paypal['s2member_log'][] = 'Signup Notification URLs have been processed.';
                     }
                     if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['signup_notification_recipients'] && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                         $msg = $sbj = '(s2Member / API Notification Email) - Signup';
                         $msg .= "\n\n";
                         // Spacing in the message body.
                         $msg .= 'subscr_id: %%subscr_id%%' . "\n";
                         $msg .= 'subscr_baid: %%subscr_baid%%' . "\n";
                         $msg .= 'subscr_cid: %%subscr_cid%%' . "\n";
                         $msg .= 'currency: %%currency%%' . "\n";
                         $msg .= 'currency_symbol: %%currency_symbol%%' . "\n";
                         $msg .= 'initial: %%initial%%' . "\n";
                         $msg .= 'regular: %%regular%%' . "\n";
                         $msg .= 'recurring: %%recurring%%' . "\n";
                         $msg .= 'initial_term: %%initial_term%%' . "\n";
                         $msg .= 'regular_term: %%regular_term%%' . "\n";
                         $msg .= 'item_number: %%item_number%%' . "\n";
                         $msg .= 'item_name: %%item_name%%' . "\n";
                         $msg .= 'first_name: %%first_name%%' . "\n";
                         $msg .= 'last_name: %%last_name%%' . "\n";
                         $msg .= 'full_name: %%full_name%%' . "\n";
                         $msg .= 'payer_email: %%payer_email%%' . "\n";
                         $msg .= 'user_ip: %%user_ip%%' . "\n";
                         $msg .= 'full_coupon_code: %%full_coupon_code%%' . "\n";
                         $msg .= 'coupon_code: %%coupon_code%%' . "\n";
                         $msg .= 'coupon_affiliate_id: %%coupon_affiliate_id%%' . "\n";
                         $msg .= 'cv0: %%cv0%%' . "\n";
                         $msg .= 'cv1: %%cv1%%' . "\n";
                         $msg .= 'cv2: %%cv2%%' . "\n";
                         $msg .= 'cv3: %%cv3%%' . "\n";
                         $msg .= 'cv4: %%cv4%%' . "\n";
                         $msg .= 'cv5: %%cv5%%' . "\n";
                         $msg .= 'cv6: %%cv6%%' . "\n";
                         $msg .= 'cv7: %%cv7%%' . "\n";
                         $msg .= 'cv8: %%cv8%%' . "\n";
                         $msg .= 'cv9: %%cv9%%';
                         if (($msg = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)) && ($msg = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $msg))) {
                             if (($msg = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $msg)) && ($msg = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $msg))) {
                                 if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                     if (($msg = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $msg)) && ($msg = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $msg)) && ($msg = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $msg))) {
                                         if (($msg = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $msg)) && ($msg = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $msg))) {
                                             if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                                 if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                     if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                         if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                             if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $msg)) {
                                                                 if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                     if ($sbj && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                         // Still have a ``$sbj`` and a ``$msg``?
                                                                         foreach (c_ws_plugin__s2member_utils_strings::parse_emails($GLOBALS['WS_PLUGIN__']['s2member']['o']['signup_notification_recipients']) as $recipient) {
                                                                             wp_mail($recipient, apply_filters('ws_plugin__s2member_signup_notification_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_signup_notification_email_msg', $msg, get_defined_vars()), 'Content-Type: text/plain; charset=UTF-8');
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         $paypal['s2member_log'][] = 'Signup Notification Emails have been processed.';
                     }
                     if ($processing && ($code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['signup_tracking_codes']) && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                         if (($code = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $code)) && ($code = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $code))) {
                             if (($code = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $code)) && ($code = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $code))) {
                                 if (($code = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $code)) && ($code = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $code))) {
                                     if (($code = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial']), $code)) && ($code = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular']), $code)) && ($code = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['recurring']), $code))) {
                                         if (($code = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['initial_term']), $code)) && ($code = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['regular_term']), $code))) {
                                             if (($code = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $code)) && ($code = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $code))) {
                                                 if (($code = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $code)) && ($code = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $code))) {
                                                     if ($code = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $code)) {
                                                         if ($code = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $code)) {
                                                             if ($code = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $code)) {
                                                                 if (($code = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $code)) && ($code = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $code)) && ($code = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $code))) {
                                                                     if ($code = trim(preg_replace('/%%(.+?)%%/i', '', $code))) {
                                                                         $paypal['s2member_log'][] = 'Storing Signup Tracking Codes into a Transient Queue. These will be processed on-site.';
                                                                         set_transient('s2m_' . md5('s2member_transient_signup_tracking_codes_' . $paypal['subscr_id']), $code, 43200);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     do_action('ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars', get_defined_vars());
                     unset($__refs, $__v);
                 } else {
                     $paypal['s2member_log'][] = 'Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.';
                 }
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 do_action('ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars', get_defined_vars());
                 unset($__refs, $__v);
             }
             if ($processing && $_REQUEST['s2member_paypal_proxy'] && ($url = $_REQUEST['s2member_paypal_proxy_return_url']) && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                 if (!empty($user_id) && !empty($user) && is_object($user) && $user->ID || ($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with($paypal['subscr_id'], $paypal['option_selection1'])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                     $fields = get_user_option('s2member_custom_fields', $user_id);
                     // These will be needed in the routines below.
                     $user_reg_ip = get_user_option('s2member_registration_ip', $user_id);
                     // Original IP during Registration.
                     if (($url = preg_replace('/%%cv([0-9]+)%%/ei', 'urlencode(trim(@$cv[$1]))', $url)) && ($url = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_id'])), $url))) {
                         if (($url = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_baid'])), $url)) && ($url = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_cid'])), $url))) {
                             if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                 if (($url = preg_replace('/%%initial%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['initial'])), $url)) && ($url = preg_replace('/%%regular%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['regular'])), $url)) && ($url = preg_replace('/%%recurring%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['recurring'])), $url))) {
                                     if (($url = preg_replace('/%%initial_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['initial_term'])), $url)) && ($url = preg_replace('/%%regular_term%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['regular_term'])), $url))) {
                                         if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                             if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                 if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                     if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                         if ($url = preg_replace('/%%modification%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode((int) $modifying)), $url)) {
                                                             if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                                 if (($url = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->first_name)), $url)) && ($url = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->last_name)), $url))) {
                                                                     if ($url = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($user->first_name . ' ' . $user->last_name))), $url)) {
                                                                         if ($url = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_email)), $url)) {
                                                                             if ($url = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_login)), $url)) {
                                                                                 if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_reg_ip)), $url)) {
                                                                                     if ($url = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_id)), $url)) {
                                                                                         if (is_array($fields) && !empty($fields)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 if (!($url = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(maybe_serialize($val))), $url))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                         if ($url = trim($url)) {
                                                                                             // Preserve remaining replacements; parent routine may perform replacements too.
                                                                                             $paypal['s2member_paypal_proxy_return_url'] = $url;
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 $paypal['s2member_log'][] = 'Subscr. Return ( `modification=' . (int) $modifying . '` ), a Proxy Return URL is ready.';
             }
             if ($processing && (preg_match('/^web_accept$/i', $paypal['txn_type']) || $_REQUEST['s2member_paypal_proxy'] && preg_match('/subscr-signup-as-subscr-payment/', $_REQUEST['s2member_paypal_proxy_use']) && $paypal['txn_id'] && $paypal['mc_gross'] > 0) && (!empty($user_id) && !empty($user) && is_object($user) && $user->ID || ($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with($paypal['subscr_id'], $paypal['option_selection1'])) && is_object($user = new WP_User($user_id)) && $user->ID)) {
                 $paypal['s2member_log'][] = 'User exists. Handling `payment` for Subscription via ( `' . (preg_match('/^web_accept$/i', $paypal['txn_type']) ? 'web_accept' : 'subscr-signup-as-subscr-payment') . '` ).';
                 $pr_times = get_user_option('s2member_paid_registration_times', $user_id);
                 $pr_times['level'] = !$pr_times['level'] ? time() : $pr_times['level'];
                 // Preserve existing.
                 $pr_times['level' . $paypal['level']] = !$pr_times['level' . $paypal['level']] ? time() : $pr_times['level' . $paypal['level']];
                 update_user_option($user_id, 's2member_paid_registration_times', $pr_times);
                 if (!get_user_option('s2member_first_payment_txn_id', $user_id)) {
                     update_user_option($user_id, 's2member_first_payment_txn_id', $paypal['txn_id']);
                 }
                 update_user_option($user_id, 's2member_last_payment_time', time());
                 // Update the last payment time.
                 $fields = get_user_option('s2member_custom_fields', $user_id);
                 // These will be needed in the routines below.
                 $user_reg_ip = get_user_option('s2member_registration_ip', $user_id);
                 // Original IP during Registration.
                 if (empty($processed_coupons) && !empty($coupon['full_coupon_code']) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                     $user_coupons = is_array($user_coupons = get_user_option('s2member_coupon_codes', $user_id)) ? $user_coupons : array();
                     $user_coupons = array_unique(array_merge($user_coupons, (array) $coupon['full_coupon_code']));
                     update_user_option($user_id, 's2member_coupon_codes', $user_coupons);
                     $processed_coupons = TRUE;
                     // Flag for routines below.
                 }
                 if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_urls'] && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                     foreach (preg_split('/[' . "\r\n\t" . ']+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_urls']) as $url) {
                         if (($url = preg_replace('/%%cv([0-9]+)%%/ei', 'urlencode(trim(@$cv[$1]))', $url)) && ($url = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_id'])), $url))) {
                             if (($url = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_baid'])), $url)) && ($url = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['subscr_cid'])), $url))) {
                                 if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                     if (($url = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['mc_gross'])), $url)) && ($url = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_id'])), $url))) {
                                         if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                             if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                 if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                     if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                         if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                             if (($url = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->first_name)), $url)) && ($url = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->last_name)), $url))) {
                                                                 if ($url = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($user->first_name . ' ' . $user->last_name))), $url)) {
                                                                     if ($url = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_email)), $url)) {
                                                                         if ($url = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_login)), $url)) {
                                                                             if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_reg_ip)), $url)) {
                                                                                 if ($url = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_id)), $url)) {
                                                                                     if (is_array($fields) && !empty($fields)) {
                                                                                         foreach ($fields as $var => $val) {
                                                                                             if (!($url = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(maybe_serialize($val))), $url))) {
                                                                                                 break;
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                     if ($url = trim(preg_replace('/%%(.+?)%%/i', '', $url))) {
                                                                                         c_ws_plugin__s2member_utils_urls::remote($url);
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     $paypal['s2member_log'][] = 'Payment Notification URLs have been processed.';
                 }
                 if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_recipients'] && is_array($cv = preg_split('/\\|/', $paypal['custom']))) {
                     $msg = $sbj = '(s2Member / API Notification Email) - Payment';
                     $msg .= "\n\n";
                     // Spacing in the message body.
                     $msg .= 'subscr_id: %%subscr_id%%' . "\n";
                     $msg .= 'subscr_baid: %%subscr_baid%%' . "\n";
                     $msg .= 'subscr_cid: %%subscr_cid%%' . "\n";
                     $msg .= 'currency: %%currency%%' . "\n";
                     $msg .= 'currency_symbol: %%currency_symbol%%' . "\n";
                     $msg .= 'amount: %%amount%%' . "\n";
                     $msg .= 'txn_id: %%txn_id%%' . "\n";
                     $msg .= 'item_number: %%item_number%%' . "\n";
                     $msg .= 'item_name: %%item_name%%' . "\n";
                     $msg .= 'first_name: %%first_name%%' . "\n";
                     $msg .= 'last_name: %%last_name%%' . "\n";
                     $msg .= 'full_name: %%full_name%%' . "\n";
                     $msg .= 'payer_email: %%payer_email%%' . "\n";
                     $msg .= 'full_coupon_code: %%full_coupon_code%%' . "\n";
                     $msg .= 'coupon_code: %%coupon_code%%' . "\n";
                     $msg .= 'coupon_affiliate_id: %%coupon_affiliate_id%%' . "\n";
                     $msg .= 'user_first_name: %%user_first_name%%' . "\n";
                     $msg .= 'user_last_name: %%user_last_name%%' . "\n";
                     $msg .= 'user_full_name: %%user_full_name%%' . "\n";
                     $msg .= 'user_email: %%user_email%%' . "\n";
                     $msg .= 'user_login: %%user_login%%' . "\n";
                     $msg .= 'user_ip: %%user_ip%%' . "\n";
                     $msg .= 'user_id: %%user_id%%' . "\n";
                     if (is_array($fields) && !empty($fields)) {
                         foreach ($fields as $var => $val) {
                             $msg .= $var . ': %%' . $var . '%%' . "\n";
                         }
                     }
                     $msg .= 'cv0: %%cv0%%' . "\n";
                     $msg .= 'cv1: %%cv1%%' . "\n";
                     $msg .= 'cv2: %%cv2%%' . "\n";
                     $msg .= 'cv3: %%cv3%%' . "\n";
                     $msg .= 'cv4: %%cv4%%' . "\n";
                     $msg .= 'cv5: %%cv5%%' . "\n";
                     $msg .= 'cv6: %%cv6%%' . "\n";
                     $msg .= 'cv7: %%cv7%%' . "\n";
                     $msg .= 'cv8: %%cv8%%' . "\n";
                     $msg .= 'cv9: %%cv9%%';
                     if (($msg = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)) && ($msg = preg_replace('/%%subscr_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_id']), $msg))) {
                         if (($msg = preg_replace('/%%subscr_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_baid']), $msg)) && ($msg = preg_replace('/%%subscr_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['subscr_cid']), $msg))) {
                             if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                 if (($msg = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $msg)) && ($msg = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $msg))) {
                                     if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                         if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                             if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                 if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                     if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                         if (($msg = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $msg)) && ($msg = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $msg))) {
                                                             if ($msg = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $msg)) {
                                                                 if ($msg = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $msg)) {
                                                                     if ($msg = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $msg)) {
                                                                         if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $msg)) {
                                                                             if ($msg = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $msg)) {
                                                                                 if (is_array($fields) && !empty($fields)) {
                                                                                     foreach ($fields as $var => $val) {
                                                                                         if (!($msg = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $msg))) {
                                                                                             break;
                                                                                         }
                                                                                     }
                                                                                 }
                                                                                 if ($sbj && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                     // Still have a ``$sbj`` and a ``$msg``?
                                                                                     foreach (c_ws_plugin__s2member_utils_strings::parse_emails($GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_recipients']) as $recipient) {
                                                                                         wp_mail($recipient, apply_filters('ws_plugin__s2member_payment_notification_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_payment_notification_email_msg', $msg, get_defined_vars()), 'Content-Type: text/plain; charset=UTF-8');
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     $paypal['s2member_log'][] = 'Payment Notification Emails have been processed.';
                 }
             } else {
                 if ($processing && (preg_match('/^web_accept$/i', $paypal['txn_type']) || $_REQUEST['s2member_paypal_proxy'] && preg_match('/subscr-signup-as-subscr-payment/', $_REQUEST['s2member_paypal_proxy_use']) && $paypal['txn_id'] && $paypal['mc_gross'] > 0)) {
                     $paypal['s2member_log'][] = 'Storing `payment` for Subscription via ( `' . (preg_match('/^web_accept$/i', $paypal['txn_type']) ? 'web_accept' : 'subscr-signup-as-subscr-payment') . '` ).';
                     $ipn = array('txn_type' => 'subscr_payment');
                     // Create a simulated IPN response for txn_type=subscr_payment.
                     foreach ($paypal as $var => $val) {
                         if (in_array($var, array('subscr_gateway', 'subscr_id', 'subscr_baid', 'subscr_cid', 'txn_id', 'custom', 'invoice', 'mc_gross', 'mc_currency', 'tax', 'payer_email', 'first_name', 'last_name', 'item_name', 'item_number', 'option_name1', 'option_selection1', 'option_name2', 'option_selection2'))) {
                             $ipn[$var] = $val;
                         }
                     }
                     $paypal['s2member_log'][] = 'Creating an IPN response for `subscr_payment`. This will go into a Transient Queue; and be processed during registration.';
                     set_transient('s2m_' . md5('s2member_transient_ipn_subscr_payment_' . $paypal['subscr_id']), $ipn, 43200);
                 }
             }
             if ($processing && (!empty($user_id) && !empty($user) && is_object($user) && $user->ID || ($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with($paypal['subscr_id'], $paypal['option_selection1'])) && is_object($user = new WP_User($user_id)) && $user->ID)) {
                 $paypal['s2member_log'][] = 'Storing IPN signup vars now. These are associated with a User\'s account record; for future reference.';
                 update_user_option($user_id, 's2member_ipn_signup_vars', $ipn_signup_vars);
             } else {
                 if ($processing) {
                     $paypal['s2member_log'][] = 'Storing IPN signup vars into a Transient Queue. These will be processed on registration.';
                     set_transient('s2m_' . md5('s2member_transient_ipn_signup_vars_' . $paypal['subscr_id']), $ipn_signup_vars, 43200);
                 }
             }
         } else {
             $paypal['s2member_log'][] = 'Not processing. Duplicate IPN.';
             $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ).';
             $paypal['s2member_log'][] = 'Duplicate IPN. Already processed. This IPN will be ignored.';
         }
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__s2member_during_paypal_notify_after_subscr_signup', get_defined_vars());
         unset($__refs, $__v);
         return apply_filters('c_ws_plugin__s2member_paypal_notify_in_subscr_or_wa_w_level', $paypal, get_defined_vars());
     }
     return apply_filters('c_ws_plugin__s2member_paypal_notify_in_subscr_or_wa_w_level', FALSE, get_defined_vars());
 }
Ejemplo n.º 11
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>General Options</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form">' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-options-save")) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n";
     do_action("ws_plugin__s2member_during_gen_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_uninstall", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || is_super_admin(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_uninstall", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Plugin Deletion Safeguards"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["run_uninstall_routines"] ? ' default-state="open"' : '') . '>' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-uninstall-section">' . "\n";
         echo '<h3>Plugin Deletion Safeguards (highly recommended)</h3>' . "\n";
         echo '<p>By default, s2Member will retain all of it\'s Roles, Capabilities, and your Configuration Options when/if you delete s2Member from the Plugins Menu in WordPress. However, if you would like for s2Member to erase itself completely, please choose: <code>No (upon deletion, erase all data/options)</code>.</p>';
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_uninstall", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-run-uninstall-routines">' . "\n";
         echo 'Safeguard s2Member Data/Options?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_run_uninstall_routines" id="ws-plugin--s2member-run-uninstall-routines">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["run_uninstall_routines"] ? ' selected="selected"' : '') . '>Yes (safeguard all data/options)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["run_uninstall_routines"] ? ' selected="selected"' : '') . '>No (upon deletion, erase all data/options)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting: (<code>Yes, safeguard all data/options</code>)' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_uninstall", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_security", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_security", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Security Encryption Key">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-security-section">' . "\n";
         echo '<img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/large-icon.png" title="s2Member (a Membership management system for WordPress)" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
         echo '<h3>Security Encryption Key (optional, for tighter security)</h3>' . "\n";
         echo '<p>Just like WordPress, s2Member is open-source software. Which is wonderful. However, this also makes it possible for anyone to grab a copy of the software, and try to learn their way around its security measures. In order to keep your installation of s2Member unique/secure, you should configure a Security Encryption Key. s2Member will use your Security Encryption Key to protect itself against hackers. It does this by encrypting all sensitive information with your Key. A Security Encryption Key is unique to your installation.</p>' . "\n";
         echo '<p>Once you configure this, you do NOT want to change it; not ever. In fact, it is a VERY good idea to keep this backed up in a safe place, just in case you need to move your site, or re-install s2Member in the future. Some of the sensitive data that s2Member stores, will be encrypted with this Key. If you change it, that data can no longer be read, even by s2Member itself. In other words, don\'t use s2Member for six months, then decide to change your Key. That would break your installation.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_security", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-sec-encryption-key">' . "\n";
         echo 'Security Encryption Key (at least 60 chars)' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key"] ? ' <a href="#" onclick="ws_plugin__s2member_enableSecurityKey(); return false;" title="(not recommended)">edit key</a>' : ' <a href="#" onclick="ws_plugin__s2member_generateSecurityKey(); return false;" title="Insert an auto-generated Key. (recommended)">auto-generate</a>') . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" maxlength="256" autocomplete="off" name="ws_plugin__s2member_sec_encryption_key" id="ws-plugin--s2member-sec-encryption-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key"]) . '"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key"] ? ' disabled="disabled"' : '') . ' />' . "\n";
         echo !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key"] ? '<br />This may contain letters, numbers, spaces; even punctuation. Up to 256 characters.<br /><em>Ex: <code>' . esc_html(strtoupper(c_ws_plugin__s2member_utils_strings::random_str_gen(64))) . '</code></em>' . "\n" : '';
         echo count($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key_history"]) > 1 ? '<br /><a href="#" onclick="ws_plugin__s2member_securityKeyHistory(); return false;">Click here</a> for a history of your last 10 Encryption Keys.<div id="ws-plugin--s2member-sec-encryption-key-history" style="display:none;"><code>' . implode('</code><br /><code>', $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sec_encryption_key_history"]) . '</code></div>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3>Additional Details Regarding this Key:</h3>' . "\n";
         echo '<p>Your Security Encryption Key is used throughout s2Member\'s source code for many different things. However, MOST (not all, but most) uses of this Key are related to transactional processing within a particular session; so changing the Key won\'t really impact these scenarios in any significant way. Your Security Encryption Key is simply there to enhance security of data that is being transmitted in these cases.</p>' . "\n";
         echo '<p>That said, there are a few scenarios where use of your Security Encryption Key is more long-term. These include: Specific Post/Page Access Links, Registration Access Links, and it can also have a long-term impact on IPN communication because some data analyzed by s2Member includes a checksum that depends on your Key. If the Key changes, it could cause future IPN data (i.e. data from your payment gateway) to fail validation.</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_security", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_localhost_info", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || is_super_admin(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_localhost_info", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Localhost WAMP/MAMP Developers">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-localhost-info-section">' . "\n";
         echo '<h3>Localhost WAMP/MAMP Installs (are you a developer?)</h3>' . "\n";
         echo '<p>If you\'re developing your site in a <code>localhost</code> environment, running something like WAMP/MAMP, or <a href="http://www.easyphp.org/" target="_blank" rel="external">EasyPHP</a>, please add this line to your <code>/wp-config.php</code> file: <code><span style="color:#0000BB;">define</span><span style="color:#007700;">(</span><span style="color:#DD0000;">"LOCALHOST"</span>, <span style="color:#0000BB;">true</span><span style="color:#007700;">);</span></code>.</p>' . "\n";
         echo '<p>This lets s2Member know definitively that your site is in a <code>localhost</code> environment. s2Member will adjust itself accordingly, maximizing functionality during your developement. s2Member can usually auto-detect this, but in cases where your <code>localhost</code> installation runs on something other than <code>127.0.0.1/localhost</code>, you need to tell s2Member definitively, by adding that line to your <code>/wp-config.php</code> file. For instance, s2Member needs to know when your server IP is the same as all User IPs.</p>' . "\n";
         echo '<p><em>Once your site goes live, please remove the line. If you\'re already on a live server connected to the web, please ignore this section.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_localhost_info", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_localhost_info", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_lazy_load", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || is_super_admin(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_lazy_load", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="CSS/JS Lazy Loading">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-lazy-load-section">' . "\n";
         echo '<h3>CSS/JS Lazy Loading (Client-Side Libraries)</h3>' . "\n";
         echo '<p>By default, s2Member will load it\'s CSS/JS libraries on every page of your site. However, you may wish to enable lazy-loading here (e.g. only load when absolutely necessary).</p>' . "\n";
         echo '<p><em><strong>Tip:</strong> Do you need s2Member\'s CSS/JS on every page? If not, you can turn lazy-loading on. If you need s2Member\'s CSS/JS on a given Post/Page, you can insert an HTML comment into the Post/Page content like this: <code>&lt;!--s2member--&gt;</code>. If a Post/Page contains the word <code>s2member</code> or an <code>[s2*</code> Shortcode, this will automatically trigger s2Member\'s lazy-load routine (no matter what you configure here). Thus, it\'s an easy way to force s2Member to load it\'s CSS/JS on specific Posts/Pages where you deem this necessary. There is also a WordPress filter available: <code>add_filter("ws_plugin__s2member_lazy_load_css_js", "__return_true");</code> for developers; this could be incorporated into more dynamic scenarios.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_lazy_load", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-lazy-load-css-js">' . "\n";
         echo 'Lazy-Load s2Member\'s CSS/JS Libraries?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_lazy_load_css_js" id="ws-plugin--s2member-lazy-load-css-js">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["lazy_load_css_js"] ? ' selected="selected"' : '') . '>No (always load the CSS/JS libraries; e.g. on every page of the site)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["lazy_load_css_js"] ? ' selected="selected"' : '') . '>Yes (lazy-load CSS/JS libraries; e.g. load only when absolutely necessary)</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_lazy_load", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_s_badge_wp_footer_code", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_s_badge_wp_footer_code", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="s2Member Security Badge">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-s-badge-wp-footer-code-section">' . "\n";
         echo '<h3>Security Badge &amp; Footer Configuration (optional)</h3>' . "\n";
         echo '<div class="ws-menu-page-right">' . c_ws_plugin__s2member_utilities::s_badge_gen("1", TRUE, TRUE) . '</div>' . "\n";
         echo '<p>An s2Member Security Badge <em>(optional)</em>, can be used to express your site\'s concern for security; demonstrating to all Users/Members that your site <em>(and the s2Member software)</em>, takes security seriously. However, in order to qualify your site, you MUST generate a Security Encryption Key <em>(previous section)</em>, and then click "Save All Changes". Only then, will s2Member officially verify your installation <em>(verification occurs automatically)</em>.</p>' . "\n";
         echo '<p>Once you\'ve <a href="http://www.s2member.com/kb/security-badges/" target="_blank" rel="external">properly configured all security aspects of s2Member</a>, your s2Member Security Badge will be verified. To see the "verified" version of your Security Badge, you might need to refresh your browser after saving all changes <em>(i.e. after you create a Security Encryption Key)</em>. Also, s2Member will NOT "verify" your site if you turn off Unique IP Restrictions, Brute Force Login Protection, or if your <code>/wp-config.php</code> file lacks <a href="http://codex.wordpress.org/Editing_wp-config.php#Security_Keys" target="_blank" rel="external">Security Keys</a> <em>(each at least 60 chars in length)</em>. In addition, it\'s NOT possible for s2Member to verify your Security Badge, if your site is in a <code>localhost</code> environment; i.e. not connected to the web.</p>' . "\n";
         echo '<p><strong>How does s2Member know when my site is secure?</strong><br />If enabled below, an API call for "Security Badge Status", will allow web service connections to determine your status. Clicking <a href="' . esc_attr(site_url("/?s2member_s_badge_status=1")) . '" target="_blank" rel="external">this link</a> will report <code>1</code> <em>(secure)</em>, <code>0</code> <em>(at risk)</em>, or <code>-</code> <em>(API disabled)</em>. Once all security considerations are satisfied, s2Member will report <code>1</code> <em>(secure)</em> for your installation. *Note, this simple API will NOT, and should not, report any other information. It will ONLY report the current status of your Security Badge, as determined by your installation of s2Member. When/if you install the s2Member Security Badge, s2Member will make a connection to your site "once per day", to test your status.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_s_badge_wp_footer_code", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-s-badge-status-enabled">' . "\n";
         echo 'Enable Security Badge Status API?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_s_badge_status_enabled" id="ws-plugin--s2member-s-badge-status-enabled">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["s_badge_status_enabled"] ? ' selected="selected"' : '') . '>No (default, Badge Status API is disabled)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["s_badge_status_enabled"] ? ' selected="selected"' : '') . '>Yes (enable Badge Status API for verification)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'This must be enabled if you want s2Member to verify your Security Badge.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-wp-footer-code">' . "\n";
         echo 'Customize WordPress Footer:<br />' . "\n";
         echo '<small>[ <a href="#" onclick="this.$code = jQuery(\'textarea#ws-plugin--s2member-wp-footer-code\'); this.$code.val(jQuery.trim(unescape(\'' . rawurlencode('[s2Member-Security-Badge v="1" /]') . '\')+\'\\n\'+this.$code.val())); return false;">Click HERE to insert your Security Badge</a> ],<br />or use Shortcode <code>[s2Member-Security-Badge v="1" /]</code> in a Post/Page/Widget.<br />The <code>v="1"</code> attribute is a Security Badge style/variation. Try variations <code>1|2|3</code>.</small>' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_wp_footer_code" id="ws-plugin--s2member-wp-footer-code" rows="8" wrap="off" spellcheck="false" class="monospace">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["wp_footer_code"]) . '</textarea><br />' . "\n";
         echo 'Any valid XHTML / JavaScript' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' (or even PHP)') . ' code will work just fine here.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_s_badge_wp_footer_code", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_email_config", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_email_config", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Email Configuration">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-email-section">' . "\n";
         echo '<h3 style="margin:0;">Email From: ' . esc_html('"Name" <address>') . '</h3>' . "\n";
         echo '<p style="margin:0;">This is the name/address that will appear in outgoing email notifications sent by the s2Member plugin.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_email_from_name_config", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-reg-email-from-name">' . "\n";
         echo 'Email From Name:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_reg_email_from_name" id="ws-plugin--s2member-reg-email-from-name" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . '" /><br />' . "\n";
         echo 'We recommend that you use the name of your site here.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-reg-email-from-email">' . "\n";
         echo 'Email From Address:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_reg_email_from_email" id="ws-plugin--s2member-reg-email-from-email" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]) . '" /><br />' . "\n";
         echo 'Example: support@your-domain.com. <em class="ws-menu-page-hilite">Please read <a href="#" onclick="alert(\'Running WordPress with an SMTP mail plugin?\\n\\nPlease be advised. If you run an SMTP mail plugin with WordPress, be sure to configure s2Member with a valid `From:` address (i.e. one matching your SMTP configuration perhaps). Most free SMTP servers, such as Gmail and Yahoo, require that your `From:` header match the email address associated with your account. Please check with your SMTP service provider before attempting to configure plugins like s2Member to use a different `From:` address when sending email messages.\'); return false;">this IMPORTANT note</a></em>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-reg-email-support-link">' . "\n";
         echo 'Email Support/Contact Link:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_reg_email_support_link" id="ws-plugin--s2member-reg-email-support-link" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_support_link"]) . '" /><br />' . "\n";
         echo 'Ex: <code>mailto:support@your-domain.com</code> (<em>mailto link</em>).<br />' . "\n";
         echo 'Or: <code>' . esc_html(site_url("/contact-us/")) . '</code>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3 style="margin:0;">New User Email Configuration</h3>' . "\n";
         echo '<input type="hidden" id="ws-plugin--s2member-pluggables-wp-new-user-notification" value="' . esc_attr(empty($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["pluggables"]["wp_new_user_notification"]) ? '0' : '1') . '" />' . "\n";
         echo empty($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["pluggables"]["wp_new_user_notification"]) ? '<p class="ws-menu-page-error" style="margin:0;"><em><strong>Conflict warning:</strong> You have another theme or plugin installed that is preventing s2Member from controlling this aspect of your installation. When the pluggable function <code><a href="http://codex.wordpress.org/Function_Reference/wp_new_user_notification" target="_blank" rel="external">wp_new_user_notification()</a></code> is handled by another plugin, it\'s not possible for s2Member to allow customization of New User Emails. This is NOT a major issue. In fact, in some cases, it might be desirable. That being said, if you DO want to use s2Member\'s customization of New User Emails, you will need to deactivate one plugin at a time until this conflict warning goes away.</em></p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_new_user_emails", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_new_user_emails_enabled" id="ws-plugin--s2member-new-user-emails-enabled">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_emails_enabled"] ? ' selected="selected"' : '') . '>No (default, use WordPress defaults)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_emails_enabled"] ? ' selected="selected"' : '') . '>Yes (customize New User Emails with s2Member)</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div id="ws-plugin--s2member-new-user-emails">' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3 style="margin:0;">New User Email Message (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-new-user-email-details\').toggle(); return false;" class="ws-dotted-link">click to customize</a>)</h3>' . "\n";
         echo '<p style="margin:0;">This email is sent to all new Users/Members. It should always contain their Username/Password. In addition to this email, s2Member will also send new paying Customers a Signup Confirmation Email, which you can customize from your Dashboard, under: <code>s2Member -› PayPal Options</code>. You may wish to customize these emails further, by providing details that are specifically geared to your site.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_new_user_email", get_defined_vars());
         echo '<div id="ws-plugin--s2member-new-user-email-details" style="display:none;">' . "\n";
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> please note that BuddyPress does NOT send this email to Users that register through the BuddyPress registration system. This is because BuddyPress sends each User an activation link; eliminating the need for this email all together. However, you CAN still customize s2Member\'s separate email to paying Members. See: <code>s2Member -› PayPal Options -› Signup Confirmation Email</code>.</em></p>' . "\n" : '';
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-new-user-email-subject">' . "\n";
         echo 'New User Email Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_new_user_email_subject" id="ws-plugin--s2member-new-user-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email sent to new Users/Members.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-new-user-email-message">' . "\n";
         echo 'New User Email Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_new_user_email_message" id="ws-plugin--s2member-new-user-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email sent to new Users/Members.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%role%%</code> = The Role ID <code>(subscriber, s2member_level[0-9]+, administrator, editor, author, contributor)</code>.</li>' . "\n";
         echo '<li><code>%%label%%</code> = The Role ID Label <code>(Subscriber, s2Member Level 1, s2Member Level 2; or your own custom Labels — if configured)</code>.</li>' . "\n";
         echo '<li><code>%%level%%</code> = The Level number <code>(0, 1, 2, 3, 4)</code>. (<em>deprecated, no longer recommended; use <code>%%role%%</code></em>)</li>' . "\n";
         echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> (<em>in comma-delimited format</em>).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n";
         echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>' . "\n";
         echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<div class="ws-menu-page-hr"></div>' . "\n" . '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags — optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$user</code> variable is the most important one. It\'s an instance of the <a href="http://codex.wordpress.org/Class_Reference/WP_User" target="_blank" rel="external"><code>WP_User</code></a> class (e.g. <code>$user->ID</code>, <code>$user->has_cap()</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3 style="margin:0;">Administrative: New User Notification (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-new-user-admin-email-details\').toggle(); return false;" class="ws-dotted-link">click to customize</a>)</h3>' . "\n";
         echo '<p style="margin:0;">This email notification is sent to you, each time a new User/Member registers.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_new_user_admin_email", get_defined_vars());
         echo '<div id="ws-plugin--s2member-new-user-admin-email-details" style="display:none;">' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-new-user-admin-email-recipients">' . "\n";
         echo 'New User Notification Recipients:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_new_user_admin_email_recipients" id="ws-plugin--s2member-new-user-admin-email-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"Name" &lt;user@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-new-user-admin-email-subject">' . "\n";
         echo 'New User Notification Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_new_user_admin_email_subject" id="ws-plugin--s2member-new-user-admin-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email notification sent to Administrator.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-new-user-admin-email-message">' . "\n";
         echo 'New User Notification Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_new_user_admin_email_message" id="ws-plugin--s2member-new-user-admin-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email notification sent to Administrator.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%role%%</code> = The Role ID <code>(subscriber, s2member_level[0-9]+, administrator, editor, author, contributor)</code>.</li>' . "\n";
         echo '<li><code>%%label%%</code> = The Role ID Label <code>(Subscriber, s2Member Level 1, s2Member Level 2; or your own custom Labels — if configured)</code>.</li>' . "\n";
         echo '<li><code>%%level%%</code> = The Level number <code>(0, 1, 2, 3, 4)</code>. (<em>deprecated, no longer recommended; use <code>%%role%%</code></em>)</li>' . "\n";
         echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> (<em>in comma-delimited format</em>).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n";
         echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>' . "\n";
         echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<div class="ws-menu-page-hr"></div>' . "\n" . '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags — optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$user</code> variable is the most important one. It\'s an instance of the <a href="http://codex.wordpress.org/Class_Reference/WP_User" target="_blank" rel="external"><code>WP_User</code></a> class (e.g. <code>$user->ID</code>, <code>$user->has_cap()</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_email_config", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_open_registration", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_open_registration", get_defined_vars());
         if (is_multisite() && is_main_site()) {
             echo '<div class="ws-menu-page-group" title="Open Registration">' . "\n";
             echo '<div class="ws-menu-page-section ws-plugin--s2member-open-registration-section">' . "\n";
             echo '<h3>Open Registration / Free Subscribers (optional)</h3>' . "\n";
             echo '<p>On the Main Site of a Multisite Network, the settings for Open Registration are consolidated into the <code>s2Member -› Multisite (Config)</code> panel.</p>' . "\n";
             do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_open_registration", get_defined_vars());
             echo '</div>' . "\n";
             echo '</div>' . "\n";
         } else {
             echo '<div class="ws-menu-page-group" title="Open Registration">' . "\n";
             echo '<div class="ws-menu-page-section ws-plugin--s2member-open-registration-section">' . "\n";
             echo '<h3>Open Registration / Free Subscribers (optional)</h3>' . "\n";
             echo '<p>s2Member supports Free Subscribers (at Level #0), along with four Primary Levels [1-4] of paid Membership. If you want your visitors to be capable of registering absolutely free, you will want to "allow" Open Registration. Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0.</p>' . "\n";
             do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_open_registration", get_defined_vars());
             echo '<table class="form-table">' . "\n";
             echo '<tbody>' . "\n";
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-allow-subscribers-in">' . "\n";
             echo 'Allow Open Registration? (Free Subscribers)' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<select name="ws_plugin__s2member_allow_subscribers_in" id="ws-plugin--s2member-allow-subscribers-in">' . "\n";
             echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"] ? ' selected="selected"' : '') . '>No (do NOT allow Open Registration)</option>' . "\n";
             echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"] ? ' selected="selected"' : '') . '>Yes (allow Open Registration; Free Subscribers at Level #0)</option>' . "\n";
             echo '</select><br />' . "\n";
             echo 'If you set this to <code>Yes</code>, you\'re unlocking <a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::wp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your Standard Registration Form.\\n* s2Member makes this form available to logged-in Administrators, at all times (for testing purposes), regardless of configuration.' . (c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">/wp-login.php?action=register</a>. When a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0. The s2Member software reserves Level #0; to be used ONLY for Free Subscribers. All other Membership Levels [1-4] require payment.' . "\n";
             echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<br /><br /><em><strong>BuddyPress:</strong> BuddyPress will use its own Registration Form <a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::bp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your BuddyPress Registration Form.\\n* However, you will probably be redirected away from this BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.\');">here</a>.<br />s2Member integrates with BuddyPress, and the above setting will control Open Regisration for BuddyPress too.</em>' . "\n" : '';
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
             echo '</tbody>' . "\n";
             echo '</table>' . "\n";
             echo '</div>' . "\n";
             echo '</div>' . "\n";
         }
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_open_registration", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_membership_levels", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_membership_levels", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Membership Levels/Labels">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-levels-section">' . "\n";
         echo '<h3>Membership Levels (required, please customize these)</h3>' . "\n";
         echo '<p>The default Membership Levels are labeled generically; feel free to modify them as needed. s2Member supports Free Subscribers <em>(at Level #0)</em>, along with several Primary Roles for paid Membership <em>(i.e. Levels 1-4)</em>, created by the s2Member plugin.' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? ' s2Member also supports unlimited Custom Capability Packages <em>(see <code>s2Member -› API Scripting -› Custom Capabilities</code>)</em>' : '') . '. That being said, you don\'t have to use all of the Membership Levels if you don\'t want to. To use only 1 or 2 of these Levels, just design your Membership Options Page, so it only includes Payment Buttons for the Levels being used.</p>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>TIP:</strong> <strong>Unlimited Membership Levels</strong> are only possible with <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro</a>. However, Custom Capabilities are possible in all versions of s2Member, including the free version. Custom Capabilities are a great way to extend s2Member in creative ways. If you\'re an advanced site owner, a theme designer, or a web developer integrating s2Member for a client, please check your Dashboard, under: <code>s2Member -› API Scripting -› Custom Capabilities</code>. We also recommend <a href="http://www.s2member.com/videos/A2C07377CF60025E/" target="_blank" rel="external">this video tutorial</a>.</em></p>' . "\n" : '';
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<p><strong>See also:</strong> These KB articles: <a href="http://www.s2member.com/kb/roles-caps/" target="_blank" rel="external">s2Member Roles/Capabilities</a> and <a href="http://www.s2member.com/kb/simple-shortcode-conditionals/" target="_blank" rel="external">Simple Shortcode Conditionals</a>.</p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_membership_levels", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-label">' . "\n";
             echo $n === 0 ? 'Level #' . $n . ' <em>(Free Subscribers)</em>:' . "\n" : 'Level #' . $n . ' Members:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_label" id="ws-plugin--s2member-level' . $n . '-label" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"]) . '" /><br />' . "\n";
             echo 'This is the Label for Level #' . $n . ($n === 0 ? ' (Free Subscribers)' : ' Members') . '.<br />' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-apply-label-translations">' . "\n";
         echo 'Force WordPress to use your Labels?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="radio" name="ws_plugin__s2member_apply_label_translations" id="ws-plugin--s2member-apply-label-translations-0" value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["apply_label_translations"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-apply-label-translations-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_apply_label_translations" id="ws-plugin--s2member-apply-label-translations-1" value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["apply_label_translations"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-apply-label-translations-1">Yes, force WordPress to use my Labels.</label><br />' . "\n";
         echo 'This affects your administrative Dashboard only <em>(i.e. your list of Users)</em>.<br />s2Member can force WordPress to use your Labels instead of referencing Roles by `s2Member Level #`. If this is your first installation of s2Member, we suggest leaving this set to <code>no</code> until you\'ve had a chance to get acclimated with s2Member\'s functionality. In fact, many site owners choose to leave this off, because they find it less confusing when Roles are referred to by their s2Member Level #.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<input type="button" value="Reset Roles/Capabilities" class="ws-menu-page-right ws-plugin--s2member-reset-roles-button" style="min-width:175px;" />' . "\n";
         echo '<p>The button to the right, is a nifty tool, which allows you to reset s2Member\'s internal Roles and Capabilities that integrate with WordPress. If you, or a developer working with you, has made attempts to alter the default <em>internal</em> Role/Capability sets that come with s2Member, and you need to reset them back to the way s2Member expects them to be, please use this tool. <em>Attn Developers: it is also possible lock-in your modified Roles/Capabilities with an s2Member Filter. Please see <a href="http://www.s2member.com/kb/roles-caps/#modifying-roles-caps" target="_blank" rel="external">this KB article for details</a>.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_membership_levels", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_login_registration", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_login_registration", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Login/Registration Design">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-login-registration-section">' . "\n";
         echo '<h3>Login/Registration Page Customization (optional)</h3>' . "\n";
         echo '<p>These settings customize your Standard Login/Registration Pages:<br />(<a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::wp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your Standard Registration Form.\\n* s2Member makes this form available to logged-in Administrators, at all times (for testing purposes), regardless of configuration.' . (c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__s2member_utils_urls::wp_register_url()) . '</a>)</p>' . "\n";
         echo is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() ? '<p><em>The Main Site of a Multisite Blog Farm uses this Form instead, powered by your theme.<br />(<a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::wp_signup_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your Multisite Registration Form.\\n* s2Member makes this form available to logged-in Super Administrators, at all times (for testing purposes), regardless of configuration.' . (c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__s2member_utils_urls::wp_signup_url()) . '</a>)</em></p>' . "\n" : '';
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> BuddyPress will use its own Registration Form, powered by your theme.<br />(<a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::bp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your BuddyPress Registration Form.\\n* However, you will probably be redirected away from this BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.\');">' . esc_html(c_ws_plugin__s2member_utils_urls::bp_register_url()) . '</a>)</em></p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_login_registration", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Enable This Functionality?</h3>' . "\n";
         echo '<select name="ws_plugin__s2member_login_reg_design_enabled" id="ws-plugin--s2member-login-reg-design-enabled">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_design_enabled"] ? ' selected="selected"' : '') . '>No (default, use WordPress defaults)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_design_enabled"] ? ' selected="selected"' : '') . '>Yes (customize Login/Registration with s2Member)</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div id="ws-plugin--s2member-login-reg-design"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_design_enabled"] ? ' style="display:none;"' : '') . '>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Overall Font/Size Configuration</h3>' . "\n";
         echo '<p style="margin:0;">These settings are all focused on your Login/Registration Fonts.</p>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-font-size">' . "\n";
         echo 'Overall Font Size:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_font_size" id="ws-plugin--s2member-login-reg-font-size" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_size"]) . '" /><br />' . "\n";
         echo 'Set this to a numeric value, calculated in pixels.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-font-family">' . "\n";
         echo 'Overall Font Family:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_font_family" id="ws-plugin--s2member-login-reg-font-family" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_family"]) . '" /><br />' . "\n";
         echo 'Set this to a web-safe font family.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-font-field-size">' . "\n";
         echo 'Form Field Font Size:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_font_field_size" id="ws-plugin--s2member-login-reg-font-field-size" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_field_size"]) . '" /><br />' . "\n";
         echo 'Set this to a numeric value, calculated in pixels.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Background Configuration</h3>' . "\n";
         echo '<p style="margin:0;">These settings are all focused on your Login/Registration Background.</p>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-background-color">' . "\n";
         echo 'Background Color:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_background_color" id="ws-plugin--s2member-login-reg-background-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-background-image">' . "\n";
         echo 'Background Image:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_background_image" id="ws-plugin--s2member-login-reg-background-image" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image"]) . '" /><br />' . "\n";
         echo '<input type="button" id="ws-plugin--s2member-login-reg-background-image-media-btn" value="Open Media Library" class="ws-menu-page-media-btn" rel="ws-plugin--s2member-login-reg-background-image" />' . "\n";
         echo 'Set this to the URL of your Background Image. (this is optional)<br />';
         echo 'If supplied, your Background Image will be tiled.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-background-image-repeat">' . "\n";
         echo 'Background Image Tile:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_login_reg_background_image_repeat" id="ws-plugin--s2member-login-reg-background-image-repeat">' . "\n";
         echo '<option value="repeat"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "repeat" ? ' selected="selected"' : '') . '>Seamless Tile ( background-repeat: repeat; )</option>' . "\n";
         echo '<option value="repeat-x"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "repeat-x" ? ' selected="selected"' : '') . '>Tile Horizontally ( background-repeat: repeat-x; )</option>' . "\n";
         echo '<option value="repeat-y"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "repeat-y" ? ' selected="selected"' : '') . '>Tile Vertically ( background-repeat: repeat-y; )</option>' . "\n";
         echo '<option value="no-repeat"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "no-repeat" ? ' selected="selected"' : '') . '>No Tiles ( background-repeat: no-repeat; )</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'This controls the way your Background Image is styled with CSS. [ <a href="http://www.w3schools.com/css/pr_background-repeat.asp" target="_blank" rel="external">learn more</a> ]' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-background-text-color">' . "\n";
         echo 'Color of Text on top of your Background:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_background_text_color" id="ws-plugin--s2member-login-reg-background-text-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-background-text-shadow-color">' . "\n";
         echo 'Shadow Color for Text on top of your Background:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_background_text_shadow_color" id="ws-plugin--s2member-login-reg-background-text-shadow-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-background-box-shadow-color">' . "\n";
         echo 'Shadow Color for Boxes on top of your Background:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_background_box_shadow_color" id="ws-plugin--s2member-login-reg-background-box-shadow-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Logo Image Configuration</h3>' . "\n";
         echo '<p style="margin:0;">These settings are all focused on your Login/Registration Logo.</p>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-logo-src">' . "\n";
         echo 'Logo Image Location:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_logo_src" id="ws-plugin--s2member-login-reg-logo-src" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"]) . '" /><br />' . "\n";
         echo '<input type="button" id="ws-plugin--s2member-login-reg-logo-src-media-btn" value="Open Media Library" class="ws-menu-page-media-btn" rel="ws-plugin--s2member-login-reg-logo-src" />' . "\n";
         echo 'Set this to the URL of your Logo Image.<br />' . "\n";
         echo 'Suggested size is around 500 x 100.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-logo-src-width">' . "\n";
         echo 'Logo Image Width:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_logo_src_width" id="ws-plugin--s2member-login-reg-logo-src-width" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"]) . '" /><br />' . "\n";
         echo 'The pixel Width of your Logo Image. <em>* This ALSO affects the overall width of your Login/Registration forms. If you want wider form fields, use a wider Logo.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-logo-src-height">' . "\n";
         echo 'Logo Image Height:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_logo_src_height" id="ws-plugin--s2member-login-reg-logo-src-height" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_height"]) . '" /><br />' . "\n";
         echo 'The pixel Height of your Logo Image.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-logo-url">' . "\n";
         echo 'Logo Image Click URL:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_logo_url" id="ws-plugin--s2member-login-reg-logo-url" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_url"]) . '" /><br />' . "\n";
         echo 'Set this to the Click URL for your Logo Image.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-logo-title">' . "\n";
         echo 'Logo Image Title Attribute:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_reg_logo_title" id="ws-plugin--s2member-login-reg-logo-title" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_title"]) . '" /><br />' . "\n";
         echo 'Used as the <code>title=""</code> attribute for your Logo Image.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-footer-backtoblog">' . "\n";
         echo 'Display [Back to Home Page] Link At Bottom?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_login_reg_footer_backtoblog" id="ws-plugin--s2member-login-reg-footer-backtoblog">' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_footer_backtoblog"] ? ' selected="selected"' : '') . '>Yes, display link at bottom pointing visitors back to the home page</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_footer_backtoblog"] ? ' selected="selected"' : '') . '>No, hide this link (I\'ll create my own custom footer w/ the details I prefer)</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Footer Design (i.e. Bottom)</h3>' . "\n";
         echo '<p style="margin:0;">This field accepts raw HTML' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? ' (and/or PHP)' : '') . ' code.</p>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-reg-footer-design">' . "\n";
         echo 'Login/Registration Footer Design (optional):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_login_reg_footer_design" id="ws-plugin--s2member-login-reg-footer-design" rows="3" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_footer_design"]) . '</textarea><br />' . "\n";
         echo 'This optional HTML' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? ' (and/or PHP)' : '') . ' code will appear at the very bottom of your Login/Registration Forms.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_login_registration", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_custom_reg_fields", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_custom_reg_fields", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Registration/Profile Fields &amp; Options">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-reg-fields-section">' . "\n";
         echo '<h3>Custom Registration/Profile Fields (optional, for further customization)</h3>' . "\n";
         echo '<p>Some fields are already built-in by default. The defaults are: <code>*Username*, *Email*, *First Name*, *Last Name*</code>.</p>' . "\n";
         echo '<p>Custom Fields will appear in your Standard Registration Form, and in User/Member Profiles:<br />(<a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::wp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your Standard Registration Form.\\n* s2Member makes this form available to logged-in Administrators, at all times (for testing purposes), regardless of configuration.' . (c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__s2member_utils_urls::wp_register_url()) . '</a>)</p>' . "\n";
         echo is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() ? '<p><em>The Main Site of a Multisite Blog Farm uses this Form. s2Member supports Custom Fields here too.<br />(<a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::wp_signup_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your Multisite Registration Form.\\n* s2Member makes this form available to logged-in Super Administrators, at all times (for testing purposes), regardless of configuration.' . (c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__s2member_utils_urls::wp_signup_url()) . '</a>)</em></p>' . "\n" : '';
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> BuddyPress will use its own Registration Form <a href="' . esc_attr(c_ws_plugin__s2member_utils_urls::bp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'s2Member will now open your BuddyPress Registration Form.\\n* However, you will probably be redirected away from this BuddyPress Registration Form ( ' . c_ws_plugin__s2member_utils_strings::esc_js_sq(c_ws_plugin__s2member_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.\');">here</a>.<br />s2Member can integrate your Custom Fields with BuddyPress too, please see options below.</em></p>' . "\n" : '';
         echo '<p><strong>Regarding registration...</strong> Custom Fields do NOT appear during repeat registration and/or checkout attempts (e.g. they do NOT appear for any user that is currently logged into the site). Please make sure that you test registration and/or checkout forms while NOT logged in (e.g. please test as a first-time customer). Existing users/members/customers may update Custom Fields by editing their Profile.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_custom_reg_fields", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label>' . "\n";
         echo 'Custom Registration/Profile Fields:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="hidden" name="ws_plugin__s2member_custom_reg_fields" id="ws-plugin--s2member-custom-reg-fields" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) . '" />' . "\n";
         echo '<div id="ws-plugin--s2member-custom-reg-field-configuration"></div>' . "\n";
         // This is filled by JavaScript routines.
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-names">' . "\n";
         echo 'Collect First/Last Names during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_custom_reg_names" id="ws-plugin--s2member-custom-reg-names">' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] ? ' selected="selected"' : '') . '>Yes (always collect First/Last Names during registration)</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_names"] ? ' selected="selected"' : '') . '>No (do NOT collect First/Last Names during registration)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting (<code>Yes</code>). It\'s usually a good idea to leave this on.' . "\n";
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<br /><em>* Has NO affect on BuddyPress registration form (BuddyPress always collects a full <code>Name</code> field).</em>' . "\n" : '';
         echo c_ws_plugin__s2member_utils_conds::pro_is_installed() ? '<br /><em>* s2Member Pro (Checkout) Forms always require a First/Last Name for billing.</em>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-display-name">' . "\n";
         echo 'Set "Display Name" during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_custom_reg_display_name" id="ws-plugin--s2member-custom-reg-display-name">' . "\n";
         echo '<option value="full"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "full" ? ' selected="selected"' : '') . '>Yes (set Display Name to User\'s Full Name)</option>' . "\n";
         echo '<option value="first"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "first" ? ' selected="selected"' : '') . '>Yes (set Display Name to User\'s First Name)</option>' . "\n";
         echo '<option value="last"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "last" ? ' selected="selected"' : '') . '>Yes (set Display Name to User\'s Last Name)</option>' . "\n";
         echo '<option value="login"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "login" ? ' selected="selected"' : '') . '>Yes (set Display Name to User\'s Username)</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] ? ' selected="selected"' : '') . '>No (leave Display Name at default WordPress value)</option>' . "\n";
         echo '</select>' . "\n";
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<br /><em>* Has NO affect on BuddyPress registration form (BuddyPress always uses its full <code>Name</code> field).</em>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-password">' . "\n";
         echo 'Allow Custom Passwords during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_custom_reg_password" id="ws-plugin--s2member-custom-reg-password"' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() && !c_ws_plugin__s2member_utils_conds::pro_is_installed() ? ' disabled="disabled"' : '') . '>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] ? ' selected="selected"' : '') . '>No (send auto-generated passwords via email; after registration)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] ? ' selected="selected"' : '') . '>Yes (allow members to create their own password during registration)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Auto-generated Passwords are recommended for best security; because, this also serves as a form of email confirmation.' . "\n";
         echo is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() ? '<br /><em>* For security purposes, Custom Passwords are NOT possible on the Main Site of a Blog Farm. <a href="#" onclick="alert(\'For security purposes, Custom Passwords are NOT possible on the Main Site of a Blog Farm. A User MUST wait for the activation/confirmation email; where a randomly generated Password will be assigned. Please note, this limitation only affects your Main Site, via `/wp-signup.php`. In other words, your Customers (i.e. other Blog Owners) will still have the ability to allow Custom Passwords with s2Member. YOU are affected by this limitation, NOT them.\\n\\n* NOTE: s2Member (Pro) removes this limitation.\\nIf you install the s2Member Pro Module, you WILL be able to allow Custom Passwords through s2Member Pro Forms; even on a Multisite Blog Farm.\'); return false;" tabindex="-1">[?]</a></em>' . "\n" : '';
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<br /><em>* Does NOT affect BuddyPress registration form (always <code>yes</code> with BuddyPress registration).</em>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-force-personal-emails">' . "\n";
         echo 'Force Personal Emails during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_custom_reg_force_personal_emails" id="ws-plugin--s2member-custom-reg-force-personal-emails" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_force_personal_emails"]) . '" /><br />' . "\n";
         echo 'To force personal email addresses, provide a comma-delimited list of email users to reject. <a href="#" onclick="alert(\'s2Member will reject [user]@ (based on your configuration here). A JavaScript alert message will be issued, asking the User to, `please use a personal email address`.\'); return false;" tabindex="-1">[?]</a><br />' . "\n";
         echo 'Ex: <code>info,help,admin,webmaster,hostmaster,sales,support,spam</code><br />' . "\n";
         echo 'See: <a href="http://kb.mailchimp.com/article/what-role-addresses-does-mailchimp-specifically-block-from-bulk-importing/" target="_blank" rel="external">this article</a> for a more complete list.' . "\n";
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<br /><em>* Affects BuddyPress registration form too.</em>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-fields-4bp">' . "\n";
         echo 'Integrate Custom Registration/Profile Fields with BuddyPress?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<div class="ws-menu-page-scrollbox" style="height:65px;">' . "\n";
         echo '<input type="hidden" name="ws_plugin__s2member_custom_reg_fields_4bp[]" value="update-signal"' . (!c_ws_plugin__s2member_utils_conds::bp_is_installed() ? ' disabled="disabled"' : '') . ' />' . "\n";
         foreach (array("profile-view" => "Yes, integrate with BuddyPress Public Profiles.", "registration" => "Yes, integrate with BuddyPress Registration Form.", "profile" => "Yes, integrate with BuddyPress Profile Editing Panel.") as $ws_plugin__s2member_temp_s_value => $ws_plugin__s2member_temp_s_label) {
             echo '<input type="checkbox" name="ws_plugin__s2member_custom_reg_fields_4bp[]" id="ws-plugin--s2member-custom-reg-fields-4bp-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__s2member_temp_s_value)) . '" value="' . esc_attr($ws_plugin__s2member_temp_s_value) . '"' . (in_array($ws_plugin__s2member_temp_s_value, $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields_4bp"]) ? ' checked="checked"' : '') . (!c_ws_plugin__s2member_utils_conds::bp_is_installed() ? ' disabled="disabled"' : '') . ' /> <label for="ws-plugin--s2member-custom-reg-fields-4bp-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__s2member_temp_s_value)) . '">' . $ws_plugin__s2member_temp_s_label . '</label><br />' . "\n";
         }
         echo '</div>' . "\n";
         echo !c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<em>* BuddyPress is NOT installed; which is perfectly OK. BuddyPress is NOT a requirement.</em>' . "\n" : '<em>* The options above, make it possible to integrate Custom Registration/Profile Fields (i.e. those configured with s2Member) into BuddyPress as well. However, if you configure Profile Fields with BuddyPress, those will NOT be integrated with s2Member. Therefore, if you need Custom Registration/Profile Fields to work with both s2Member and with BuddyPress, please configure them with s2Member.</em>';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_custom_reg_fields", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_login_welcome_page", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_login_welcome_page", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Login Welcome Page">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-login-welcome-page-section">' . "\n";
         echo '<h3>Login Welcome Page (required, please customize this)</h3>' . "\n";
         echo '<p>Please create and/or choose an existing Page to use as the first page Members will see after logging in.</p>' . "\n";
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> s2Member integrates with BuddyPress. Your Login Welcome Page affects BuddyPress too.</em></p>' . "\n" : '';
         echo '<p><em><strong>*Tips*</strong> This special Page will be protected from public access (automatically) by s2Member. Also, please remember this option CANNOT be set to your Front Page (e.g. your Home Page), or to your Posts Page (e.g. your main Blog page). Please create a separate Page in WordPress &amp; designate it here as your Login Welcome Page.</em></p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/customizing-your-lwp/" target="_blank" rel="external">Customizing Your Login Welcome Page</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_login_welcome_page", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-welcome-page">' . "\n";
         echo 'Login Welcome Page:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_login_welcome_page" id="ws-plugin--s2member-login-welcome-page">' . "\n";
         echo '<option value="">&mdash; Select &mdash;</option>' . "\n";
         foreach ($ws_plugin__s2member_temp_a = array_merge((array) get_pages()) as $ws_plugin__s2member_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__s2member_temp_o->ID) . '"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && $ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] ? ' selected="selected"' : '') . '>' . esc_html($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
         }
         echo '</select><br />' . "\n";
         echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-redirection-override">' . "\n";
         echo 'Or, a Special Redirection URL?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_login_redirection_override" id="ws-plugin--s2member-login-redirection-override" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
         echo 'Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>. <em>A few <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s Username, lowercase (deprecated, please use %%current_user_nicename%%).\\n\\n%%current_user_nicename%% = The current User\\\'s Nicename in lowercase format (i.e. a cleaner version of the username for URLs; recommended for best compatibility).\\n\\n%%current_user_id%% = The current User\\\'s ID.\\n\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\n%%current_user_role%% = The current User\\\'s WordPress Role.' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '\\n\\n%%current_user_ccaps%% = The current User\\\'s Custom Capabilities.' : '') . '\\n\\n%%current_user_logins%% = Number of times the current User has logged in.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: ' . site_url("/members/%%current_user_nicename%%/profile/") . '\\n\\nOr ... using %%current_user_level%%, you could have a separate Login Welcome Page for each Membership Level that you plan to offer. BuddyPress not required.\'); return false;">Replacement Codes</a> are also supported here.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-login-redirection-always-http">' . "\n";
         echo 'Always Redirect non-Administrative Users (after login) using HTTP?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_login_redirection_always_http" id="ws-plugin--s2member-login-redirection-always-http">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_always_http"] ? ' selected="selected"' : '') . '>No, do NOT modify (use WordPress default behavior; e.g. detect URL scheme automatically)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_always_http"] ? ' selected="selected"' : '') . '>Yes, always redirect non-administrative users to non-SSL version (e.g. always use http://)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting: <code>Yes</code>. This is compatible w/ <a href="http://codex.wordpress.org/Administration_Over_SSL" target="_blank" rel="external"><code>FORCE_SSL_LOGIN</code></a> and/or <a href="http://codex.wordpress.org/Administration_Over_SSL" target="_blank" rel="external"><code>FORCE_SSL_ADMIN</code></a>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_login_welcome_page", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_membership_options_page", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_membership_options_page", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Membership Options Page">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-options-page-section">' . "\n";
         echo '<h3>Membership Options Page (required, please customize this)</h3>' . "\n";
         echo '<p>Please create and/or choose an existing Page that showcases your Membership subscription options. This special Page is where you will insert the Payment Button(s) generated for you by s2Member. This Page serves as your lead-in signup page <em>(i.e. you\'ll give visitors one or more registration options here, and they\'ll be redirected to your Payment Gateway, to pay for the option they choose)</em>.</p>' . "\n";
         echo '<p>Your Membership Options Page should detail all of the features that come with Membership to your site, and provide a Payment Button for each Level of access you plan to offer. This is also the Page that anyone could be redirected to <em>(by s2Member)</em>, should they attempt to access an area of your site, which may require access to something they\'re NOT currenty allowed to view.' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? ' For more on this advanced topic, please check your Dashboard here: <code>s2Member -› API Scripting -› Membership Options Page / Variables</code>.' : '') . '</p>' . "\n";
         echo '<p><em><strong>*Tip*</strong> If you allow Open Registration (i.e. Free Subscribers), you might want to place a link on your Membership Options Page, which points directly to your free Registration Form, instead of routing a Customer through your Payment Gateway first. It\'s a matter of preference though. For further details, please check the section above: <code>s2Member -› General Options -› Open Registration</code>.</em></p>' . "\n";
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> Even with BuddyPress, s2Member still needs a Membership Options Page. This is where your Payment Button(s) will go, giving people the ability to pay you. And again, this is also the Page that anyone could be redirected to <em>(by s2Member)</em>, should they attempt to access an area of your site, which may require access to something they are currenty NOT allowed to view.' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? ' For more on this advanced topic, please check your Dashboard here: <code>s2Member -› API Scripting -› Membership Options Page / Variables</code>.' : '') . '</em></p>' . "\n" : '';
         echo '<p><em><strong>*Tip*</strong> s2Member will NEVER allow this Page to be protected from public access.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_membership_options_page", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-membership-options-page">' . "\n";
         echo 'Membership Options Page:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_membership_options_page" id="ws-plugin--s2member-membership-options-page">' . "\n";
         echo '<option value="">&mdash; Select &mdash;</option>' . "\n";
         foreach ($ws_plugin__s2member_temp_a = array_merge((array) get_pages()) as $ws_plugin__s2member_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__s2member_temp_o->ID) . '"' . ($ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] ? ' selected="selected"' : '') . '>' . esc_html($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
         }
         echo '</select><br />' . "\n";
         echo 'Please choose a Page that provides Users a way to signup for Membership. This Page should also contain your Payment Button(s). We recommend the following title: <code>Membership Signup</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-membership-options-page-vars-enable">' . "\n";
         echo 'Enable MOP Vars (i.e. Membership Options Page Variables)?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_membership_options_page_vars_enable" id="ws-plugin--s2member-membership-options-page-vars-enable">' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page_vars_enable"] ? ' selected="selected"' : '') . '>Yes (enable MOP Vars in all redirections; recommended behavior)</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page_vars_enable"] ? ' selected="selected"' : '') . '>No (don\'t include the additional details provided by MOP Vars)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'See: <code>Dashboard ⥱ s2Member ⥱ API / Scripting ⥱ Membership Options Page / Variables</code><br />' . "\n";
         echo 'Recommended setting: (<code>Yes, enable MOP Vars</code>)' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_membership_options_page", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_profile_modifications", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_profile_modifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Member Profile Modifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-profile-modifications-section">' . "\n";
         echo '<h3>Giving Members The Ability To Modify Their Profile</h3>' . "\n";
         echo '<p>s2Member can be configured to redirect Members away from the <a href="' . esc_attr(admin_url("/profile.php")) . '" target="_blank" rel="external">default Profile Editing Panel</a> that is built into WordPress. When/if a Member attempts to access the default Profile Editing Panel, they\'ll instead, be redirected to the Login Welcome Page that you\'ve configured through s2Member. <strong>Why would I redirect?</strong> Unless you\'ve made some drastic modifications to your WordPress installation, the default Profile Editing Panel that ships with WordPress, is NOT really suited for public access, even by a Member.</p>' . "\n";
         echo '<p>So instead of using this default Profile Editing Panel; s2Member creates an added layer of functionality, on top of WordPress. It does this by providing you <em>(as the site owner)</em>, with a special Shortcode: <code>[s2Member-Profile /]</code> that you can place into your Login Welcome Page, or any Post/Page for that matter <em>(even into a Text Widget)</em>. This Shortcode produces an Inline Profile Editing Form that supports all aspects of s2Member, including Password changes; and any Custom Registration/Profile Fields that you\'ve configured with s2Member.</p>' . "\n";
         echo '<p>Alternatively, s2Member also gives you the ability to send your Members to a <a href="' . esc_attr(site_url("/?s2member_profile=1")) . '" target="_blank" rel="external">special Stand-Alone version</a>. This Stand-Alone version has been designed <em>(with a bare-bones format)</em>, intentionally. This makes it possible for you to <a href="#" onclick="if(!window.open(\'' . site_url("/?s2member_profile=1") . '\', \'_popup\', \'width=600,height=400,left=100,screenX=100,top=100,screenY=100,location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1\')) alert(\'Please disable popup blockers and try again!\'); return false;" rel="external">open it up in a popup window</a>, or embed it into your Login Welcome Page using an IFRAME. Code samples are provided below.</p>' . "\n";
         echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> BuddyPress already provides Users/Members with a Profile Editing Panel, powered by your theme. If you\'ve configured Custom Registration/Profile Fields with s2Member, you can also enable s2Member\'s Profile Field integration with BuddyPress (recommended). For further details, see: <code>s2Member -› General Options -› Registration/Profile Fields</code>.</em></p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_profile_modifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-force-admin-lockouts">' . "\n";
         echo 'Redirect Members away from the Default Profile Panel?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_force_admin_lockouts" id="ws-plugin--s2member-force-admin-lockouts">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] ? ' selected="selected"' : '') . '>No (I want to use the WordPress default methodologies)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] ? ' selected="selected"' : '') . '>Yes (redirect to Login Welcome Page; locking all /wp-admin/ areas)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting (<code>Yes</code>). <em><strong>*Note*</strong> When this is set to (<code>Yes</code>), s2Member will take an initiative to further safeguard ALL <code>/wp-admin/</code> areas of your installation; not just the Default Profile Panel.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Shortcode (copy/paste)</strong>, for an Inline Profile Modification Form:<br />' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit('[s2Member-Profile /]') . '" class="monospace" onclick="this.select ();" /></p>' . "\n";
         echo '<p style="margin-top:20px;"><strong>Stand-Alone (copy/paste)</strong>, for popup window:</p>' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit(preg_replace("/\\<\\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \\?\\>/", c_ws_plugin__s2member_utils_strings::esc_refs(site_url("/?s2member_profile=1")), file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.x-php"))) . '" class="monospace" onclick="this.select ();" /></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_profile_modifications", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_gen_ops_page_during_left_sections_display_url_shortening", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_url_shortening", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="URL Shortening Service Preference">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-url-shortening-section">' . "\n";
         echo '<h3>URL Shortening Service API (Preference)</h3>' . "\n";
         echo '<p>In a few special cases, long URLs generated by s2Member, containing encrypted authentication details, will be shortened; using one of the URL Shortening APIs <em>(listed below)</em>. A shortened URL prevents issues with VERY long links becoming corrupted by a Customer\'s email application. For instance, the Signup Confirmation Email that s2Member sends out to a new paying Customer, may contain a link which is shortened to prevent corruption by email applications. By default, s2Member uses the tinyURL API, which has proven itself to be the most reliable. However, in cases where an API service call fails, s2Member will automatically use one or more of its other APIs as a backup. The option below, allows you to configure which URL Shortening API s2Member should try first <em>(i.e. the one you prefer)</em>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_url_shortening", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-default-url-shortener">' . "\n";
         echo 'URL Shortening Service API (Preference):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_default_url_shortener" id="ws-plugin--s2member-default-url-shortener">' . "\n";
         echo '<option value="tiny_url"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["default_url_shortener"] === "tiny_url" ? ' selected="selected"' : '') . '>tinyurl.com (free tinyURL API service)</option>' . "\n";
         echo '<option value="goo_gl"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["default_url_shortener"] === "goo_gl" ? ' selected="selected"' : '') . '>goo.gl (free Google URL Shortening API service)</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-default-custom-str-url-shortener">' . "\n";
         echo 'Custom URL Shortening Service API (Optional/Advanced):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_default_custom_str_url_shortener" id="ws-plugin--s2member-default-custom-str-url-shortener" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["default_custom_str_url_shortener"]) . '" /><br />' . "\n";
         echo 'Your own custom URL <code>(i.e. GET request)</code>, with <code>%%s2_long_url%%</code> Replacement Code. [ <a href="#" onclick="alert(\'s2Member makes it possible for advanced site owners to use a custom URL shortening service they prefer, over the ones currently pre-integrated with s2Member. In order for this to work, your URL shortening service MUST support basic GET requests through its API (sometimes referred to as a REST or NVP API). In addition, your URL shortening service MUST be capable of returning a simple URL in the response that s2Member receives, as a result of s2Member processing the GET request you formulate. See example below.\\n\\nBitly example GET request with format=txt:\\nhttp://api.bitly.com/v3/shorten?login=demo&apiKey=2d71bf07&format=txt&longUrl=%%s2_long_url%%\\n(s2Member expects a shortened URL in the response from Bitly)\\n\\n* If you configure s2Member to use your own custom URL shortening service, s2Member will try your configuration first, and if anything fails, it will fall back on its own pre-integrated backups. When configuring your URL for the GET request, s2Member makes two Replacement Codes available:\\n\\n%%s2_long_url%% = The full URL that needs to be shortened (raw URL-encoded).\\n%%s2_long_url_md5%% = An MD5 hash of the full URL (might be useful in some APIs).\\n\\n* If you have any trouble getting your URL shortening service integrated with s2Member in this way, you might take a look at this WordPress Filter ( `ws_plugin__s2member_url_shorten` ), which s2Member makes available for advanced circumstances. Search s2Member\\\'s source code for `ws_plugin__s2member_url_shorten`.\'); return false;" tabindex="-1">click for details</a> ]<br />' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_after_url_shortening", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_gen_ops_page_after_left_sections", get_defined_vars());
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Ejemplo n.º 12
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>Getting Help w/ s2Member®</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     do_action("ws_plugin__s2member_during_help_page_before_left_sections", get_defined_vars());
     do_action("ws_plugin__s2member_during_help_page_during_left_sections_before_help", get_defined_vars());
     echo '<div class="ws-menu-page-group" title="Getting Help w/ s2Member" default-state="open">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-help">' . "\n";
     echo '<p>s2Member is pretty easy to setup and install initially. Most of the official documentation is right here in your Dashboard (i.e., there is a lot of inline documentation built into the software). That being said, it can take some time to master everything there is to know about s2Member\'s advanced features. If you need assistance with s2Member, please search the <a href="http://s2member.com/kb/" target="_blank" rel="external">s2Member Knowledge Base</a>, <a href="http://s2member.com/videos/" target="_blank" rel="external">Video Tutorials</a>, <a href="http://s2member.com/forums/" target="_blank" rel="external">Forums</a> and <a href="http://s2member.com/r/codex/" target="_blank" rel="external">Codex</a>. If you are planning to do something creative with s2Member, you might want to <a href="http://jobs.wordpress.net" target="_blank" rel="external">hire a freelance developer</a> to assist you.</p>' . "\n";
     echo '<p><strong>See also:</strong> <a href="http://s2member.com/r/common-troubleshooting-tips/" target="_blank" rel="external">s2Member Troubleshooting Guide</a> (please read this first if you\'re having trouble).</p>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h3 style="margin-bottom:0;">Testing Server Compatibility</h3>' . "\n";
     echo '<p>Please download the <a href="http://s2member.com/r/server-scanner-info/">s2Member Server Scanner</a>. Unzip, upload via FTP; then open in a browser for a full report.</p>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h3 style="margin-bottom:0;">Troubleshooting Payment Gateway Integrations</h3>' . "\n";
     echo '<p>Please use s2Member\'s <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")) . '">Log Viewer</a>. Log files can be very helpful.</p>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h3 style="margin-bottom:0;">Search s2Member KB Articles<em>!</em></h3>' . "\n";
     echo '<form method="get" action="http://s2member.com/kb/" target="_blank" onsubmit="if(this.q.value === \'enter search terms...\') this.q.value = \'\';" autocomplete="off">' . "\n";
     echo '<p><input type="text" name="kb_q" value="enter search terms..." style="width:60%;" onfocus="if(this.value === \'enter search terms...\') this.value = \'\';" onblur="if(this.value === \'\') this.value = \'enter search terms...\';" /> <input type="submit" value="Search" style="font-size:120%; font-weight:normal;" /></p>' . "\n";
     echo '</form>' . "\n";
     do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_help", get_defined_vars());
     echo '</div>' . "\n";
     echo '</div>' . "\n";
     do_action("ws_plugin__s2member_during_help_page_during_left_sections_after_help", get_defined_vars());
     do_action("ws_plugin__s2member_during_help_page_during_left_sections_before_support", get_defined_vars());
     echo '<div class="ws-menu-page-group" title="s2Member Tech. Support (for Pro Customers)" default-state="open">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-support">' . "\n";
     echo '<p style="max-width:900px;">Support for s2Member® is provided by WebSharks, Inc. Our customer support representatives are available Monday through Friday, excluding all major holidays. Or, you can discuss problems/solutions with others in our <a href="https://wordpress.org/support/plugin/s2member" target="_blank" rel="external">public community forum</a>.</p>' . "\n";
     echo '<ul>' . "\n";
     echo '<li>For pre-sale questions please see: <a href="http://s2member.com/kb/kb-tag/pre-sale-faqs/" target="_blank" rel="external">Pre-Sale FAQs</a>.</li>' . "\n";
     echo '<li>For installation instructions, please see: <a href="http://s2member.com/installation/" target="_blank" rel="external">Installing/Updating s2Member & s2Member Pro</a>.</li>' . "\n";
     echo '<li>For troubleshooting (and documentation) please <a href="http://s2member.com/kb/" target="_blank" rel="external">search our Knowledge Base</a>.</li>' . "\n";
     echo '<li>Paying customers in need of assistance may <a href="http://s2member.com/r/new-trouble-ticket/" target="_blank" rel="external">submit a trouble ticket</a>.</li>' . "\n";
     echo '<li>If you have other questions, please <a href="http://s2member.com/r/new-pre-sale-inquiry/" target="_blank" rel="external">contact our sales dept</a>.</li>' . "\n";
     echo '</ul>' . "\n";
     do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_support", get_defined_vars());
     echo '</div>' . "\n";
     echo '</div>' . "\n";
     do_action("ws_plugin__s2member_during_help_page_during_left_sections_after_support", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_help_page_during_left_sections_display_pro", !c_ws_plugin__s2member_utils_conds::pro_is_installed(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_help_page_during_left_sections_before_pro", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Upgrading to s2Member Pro<em>!</em>" default-state="open">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-pro">' . "\n";
         echo '<p>Among many other features/enhancements, <a href="http://s2member.com/" target="_blank" rel="external">s2Member Pro</a> comes pre-integrated with additional payment gateways that work with s2Member Pro-Forms (a powerful s2Member Pro feature). For instance, Stripe (most popular; also supports Bitcoin), PayPal Payments Pro, and Authorize.Net. Each of these payment gateways allow you to accept most major credit cards on-site; i.e., customers never leave your site! s2Member Pro-Forms also support PayPal Express Checkout (if you integrate with PayPal Pro); for customers who actually prefer to pay with PayPal.</p>' . "\n";
         echo '<p><strong>Learn more here:</strong> <a href="http://s2member.com/features/" target="_blank" rel="external">s2Member Pro Features</a></p>' . "\n";
         do_action("ws_plugin__s2member_during_help_page_during_left_sections_during_pro", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_start_page_during_left_sections_after_pro", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_help_page_after_left_sections", get_defined_vars());
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Ejemplo n.º 13
0
 /**
  * Disallow automatic updates of s2Member w/ Pro is installed.
  *
  * @package s2Member\Installation
  * @since 150717
  *
  * @attaches-to `auto_update_plugin` filter.
  */
 public static function auto_update_filter($update = NULL, $item = NULL)
 {
     if (is_object($item) && !empty($item->slug) && $item->slug === 's2member') {
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             $update = FALSE;
         }
     }
     // Disallow.
     return $update;
     // Filter through.
 }
Ejemplo n.º 14
0
 /**
  * Handles the Shortcode for: `[s2Stream /]`.
  *
  * @package s2Member\s2File
  * @since 130119
  *
  * @attaches-to ``add_shortcode('s2Stream');``
  *
  * @param array  $attr An array of Attributes.
  * @param string $content Content inside the Shortcode.
  * @param string $shortcode The actual Shortcode name itself.
  *
  * @return string HTML markup that produces an audio/video stream for a specific player.
  */
 public static function sc_get_stream($attr = array(), $content = '', $shortcode = '')
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_sc_get_stream', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $attr = shortcode_atts(array('download' => '', 'file_download' => '', 'download_key' => '', 'stream' => 'yes', 'inline' => 'yes', 'storage' => '', 'remote' => '', 'ssl' => '', 'rewrite' => 'yes', 'rewrite_base' => '', 'skip_confirmation' => '', 'url_to_storage_source' => 'yes', 'count_against_user' => 'yes', 'check_user' => 'yes', 'player' => 'jwplayer-v6-rtmp', 'player_id' => 's2-stream-' . md5(uniqid('', TRUE)), 'player_path' => '/jwplayer/jwplayer.js', 'player_key' => '', 'player_title' => '', 'player_image' => '', 'player_mediaid' => '', 'player_description' => '', 'player_captions' => '', 'player_resolutions' => '', 'player_controls' => 'yes', 'player_skin' => '', 'player_stretching' => 'uniform', 'player_width' => '480', 'player_height' => '270', 'player_aspectratio' => '', 'player_autostart' => 'no', 'player_fallback' => 'yes', 'player_mute' => 'no', 'player_primary' => $attr['player'] === 'jw-player-v6' ? 'html5' : 'flash', 'player_repeat' => 'no', 'player_startparam' => '', 'player_option_blocks' => ''), $attr);
     $attr['download'] = !empty($attr['file_download']) ? $attr['file_download'] : $attr['download'];
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_sc_get_stream_after_shortcode_atts', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
     foreach ($attr as $key => $value) {
         // Now we need to go through and a `file_` prefix  to certain Attribute keys, for compatibility.
         if (strlen($value) && in_array($key, array('download', 'download_key', 'stream', 'inline', 'storage', 'remote', 'ssl', 'rewrite', 'rewrite_base'))) {
             $config['file_' . $key] = $value;
         } else {
             if (strlen($value) && !in_array($key, array('file_download', 'player')) && strpos($key, 'player_') !== 0) {
                 $config[$key] = $value;
             }
         }
     }
     unset($key, $value);
     // Ditch these now. We don't want these bleeding into Hooks/Filters anyway.
     if (!empty($config) && isset($config['file_download'])) {
         if ($attr['player_resolutions'] && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             $file_download_extension = strtolower(ltrim((string) strrchr(basename($config['file_download']), '.'), '.'));
             $file_download_resolution_wo_extension = substr($config['file_download'], 0, -(strlen($file_download_extension) + 1));
             $file_download_wo_resolution_extension = preg_replace('/\\-r[0-9]+([^.]*)$/i', '', $file_download_resolution_wo_extension);
             // e.g., `r720p-HD` is removed here.
             $file_download_resolutions = array();
             // Initialize the array of resolutions.
             foreach (preg_split('/[,;\\s]+/', $attr['player_resolutions'], NULL, PREG_SPLIT_NO_EMPTY) as $_player_resolution) {
                 $_player_resolution = ltrim($_player_resolution, 'Rr');
                 // Remove R|r prefix.
                 $file_download_resolutions[$_player_resolution] = $file_download_wo_resolution_extension . '-r' . $_player_resolution . '.' . $file_download_extension;
             }
             unset($_player_resolution);
             // Housekeeping.
             $file_download_urls = array();
             // Initialize array of all file download urls.
             foreach ($file_download_resolutions as $_player_resolution => $_file_download_resolution) {
                 $_file_download_config = array_merge($config, array('file_download' => $_file_download_resolution));
                 if ($file_download_urls) {
                     // If this is a ANOTHER resolution, don't count it against the user.
                     $_file_download_config = array_merge($_file_download_config, array('check_user' => FALSE, 'count_against_user' => FALSE));
                 }
                 if (!($file_download_urls[str_replace(array('_', '-'), ' ', $_player_resolution)] = c_ws_plugin__s2member_files::create_file_download_url($_file_download_config, TRUE))) {
                     return apply_filters('ws_plugin__s2member_sc_get_stream', NULL, get_defined_vars());
                 }
                 // Failure.
             }
             unset($_player_resolution, $_file_download_resolution, $_file_download_config);
             // Housekeeping.
         } else {
             $file_download_urls = array(c_ws_plugin__s2member_files::create_file_download_url($config, TRUE));
         }
         // Default behavior.
         if ($file_download_urls && $attr['player'] && is_file($template = dirname(dirname(__FILE__)) . '/templates/players/' . $attr['player'] . '.php') && $attr['player_id'] && $attr['player_path']) {
             $template = is_file(TEMPLATEPATH . '/' . basename($template)) ? TEMPLATEPATH . '/' . basename($template) : $template;
             $template = is_file(get_stylesheet_directory() . '/' . basename($template)) ? get_stylesheet_directory() . '/' . basename($template) : $template;
             $template = is_file(WP_CONTENT_DIR . '/' . basename($template)) ? WP_CONTENT_DIR . '/' . basename($template) : $template;
             if (strpos($attr['player'], 'jwplayer-v6') === 0) {
                 $player = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($template)));
                 $_first_file_download_url = array();
                 // Holds the first one.
                 $_last_file_download_url = array();
                 // Holds the last one.
                 $_uses_rtmp_streamers = FALSE;
                 // Streamers use RTMP?
                 $_total_player_sources = count($file_download_urls);
                 // Total sources.
                 $_player_sources_counter = 1;
                 // Player sources counter; needed by the loop below.
                 $player_resolution_aspect_ratio_w = 16;
                 // Default aspect ratio width.
                 $player_resolution_aspect_ratio_h = 9;
                 // Default aspect ratio in height.
                 if ($attr['player_aspectratio'] && preg_match('/^[0-9]+\\:[0-9]+$/', $attr['player_aspectratio'])) {
                     list($player_resolution_aspect_ratio_w, $player_resolution_aspect_ratio_h) = explode(':', $attr['player_aspectratio']);
                 }
                 $player_resolution_aspect_ratio_w = (int) $player_resolution_aspect_ratio_w;
                 // Force integer value.
                 $player_resolution_aspect_ratio_h = (int) $player_resolution_aspect_ratio_h;
                 // Force integer value.
                 // See: <http://wsharks.com/1yzjAl6> and <http://wsharks.com/1yzkhea> regarging the SMIL bitrate hints given here.
                 $player_resolution_bitrates = array(2160 => '35000000', 1440 => '10000000', 1080 => '8000000', 720 => '5000000', 640 => '2500001', 480 => '2500000', 360 => '1000000', 320 => '999999', 240 => '500000', 180 => '300000');
                 $player_resolution_bitrates = apply_filters('ws_plugin__s2member_sc_get_stream_resolution_bitrates', $player_resolution_bitrates, get_defined_vars());
                 $player_resolution_sources_smil_file_id = md5(serialize($attr) . $_SERVER['REMOTE_ADDR']);
                 // Initialize SMIL ID.
                 $player_resolution_sources_smil_file_url = home_url('/s2member-rsf-file.smil?s2member_rsf_file=' . urlencode($player_resolution_sources_smil_file_id) . '&s2member_rsf_file_ip=' . urlencode($_SERVER['REMOTE_ADDR']));
                 $player_resolution_sources_smil_file_url = c_ws_plugin__s2member_utils_urls::add_s2member_sig($player_resolution_sources_smil_file_url);
                 $player_resolution_sources_smil_file_contents = '';
                 // Initialize player sources SMIL file contents.
                 $player_sources = '';
                 // Initialize player sources; empty string.
                 foreach ($file_download_urls as $_file_download_url_label => $_file_download_url) {
                     $_is_first_file_download_url = $_player_sources_counter <= 1;
                     $_is_last_file_download_url = $_player_sources_counter >= $_total_player_sources;
                     if ($_is_first_file_download_url) {
                         // We base this conditional on the first streamer.
                         $_uses_rtmp_streamers = stripos($_file_download_url['streamer'], 'rtmp') === 0;
                     }
                     switch ($attr['player']) {
                         case 'jwplayer-v6':
                             // Default w/ a direct URL (very simple).
                             $player_sources .= ',{';
                             // Open this source; JSON object properties.
                             $player_sources .= "'file': '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($_file_download_url['url']) . "'";
                             if (is_string($_file_download_url_label)) {
                                 $player_sources .= ",'label': '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($_file_download_url_label) . "'";
                             }
                             if ($_is_first_file_download_url) {
                                 $player_sources .= ",'default': 'true'";
                             }
                             $player_sources .= '}';
                             // Close this source.
                             break;
                             // Break switch loop.
                         // Break switch loop.
                         case 'jwplayer-v6-rtmp':
                             // RTMP w/ downloadable fallback (mobile compatibility).
                         // RTMP w/ downloadable fallback (mobile compatibility).
                         case 'jwplayer-v6-rtmp-only':
                             // RTMP streaming only (flash player only).
                             if ($attr['player_resolutions'] && $_total_player_sources > 1 && $_uses_rtmp_streamers) {
                                 if ($_is_first_file_download_url) {
                                     $player_sources .= ',{';
                                     // Open this source; JSON object properties.
                                     $player_sources .= "'file': '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($player_resolution_sources_smil_file_url) . "'";
                                     if ($_is_first_file_download_url) {
                                         $player_sources .= ",'default': 'true'";
                                     }
                                     $player_sources .= '}';
                                     // Close this source.
                                 }
                                 $_file_download_url['smil']['height'] = (int) $_file_download_url_label;
                                 // e.g., `720p-HD` becomes `720`.
                                 if (!$_file_download_url['smil']['height']) {
                                     $_file_download_url['smil']['height'] = 720;
                                 }
                                 // Use a default height if invalid.
                                 $_file_download_url['smil']['width'] = ceil($_file_download_url['smil']['height'] / $player_resolution_aspect_ratio_h * $player_resolution_aspect_ratio_w);
                                 $_file_download_url['smil']['system-bitrate'] = '1';
                                 // Default value.
                                 if (!empty($player_resolution_bitrates[$_file_download_url['smil']['height']])) {
                                     $_file_download_url['smil']['system-bitrate'] = $player_resolution_bitrates[$_file_download_url['smil']['height']];
                                 }
                                 $player_resolution_sources_smil_file_contents .= '<video src="' . esc_attr($_file_download_url['file']) . '"' . ' width="' . esc_attr($_file_download_url['smil']['width']) . '"' . ' height="' . esc_attr($_file_download_url['smil']['height']) . '"' . ' system-bitrate="' . esc_attr($_file_download_url['smil']['system-bitrate']) . '" />';
                             } else {
                                 $player_sources .= ',{';
                                 // Open this source; JSON object properties.
                                 $player_sources .= "'file': '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($_file_download_url['streamer'] . '/' . $_file_download_url['prefix'] . $_file_download_url['file']) . "'";
                                 if (is_string($_file_download_url_label)) {
                                     $player_sources .= ",'label': '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($_file_download_url_label) . "'";
                                 }
                                 if ($_is_first_file_download_url) {
                                     $player_sources .= ",'default': 'true'";
                                 }
                                 $player_sources .= '}';
                                 // Close this source.
                             }
                             if ($_is_last_file_download_url && $attr['player'] === 'jwplayer-v6-rtmp') {
                                 $player_sources .= ',{';
                                 // Open this source; JSON object properties.
                                 $player_sources .= "'file': '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($_file_download_url['url']) . "'";
                                 $player_sources .= '}';
                                 // Close this source.
                             }
                             break;
                             // Break switch loop.
                     }
                     if ($_is_first_file_download_url) {
                         $_first_file_download_url = $_file_download_url;
                         // Record for use later.
                         $player = preg_replace('/%%streamer%%/', $_file_download_url['streamer'], $player);
                         $player = preg_replace('/%%prefix%%/', $_file_download_url['prefix'], $player);
                         $player = preg_replace('/%%file%%/', $_file_download_url['file'], $player);
                         $player = preg_replace('/%%url%%/', $_file_download_url['url'], $player);
                     }
                     if ($_is_last_file_download_url) {
                         $_last_file_download_url = $_file_download_url;
                         // Record for use later.
                     }
                     $_player_sources_counter++;
                     // Increment the counter.
                 }
                 $player_sources = '[' . trim($player_sources, ',') . ']';
                 // Build array.
                 if ($player_resolution_sources_smil_file_contents && $_first_file_download_url) {
                     $player_resolution_sources_smil_file_contents = '<smil>' . ' <head><meta base="' . esc_attr($_first_file_download_url['streamer']) . '" /></head>' . ' <body><switch>' . $player_resolution_sources_smil_file_contents . '</switch></body>' . '</smil>';
                     set_transient('s2m_rsf_' . $player_resolution_sources_smil_file_id, $player_resolution_sources_smil_file_contents, 86400);
                 }
                 unset($_first_file_download_url, $_last_file_download_url, $_uses_rtmp_streamers, $_total_player_sources, $_player_sources_counter, $_is_first_file_download_url, $_is_last_file_download_url, $_file_download_url_label, $_file_download_url);
                 $player = preg_replace('/%%player_id%%/', $attr['player_id'], $player);
                 $player = preg_replace('/%%player_path%%/', $attr['player_path'], $player);
                 $player = preg_replace('/%%player_key%%/', $attr['player_key'], $player);
                 $player = preg_replace('/%%player_title%%/', $attr['player_title'], $player);
                 $player = preg_replace('/%%player_image%%/', $attr['player_image'], $player);
                 $player = preg_replace('/%%player_mediaid%%/', $attr['player_mediaid'], $player);
                 $player = preg_replace('/%%player_description%%/', $attr['player_description'], $player);
                 if ($attr['player_captions'] = c_ws_plugin__s2member_utils_strings::trim($attr['player_captions'], NULL, '[]')) {
                     $player = preg_replace('/%%player_captions%%/', '[' . (strpos($attr['player_captions'], ':') !== FALSE ? $attr['player_captions'] : base64_decode($attr['player_captions'])) . ']', $player);
                 } else {
                     $player = preg_replace('/%%player_captions%%/', '[]', $player);
                 }
                 $player = preg_replace('/%%player_sources%%/', $player_sources, $player);
                 // Sources are constructed dynamically.
                 $player = preg_replace('/%%player_controls%%/', filter_var($attr['player_controls'], FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false', $player);
                 $player = preg_replace('/%%player_width%%/', strpos($attr['player_width'], '%') !== FALSE ? "'" . $attr['player_width'] . "'" : (int) $attr['player_width'], $player);
                 $player = preg_replace('/%%player_height%%/', $attr['player_aspectratio'] ? "''" : (strpos($attr['player_height'], '%') !== FALSE ? "'" . $attr['player_height'] . "'" : (int) $attr['player_height']), $player);
                 $player = preg_replace('/%%player_aspectratio%%/', $attr['player_aspectratio'], $player);
                 $player = preg_replace('/%%player_stretching%%/', $attr['player_stretching'], $player);
                 $player = preg_replace('/%%player_skin%%/', $attr['player_skin'], $player);
                 $player = preg_replace('/%%player_autostart%%/', filter_var($attr['player_autostart'], FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false', $player);
                 $player = preg_replace('/%%player_fallback%%/', filter_var($attr['player_fallback'], FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false', $player);
                 $player = preg_replace('/%%player_mute%%/', filter_var($attr['player_mute'], FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false', $player);
                 $player = preg_replace('/%%player_repeat%%/', filter_var($attr['player_repeat'], FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false', $player);
                 $player = preg_replace('/%%player_startparam%%/', $attr['player_startparam'], $player);
                 $player = preg_replace('/%%player_primary%%/', $attr['player_primary'], $player);
                 $player = preg_replace('/%%player_option_blocks%%/', strpos($attr['player_option_blocks'], ':') !== FALSE ? $attr['player_option_blocks'] : base64_decode($attr['player_option_blocks']), $player);
             }
         }
     }
     return apply_filters('ws_plugin__s2member_sc_get_stream', isset($player) ? $player : NULL, get_defined_vars());
 }
Ejemplo n.º 15
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>API / Notifications</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form">' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-options-save")) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n";
     do_action("ws_plugin__s2member_during_api_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_signup_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_signup_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Signup Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-notifications-section">' . "\n";
         echo '<h3>Signup Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Subscription is created, you\'ll want to read this section. This is marked `Signup`, because the URLs that you list below, will be notified each time a "new", "paying" Member signs up. Depending on your fee structure, this may include a payment that establishes their Subscription, or it may not. This Notification will only be triggered once for each Member. Signup Notifications are sent right after a "new", "paying" Member signs up successfully through your Payment Gateway, regardless of whether any money has actually been transacted. In other words, this Notification is triggered anytime a "new", "paying" Member signs up through your Payment Gateway, even if you provided them with something for free <em>(e.g. even if no money is being transacted)</em>.</p>' . "\n";
         echo '<p>This Notification will NOT be processed for Free Subscribers that register without going through your Payment Gateway at all (e.g. they simply register on-site; and there is no checkout whatsoever). This Notification will NOT be processed when an "existing" User/Member pays for a new Subscription <em>(see: Modification Notifications for that scenario)</em>.' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' And, this Notification will NOT be processed on Buy Now transactions for Independent Custom Capabilities <em>(see: Payment Notifications for that scenario)</em>.') . '</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Signup Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_signup_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-signup-notification-urls">' . "\n";
         echo 'Signup Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_signup_notification_urls" id="ws-plugin--s2member-signup-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Signup Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. Payment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e. there is only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remains constant throughout any &amp; all future payments. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%initial%%</code> = The Initial Fee charged during signup. If you offered a 100% Free Trial, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent, whenever they initially signed up, no matter what. Even if that amount is 0.\\n\\nIf a Customer signs up, under the terms of a 100% Free Trial Period, this will be 0. So be careful using %%initial%% when you offer a 100% Free Trial Period, because a $0.00 sale amount could cause havoc with affiliate programs.\\n\\nIf you\\\'re offering a 100% Free Trial Period, and you need to track sales through affiliate programs, you can either hard-code an amount; or use `Payment Notifications` instead.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. If you offer something 100% free, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) for the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D (this means 1 Day)\\n%%initial_term%% = 1 W (this means 1 Week)\\n%%initial_term%% = 1 M (this means 1 Month)\\n%%initial_term%% = 1 Y (this means 1 Year)\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D (this means 1 Day)\\n%%regular_term%% = 1 W (this means 1 Week)\\n%%regular_term%% = 1 M (this means 1 Month)\\n%%regular_term%% = 1 Y (this means 1 Year)\\n%%regular_term%% = 1 L (this means 1 Lifetime)\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period (or duration) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code — if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (e.g. the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code — if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e. the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-signup-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_signup_notification_recipients" id="ws-plugin--s2member-signup-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_registration_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_registration_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Registration Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-notifications-section">' . "\n";
         echo '<h3>Registration Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a "new" Member is created, you\'ll want to read this section. This is marked `Registration`, because the URLs that you list below, will be notified each time a "new" Member registers a Username. This is usually triggered right after a `Signup` Notification; at the point in which a "new" Member successfully completes the Registration form, and they are assigned a Username.</p>' . "\n";
         echo '<p>This Notification is ALSO triggered whenever you create a "new" User inside your WordPress Dashboard.</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Registration Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_registration_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-registration-notification-urls">' . "\n";
         echo 'Registration Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_registration_notification_urls" id="ws-plugin--s2member-registration-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Registration Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%role%%</code> = The Role ID <code>(subscriber, s2member_level[0-9]+, administrator, editor, author, contributor)</code>.</li>' . "\n";
         echo '<li><code>%%level%%</code> = The Level number <code>(0, 1, 2, 3, 4)</code>. (<em>deprecated, no longer recommended; use <code>%%role%%</code></em>)</li>' . "\n";
         echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> (<em>in comma-delimited format</em>).</li>' . "\n";
         echo '<li><code>%%auto_eot_time%%</code> = Auto-EOT Time (if applicable). Ex: <code>1299925670</code> (<em>unix timestamp</em>).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n";
         echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-registration-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_registration_notification_recipients" id="ws-plugin--s2member-registration-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_registration_notifications", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_payment_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_payment_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Payment Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-payment-notifications-section">' . "\n";
         echo '<h3>Payment Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever payment transactions <em>(including Recurring Payments)</em> take place, you\'ll want to read this section. This is marked `Payment`, because the URLs that you list below, will be notified each time an actual payment occurs. Depending on your fee structure, this may include a first Initial Payment that establishes a Subscription. But more importantly, this will be triggered on all future payments that are received for the lifetime of the Subscription.</p>' . "\n";
         echo '<p>So, unlike the `Signup` Notification, `Payment` Notifications take place whenever actual payments are received, instead of just once after signup is completed. If a payment is required during signup <em>(i.e. no Free Trial is being offered)</em>, a Signup Notification will be triggered, and a Payment Notification will ALSO be triggered. In other words, a Payment Notification occurs anytime funds are received, no matter what.</p>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<p>Payment Notifications are also triggered whenever a Buy Now purchase for Independent Custom Capabilities takes place.</p>' . "\n" : '';
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_payment_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-payment-notification-urls">' . "\n";
         echo 'Payment Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_payment_notification_urls" id="ws-plugin--s2member-payment-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Payment Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There are some exceptions. If you are selling Lifetime or Fixed-Term (non-recurring) access, and/or Independent Custom Capabilities, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the payment.\\n\\nPayment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e. there is only ONE payment), which goes for Independent Custom Capability purchases too; using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remains constant throughout any &amp; all future payments. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%txn_id%%</code> = The Payment Transaction ID, which is always unique for each payment received.</li>' . "\n";
         echo '<li><code>%%amount%%</code> = The Amount of the payment. Most affiliate programs calculate commissions from this.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' or Capabilities.') . '</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' or Capabilities.') . '</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' or Capabilities.') . '</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' or Capabilities.') . '</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) that the payment is for.' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' [ <a href="#" onclick="alert(\'If the Payment Notification is for Independent Custom Capabilities, the `level` portion of this string will be an asterisk ( `*` ), since the Membership Level is irrelevant, and remains `as it was` in that scenario. In all other cases, the `level` portion will be a numeric value.\'); return false;">?</a> ]') . '</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro Forms):</strong><br />' . "\n";
             echo '<em>These are ONLY included with payments that occur during checkout. They will NOT be provided with any future recurring payments.</em>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code — if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (e.g. the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code — if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e. the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-payment-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_payment_notification_recipients" id="ws-plugin--s2member-payment-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_payment_notifications", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_modification_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_modification_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Modification Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-modification-notifications-section">' . "\n";
         echo '<h3>Modification Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified each time a new Subscription is created by an "existing" User/Member, or an "existing" Member modifies their paid Subscription terms, you\'ll want to read this section. This is marked `Modification`, because the URLs that you list below, will be notified each time an "existing" User/Member <em>(even if they are/were a Free Subscriber)</em> signs up for a paid Subscription <em>(i.e. a Modification takes place against an existing account within WordPress)</em>, or an "existing" Member modifies their paid Subscription terms <em>(again, a Modification takes places against an existing account within WordPress)</em>. Depending on your fee structure, this may include a payment that establishes their Subscription, or it may not.</p>' . "\n";
         echo '<p>Modification Notifications are sent right after a Member signs up and/or modifies billing terms successfully through your Payment Gateway, regardless of whether any money has actually been transacted. In other words, this Notification is triggered, even if you provided them with something for free <em>(e.g. even if no money is being transacted)</em>.</p>' . "\n";
         echo '<p>This Notification will NOT be processed for "new" Users/Members <em>(see: Signup Notifications for that scenario)</em>.' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' And, this Notification will NOT be processed for Independent Custom Capability purchases <em>(see: Payment Notifications for that scenario)</em>.') . '</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Modification Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_modification_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-modification-notification-urls">' . "\n";
         echo 'Modification Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_modification_notification_urls" id="ws-plugin--s2member-modification-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["modification_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Modification Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. Payment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e. there is only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remains constant throughout any &amp; all future payments. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%initial%%</code> = The Initial Fee. If you offered a 100% Free Trial, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent when they completed checkout, no matter what. Even if that amount is 0.\\n\\nIf a Customer upgrades/downgrades under the terms of a 100% Free Trial Period, this will be 0. So, please be careful using %%initial%% when you offer a 100% Free Trial Period, because a $0.00 sale amount could cause havoc with affiliate programs.\\n\\nIf you\\\'re offering a 100% Free Trial Period, and you need to track sales through affiliate programs, you can either hard-code an amount; or use `Payment Notifications` instead.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. If you offer something 100% free, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) for the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D (this means 1 Day)\\n%%initial_term%% = 1 W (this means 1 Week)\\n%%initial_term%% = 1 M (this means 1 Month)\\n%%initial_term%% = 1 Y (this means 1 Year)\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D (this means 1 Day)\\n%%regular_term%% = 1 W (this means 1 Week)\\n%%regular_term%% = 1 M (this means 1 Month)\\n%%regular_term%% = 1 Y (this means 1 Year)\\n%%regular_term%% = 1 L (this means 1 Lifetime)\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period (or duration) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code — if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (e.g. the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code — if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e. the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-modification-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_modification_notification_recipients" id="ws-plugin--s2member-modification-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["modification_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_cancellation_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_cancellation_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Cancellation Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-cancellation-notifications-section">' . "\n";
         echo '<h3>Cancellation Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions are cancelled through your Payment Gateway, you\'ll want to read this section. This is marked `Cancellation`, because the URLs that you list below, will be notified each time a Subscription is cancelled. A Cancellation is triggered when you cancel a Customer\'s Subscription through your Payment Gateway, or when a Customer cancels their own Subscription.</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Cancellation Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT (End Of Term). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
         echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through your Payment Gateway... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT (End Of Term) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member.</em></p>' . "\n";
         echo '<p><em>s2Member will not process an EOT (End Of Term) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system (based on your configuration). s2Member also calculates one extra day (24 hours) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_cancellation_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-cancellation-notification-urls">' . "\n";
         echo 'Cancellation Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_cancellation_notification_urls" id="ws-plugin--s2member-cancellation-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Cancellation Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase. Payment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e. there was only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that required a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that required a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remained constant throughout the lifetime of the Membership. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <em>level:custom_capabilities:fixed term</em>) that the Subscription was for.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-cancellation-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_cancellation_notification_recipients" id="ws-plugin--s2member-cancellation-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_cancellation_notifications", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_eot_deletion_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_eot_deletion_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="EOT/Deletion Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-eot-deletion-notifications-section">' . "\n";
         echo '<h3>EOT/Deletion Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have ended <em>(and a Member is demoted to a Free Subscriber)</em>, or when an account is deleted from the system, you\'ll want to read this section. This is marked `EOT/Deletion`, because the URLs that you list below, will be notified in both cases.</p>' . "\n";
         echo '<p><strong>EOT = End Of Term.</strong> An EOT is triggered <em>immediately</em> when you refund a Customer, when a Customer forces a chargeback to occur, or when a paid Subscription ends naturally <em>(i.e. expires)</em>, and your Payment Gateway sends s2Member an EOT (End Of Term) response. Delayed EOTs occur after a Cancellation, either as a result of you cancelling a Customer\'s Subscription, or a Customer cancelling their own Subscription. A Cancellation usually results in a delayed EOT, because a Cancellation does NOT always warrant an immediate action; there could still be time left on their Subscription.</p>' . "\n";
         echo '<p>Manual Deletions will trigger this Notification too. If you delete an account manually from within your WordPress Dashboard, your URLs can be notified automatically through this API Notification, and this scenario can be detected through the Replacement Code <code>%%eot_del_type%%</code>, which is documented below. So the two events are an EOT <em>(of any kind)</em> and/or a Manual Deletion.</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These EOT/Deletion Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through your Payment Gateway... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT (End Of Term) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member.</em></p>' . "\n";
         echo '<p><em>s2Member will not process an EOT (End Of Term) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system (based on your configuration). s2Member also calculates one extra day (24 hours) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_eot_deletion_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-eot-del-notification-urls">' . "\n";
         echo 'EOT/Deletion Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_eot_del_notification_urls" id="ws-plugin--s2member-eot-del-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'EOT/Deletion Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%eot_del_type%%</code> = The type of event that triggered this Notification. [ <a href="#" onclick="alert(\'List of possible values:\\n\\nuser-removal-deletion (i.e. manual removal/deletion)\\nauto-eot-cancellation-expiration-demotion\\nauto-eot-cancellation-expiration-deletion\\nipn-cancellation-expiration-demotion\\nipn-cancellation-expiration-deletion\\nipn-refund-reversal-demotion\\nipn-refund-reversal-deletion\'); return false;">list of possible values</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase. Payment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e. there was only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that required a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that required a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remained constant throughout the lifetime of the Membership. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-eot-del-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_eot_del_notification_recipients" id="ws-plugin--s2member-eot-del-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_eot_deletion_notifications", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_refund_reversal_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_refund_reversal_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Refund/Reversal Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-refund-reversal-notifications-section">' . "\n";
         echo '<h3>Refund/Reversal Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have been refunded or reversed <em>(i.e. charged back to you)</em>, you\'ll want to read this section. This is marked `Refund/Reversal`, because the URLs that you list below, will ONLY be notified in those specific cases, as opposed to EOT/Deletion Notifications, which are all-inclusive.</p>' . "\n";
         echo '<p>This is very similar to the EOT/Deletion Notification described above. However, there is an important distinction. The all-inclusive EOT/Deletion Notification includes cancellations, expirations, failed payments, refunds, chargebacks, and even manual deletions by the Administrator from within the Dashboard. In other words, EOT/Deletion Notifications are processed ANY time a deletion or End Of Term action takes place. This API Notification, that is, Refund/Reversal Notifications, do NOT include all of those scenarios.</p>' . "\n";
         echo '<p>So the distinction is that Refund/Reversal Notifications are ONLY sent under two specific circumstances: 1. You log into your Payment Gateway and refund a payment that is associated with a Subscription. 2. The Customer complains to your Payment Gateway and a chargeback occurs, forcing a Reversal. In both of these cases, an EOT/Deletion Notification will be sent <em>(as described in the previous section)</em>, but since EOT/Deletion is a broader Notification, these Refund/Reversal Notifications are here so you can nail down specific back-office operations in these two specific scenarios.</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Refund/Reversal Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_refund_reversal_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-ref-rev-notification-urls">' . "\n";
         echo 'Refund/Reversal Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_ref_rev_notification_urls" id="ws-plugin--s2member-ref-rev-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ref_rev_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Refund/Reversal Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The Paid Subscription ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase. Payment Gateways do not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e. there was only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that required a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that required a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe, which remained constant throughout the lifetime of the Membership. Each Stripe Customer has this Customer ID; and also a Subscription and/or Transaction ID [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%subscr_cid%% is simply set to the %%subscr_id%% value; i.e. it is a duplicate of %%subscr_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Subscription and/or Transaction ID. See %%subscr_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%parent_txn_id%%</code> = The Parent Transaction ID, associated with the original payment being refunded/reversed.</li>' . "\n";
         echo '<li><code>%%-amount%%</code> = The Negative Amount of the payment, that was refunded or reversed back to the Customer.</li>' . "\n";
         echo '<li><code>%%-fee%%</code> = The Negative Payment Gateway fee, that was refunded back to you as the Merchant/Seller.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <em>level:custom_capabilities:fixed term</em>) that the payment was for.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported in this Notification:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -› General Options -› Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-ref-rev-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_ref_rev_notification_recipients" id="ws-plugin--s2member-ref-rev-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ref_rev_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_refund_reversal_notifications", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_sp_sale_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_sp_sale_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Specific Post/Page ~ Sale Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-sale-notifications-section">' . "\n";
         echo '<h3>Specific Post/Page ~ Sale Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Specific Post/Page sales take place, you\'ll want to read this section. This is marked `Specific Post/Page`, because the URLs that you list below, will be notified each time a payment occurs, on a sale providing access to a Specific Post/Page.</p>' . "\n";
         echo '<p>This is one of only two API Notifications that are sent for Specific Post/Page Access <em>(i.e. this one, and another below, for Refunds/Reversals)</em>. All of the other API Notifications are designed for Membership Level Access' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and Independent Custom Capabilities') . '. None of the other API Notifications will ever be processed for Specific Post/Page Access. If you intend to respond to events related to Specific Post/Page Access, you MUST use one of the two API Notifications specifically geared to Post/Page Access.</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Sale Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_sp_sale_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-sp-sale-notification-urls">' . "\n";
         echo 'Specific Post/Page ~ Sale Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_sp_sale_notification_urls" id="ws-plugin--s2member-sp-sale-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_sale_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Specific Post/Page ~ Sale Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%sp_access_url%%</code> = The full URL (generated by s2Member) where the Customer can gain access.</li>' . "\n";
         echo '<li><code>%%sp_access_exp%%</code> = Human readable expiration for <code>%%sp_access_url%%</code>. Ex: <em>(link expires in <code>%%sp_access_exp%%</code>)</em>.</li>' . "\n";
         echo '<li><code>%%txn_id%%</code> = The Paid Transaction ID. Payment Gateways assign a unique identifier for every purchase.</li>' . "\n";
         echo '<li><code>%%txn_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe. Each Stripe Customer has this Customer ID; and also a Transaction ID associated with their purchase of the Specific Post/Page [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%txn_cid%% is simply set to the %%txn_id%% value; i.e. it is a duplicate of %%txn_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Transaction ID. See %%txn_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%amount%%</code> = The full Amount of the sale. If you offer something 100% free, this will be <code>0</code>.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customers\'s IP Address, during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> (translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code>).</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code — if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (e.g. the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code — if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e. the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-sp-sale-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_sp_sale_notification_recipients" id="ws-plugin--s2member-sp-sale-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_sale_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_sp_sale_notifications", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_sp_refund_reversal_notifications", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_sp_refund_reversal_notifications", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Specific Post/Page ~ Refund/Reversal Notifications">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-refund-reversal-notifications-section">' . "\n";
         echo '<h3>Specific Post/Page ~ Refund/Reversal Notification URLs (optional)</h3>' . "\n";
         echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever sales have been refunded or reversed <em>(i.e. charged back to you)</em>, you\'ll want to read this section. This is marked `Specific Post/Page`, because the URLs that you list below, will be notified each time a Refund or Reversal occurs, on a sale that provided access to a Specific Post/Page.</p>' . "\n";
         echo '<p>This is one of only two Notifications that are sent for Specific Post/Page Access <em>(i.e. this one, and another above, for Sales)</em>. All of the other API Notifications are designed for Membership Level Access' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and Independent Custom Capabilities') . '. None of the other API Notifications will ever be processed for Specific Post/Page Access. If you intend to respond to events related to Specific Post/Page Access, you MUST use one of the two API Notifications specifically geared to Post/Page Access.</p>' . "\n";
         echo '<p>Please note, this feature is not to be confused with the PayPal IPN service. PayPal IPN <em>(and other service integrations)</em> are already built into s2Member. They remain active at all times. These Refund/Reversal Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/building-an-api-notification-handler/" target="_blank" rel="external">Building An API Notification Handler</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_sp_refund_reversal_notifications", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-sp-ref-rev-notification-urls">' . "\n";
         echo 'Specific Post/Page ~ Refund/Reversal Notification URLs:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
         echo '<textarea name="ws_plugin__s2member_sp_ref_rev_notification_urls" id="ws-plugin--s2member-sp-ref-rev-notification-urls" rows="3" wrap="off">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_ref_rev_notification_urls"]) . '</textarea><br />' . "\n";
         echo 'Specific Post/Page ~ Refund/Reversal Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%parent_txn_id%%</code> = The Parent Transaction ID, associated with the original payment being refunded/reversed.</li>' . "\n";
         echo '<li><code>%%parent_txn_cid%%</code> = Applicable only with Stripe integration. This is the Customer\'s ID in Stripe. Each Stripe Customer has this Customer ID; and also a Transaction ID associated with their purchase of the Specific Post/Page [ <a href="#" onclick="alert(\'Applicable only when you integrate s2Member with Stripe. In all other cases, the %%parent_txn_cid%% is simply set to the %%parent_txn_id%% value; i.e. it is a duplicate of %%parent_txn_id%% when running anything other than Stripe.\\n\\nEach Stripe Customer has a Customer ID; and also a Transaction ID. See %%parent_txn_id%% for further details.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%-amount%%</code> = The Negative Amount of the payment, that was refunded or reversed back to the Customer.</li>' . "\n";
         echo '<li><code>%%-fee%%</code> = The Negative Payment Gateway fee, that was refunded back to you as the Merchant/Seller.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased access to a Specific Post/Page.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased access to a Specific Post/Page.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased access to a Specific Post/Page.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased access to a Specific Post/Page.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> (translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code>).</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-sp-ref-rev-notification-recipients">' . "\n";
         echo 'Send An Email Transaction Log Of This Event?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_sp_ref_rev_notification_recipients" id="ws-plugin--s2member-sp-ref-rev-notification-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_ref_rev_notification_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_sp_refund_reversal_notifications", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_api_ops_page_after_left_sections", get_defined_vars());
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Ejemplo n.º 16
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>API / Scripting</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     do_action("ws_plugin__s2member_during_scripting_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_easy_way", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_easy_way", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="The Extremely Easy Way">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-easy-way-section">' . "\n";
         echo '<h3>The Extremely Easy Way (no scripting required)</h3>' . "\n";
         echo '<p>From your s2Member Restriction Options panel, you may restrict access to certain Posts, Pages, Tags, Categories, and/or URIs based on a Member\'s Level. The s2Member Restriction Options panel makes it easy for you. All you do is type in the basics of what you want to restrict access to, and those sections of your site will be off limits to non-Members. That being said, there are times when you might need to have greater control over which portions of your site can be viewed by non-Members, or Members at different Levels; with different Capabilities. This is where API Scripting with Conditionals comes in.</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_easy_way", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_easy_way", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_simple_way", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_simple_way", get_defined_vars());
         if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
             echo '<div class="ws-menu-page-group" title="Simple/Shortcode Conditionals">' . "\n";
             echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
             echo '<h3>Simple Conditionals (via WordPress Shortcodes)</h3>' . "\n";
             echo '<p>In an effort to give you even more control over access restrictions, s2Member makes Simple Conditionals available to you from within WordPress, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Member\'s Level, or even based on Custom Capabilities. s2Member\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
             echo '<p><em>There are <strong>two different Shortcodes</strong> being demonstrated here:<br /><strong>1. <code>s2If</code></strong> (for testing simple conditional expressions).<br /><strong>2. <code>s2Get</code></strong> (to get an API Constant value, a Custom Field, or meta key).</em></p>' . "\n";
             do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way_farm", get_defined_vars());
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-is-user-logged-in-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #2:</strong> The same as example #1, but this uses <code>[else]</code> syntax.</strong></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-is-user-logged-in-else-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #3:</strong> Full access for any Member with a Level >= 1; also using <code>[else]</code> syntax.</strong></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-can-full-access-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #4:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-is-specific-content-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #5:</strong> The same as example #4, but this uses <code>[else]</code> syntax &amp; nesting.</strong></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-is-specific-content-else-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #6:</strong> Simple Conditionals w/ integrated use of [s2Get /].</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-1-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #7:</strong> Using multiple Conditionals together; also nesting other Shortcodes.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-2-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #8:</strong> Using multiple Conditionals together; also nesting Conditionals.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-3-farm.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 (a Free Subscriber). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><em><strong>s2Member supports many <a href="http://s2member.com/r/wordpress-conditional-tags/" target="_blank" rel="external">Conditional Tags</a> in WordPress.</strong> Including: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>is_admin()</code></strong>, <strong><code>is_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_admin()</code></strong>, <strong><code>is_404()</code></strong>, <strong><code>is_home()</code></strong>, <strong><code>is_front_page()</code></strong>, <strong><code>is_singular(ID|slug|{slug,ID})"</code></strong>, <strong><code>is_single(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page_template(file.php)</code></strong>, <strong><code>is_attachment()</code></strong>, <strong><code>is_feed()</code></strong>, <strong><code>is_archive()</code></strong>, <strong><code>is_search()</code></strong>, <strong><code>is_category(ID|slug|{slug,ID})</code></strong>, <strong><code>is_tax(taxonomy,term)</code></strong>, <strong><code>is_tag(slug|{slug,slug})"</code></strong>, <strong><code>has_tag(slug|{slug,slug})"</code></strong>, <strong><code>is_author(ID|slug|{slug,ID})</code></strong>, <strong><code>is_date()</code></strong>, <strong><code>is_day()</code></strong>, <strong><code>is_month()</code></strong>, <strong><code>is_time()</code></strong>, <strong><code>is_year()</code></strong>, <strong><code>is_sticky(ID)</code></strong>, <strong><code>is_paged()</code></strong>, <strong><code>is_preview()</code></strong>, <strong><code>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>.</em></p>' . "\n";
             echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
             echo '<p><em>1. True/false → ex: <code>current_user_can()</code> / <code>!current_user_can()</code><br />2. False explicitly → ex: <code>current_user_cannot()</code><br />3. Passing an ID → ex: <code>is_page(24)</code><br />4. Passing a Slug → ex: <code>is_page(my-cool-page)</code><br />5. Passing an Array → ex: <code>is_page({my-cool-page,24,about,contact-form})</code></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT use spaces inside Conditionals.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_page(My Membership Options Page)</code><br />- use slugs or IDs instead, no spaces.</em></p>' . "\n";
             echo '<p><em><strong>Implementing AND/OR Conditional expressions:</strong></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT mix AND/OR expressions.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_user_logged_in() AND is_page(1) OR is_page(2)</code><br />- use one or the other; do NOT mix AND/OR together.</em></p>' . "\n";
             echo '<p><em><strong class="ws-menu-page-hilite">If you need to have both types of logic, use nesting...</strong></em></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-nesting-farm.x-php")) . '</p>' . "\n";
             echo '<p><em><strong class="ws-menu-page-hilite">Another example, if you use <code>[else]</code> when nesting...</strong></em></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-nesting-else-farm.x-php")) . '</p>' . "\n";
             echo '</div>' . "\n";
             echo '</div>' . "\n";
         } else {
             echo '<div class="ws-menu-page-group" title="Simple/Shortcode Conditionals">' . "\n";
             echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
             echo '<h3>Simple Conditionals (via WordPress Shortcodes)</h3>' . "\n";
             echo '<p>In an effort to give you even more control over access restrictions, s2Member makes Simple Conditionals available to you from within WordPress, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>current_user_is_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_is_not_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_can_for_blog(blog_id,capability)</code></strong>, <strong><code>current_user_cannot_for_blog(blog_id,capability)</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Member\'s Level, or even based on Custom Capabilities. s2Member\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
             echo '<p><em>There are <strong>two different Shortcodes</strong> being demonstrated here:<br /><strong>1. <code>s2If</code></strong> (for testing simple conditional expressions).<br /><strong>2. <code>s2Get</code></strong> (to get an API Constant value, a Custom Field, or meta key).</em></p>' . "\n";
             echo '<p>Please see this KB article to learn more: <a href="http://www.s2member.com/kb/simple-shortcode-conditionals/" target="_blank" rel="external">s2Member Simple Shortcode Conditionals</a></p>' . "\n";
             do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars());
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
             echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-is-user-logged-in.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #2:</strong> The same as example #1, but this uses <code>[else]</code> syntax.</strong></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-is-user-logged-in-else.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #3:</strong> Full access for any Member with a Level >= 1; also using <code>[else]</code> syntax.</strong></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-can-full-access.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #4:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-is-specific-content.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #5:</strong> The same as example #4, but this uses <code>[else]</code> syntax &amp; nesting.</strong></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-is-specific-content-else.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #6:</strong> Simple Conditionals w/ integrated use of [s2Get /].</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-1.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #7:</strong> Using multiple Conditionals together; also nesting other Shortcodes.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-2.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Example #8:</strong> Using multiple Conditionals together; also nesting Conditionals.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-3.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 (a Free Subscriber). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><em><strong>s2Member supports ALL <a href="http://s2member.com/r/wordpress-conditional-tags/" target="_blank" rel="external">Conditional Tags</a> in WordPress.</strong> Including, but not limited to: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>current_user_is_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_is_not_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_can_for_blog(blog_id,capability)</code></strong>, <strong><code>current_user_cannot_for_blog(blog_id,capability)</code></strong>, <strong><code>is_multisite()</code></strong>, <strong><code>is_main_site()</code></strong>, <strong><code>is_super_admin()</code></strong>, <strong><code>is_admin()</code></strong>, <strong><code>is_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_admin()</code></strong>, <strong><code>is_404()</code></strong>, <strong><code>is_home()</code></strong>, <strong><code>is_front_page()</code></strong>, <strong><code>is_comments_popup()</code></strong>, <strong><code>is_singular(ID|slug|{slug,ID})"</code></strong>, <strong><code>is_single(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page_template(file.php)</code></strong>, <strong><code>is_attachment()</code></strong>, <strong><code>is_feed()</code></strong>, <strong><code>is_trackback()</code></strong>, <strong><code>is_archive()</code></strong>, <strong><code>is_search()</code></strong>, <strong><code>is_category(ID|slug|{slug,ID})</code></strong>, <strong><code>is_tax(taxonomy,term)</code></strong>, <strong><code>is_tag(slug|{slug,slug})"</code></strong>, <strong><code>has_tag(slug|{slug,slug})"</code></strong>, <strong><code>is_author(ID|slug|{slug,ID})</code></strong>, <strong><code>is_date()</code></strong>, <strong><code>is_day()</code></strong>, <strong><code>is_month()</code></strong>, <strong><code>is_time()</code></strong>, <strong><code>is_year()</code></strong>, <strong><code>is_sticky(ID)</code></strong>, <strong><code>is_paged()</code></strong>, <strong><code>is_preview()</code></strong>, <strong><code>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>, <strong><code>is_active_sidebar(ID|number)</code></strong>.</em></p>' . "\n";
             echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
             echo '<p><em>1. True/false → ex: <code>current_user_can()</code> / <code>!current_user_can()</code><br />2. False explicitly → ex: <code>current_user_cannot()</code><br />3. Passing an ID → ex: <code>is_page(24)</code><br />4. Passing a Slug → ex: <code>is_page(my-cool-page)</code><br />5. Passing an Array → ex: <code>is_page({my-cool-page,24,about,contact-form})</code></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT use spaces inside Conditionals.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_page(My Membership Options Page)</code><br />- use slugs or IDs instead, no spaces.</em></p>' . "\n";
             echo '<p><em><strong>Implementing AND/OR Conditional expressions:</strong></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT mix AND/OR expressions.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_user_logged_in() AND is_page(1) OR is_page(2)</code><br />- use one or the other; do NOT mix AND/OR together.</em></p>' . "\n";
             echo '<p><em><strong class="ws-menu-page-hilite">If you need to have both types of logic, use nesting...</strong></em></p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-nesting.x-php")) . '</p>' . "\n";
             echo '<p><em><strong class="ws-menu-page-hilite">Another example, if you use <code>[else]</code> when nesting...</strong></em></p>' . "\n";
             if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[else]</code> requires s2Member Pro.</strong></em></p>' . "\n";
             }
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-nesting-else.x-php")) . '</p>' . "\n";
             echo '</div>' . "\n";
             echo '</div>' . "\n";
         }
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_simple_way", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_advanced_way", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_advanced_way", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Advanced/PHP Conditionals">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
         echo '<h3>The Advanced Way (some PHP scripting required)</h3>' . "\n";
         echo '<p>In an effort to give you even more control over access restrictions, s2Member makes some PHP functions, and also some PHP Constants, available to you from within WordPress. In this section, we\'ll demonstrate several functions: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is("role")</code></strong>, <strong><code>current_user_is_not("role")</code></strong>, <strong><code>current_user_can("capability")</code></strong>, <strong><code>current_user_cannot("capability")</code></strong>, <strong><code>current_user_is_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_is_not_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_can_for_blog($blog_id,"capability")</code></strong>, &amp; <strong><code>current_user_cannot_for_blog($blog_id,"capability")</code></strong>. To make use of these functions, please follow our PHP code samples below. Using PHP, is a very powerful way to build Advanced Conditionals within your content; based on a Member\'s Level, Custom Capabilities, and/or other factors. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin (<a href="http://s2member.com/r/ezphp/" target="_blank" rel="external">ezPHP</a>).</p>' . "\n";
         echo '<p>See also this related KB article: <a href="http://www.s2member.com/kb/simple-shortcode-conditionals/" target="_blank" rel="external">s2Member Simple Shortcode Conditionals</a></p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_way", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/is-user-logged-in.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-full-access.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-is-specific-content.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #4:</strong> Using s2Member API Conditionals, supplementing WordPress core functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2-conditional-supplements-1.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #5:</strong> Using s2Member API Conditionals, supplementing WordPress core functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2-conditional-supplements-2.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2-conditional-supplements-3.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #7:</strong> Using s2Member API Constants, instead of conditional functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-constants-1.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #8:</strong> Using s2Member API Constants, instead of conditional functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-constants-2.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
         echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
         echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 (a Free Subscriber). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_advanced_way", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_queries", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_queries", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Advanced/PHP Query Conditionals">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
         echo '<h3>Advanced Query Conditionals (some PHP scripting required)</h3>' . "\n";
         echo '<p>s2Member provides several built-in API Functions that are tailored to meet the needs of developers integrating s2Member into their themes. Such as: <strong><code>is_protected_by_s2member($id, "[category,tag,post,page,singular,uri]")</code></strong>, <strong><code>is_permitted_by_s2member($id, "[category,tag,post,page,singular,uri]")</code></strong>, <strong><code>is_category_protected_by_s2member($cat_id)</code></strong>, <strong><code>is_category_permitted_by_s2member($cat_id)</code></strong>, <strong><code>is_tag_protected_by_s2member($tag_id [slug or tag name])</code></strong>, <strong><code>is_tag_permitted_by_s2member($tag_id [slug or tag name])</code></strong>, <strong><code>is_post_protected_by_s2member($post_id)</code></strong>, <strong><code>is_post_permitted_by_s2member($post_id)</code></strong>, <strong><code>is_page_protected_by_s2member($page_id)</code></strong>, <strong><code>is_page_permitted_by_s2member($page_id)</code></strong>, <strong><code>is_uri_protected_by_s2member($uri [or full url])</code></strong>, <strong><code>is_uri_permitted_by_s2member($uri [ or full url])</code></strong>.</p>' . "\n";
         echo '<p>In addition, there are two special functions that can be applied by theme authors before making custom queries: <strong><code>attach_s2member_query_filters()</code></strong>, <strong><code>detach_s2member_query_filters()</code></strong>. These can be used before and after a call to <strong><code>query_posts()</code></strong> for example. s2Member will automatically filter all protected content (not available to the current User/Member).</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_queries", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #1:</strong> Pre-filtering custom queries in WordPress.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/custom-queries.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #2:</strong> OR, instead of pre-filtering; check Access Restrictions in The Loop.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/custom-queries-loop.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #3:</strong> Checking Tag Restrictions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-tag-restrictions.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #4:</strong> Checking Category Restrictions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-category-restrictions.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #5:</strong> Checking Page Restrictions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-page-restrictions.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Example #6:</strong> Checking Post Restrictions, including Custom Post Types.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-post-restrictions.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_queries", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_custom_capabilities", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_custom_capabilities", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Custom Capabilities (Packages)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-capabilities-section">' . "\n";
         echo '<h3>Packaging Together Custom Capabilities w/ Membership</h3>' . "\n";
         echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/_F91xzrmq-Q" frameborder="0" allowscriptaccess="always" allowfullscreen="true" style="float:right; margin:0 0 20px 20px; width:300px; height:200px;"></iframe>' . "\n";
         echo '<p>Using one of s2Member\'s Payment Button and/or Form Generators, you can add Custom Capabilities in comma-delimited format. s2Member builds upon existing functionality offered by <a href="http://s2member.com/r/wordpress-rolescaps/" target="_blank" rel="external">WordPress Roles/Capabilities</a>. s2Member supports Free Subscribers <em>(at Level #0)</em>, and several Primary Roles created by the s2Member plugin <em>(i.e., s2Member Levels 1-4, or up to the number of configured Levels)</em>. Each s2Member Level <em>(aka: s2Member Role)</em> provides the Capability <code>current_user_can("access_s2member_level0"), 1, 2, 3, 4</code>, where <code>access_s2member_level[0-4]</code> is the Capability associated with each Role; and Membership Levels provide incremental access <em>(i.e., Level #4 Members can also access content at Levels 0, 1, 2, and 3 beneath them)</em>. In short, these Level-based permissions are the default Capabilities that come with each Membership Level being sold on your site.</p>' . "\n";
         echo '<p>Now, if you\'d like to package together some variations of each Membership Level that you\'re selling, you can! All you do is add <strong>Custom Capabilities</strong> whenever you create your Payment Button and/or Form Shortcode (<em>there is a field in the Button &amp; Form Generators where you can enter Custom Capabilities</em>). You can sell Membership Packages that come with Custom Capabilities, and even with custom prices.</p>' . "\n";
         echo '<p>Custom Capabilities are an extension to a feature that already exists in WordPress. The <code>current_user_can()</code> function, can be used to test for these additional Capabilities that you allow. Whenever a Member completes the checkout process, after having purchased a Membership from you (one that included Custom Capabilities), s2Member will add those Custom Capabilities to the account for that specific Member.</p>' . "\n";
         echo '<p>Custom Capabilities are always prepended with <code>access_s2member_ccap_</code>. You fill in the last part, with ONLY lowercase alpha-numerics and/or underscores. For example, let\'s say you want to sell Membership Level #1, as is. But, you also want to sell a slight variation of Membership Level #1, that includes the ability to access the Music &amp; Video sections of your site. So, instead of selling this additional access under a whole new Membership Level, you could just sell a modified version of Membership Level #1. Add the the Custom Capabilities: <code>music,videos</code>. Once a Member has these Capabilities, you can test for these Capabilities using <code>current_user_can("access_s2member_ccap_music")</code> and <code>current_user_can("access_s2member_ccap_videos")</code>.</p>' . "\n";
         echo '<p>The important thing to realize, is that Custom Capabilities, are just that. They\'re custom. s2Member only deals with the default Capabilities that it uses. If you start using Custom Capabilities, you MUST use Simple or Advanced Conditionals (<em>i.e., <a href="http://codex.wordpress.org/Function_Reference/current_user_can" target="_blank" rel="external"><code>current_user_can()</code></a> logic</em>) to test for them. Either in your theme files with PHP, or in Posts/Pages using <a href="http://www.s2member.com/kb/simple-shortcode-conditionals/" target="_blank" rel="external">Simple Conditionals</a> <em>(powered by Shortcodes)</em>.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/roles-caps/" target="_blank" rel="external">s2Member Roles/Capabilities (Including bbPress Support)</a>.</p>' . "\n";
         echo '<p><strong class="ws-menu-page-hilite">See also:</strong> This VIDEO tutorial: <a href="http://www.s2member.com/videos/A2C07377CF60025E/" target="_blank" rel="external">Using Custom Capabilities with s2Member</a> (by Lead Developer Jason Caldwell).</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>New:</strong> In the latest versions of s2Member, you can automatically require certain Custom Capabilities on a per Post/Page basis. So now, s2Member <em>(if you prefer)</em> CAN handle Custom Capabilities for you automatically! Whenever you edit a Post/Page <em>(i.e., there is a Meta Box for s2Member in your Post/Page editing station)</em>... you can tell s2Member to require certain Custom Capabilities that you type in, using comma-delimited format. In other words, you will need to type in some of the trigger words that you used whenever you created your Payment Buttons/Forms. This way paying Members will have the Custom Capabilities to view different kinds of content that you offer.</p>' . "\n";
         echo '<p><strong>New:</strong> By default, a Checkout Button or Form generated by s2Member is designed to (Add) Custom Capabilities to any that may or may not already exist for a particular User/Member. However, starting with s2Member v110815+, you can tell s2Member to (Remove All) Custom Capabilities, and then (Add) only the new ones that you specify. This is accomplished on a per Form/Button basis by preceding your comma-delimited list of Custom Capabilities with `-all`. For further details on this topic, click the <a href="#" onclick="alert(\'*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> icon next to the Custom Capabilities field in any Button/Form Generator supplied by s2Member.</p>' . "\n";
         echo '<p><strong>New:</strong> Independent Custom Capabilities. You can now sell one or more Custom Capabilities using Buy Now functionality, to "existing" Users/Members, regardless of which Membership Level they have on your site <em>(i.e., you could even sell Independent Custom Capabilities to Users at Membership Level #0, normally referred to as Free Subscribers, if you like)</em>. So this is quite flexible. For further details, please check your Dashboard, under: <strong>s2Member → PayPal Buttons → Capability (Buy Now) Buttons</strong>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_custom_capabilities", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://s2member.com/r/enhanced-capability-manager/" target="_blank" rel="external">Plugins → Enhanced Capability Manager</a> <em>(may come in handy for some)</em>.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Custom Capabilities:</strong> (music,videos):</p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-ccaps-1.x-php")) . '</p>' . "\n";
         echo '<p><strong>Custom Capabilities:</strong> (ebooks,reports,tips):</p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-ccaps-2.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_custom_capabilities", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_custom_capability_files", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_custom_capability_files", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Custom Capability &amp; Member Level Files">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-capability-files-section">' . "\n";
         echo '<h3>Restricting Files, Based On Custom Capabilities</h3>' . "\n";
         echo '<p>If you\'re NOT familiar with Custom Capabilities yet, please read the section above, titled: <code>Custom Capability Packages</code>, and also see: <strong>s2Member → Download Options</strong>, both as primers; BEFORE you read this section. Once you understand the basic concept of Custom Capabilities &amp; Protected File Downloads, you\'ll see that (by default) s2Member does NOT handle File Download Protection with respect to Custom Capabilities. That\'s where Custom Capability Sub-directories come in.</p>' . "\n";
         echo '<p>You can create Custom Capability Sub-directories under: <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '</code>. For instance, if you have a Custom Capability <code>music</code>, you can place protected files that should ONLY be accessible to Members with <code>access_s2member_ccap_music</code>, inside: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music/</code>. Some examples are provided below.</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_custom_capability_files", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Custom Capabilities:</strong> (music,videos)</p>' . "\n";
         echo '<p>Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos</code></p>' . "\n";
         echo '<p>Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music/file.mp3</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos/file.avi</code></p>' . "\n";
         echo '<p>Now, here are some link examples, using Custom Capability Sub-directories:</p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/ccap-file-downloads.x-php")) . '</p>' . "\n";
         echo '<p><em>These links will ONLY work for Members who are logged-in, with the proper Capabilities.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Membership Levels:</strong> (this also works fine)</p>' . "\n";
         echo '<p>Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level0</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level1</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level2</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level3</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level4</code></p>' . "\n";
         echo '<p>Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level0/tiger.doc</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level1/zebra.pdf</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level2/elephant.doc</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level3/rhino.pdf</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level4/lion.doc</code></p>' . "\n";
         echo '<p>Now, here are some link examples, using Member Level Sub-directories:</p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/level-file-downloads.x-php")) . '</p>' . "\n";
         echo '<p><em>These links will ONLY work for Members who are logged-in, with an adequate Membership Level.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_custom_capability_files", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_advanced_dripping", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_advanced_dripping", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="s2Member Content Dripping">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-dripping-section">' . "\n";
         echo '<h3>Dripping Content (some PHP scripting may be required)</h3>' . "\n";
         echo '<p>Content Dripping is the gradual, pre-scheduled release of premium website content to paying Members. This has become increasingly popular, because it allows older Members; those who have paid you more, due to recurring charges; to acquire access to more content progressively; based on their original paid registration time. It also gives you (as the site owner), the ability to launch multiple membership site portals, operating on autopilot, without any direct day-to-day involvement in a content release process. <strong>The <a href="http://www.s2member.com/kb/s2drip-shortcode/" target="_blank" rel="external"><code>[s2Drip]</code> shortcode</a> is the easiest way to drip content.</strong> The other methods (shown below) require some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin (<a href="http://s2member.com/r/ezphp/" target="_blank" rel="external">ezPHP</a>).</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_dripping", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>A very simple way to drip content; via the <a href="http://www.s2member.com/kb/s2drip-shortcode/" target="_blank" rel="external"><code>[s2Drip]</code></a> Shortcode:</strong></p>' . "\n";
         if (!c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<p><em><strong class="ws-menu-page-hilite">NOTE: the use of <code>[s2Drip]</code> requires s2Member Pro.</strong></em></p>' . "\n";
         }
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2drip-example1.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>To drip content using <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>:</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-paid-registration-days-dripping.x-php")) . '</p>' . "\n";
         echo '<p><em>There are more examples on this page, under the sub-section "s2Member PHP/API Constants". You\'ll see that s2Member provides you with access to several PHP/API Constants, which will assist you in dripping content. Some of the most relevant API Constants include: <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</code>, <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>, <code>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</code>, <code>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</code>; and there are many others.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3>Very Advanced Content Dripping (some PHP required)</h3>' . "\n";
         echo '<p>If you plan on dripping content in VERY advanced ways, you can tap into s2Member\'s recorded history of all Paid Registration Times. (i.e., <code>' . esc_html('<?php $time = s2member_paid_registration_time("level1"); ?>') . '</code>) will give you a timestamp at which a Member first paid for Level#1 access. If they\'ve never paid for Level#1 access, the function will return 0. s2Member keeps a recorded history of timestamps associated with each Level that a Member gains access to, throughout the lifetime of their account.</p>' . "\n";
         echo '<p><strong>Here is the function documentation for PHP/WordPress developers:</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2member-paid-registration-time.x-php")) . '</p>' . "\n";
         echo '<p><strong>Here are some actual examples that should give you some ideas:</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2member-paid-registration-time-examples.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_advanced_dripping", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_constants", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_constants", get_defined_vars());
         if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
             echo '<div class="ws-menu-page-group" title="s2Get / s2Member API Constants">' . "\n";
             echo '<div class="ws-menu-page-section ws-plugin--s2member-api-constants-section">' . "\n";
             echo '<h3>Using s2Get w/ s2Member API Constants</h3>' . "\n";
             echo '<p>A Constant, is an identifier (a name) for a simple value. Below is a comprehensive list that includes all of the defined Constants available to you. We recommend using some of these Constants in the creation of your Login Welcome Page; which is described in the s2Member General Options Panel. These are NOT required, but you can get pretty creative with your Login Welcome Page if you know how to use the <code>[s2Get constant="" /]</code> Shortcode for WordPress.</p>' . "\n";
             echo '<p>For example, you might use <code>[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]</code> to display the type of Membership a Customer has.</em></p>' . "\n";
             do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_constants_farm", get_defined_vars());
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_VERSION</strong><br />This will always be a (string) with the current s2Member version. Available since s2Member 3.0. Dated versions began with s2Member v110604.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_LOGIN_COUNTER</strong><br />This will always be (int) <code>-1</code> or higher <em>(representing the number of times a User/Member has logged into your site)</em>. <code>-1</code> if no User is logged in. <code>0</code> if the current User has NEVER logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN</strong><br />This will always be (bool) true or false. True if a User/Member is currently logged in with an Access Level >= 0.</p>' . "\n";
             echo '<p><em>See: <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER</strong><br />This will always be (bool) true or false. True if a Member is currently logged in with an Access Level >= 1.</p>' . "\n";
             echo '<p><em>See: <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) <code>-1</code> thru <code>4</code> <em>(or, up to the total number Membership Levels you\'ve configured)</em>. <code>-1</code> if not logged in. <code>0</code> if logged in as a Free Subscriber.</p>' . "\n";
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 (a Free Subscriber). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LABEL</strong><br />This will always be a (string) containing the Membership Label associated with the current User\'s account. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be an empty string. Also empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be their WordPress User ID#. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. Gateway. If they\'ve NOT paid yet, this will be empty. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_CUSTOM</strong><br />This will always be a (string) containing the current User\'s Custom String; associated with their s2Member Profile. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. 0 if not logged in. This holds the recorded time at which the User originally registered their Username for access to your site; for free or otherwise. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>(i.e., if they\'re still a Free Subscriber)</em>. This holds the recorded time at which the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. This value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once this value is recorded, it never changes under any circumstance. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>(i.e., if they\'re still a Free Subscriber)</em>. This is the number of days that have passed since the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. The underlying timestamp behind this value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once the underlying timestamp behind this value is recorded, it never changes under any circumstance. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</strong><br />This will always be an (int). 0 if not logged in. This is the number of days that have passed since the User originally registered their Username for access to your site; for free or otherwise. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DISPLAY_NAME</strong><br />This will always be a (string) containing the current User\'s Display Name. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_FIRST_NAME</strong><br />This will always be a (string) containing the current User\'s First Name. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_LAST_NAME</strong><br />This will always be a (string) containing the current User\'s Last Name. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_LOGIN</strong><br />This will always be a (string) containing the current User\'s Username. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_EMAIL</strong><br />This will always be a (string) containing the current User\'s Email Address. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address, even when/if NOT logged-in. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if browsing anonymously.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_IP</strong><br />This is a (string) containing the IP Address the current User had at the time they registered. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_ID</strong><br />This will always be an (int) containing the current User\'s ID# in WordPress. However, it will be 0 if not logged in.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             #echo '<p><strong>S2MEMBER_CURRENT_USER_FIELDS</strong><br />This will always be a JSON encoded array, in (string) format. An empty JSON encoded array, in (string) format, if not logged in. This JSON encoded array will contain the following fields: <code>id, ip, reg_ip, email, login, first_name, last_name, display_name, subscr_id, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. You can do <code>print_r(json_decode(S2MEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
             #echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'re allowed to download. 0 means no access.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED</strong><br />This will always be (bool) true or false. A value of true means their allowed downloads are >= 999999999, and false means it is not. This is useful if you are allowing unlimited (999999999) downloads on some Membership Levels. You can display `Unlimited` instead of a number.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'ve downloaded in the current period.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS</strong><br />This will always be an (int) value >= 0. This indicates how many total days make up the current period. 0 means no access.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile. In addition to this Stand-Alone version, s2Member also makes a Shortcode available which produces an Inline Profile Editing Form. Use <code>[s2Member-Profile /]</code> in any Post/Page, or even in a Text Widget if you like.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL</strong><br />This is the full URL to the Limit Exceeded Page (informational).</p>' . "\n";
             echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL</strong><br />This is the full URL to the Membership Options Page (the signup page).</p>' . "\n";
             echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_URL</strong><br />This is the full URL to the Login Welcome Page (the User\'s account page). * This could also be the full URL to a Special Redirection URL (if you configured one). See <strong>s2Member → General Options → Login Welcome Page</strong>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL. * In the case of a Special Redirection URL, this ID is not really applicable.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LOGIN_PAGE_URL</strong><br />This is the full URL to the Membership Login Page (the WordPress login page).</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LOGOUT_PAGE_URL</strong><br />This is the full URL to the Membership Logout Page (the WordPress logout page).</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LEVELn_LABEL</strong><br />This is the (string) Label that you configured for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_EMAIL</strong><br />This is the Email Address that outgoing messages are sent by.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_NOTIFY_URL</strong><br />This is the URL on your system that receives PayPal IPN responses.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_RETURN_URL</strong><br />This is the URL on your system that receives PayPal return variables.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_BUSINESS</strong><br />This is the Email Address that identifies your PayPal Business.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_ENDPOINT</strong><br />PayPal Endpoint Domain <em>(changes when Sandbox Mode is enabled)</em>.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_ENDPOINT</strong><br />PayPal API Endpoint Domain <em>(changes when Sandbox Mode is enabled)</em>.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_USERNAME</strong><br />This is the API Username associated with your PayPal Business.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_PASSWORD</strong><br />This is the API Password associated with your PayPal Business.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_SIGNATURE</strong><br />This is the API Signature associated with your PayPal Business.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN</strong><br />This is the PDT Identity Token associated with your PayPal Business.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants_farm", get_defined_vars());
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>on0</code> input variable, with the string: <code>"Referencing Customer ID"</code>. Otherwise, it will be set to a default value of: <code>"Originating Domain"</code>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>os0</code> input variable, with the value of <code>S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</code>. Otherwise, it will be set to a default value of <code>$_SERVER["HTTP_HOST"]</code> <em>(the originating domain name)</em>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1</strong> ... This auto-fills the <code>on1</code> value in PayPal Button Codes. This always contains the string: <code>"Customer IP Address"</code>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1</strong> ... This auto-fills the <code>os1</code> value in PayPal Button Codes. This always contains the value of <code>$_SERVER["REMOTE_ADDR"]</code> <em>(the Customer\'s IP address)</em>.</p>' . "\n";
             echo '<p><em>These four Constants above are special. They\'re used by the PayPal Button Generator for s2Member. This is how s2Member identifies an existing Member (and/or a Free Subscriber), who is already logged in when they click a PayPal Modification Button that was generated for you by s2Member. Instead of forcing a Member (and/or a Free Subscriber) to re-register for a new account, s2Member can identify their existing account, and update it, according to the modified terms in your Button Code. Specifically, these three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal Buttons, you won\'t even see these, because they\'re added internally by the Shortcode processor. Anyway, they\'re just documented here for clarity; you probably won\'t use these directly; the Button Generator pops them in.</em></p>' . "\n";
             echo '</div>' . "\n";
             echo '</div>' . "\n";
         } else {
             echo '<div class="ws-menu-page-group" title="s2Member PHP/API Constants">' . "\n";
             echo '<div class="ws-menu-page-section ws-plugin--s2member-api-constants-section">' . "\n";
             echo '<h3>You Have Access To PHP Constants (some PHP scripting required)</h3>' . "\n";
             echo '<p>A Constant, is an identifier <em>(i.e., a name)</em> for a simple value in PHP scripting. Below is a comprehensive list that includes all of the PHP defined Constants available to you. All of these Constants are also available through JavaScript as Global Variables. Example code has been provided in the documentation below. If you\'re a web developer, we suggest using some of these Constants in the creation of your Login Welcome Page; which is described in the s2Member General Options Panel. These are NOT required, but you can get pretty creative with the Login Welcome Page, if you know a little PHP.</p>' . "\n";
             echo '<p>If you don\'t know any PHP, you can use the <code>[s2Get constant="NAME_OF_CONSTANT" /]</code> Shortcode for WordPress. For example, you might use <code>[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]</code> to display the type of Membership a Customer has. The <code>[s2Get constant="" /]</code> Shortcode will work for any of the API Constants documented below.</p>' . "\n";
             do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_constants", get_defined_vars());
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p>Before you read any further, you should install this handy plugin: <a href="http://s2member.com/r/ezphp/" target="_blank" rel="external">ezPHP</a>.<br />' . "\n";
             echo 'You\'ll need to have this plugin installed to use PHP code in Posts/Pages.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
             echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_VERSION</strong><br />This will always be a (string) with the current s2Member version. Available since s2Member 3.0. Dated versions began with s2Member v110604.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/version.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_LOGIN_COUNTER</strong><br />This will always be (int) <code>-1</code> or higher <em>(representing the number of times a User/Member has logged into your site)</em>. <code>-1</code> if no User is logged in. <code>0</code> if the current User has NEVER logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-login-counter.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN</strong><br />This will always be (bool) true or false. True if a User/Member is currently logged in with an Access Level >= 0.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-is-logged-in.x-php")) . '</p>' . "\n";
             echo '<p><em>See: <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER</strong><br />This will always be (bool) true or false. True if a Member is currently logged in with an Access Level >= 1.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-is-logged-in-as-member.x-php")) . '</p>' . "\n";
             echo '<p><em>See: <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) <code>-1</code> thru <code>4</code> <em>(or, up to the total number Membership Levels you\'ve configured)</em>. <code>-1</code> if not logged in. <code>0</code> if logged in as a Free Subscriber.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-access-level.x-php")) . '</p>' . "\n";
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 (a Free Subscriber). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LABEL</strong><br />This will always be a (string) containing the Membership Label associated with the current User\'s account. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-access-label.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be an empty string. Also empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-subscr-id.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be their WordPress User ID#. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-subscr-or-wp-id.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. Gateway. If they\'ve NOT paid yet, this will be empty. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-subscr-gateway.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_CUSTOM</strong><br />This will always be a (string) containing the current User\'s Custom String; associated with their s2Member Profile. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-custom.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. 0 if not logged in. This holds the recorded time at which the User originally registered their Username for access to your site; for free or otherwise. This is useful if you want to drip content over an extended period of time, based on how long someone has been registered (period); regardless of whether they are/were paying you. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-registration-time.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</strong><br />This will always be an (int). 0 if not logged in. This is the number of days that have passed since the User originally registered their Username for access to your site; for free or otherwise. This is useful if you want to drip content over an extended period of time, based on how long someone has been registered (period); regardless of whether they are/were paying you. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-registration-days.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>(i.e., if they\'re still a Free Subscriber)</em>. This holds the recorded time at which the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. This value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once this value is recorded, it never changes under any circumstance. This is useful if you want to drip content over an extended period of time, based on how long someone has been a "paying" Member (period); regardless of their original or existing Membership Level. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-paid-registration-time.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>(i.e., if they\'re still a Free Subscriber)</em>. This is the number of days that have passed since the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. The underlying timestamp behind this value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once the underlying timestamp behind this value is recorded, it never changes under any circumstance. This is useful if you want to drip content over an extended period of time, based on how long someone has been a "paying" Member (period); regardless of their original or existing Membership Level. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-paid-registration-days.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DISPLAY_NAME</strong><br />This will always be a (string) containing the current User\'s Display Name. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-display-name.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_FIRST_NAME</strong><br />This will always be a (string) containing the current User\'s First Name. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-first-name.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_LAST_NAME</strong><br />This will always be a (string) containing the current User\'s Last Name. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-last-name.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_LOGIN</strong><br />This will always be a (string) containing the current User\'s Username. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-login.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_EMAIL</strong><br />This will always be a (string) containing the current User\'s Email Address. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-email.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address, even when/if NOT logged in. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if browsing anonymously.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-ip.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_IP</strong><br />This will always be a (string) containing the current User\'s original IP Address during registration. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-registration-ip.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_ID</strong><br />This will always be an (int) containing the current User\'s ID# in WordPress. However, it will be 0 if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-id.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_FIELDS</strong><br />This will always be a JSON encoded array, in (string) format. An empty JSON encoded array, in (string) format, if not logged in. This JSON encoded array will contain the following fields: <code>id, ip, reg_ip, email, login, first_name, last_name, display_name, subscr_id, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. You can do <code>print_r(json_decode(S2MEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-fields.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'re allowed to download. 0 means no access.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-allowed.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED</strong><br />This will always be (bool) true or false. A value of true means their allowed downloads are >= 999999999, and false means it is not. This is useful if you are allowing unlimited (999999999) downloads on some Membership Levels. You can display `Unlimited` instead of a number.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-allowed-is-unlimited.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'ve downloaded in the current period.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-currently.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS</strong><br />This will always be an (int) value >= 0. This indicates how many total days make up the current period. 0 means no access.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-allowed-days.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile. In addition to this Stand-Alone version, s2Member also makes a Shortcode available which produces an Inline Profile Editing Form. Use <code>[s2Member-Profile /]</code> in any Post/Page, or even in a Text Widget if you like.</p>' . "\n";
             echo '<p><strong>Code Sample #1</strong> (standard link):</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.x-php")) . '</p>' . "\n";
             echo '<p><strong>Code Sample #2</strong> (open the link in a popup window):</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.x-php")) . '</p>' . "\n";
             echo '<p><strong>Code Sample #3</strong> (embed the form into a Post/Page using an IFRAME tag):</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL</strong><br />This is the full URL to the Limit Exceeded Page (informational).</p>' . "\n";
             echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/file-download-limit-exceeded-page-url.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL</strong><br />This is the full URL to the Membership Options Page (the signup page).</p>' . "\n";
             echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/membership-options-page-url.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_URL</strong><br />This is the full URL to the Login Welcome Page (the User\'s account page). * This could also be the full URL to a Special Redirection URL (if you configured one). See <strong>s2Member → General Options → Login Welcome Page</strong>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL. * In the case of a Special Redirection URL, this ID is not really applicable.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/login-welcome-page-url.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LOGIN_PAGE_URL</strong><br />This is the full URL to the Membership Login Page (the WordPress login page).</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/login-page-url.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LOGOUT_PAGE_URL</strong><br />This is the full URL to the Membership Logout Page (the WordPress logout page).</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/logout-page-url.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LEVELn_LABEL</strong><br />This is the (string) Label that you created for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #..</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/leveln-label.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/leveln-file-downloads-allowed.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/leveln-file-downloads-allowed-days.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/file-download-inline-extensions.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/reg-email-from-name.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_EMAIL</strong><br />This is the Email Address that outgoing messages are sent by.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/reg-email-from-email.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_NOTIFY_URL</strong><br />This is the URL on your system that receives PayPal IPN responses.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-notify-url.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_RETURN_URL</strong><br />This is the URL on your system that receives PayPal return variables.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-return-url.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal server <em>(changes when Sandbox Mode is enabled)</em>.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-endpoint.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal API server <em>(changes when Sandbox Mode is enabled)</em>.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-endpoint.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_BUSINESS</strong><br />This is the Email Address that identifies your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-business.x-php")) . '</p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_USERNAME</strong><br />This is the API Username associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-username.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_PASSWORD</strong><br />This is the API Password associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-password.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_API_SIGNATURE</strong><br />This is the API Signature associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-signature.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<p><strong>S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN</strong><br />This is the PDT Identity Token associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-pdt-identity-token.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants", get_defined_vars());
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>on0</code> input variable, with the string: <code>"Referencing Customer ID"</code>. Otherwise, it will be set to a default value of: <code>"Originating Domain"</code>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>os0</code> input variable, with the value of <code>S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</code>. Otherwise, it will be set to a default value of <code>$_SERVER["HTTP_HOST"]</code> <em>(the originating domain name)</em>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1</strong> ... This auto-fills the <code>on1</code> value in PayPal Button Codes. This always contains the string: <code>"Customer IP Address"</code>.</p>' . "\n";
             echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1</strong> ... This auto-fills the <code>os1</code> value in PayPal Button Codes. This always contains the value of <code>$_SERVER["REMOTE_ADDR"]</code> <em>(the Customer\'s IP address)</em>.</p>' . "\n";
             echo '<p><em>These four Constants are special. They are used by the PayPal Button Generator for s2Member. This is how s2Member identifies an existing Member (and/or a Free Subscriber), who is already logged in when they click a PayPal Modification Button that was generated for you by s2Member. Instead of forcing a Member (and/or a Free Subscriber) to re-register for a new account, s2Member can identify their existing account, and update it, according to the modified terms in your Button Code. Specifically, these three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal Buttons, you won\'t even see these, because they\'re added internally by the Shortcode processor. Anyway, they\'re just documented here for clarity; you probably won\'t use these directly; the Button Generator pops them in.</em></p>' . "\n";
             echo '<p><em>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-value-for-pp-on0-os0-on1-os1.x-php")) . '</em></p>' . "\n";
             echo '</div>' . "\n";
             echo '</div>' . "\n";
         }
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_constants", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_js_globals", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_js_globals", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="s2Member JS/API Globals">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-js-globals-section">' . "\n";
         echo '<h3>You Also Have Access To JS Globals (some JavaScript knowledge required)</h3>' . "\n";
         echo '<p>Unless noted otherwise, all of the PHP Constants, are also available through JavaScript, as Global Variables <em>(with the exact same names/types as their PHP counterparts)</em>. s2Member automatically loads it\'s compressed JavaScript API into your theme for WordPress. s2Member is very intelligent about the way it loads <em>(and maintains)</em> it\'s JavaScript API. You can rely on the JavaScript Globals, the same way you rely on PHP Constants. The only exceptions are related to security. Variables that include private server-side details, like Identity Tokens and other API service credentials, will be excluded automatically.</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_js_globals", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_js_globals", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_mop_vars", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_mop_vars", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Membership Options Page / Variables">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-mop-vars-section">' . "\n";
         echo '<h3>Membership Options Page Variables (some scripting required)</h3>' . "\n";
         echo '<p>At the core of s2Member, is it\'s ability to protect content <em>(i.e., Posts, Pages, Tags, Categories, URI word fragments, etc)</em>. Whenever a public User, or even an existing Member attempts to access an area of your site that is unavailable to them; either because they are not logged-in, not a paying Member at all; or maybe they are logged-in, but they don\'t have access to content you\'ve protected at a higher Membership Level; s2Member will always redirect these unauthenticated requests to your Membership Options Page.</p>' . "\n";
         echo '<p>So your Membership Options Page is a key element of your site. It serves as the focal point of your s2Member installation. Understanding this, you can see it becomes important for s2Member to provide information about what the User/Member was attempting to access <em>(before they were redirected to the Membership Options Page)</em>. This is where s2Member\'s MOP Vars come in <em>(i.e., Membership Options Page Variables)</em>. Whenever s2Member redirects a User/Member to your Membership Options Page, it will include these important MOP Variables in the query string of the URL. These Variables can be used to provide more informative messages; or even to provide a different set of Membership Options <em>(e.g., Payment Buttons)</em>, based on what a User/Member was attempting to access.</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_mop_vars", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> If you\'re running s2Member Pro, there is a NEW simplified way to deal with MOP Vars using the <a href="http://www.s2member.com/kb/s2mop-shortcode/" target="_blank" rel="external"><code>[s2MOP]</code> Shortcode</a>.<br />' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>PHP Code Sample:</strong> This may give you some other ideas [<a href="#" onclick="jQuery(\'p#ws-plugin--s2member-api-mop-vars-code-samples\').toggle(); return false;" class="ws-dotted-link">click here</a>].</p>' . "\n";
         echo '<p id="ws-plugin--s2member-api-mop-vars-code-samples" style="display:none;">' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/api-mop-vars-e.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>s2Member MOP Vars (Explained) ...</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/api-mop-vars.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Backward compatibility (the old way):</strong> The structure of s2Member\'s MOP Vars changed again in Apr, 2014. However, s2Member still provides the same MOP Vars that it used in previous versions, for backward compatibility. These <a href="#" onclick="jQuery(\'p#ws-plugin--s2member-old-api-mop-vars-details\').toggle(); return false;" class="ws-dotted-link">old MOP Variables</a> were more difficult to use; they are now deprecated <em>(i.e., they WILL eventually be removed)</em>. Going foward, please go by the new documentation above.</p>' . "\n";
         echo '<p id="ws-plugin--s2member-old-api-mop-vars-details" style="display:none;">' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/api-mop-vars-o.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Backward compatibility (the really old way):</strong> The structure of s2Member\'s MOP Vars changed a bit in Nov, 2011. However, s2Member still provides the same MOP Vars that it used in previous versions, for backward compatibility. These <a href="#" onclick="jQuery(\'p#ws-plugin--s2member-really-old-api-mop-vars-details\').toggle(); return false;" class="ws-dotted-link">old MOP Variables</a> were more difficult to use; they are now deprecated <em>(i.e., they WILL eventually be removed)</em>. Going foward, please go by the new documentation above.</p>' . "\n";
         echo '<p id="ws-plugin--s2member-really-old-api-mop-vars-details" style="display:none;">' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/api-mop-vars-ro.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_mop_vars", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_hooks", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_hooks", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Hooks/Filters (For Developers)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-hooks-section">' . "\n";
         echo '<h3>WP Hooks For Theme/Plugin Developers (scripting required)</h3>' . "\n";
         echo '<p>In addition to its API Constants, s2Member also makes several Hooks/Filters available throughout its framework. This makes it possible to build onto <em>(or even modify)</em> s2Member in lots of different ways. If you need to add custom processing routines, modify the behavior of existing processing routines, or tinker with things otherwise; you should use API Hooks/Filters. API Hooks &amp; Filters, give you the ability to "hook into", and/or "filter" processing routines, with files/functions of your own; instead of editing the s2Member plugin files directly. If you don\'t use a Hook/Filter, and instead, you edit the plugin files for s2Member, you\'ll have to merge all of your changes every time a new version of s2Member is released. If you create custom processing routines, you could place those routines into a PHP file here: <code>/wp-content/mu-plugins/s2-hacks.php</code>. If you don\'t have an <code>/mu-plugins/</code> directory, please create one. These are <em>(mu)</em> <a href="http://s2member.com/r/mu-plugins/" target="_blank" rel="external">MUST USE plugins</a>, which are loaded into WordPress automatically; that\'s what you want!</p>' . "\n";
         echo '<p><strong>Attn Developers:</strong> There are simply too many Hooks/Filters spread throughout s2Member\'s framework <em>(over 1000 total)</em>. Rather than documenting each Hook/Filter, it is easier to browse through the files inside: <code>/s2member/includes/classes/</code>. Inspecting Hooks/Filters in this way, also leads you to a better understanding of how they work. One way to save time, is to run a search for <code>do_action</code> and/or <code>apply_filters</code>. If you\'re new to the concept of Hooks/Filters for WordPress/s2Member, we suggest <a href="http://www.s2member.com/codex/#src_doc_overview_description" target="_blank" rel="external">this article</a> as a primer. The <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a> also contains information about all Hooks/Filters that come with s2Member.</p>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_hooks", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_hooks", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_scripting_page_after_left_sections", get_defined_vars());
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Ejemplo n.º 17
0
 /**
  * Handles the Shortcode for: `[s2If /]`.
  *
  * These Shortcodes are also safe to use on a Multisite Blog Farm.
  *
  * Is Multisite Networking enabled? Please keep the following in mind.
  * ``current_user_can()``, will ALWAYS return true for a Super Admin!
  * 	*(this can be confusing when testing conditionals)*.
  *
  * If you're running a Multisite Blog Farm, you can Filter this array:
  * 	`ws_plugin__s2member_sc_if_conditionals_blog_farm_safe`
  * 	``$blog_farm_safe``
  *
  * @package s2Member\s2If
  * @since 3.5
  *
  * @attaches-to ``add_shortcode("s2If")`` + _s2If, __s2If, ___s2If for nesting.
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str The ``$content`` if true, else an empty string.
  *
  * @todo Add support for nested AND/OR conditionals inside the ONE Shortcode.
  * @todo Address possible security issue on sites with multiple editors, some of which should not have access to this feature.
  */
 public static function sc_if_conditionals($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_sc_if_conditionals", get_defined_vars());
     unset($__refs, $__v);
     $blog_farm_safe = apply_filters("ws_plugin__s2member_sc_if_conditionals_blog_farm_safe", array("is_user_logged_in", "is_user_not_logged_in", "user_is", "user_is_not", "user_can", "user_cannot", "current_user_is", "current_user_is_not", "current_user_can", "current_user_cannot", "is_admin", "is_blog_admin", "is_user_admin", "is_network_admin", "is_404", "is_home", "is_front_page", "is_singular", "is_single", "is_page", "is_page_template", "is_attachment", "is_feed", "is_archive", "is_search", "is_category", "is_tax", "is_tag", "has_tag", "is_author", "is_date", "is_day", "is_month", "is_time", "is_year", "is_sticky", "is_paged", "is_preview", "is_comments_popup", "in_the_loop", "comments_open", "pings_open", "has_excerpt", "has_post_thumbnail"), get_defined_vars());
     $pro_is_installed = c_ws_plugin__s2member_utils_conds::pro_is_installed();
     // Has pro version?
     $sc_conds_allow_arbitrary_php = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sc_conds_allow_arbitrary_php"];
     if (!$pro_is_installed || is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
         $sc_conds_allow_arbitrary_php = FALSE;
     }
     // Always disallow on child blogs of a blog farm.
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $content_if = $content_else = NULL;
     // Initialize.
     $shortcode_depth = strspn($shortcode, '_');
     // Based on a zero index.
     $else_tag = "[" . str_repeat("_", $shortcode_depth) . "else]";
     // e.g. [else], [_else], [__else]
     if (strpos($content, $else_tag) !== FALSE && $pro_is_installed) {
         list($content_if, $content_else) = explode($else_tag, $content, 2);
     }
     # Arbitrary PHP code via the `php` attribute...
     if ($sc_conds_allow_arbitrary_php && isset($attr["php"])) {
         if ($condition_succeeded = c_ws_plugin__s2member_sc_if_conds_in::evl($attr["php"])) {
             $condition_content = isset($content_if) ? $content_if : $content;
         } else {
             $condition_content = isset($content_else) ? $content_else : "";
         }
         if ($condition_content) {
             $condition_content = c_ws_plugin__s2member_utils_strings::trim_html($condition_content);
         }
         return do_shortcode(apply_filters("ws_plugin__s2member_sc_if_conditionals", $condition_content, get_defined_vars()));
     } else {
         if (isset($attr["php"])) {
             trigger_error("s2If syntax error. Simple Conditionals are not currently configured to allow arbitrary PHP code evaluation.", E_USER_ERROR);
             return "";
             // Return now; empty string in this case.
         }
     }
     # Default behavior otherwise...
     foreach ($attr as $attr_key => $attr_value) {
         // Detects and removes logical attributes.
         // It's NOT possible to mix logic. You MUST stick to one type of logic or another.
         // If both types of logic are needed, you MUST use two different Shortcodes.
         if (preg_match("/^(&&|&amp;&amp;|&#038;&#038;|AND|\\|\\||OR|[\\!\\=\\<\\>]+)\$/i", $attr_value)) {
             // Stick with AND/OR. Ampersands are corrupted by the Visual Editor.
             $logicals[] = strtolower($attr_value);
             // Place all logicals into an array here.
             unset($attr[$attr_key]);
             // ^ Detect logic here. We'll use the first key #0.
             if (preg_match("/^[\\!\\=\\<\\>]+\$/i", $attr_value)) {
                 trigger_error("s2If, invalid operator [ " . $attr_value . " ]. Simple Conditionals cannot process operators like ( == != <> ). Please use Advanced (PHP) Conditionals instead.", E_USER_ERROR);
                 return "";
                 // Return now; empty string in this case.
             }
         }
     }
     if (!empty($logicals) && is_array($logicals) && count(array_unique($logicals)) > 1) {
         trigger_error("s2If, AND/OR malformed conditional logic. It's NOT possible to mix logic using AND/OR combinations. You MUST stick to one type of logic or another. If both types of logic are needed, you MUST use two different Shortcode expressions. Or, use Advanced (PHP) Conditionals instead.", E_USER_ERROR);
         return "";
         // Return now; empty string in this case.
     }
     $conditional_logic = !empty($logicals) && is_array($logicals) && preg_match("/^(\\|\\||OR)\$/i", $logicals[0]) ? "OR" : "AND";
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_sc_if_conditionals_after_conditional_logic", get_defined_vars());
     unset($__refs, $__v);
     if ($conditional_logic === "AND") {
         foreach ($attr as $attr_value) {
             if (preg_match("/^(\\!?)(.+?)(\\()(.*?)(\\))\$/", $attr_value, $m) && ($exclamation = $m[1]) !== "nill" && ($conditional = $m[2]) && ($attr_args = preg_replace("/[\r\n\t\\s ]/", "", $m[4])) !== "nill") {
                 if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || !(preg_match("/[\$\\(\\)]/", $attr_args) || preg_match("/new[\r\n\t\\s]/i", $attr_args))) {
                     if (is_array($args = preg_split("/[;,]+/", $attr_args, 0, PREG_SPLIT_NO_EMPTY))) {
                         if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || in_array(strtolower($conditional), $blog_farm_safe)) {
                             $test = $exclamation ? false : true;
                             // If !exclamation (false) otherwise this defaults to true.
                             if (preg_match("/^\\{(.*?)\\}\$/", $attr_args)) {
                                 if ($test === true && !call_user_func($conditional, $args)) {
                                     $condition_failed = true;
                                     break;
                                 } else {
                                     if ($test === false && call_user_func($conditional, $args)) {
                                         $condition_failed = true;
                                         break;
                                     }
                                 }
                             } else {
                                 if (empty($args)) {
                                     if ($test === true && !call_user_func($conditional)) {
                                         $condition_failed = true;
                                         break;
                                     } else {
                                         if ($test === false && call_user_func($conditional)) {
                                             $condition_failed = true;
                                             break;
                                         }
                                     }
                                 } else {
                                     if ($test === true && !call_user_func_array($conditional, $args)) {
                                         $condition_failed = true;
                                         break;
                                     } else {
                                         if ($test === false && call_user_func_array($conditional, $args)) {
                                             $condition_failed = true;
                                             break;
                                         }
                                     }
                                 }
                             }
                         } else {
                             trigger_error("s2If, unsafe conditional function [ " . $attr_value . " ]", E_USER_ERROR);
                             return "";
                             // Return now; empty string in this case.
                         }
                     } else {
                         trigger_error("s2If, conditional args are NOT an array [ " . $attr_value . " ]", E_USER_ERROR);
                         return "";
                         // Return now; empty string in this case.
                     }
                 } else {
                     trigger_error("s2If, unsafe conditional args [ " . $attr_value . " ]", E_USER_ERROR);
                     return "";
                     // Return now; empty string in this case.
                 }
             } else {
                 trigger_error("s2If, malformed conditional [ " . $attr_value . " ]", E_USER_ERROR);
                 return "";
                 // Return now; empty string in this case.
             }
         }
         if (!empty($condition_failed)) {
             $condition_content = isset($content_else) ? $content_else : "";
         } else {
             $condition_content = isset($content_if) ? $content_if : $content;
         }
         if ($condition_content) {
             $condition_content = c_ws_plugin__s2member_utils_strings::trim_html($condition_content);
         }
         return do_shortcode(apply_filters("ws_plugin__s2member_sc_if_conditionals", $condition_content, get_defined_vars()));
     } else {
         if ($conditional_logic === "OR") {
             foreach ($attr as $attr_value) {
                 if (preg_match("/^(\\!?)(.+?)(\\()(.*?)(\\))\$/", $attr_value, $m) && ($exclamation = $m[1]) !== "nill" && ($conditional = $m[2]) && ($attr_args = preg_replace("/[\r\n\t\\s ]/", "", $m[4])) !== "nill") {
                     if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || !(preg_match("/[\$\\(\\)]/", $attr_args) || preg_match("/new[\r\n\t\\s]/i", $attr_args))) {
                         if (is_array($args = preg_split("/[;,]+/", $attr_args, 0, PREG_SPLIT_NO_EMPTY))) {
                             if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || in_array(strtolower($conditional), $blog_farm_safe)) {
                                 $test = $exclamation ? false : true;
                                 // If !exclamation (false) otherwise this defaults to true.
                                 if (preg_match("/^\\{(.*?)\\}\$/", $attr_args)) {
                                     if ($test === true && call_user_func($conditional, $args)) {
                                         $condition_succeeded = true;
                                         break;
                                     } else {
                                         if ($test === false && !call_user_func($conditional, $args)) {
                                             $condition_succeeded = true;
                                             break;
                                         }
                                     }
                                 } else {
                                     if (empty($args)) {
                                         if ($test === true && call_user_func($conditional)) {
                                             $condition_succeeded = true;
                                             break;
                                         } else {
                                             if ($test === false && !call_user_func($conditional)) {
                                                 $condition_succeeded = true;
                                                 break;
                                             }
                                         }
                                     } else {
                                         if ($test === true && call_user_func_array($conditional, $args)) {
                                             $condition_succeeded = true;
                                             break;
                                         } else {
                                             if ($test === false && !call_user_func_array($conditional, $args)) {
                                                 $condition_succeeded = true;
                                                 break;
                                             }
                                         }
                                     }
                                 }
                             } else {
                                 trigger_error("s2If, unsafe conditional function [ " . $attr_value . " ]", E_USER_ERROR);
                                 return "";
                                 // Return now; empty string in this case.
                             }
                         } else {
                             trigger_error("s2If, conditional args are NOT an array [ " . $attr_value . " ]", E_USER_ERROR);
                             return "";
                             // Return now; empty string in this case.
                         }
                     } else {
                         trigger_error("s2If, unsafe conditional args [ " . $attr_value . " ]", E_USER_ERROR);
                         return "";
                         // Return now; empty string in this case.
                     }
                 } else {
                     trigger_error("s2If, malformed conditional [ " . $attr_value . " ]", E_USER_ERROR);
                     return "";
                     // Return now; empty string in this case.
                 }
             }
             if (!empty($condition_succeeded)) {
                 $condition_content = isset($content_if) ? $content_if : $content;
             } else {
                 $condition_content = isset($content_else) ? $content_else : "";
             }
             if ($condition_content) {
                 $condition_content = c_ws_plugin__s2member_utils_strings::trim_html($condition_content);
             }
             return do_shortcode(apply_filters("ws_plugin__s2member_sc_if_conditionals", $condition_content, get_defined_vars()));
         }
     }
     return "";
     // Default return value.
 }
Ejemplo n.º 18
0
 /**
  * Handles the Shortcode for: `[s2If /]`.
  *
  * These Shortcodes are also safe to use on a Multisite Blog Farm.
  *
  * Is Multisite Networking enabled? Please keep the following in mind.
  * ``current_user_can()``, will ALWAYS return true for a Super Admin!
  *   *(this can be confusing when testing conditionals)*.
  *
  * If you're running a Multisite Blog Farm, you can Filter this array:
  *   `ws_plugin__s2member_sc_if_conditionals_blog_farm_safe`
  *   ``$blog_farm_safe``
  *
  * @package s2Member\s2If
  * @since 3.5
  *
  * @attaches-to ``add_shortcode('s2If')`` + _s2If, __s2If, ___s2If for nesting.
  *
  * @param array  $attr An array of Attributes.
  * @param string $content Content inside the Shortcode.
  * @param string $shortcode The actual Shortcode name itself.
  *
  * @return string The ``$content`` if true, else an empty string.
  *
  * @todo Add support for nested AND/OR conditionals inside the ONE Shortcode.
  * @todo Address possible security issue on sites with multiple editors, some of which should not have access to this feature.
  */
 public static function sc_if_conditionals($attr = array(), $content = '', $shortcode = '')
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_sc_if_conditionals', get_defined_vars());
     unset($__refs, $__v);
     // Allows variables to be modified by reference.
     c_ws_plugin__s2member_no_cache::no_cache_constants(true);
     $blog_farm_safe = apply_filters('ws_plugin__s2member_sc_if_conditionals_blog_farm_safe', array('is_user_logged_in', 'is_user_not_logged_in', 'user_is', 'user_is_not', 'user_can', 'user_cannot', 'current_user_is', 'current_user_is_not', 'current_user_can', 'current_user_cannot', 'is_admin', 'is_blog_admin', 'is_user_admin', 'is_network_admin', 'is_404', 'is_home', 'is_front_page', 'is_singular', 'is_single', 'is_page', 'is_page_template', 'is_attachment', 'is_feed', 'is_archive', 'is_search', 'is_category', 'is_tax', 'is_tag', 'has_tag', 'is_author', 'is_date', 'is_day', 'is_month', 'is_time', 'is_year', 'is_sticky', 'is_paged', 'is_preview', 'is_comments_popup', 'in_the_loop', 'comments_open', 'pings_open', 'has_excerpt', 'has_post_thumbnail'), get_defined_vars());
     $pro_is_installed = c_ws_plugin__s2member_utils_conds::pro_is_installed();
     // Has pro version?
     $sc_conds_allow_arbitrary_php = $GLOBALS['WS_PLUGIN__']['s2member']['o']['sc_conds_allow_arbitrary_php'];
     if (!$pro_is_installed || is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
         $sc_conds_allow_arbitrary_php = FALSE;
     }
     // Always disallow on child blogs of a blog farm.
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $content_if = $content_else = NULL;
     // Initialize.
     $shortcode_depth = strspn($shortcode, '_');
     // Based on a zero index.
     $else_tag = '[' . str_repeat('_', $shortcode_depth) . 'else]';
     // e.g., [else], [_else], [__else]
     if (strpos($content, $else_tag) !== FALSE && $pro_is_installed) {
         list($content_if, $content_else) = explode($else_tag, $content, 2);
     }
     # Arbitrary PHP code via the `php` attribute...
     if ($sc_conds_allow_arbitrary_php && isset($attr['php'])) {
         if ($condition_succeeded = c_ws_plugin__s2member_sc_if_conds_in::evl($attr['php'])) {
             $condition_content = isset($content_if) ? $content_if : $content;
         } else {
             $condition_content = isset($content_else) ? $content_else : '';
         }
         if ($condition_content) {
             $condition_content = c_ws_plugin__s2member_utils_strings::trim_html($condition_content);
         }
         return do_shortcode(apply_filters('ws_plugin__s2member_sc_if_conditionals', $condition_content, get_defined_vars()));
     } else {
         if (isset($attr['php'])) {
             trigger_error('s2If syntax error. Simple Conditionals are not currently configured to allow arbitrary PHP code evaluation.', E_USER_ERROR);
             return '';
             // Return now; empty string in this case.
         }
     }
     # Default behavior otherwise...
     foreach ($attr as $attr_key => $attr_value) {
         // Detects and removes logical attributes.
         // It's NOT possible to mix logic. You MUST stick to one type of logic or another.
         // If both types of logic are needed, you MUST use two different Shortcodes.
         if (preg_match('/^(&&|&amp;&amp;|&#038;&#038;|AND|\\|\\||OR|[\\!\\=\\<\\>]+)$/i', $attr_value)) {
             // Stick with AND/OR. Ampersands are corrupted by the Visual Editor.
             $logicals[] = strtolower($attr_value);
             // Place all logicals into an array here.
             unset($attr[$attr_key]);
             // ^ Detect logic here. We'll use the first key #0.
             if (preg_match('/^[\\!\\=\\<\\>]+$/i', $attr_value)) {
                 trigger_error('s2If, invalid operator [ ' . $attr_value . ' ]. Simple Conditionals cannot process operators like ( == != <> ). Please use Advanced (PHP) Conditionals instead.', E_USER_ERROR);
                 return '';
                 // Return now; empty string in this case.
             }
         }
     }
     if (!empty($logicals) && is_array($logicals) && count(array_unique($logicals)) > 1) {
         trigger_error('s2If, AND/OR malformed conditional logic. It\'s NOT possible to mix logic using AND/OR combinations. You MUST stick to one type of logic or another. If both types of logic are needed, you MUST use two different Shortcode expressions. Or, use Advanced (PHP) Conditionals instead.', E_USER_ERROR);
         return '';
         // Return now; empty string in this case.
     }
     $conditional_logic = !empty($logicals) && is_array($logicals) && preg_match('/^(\\|\\||OR)$/i', $logicals[0]) ? 'OR' : 'AND';
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_sc_if_conditionals_after_conditional_logic', get_defined_vars());
     unset($__refs, $__v);
     // Allows variables to be modified by reference.
     if ($conditional_logic === 'AND') {
         foreach ($attr as $attr_value) {
             if (preg_match('/^(\\!?)(.+?)(\\()(.*?)(\\))$/', $attr_value, $m) && ($exclamation = $m[1]) !== 'nill' && ($conditional = $m[2]) && ($attr_args = preg_replace('/[' . "\r\n\t" . '\\s]/', '', $m[4])) !== 'nill') {
                 if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || !(preg_match('/[\\$\\(\\)]/', $attr_args) || preg_match('/new[' . "\r\n\t" . '\\s]/i', $attr_args))) {
                     if (is_array($args = preg_split('/[;,]+/', $attr_args, 0, PREG_SPLIT_NO_EMPTY))) {
                         if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || in_array(strtolower($conditional), $blog_farm_safe)) {
                             $test = $exclamation ? FALSE : TRUE;
                             // If !exclamation (false) otherwise this defaults to true.
                             if (preg_match('/^\\{(.*?)\\}$/', $attr_args)) {
                                 if ($test === TRUE && !call_user_func($conditional, $args)) {
                                     $condition_failed = TRUE;
                                     break;
                                 } else {
                                     if ($test === FALSE && call_user_func($conditional, $args)) {
                                         $condition_failed = TRUE;
                                         break;
                                     }
                                 }
                             } else {
                                 if (empty($args)) {
                                     if ($test === TRUE && !call_user_func($conditional)) {
                                         $condition_failed = TRUE;
                                         break;
                                     } else {
                                         if ($test === FALSE && call_user_func($conditional)) {
                                             $condition_failed = TRUE;
                                             break;
                                         }
                                     }
                                 } else {
                                     if ($test === TRUE && !call_user_func_array($conditional, $args)) {
                                         $condition_failed = TRUE;
                                         break;
                                     } else {
                                         if ($test === FALSE && call_user_func_array($conditional, $args)) {
                                             $condition_failed = TRUE;
                                             break;
                                         }
                                     }
                                 }
                             }
                         } else {
                             trigger_error('s2If, unsafe conditional function [ ' . $attr_value . ' ]', E_USER_ERROR);
                             return '';
                             // Return now; empty string in this case.
                         }
                     } else {
                         trigger_error('s2If, conditional args are NOT an array [ ' . $attr_value . ' ]', E_USER_ERROR);
                         return '';
                         // Return now; empty string in this case.
                     }
                 } else {
                     trigger_error('s2If, unsafe conditional args [ ' . $attr_value . ' ]', E_USER_ERROR);
                     return '';
                     // Return now; empty string in this case.
                 }
             } else {
                 trigger_error('s2If, malformed conditional [ ' . $attr_value . ' ]', E_USER_ERROR);
                 return '';
                 // Return now; empty string in this case.
             }
         }
         if (!empty($condition_failed)) {
             $condition_content = isset($content_else) ? $content_else : '';
         } else {
             $condition_content = isset($content_if) ? $content_if : $content;
         }
         if ($condition_content) {
             $condition_content = c_ws_plugin__s2member_utils_strings::trim_html($condition_content);
         }
         return do_shortcode(apply_filters('ws_plugin__s2member_sc_if_conditionals', $condition_content, get_defined_vars()));
     } else {
         if ($conditional_logic === 'OR') {
             foreach ($attr as $attr_value) {
                 if (preg_match('/^(\\!?)(.+?)(\\()(.*?)(\\))$/', $attr_value, $m) && ($exclamation = $m[1]) !== 'nill' && ($conditional = $m[2]) && ($attr_args = preg_replace('/[' . "\r\n\t" . '\\s]/', '', $m[4])) !== 'nill') {
                     if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || !(preg_match('/[\\$\\(\\)]/', $attr_args) || preg_match('/new[' . "\r\n\t" . '\\s]/i', $attr_args))) {
                         if (is_array($args = preg_split('/[;,]+/', $attr_args, 0, PREG_SPLIT_NO_EMPTY))) {
                             if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || in_array(strtolower($conditional), $blog_farm_safe)) {
                                 $test = $exclamation ? FALSE : TRUE;
                                 // If !exclamation (false) otherwise this defaults to true.
                                 if (preg_match('/^\\{(.*?)\\}$/', $attr_args)) {
                                     if ($test === TRUE && call_user_func($conditional, $args)) {
                                         $condition_succeeded = TRUE;
                                         break;
                                     } else {
                                         if ($test === FALSE && !call_user_func($conditional, $args)) {
                                             $condition_succeeded = TRUE;
                                             break;
                                         }
                                     }
                                 } else {
                                     if (empty($args)) {
                                         if ($test === TRUE && call_user_func($conditional)) {
                                             $condition_succeeded = TRUE;
                                             break;
                                         } else {
                                             if ($test === FALSE && !call_user_func($conditional)) {
                                                 $condition_succeeded = TRUE;
                                                 break;
                                             }
                                         }
                                     } else {
                                         if ($test === TRUE && call_user_func_array($conditional, $args)) {
                                             $condition_succeeded = TRUE;
                                             break;
                                         } else {
                                             if ($test === FALSE && !call_user_func_array($conditional, $args)) {
                                                 $condition_succeeded = TRUE;
                                                 break;
                                             }
                                         }
                                     }
                                 }
                             } else {
                                 trigger_error('s2If, unsafe conditional function [ ' . $attr_value . ' ]', E_USER_ERROR);
                                 return '';
                                 // Return now; empty string in this case.
                             }
                         } else {
                             trigger_error('s2If, conditional args are NOT an array [ ' . $attr_value . ' ]', E_USER_ERROR);
                             return '';
                             // Return now; empty string in this case.
                         }
                     } else {
                         trigger_error('s2If, unsafe conditional args [ ' . $attr_value . ' ]', E_USER_ERROR);
                         return '';
                         // Return now; empty string in this case.
                     }
                 } else {
                     trigger_error('s2If, malformed conditional [ ' . $attr_value . ' ]', E_USER_ERROR);
                     return '';
                     // Return now; empty string in this case.
                 }
             }
             if (!empty($condition_succeeded)) {
                 $condition_content = isset($content_if) ? $content_if : $content;
             } else {
                 $condition_content = isset($content_else) ? $content_else : '';
             }
             if ($condition_content) {
                 $condition_content = c_ws_plugin__s2member_utils_strings::trim_html($condition_content);
             }
             return do_shortcode(apply_filters('ws_plugin__s2member_sc_if_conditionals', $condition_content, get_defined_vars()));
         }
     }
     return '';
     // Default return value.
 }
Ejemplo n.º 19
0
 /**
  * Auto EOT time, else NPR (next payment time).
  *
  * @package s2Member\Utilities
  * @since 150713
  *
  * @param int|string $user_id Optional. Defaults to the current User's ID.
  * @param bool $check_gateway Defaults to a true value. If this is false, it is only possible to return a fixed EOT time.
  * 	In other words, if this is false and there is no EOT time, empty values will be returned. Be careful with this, because not checking
  * 	the payment gateway can result in an inaccurate return value. Only set to false if you want to limit the check to a fixed hard-coded EOT time.
  * @param string $favor Defaults to a value of `fixed`; i.e., if a fixed EOT time is available, that is returned in favor of a next payment time.
  * 	You can set this to `next` if you'd like to favor a next payment time (when applicable) instead of returning a fixed EOT time.
  *
  * @return array An associative array of EOT details; with the following elements.
  *
  * - `type` One of `fixed` (a fixed EOT time), `next` (next payment time; i.e., an ongoing recurring subscription); or an empty string if there is no EOT for the user.
  * - `time` The timestamp (UTC time) that represents the EOT (End Of Term); else `0` if there is no EOT time.
  * - `tense` If time is now (or earlier) this will be `past`. If time is in the future, this will be `future`. If there is no time, this is an empty string.
  * - `debug` A string of details that explain to a developer what was returned. For debugging only.
  */
 public static function get_user_eot($user_id = 0, $check_gateway = TRUE, $favor = 'fixed')
 {
     if (!($user_id = (int) $user_id)) {
         // Empty user ID in this call?
         $user_id = get_current_user_id();
     }
     // Assume current user.
     if (!$favor || !in_array($favor, array('fixed', 'next'), TRUE)) {
         $favor = 'fixed';
     }
     // Default behavior.
     $now = time();
     // Current timestamp.
     $grace_time = (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['eot_grace_time'];
     $grace_time = (int) apply_filters('ws_plugin__s2member_eot_grace_time', $grace_time);
     $demotion_role = c_ws_plugin__s2member_option_forces::force_demotion_role('subscriber');
     $empty_response = array('type' => '', 'time' => 0, 'tense' => '', 'debug' => '');
     if (!$user_id || !($user = new WP_User($user_id)) || !$user->ID) {
         return array_merge($empty_response, array('debug' => 'Invalid user ID.'));
     }
     $ipn_signup_vars = self::get_user_ipn_signup_vars($user->ID);
     $subscr_gateway = (string) get_user_option('s2member_subscr_gateway', $user->ID);
     $subscr_id = (string) get_user_option('s2member_subscr_id', $user->ID);
     $subscr_cid = (string) get_user_option('s2member_subscr_cid', $user->ID);
     $last_auto_eot_time = (int) get_user_option('s2member_last_auto_eot_time', $user->ID);
     $auto_eot_time = (int) get_user_option('s2member_auto_eot_time', $user->ID);
     if ($auto_eot_time) {
         // They have a hard-coded EOT time at present?
         return array('type' => 'fixed', 'time' => $auto_eot_time, 'tense' => $auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is a fixed EOT time recorded by s2Member. It can be altered in the WordPress Dashboard for this user.');
     }
     if (!$subscr_gateway && !$subscr_id && !$subscr_cid && $last_auto_eot_time && (!user_can($user->ID, 'access_s2member_level1') || c_ws_plugin__s2member_user_access::user_access_role($user) === $demotion_role) && !c_ws_plugin__s2member_user_access::user_access_ccaps($user)) {
         return array('type' => 'fixed', 'time' => $last_auto_eot_time, 'tense' => $last_auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is an archived/fixed EOT time recorded by s2Member; i.e., the date this customer\'s access expired.');
     }
     if (!$subscr_gateway || !$subscr_id || !is_array($ipn_signup_vars) || !$ipn_signup_vars) {
         return array_merge($empty_response, array('debug' => 'This user has no subscription; i.e., missing `subscr_id`, `subscr_gateway` or `ipn_signup_vars`.'));
     }
     if (empty($ipn_signup_vars['txn_type']) || $ipn_signup_vars['txn_type'] !== 'subscr_signup') {
         return array_merge($empty_response, array('debug' => 'This user has no subscription; i.e., `txn_type` != `subscr_signup`.'));
     }
     $auto_eot_time = c_ws_plugin__s2member_utils_time::auto_eot_time($user->ID, $ipn_signup_vars['period1'], $ipn_signup_vars['period3']);
     if ($check_gateway) {
         switch ($subscr_gateway) {
             case 'paypal':
                 // PayPal (PayPal Pro only).
                 if (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !class_exists('c_ws_plugin__s2member_pro_paypal_utilities') || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_api_username'] || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_api_password'] || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_api_signature']) {
                     return array_merge($empty_response, array('debug' => 'PayPal Pro API credentials missing in your s2Member configuration.'));
                 }
                 if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_payflow_api_username']) {
                     if (!($api_response = c_ws_plugin__s2member_pro_paypal_utilities::payflow_get_profile($subscr_id)) || !empty($api_response['__error'])) {
                         return array_merge($empty_response, array('debug' => 'No fixed EOT, and the PayPal Pro API says there is no subscription for this user.'));
                     }
                     if (preg_match('/^(?:Pending|PendingProfile)$/i', $api_response['STATUS'])) {
                         return array_merge($empty_response, array('debug' => 'No fixed EOT, and the PayPal Pro API says the subscription for this user is currently pending changes. Unable to determine at this moment. Please try again in 15 minutes.'));
                     }
                     if (!preg_match('/^(?:Active|ActiveProfile)$/i', $api_response['STATUS'])) {
                         return array('type' => 'fixed', 'time' => $auto_eot_time, 'tense' => $auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is the estimated EOT time. The PayPal Pro API says this subscription is no longer active, and thus, access should be terminated at this time.');
                     }
                     if ($api_response['TERM'] > 0 && $api_response['PAYMENTSLEFT'] <= 0) {
                         return array('type' => 'fixed', 'time' => $auto_eot_time, 'tense' => $auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is the estimated EOT time. The PayPal Pro API says this subscription has reached its last payment, and thus, access should be terminated at this time.');
                     }
                     if ($api_response['TERM'] <= 0 || $api_response['PAYMENTSLEFT'] > 0) {
                         if ($api_response['NEXTPAYMENT'] && strlen($api_response['NEXTPAYMENT']) === 8) {
                             // MMDDYYYY format is not `strtotime()` compatible.
                             if (($time = strtotime(substr($api_response['NEXTPAYMENT'], -4) . '-' . substr($api_response['NEXTPAYMENT'], 0, 2) . '-' . substr($api_response['NEXTPAYMENT'], 2, 2))) > $now) {
                                 return array('type' => 'next', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The PayPal Pro API says this is the next payment time.');
                             }
                         }
                     }
                 } else {
                     $api_args = array('METHOD' => 'GetRecurringPaymentsProfileDetails', 'PROFILEID' => $subscr_id);
                     if (!($api_response = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($api_args)) || !empty($api_response['__error'])) {
                         return array_merge($empty_response, array('debug' => 'No fixed EOT, and the PayPal Pro API says there is no subscription for this user.'));
                     }
                     if (preg_match('/^(?:Pending|PendingProfile)$/i', $api_response['STATUS'])) {
                         return array_merge($empty_response, array('debug' => 'No fixed EOT, and the PayPal Pro API says the subscription for this user is currently pending changes. Unable to determine at this moment. Please try again in 15 minutes.'));
                     }
                     if (!preg_match('/^(?:Active|ActiveProfile)$/i', $api_response['STATUS'])) {
                         return array('type' => 'fixed', 'time' => $auto_eot_time, 'tense' => $auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is the estimated EOT time. The PayPal Pro API says this subscription is no longer active, and thus, access should be terminated at this time.');
                     }
                     if ($api_response['TOTALBILLINGCYCLES'] > 0 && $api_response['NUMCYCLESREMAINING'] <= 0) {
                         return array('type' => 'fixed', 'time' => $auto_eot_time, 'tense' => $auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is the estimated EOT time. The PayPal Pro API says this subscription has reached its last payment, and thus, access should be terminated at this time.');
                     }
                     if ($api_response['TOTALBILLINGCYCLES'] <= 0 || $api_response['NUMCYCLESREMAINING'] > 0) {
                         if ($api_response['NEXTBILLINGDATE'] && ($time = strtotime($api_response['NEXTBILLINGDATE'])) > $now) {
                             return array('type' => 'next', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The PayPal Pro API says this is the next payment time.');
                         }
                     }
                 }
                 return array_merge($empty_response, array('debug' => 'No fixed EOT, and there are no more payments needed from this user.'));
                 break;
                 // Break switch.
             // Break switch.
             case 'authnet':
                 // Authorize.Net (EOT only; w/ limited functionality).
                 if (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !class_exists('c_ws_plugin__s2member_pro_authnet_utilities') || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_authnet_api_login_id'] || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_authnet_api_trans_key']) {
                     return array_merge($empty_response, array('debug' => 'Authorize.Net API credentials missing in your s2Member configuration.'));
                 }
                 $api_args = array('x_method' => 'status', 'x_subscription_id' => $subscr_id);
                 if (!($api_response = c_ws_plugin__s2member_pro_authnet_utilities::authnet_arb_response($api_args)) || !empty($api_response['__error'])) {
                     return array_merge($empty_response, array('debug' => 'No fixed EOT, and the Authorize.Net API says there is no subscription for this user.'));
                 }
                 if (!preg_match('/^(?:active)$/i', $api_response['subscription_status'])) {
                     return array('type' => 'fixed', 'time' => $auto_eot_time, 'tense' => $auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is the estimated EOT time. The Authorize.Net API says this subscription is no longer active, and thus, access should be terminated at this time.');
                 }
                 // Next payment time not possible with Authorize.Net at this time.
                 // Fixed recurring intervals not possible to query with Authorize.Net at this time.
                 return array_merge($empty_response, array('debug' => 'Partially-supported payment gateway; unable to determine.'));
                 break;
                 // Break switch.
             // Break switch.
             case 'stripe':
                 // Stripe payment gateway (best).
                 if (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !class_exists('c_ws_plugin__s2member_pro_stripe_utilities') || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_stripe_api_publishable_key'] || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_stripe_api_secret_key']) {
                     return array_merge($empty_response, array('debug' => 'Stripe API credentials missing in your s2Member configuration.'));
                 }
                 if (!$subscr_cid) {
                     return array_merge($empty_response, array('debug' => 'No fixed EOT, and no `subscr_cid` on file. Unable to determine.'));
                 }
                 if (!is_object($stripe_subscription = c_ws_plugin__s2member_pro_stripe_utilities::get_customer_subscription($subscr_cid, $subscr_id)) || empty($stripe_subscription->id)) {
                     return array_merge($empty_response, array('debug' => 'No fixed EOT, and the Stripe API says there is no subscription for this user.'));
                 }
                 if ((int) $stripe_subscription->ended_at > 0) {
                     $time = $stripe_subscription->ended_at + $grace_time;
                     return array('type' => 'fixed', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this subscription reached an expiration on this date + grace time.');
                 }
                 if (in_array($stripe_subscription->status, array('canceled', 'unpaid'), TRUE) || $stripe_subscription->cancel_at_period_end) {
                     $time = $stripe_subscription->current_period_end + $grace_time;
                     return array('type' => 'fixed', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this subscription was cancelled, and thus, should EOT on this date + grace time.');
                 }
                 if (isset($stripe_subscription->plan->metadata->recurring, $stripe_subscription->plan->metadata->recurring_times) && !$stripe_subscription->plan->metadata->recurring) {
                     $time = (int) $stripe_subscription->start;
                     $time += $stripe_subscription->plan->trial_period_days * DAY_IN_SECONDS;
                     switch ($stripe_subscription->plan->interval) {
                         case 'day':
                             // Every X days in this case.
                             $time += DAY_IN_SECONDS * $stripe_subscription->plan->interval_count * 1;
                             break;
                             // Break switch now.
                         // Break switch now.
                         case 'week':
                             // Every X weeks in this case.
                             $time += WEEK_IN_SECONDS * $stripe_subscription->plan->interval_count * 1;
                             break;
                             // Break switch now.
                         // Break switch now.
                         case 'month':
                             // Every X months in this case.
                             $time += WEEK_IN_SECONDS * 4 * $stripe_subscription->plan->interval_count * 1;
                             break;
                             // Break switch now.
                         // Break switch now.
                         case 'year':
                             // Every X years in this case.
                             $time += YEAR_IN_SECONDS * $stripe_subscription->plan->interval_count * 1;
                             break;
                             // Break switch now.
                     }
                     if ($favor === 'next' && $stripe_subscription->current_period_end + 1 < $time) {
                         if ($stripe_subscription->current_period_end + 1 > $now) {
                             $time = $stripe_subscription->current_period_end + 1;
                             return array('type' => 'next', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this is the next payment time.');
                         }
                         return array_merge($empty_response, array('debug' => 'Stripe says no more payments needed from this user.'));
                     }
                     $time += $grace_time;
                     // Now add grace to the final EOT time.
                     return array('type' => 'fixed', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this subscription will be completely over on this date + grace time.');
                 }
                 if (isset($stripe_subscription->plan->metadata->recurring, $stripe_subscription->plan->metadata->recurring_times) && $stripe_subscription->plan->metadata->recurring && $stripe_subscription->plan->metadata->recurring_times <= 0) {
                     if ($stripe_subscription->current_period_end + 1 > $now) {
                         $time = $stripe_subscription->current_period_end + 1;
                         return array('type' => 'next', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this is the next payment time.');
                     }
                     return array_merge($empty_response, array('debug' => 'Stripe says no more payments needed from this user.'));
                 }
                 if (isset($stripe_subscription->plan->metadata->recurring, $stripe_subscription->plan->metadata->recurring_times) && $stripe_subscription->plan->metadata->recurring && $stripe_subscription->plan->metadata->recurring_times > 0) {
                     $time = (int) $stripe_subscription->start;
                     $time += $stripe_subscription->plan->trial_period_days * DAY_IN_SECONDS;
                     switch ($stripe_subscription->plan->interval) {
                         case 'day':
                             // Every X days in this case.
                             $time += DAY_IN_SECONDS * $stripe_subscription->plan->interval_count * $stripe_subscription->plan->metadata->recurring_times;
                             break;
                             // Break switch now.
                         // Break switch now.
                         case 'week':
                             // Every X weeks in this case.
                             $time += WEEK_IN_SECONDS * $stripe_subscription->plan->interval_count * $stripe_subscription->plan->metadata->recurring_times;
                             break;
                             // Break switch now.
                         // Break switch now.
                         case 'month':
                             // Every X months in this case.
                             $time += WEEK_IN_SECONDS * 4 * $stripe_subscription->plan->interval_count * $stripe_subscription->plan->metadata->recurring_times;
                             break;
                             // Break switch now.
                         // Break switch now.
                         case 'year':
                             // Every X years in this case.
                             $time += YEAR_IN_SECONDS * $stripe_subscription->plan->interval_count * $stripe_subscription->plan->metadata->recurring_times;
                             break;
                             // Break switch now.
                     }
                     if ($favor === 'next' && $stripe_subscription->current_period_end + 1 < $time) {
                         if ($stripe_subscription->current_period_end + 1 > $now) {
                             $time = $stripe_subscription->current_period_end + 1;
                             return array('type' => 'next', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this is the next payment time.');
                         }
                         return array_merge($empty_response, array('debug' => 'Stripe says no more payments needed from this user.'));
                     }
                     $time += $grace_time;
                     // Now add grace to the final EOT time.
                     return array('type' => 'fixed', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this subscription will be completely over on this date + grace time.');
                 }
                 if ($stripe_subscription->current_period_end + 1 > $now) {
                     $time = $stripe_subscription->current_period_end + 1;
                     return array('type' => 'next', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The Stripe API says this is the next payment time.');
                 }
                 return array_merge($empty_response, array('debug' => 'No fixed EOT, and Stripe says there are no more payments needed from this user.'));
                 break;
                 // Break switch.
             // Break switch.
             case 'clickbank':
                 // ClickBank (limited functionality).
                 if (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !class_exists('c_ws_plugin__s2member_pro_clickbank_utilities') || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_clickbank_username'] || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_clickbank_clerk_key'] || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_clickbank_developer_key'] || !$GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_clickbank_secret_key']) {
                     return array_merge($empty_response, array('debug' => 'ClickBank API credentials missing in your s2Member configuration.'));
                 }
                 if (empty($ipn_signup_vars['txn_id'])) {
                     // ClickBank receipt number.
                     return array_merge($empty_response, array('debug' => 'No fixed EOT, and no `txn_id` on file. Unable to determine.'));
                 }
                 if (!($api_response = c_ws_plugin__s2member_pro_clickbank_utilities::clickbank_api_order($ipn_signup_vars['txn_id']))) {
                     return array_merge($empty_response, array('debug' => 'No fixed EOT, and the ClickBank API says there is no subscription for this user.'));
                 }
                 if (!preg_match('/^(?:TEST_)?SALE$/i', $api_response['txnType']) || !$api_response['recurring']) {
                     return array_merge($empty_response, array('debug' => 'No fixed EOT, and the ClickBank API says there is no recurring subscription for this user.'));
                 }
                 if (strcasecmp($api_response['status'], 'active') !== 0 || $api_response['futurePayments'] <= 0) {
                     return array('type' => 'fixed', 'time' => $auto_eot_time, 'tense' => $auto_eot_time <= $now ? 'past' : 'future', 'debug' => 'This is the estimated EOT time. The ClickBank API says this subscription no longer active, or it has reached its last payment, and thus, access should be terminated at this time.');
                 }
                 if ($api_response['nextPaymentDate'] && ($time = strtotime($api_response['nextPaymentDate'])) > $now) {
                     return array('type' => 'next', 'time' => $time, 'tense' => $time <= $now ? 'past' : 'future', 'debug' => 'The ClickBank API says this is the next payment time.');
                 }
                 return array_merge($empty_response, array('debug' => 'No fixed EOT, and there are no more payments needed from this user.'));
                 break;
                 // Break switch.
             // Break switch.
             default:
                 // Default case handler.
                 return array_merge($empty_response, array('debug' => 'Partially-supported payment gateway; unable to determine.'));
         }
     }
     return array_merge($empty_response, array('debug' => 'Payment gateway check disabled; unable to determine.'));
 }
Ejemplo n.º 20
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>PayPal Options</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form" autocomplete="off">' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-options-save")) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n";
     do_action("ws_plugin__s2member_during_paypal_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_paypal_account_details", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_paypal_account_details", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="PayPal Account Details">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-account-details-section">' . "\n";
         echo '<a href="http://www.s2member.com/paypal" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/paypal-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
         echo '<h3>PayPal Account Details (required, if using PayPal)</h3>' . "\n";
         echo '<p>s2Member integrates with <a href="http://www.s2member.com/paypal" target="_blank" rel="external">PayPal Payments Standard</a>—for businesses. You do not need a PayPal Pro account. You just need to upgrade your Personal PayPal account to a Business status, which is free. A PayPal account can be <a href="http://s2member.com/r/paypal-business-upgrade/" target="_blank" rel="external">upgraded</a> from a Personal account to a Business account by clicking the "Profile" link under your "My Account" tab, selecting "Personal Business Information", and then clicking the "Upgrade Your Account" button. <strong>See also:</strong> This KB article: <a href="http://s2member.com/kb-article/supported-paypal-account-types/" target="_blank" rel="external">PayPal Compatibility (Account Types)</a>.</p>' . "\n";
         echo '<p><em><strong>PayPal API Credentials:</strong> Once you have a PayPal Business account, you\'ll need access to your <a href="http://s2member.com/r/paypal-profile-api-access/" target="_blank" rel="external">PayPal API Credentials</a>. Log into your PayPal account, and navigate to <strong>Profile → API Access (or → Request API Credentials)</strong>. From the available options, please choose "Request API Signature".</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_details", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-merchant-id">' . "\n";
         echo 'Your PayPal Merchant ID:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_paypal_merchant_id" id="ws-plugin--s2member-paypal-merchant-id" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_merchant_id"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → Secure Merchant ID</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-business">' . "\n";
         echo 'Your PayPal EMail Address:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_paypal_business" id="ws-plugin--s2member-paypal-business" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → Email Accounts</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-api-username">' . "\n";
         echo 'Your PayPal API Username:'******'</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_paypal_api_username" id="ws-plugin--s2member-paypal-api-username" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → API Access (or → Request API Credentials)</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-api-password">' . "\n";
         echo 'Your PayPal API Password:'******'</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_paypal_api_password" id="ws-plugin--s2member-paypal-api-password" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → API Access (or → Request API Credentials)</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-api-signature">' . "\n";
         echo 'Your PayPal API Signature:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_paypal_api_signature" id="ws-plugin--s2member-paypal-api-signature" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → API Access (or  → "Request API Credentials")</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_detail_rows", get_defined_vars());
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-sandbox">' . "\n";
         echo 'Developer/Sandbox Testing?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="radio" name="ws_plugin__s2member_paypal_sandbox" id="ws-plugin--s2member-paypal-sandbox-0" value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-sandbox-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_paypal_sandbox" id="ws-plugin--s2member-paypal-sandbox-1" value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-sandbox-1">Yes, enable support for Sandbox testing.</label><br />' . "\n";
         echo '<em>Only enable this if you\'ve provided Sandbox credentials above.<br />This puts the API, IPN, PDT and Form/Button Generators all into Sandbox mode.<br />See: <a href="http://s2member.com/r/paypal-developers/" target="_blank" rel="external">PayPal Developers</a></em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-btn-encryption">' . "\n";
         echo 'Enable Button Encryption?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="radio" name="ws_plugin__s2member_paypal_btn_encryption" id="ws-plugin--s2member-paypal-btn-encryption-0" value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_btn_encryption"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-btn-encryption-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_paypal_btn_encryption" id="ws-plugin--s2member-paypal-btn-encryption-1" value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_btn_encryption"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-btn-encryption-1">Yes, enable PayPal Button encryption.</label><br />' . "\n";
         echo '<em>If enabled, all of your PayPal Button Shortcodes will produce <em>encrypted</em> PayPal Buttons. This improves security against fraudulent transactions. For extra security, you should update your PayPal account too, under: <strong>My Profile → Website Payment Preferences</strong>. You\'ll want to block all non-encrypted payments. <strong>Note:</strong> this will NOT work until you\'ve supplied s2Member with your PayPal Email Address, and also with your API Username/Password/Signature.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-gateway-debug-logs">' . "\n";
             echo 'Enable Logging Routines?' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="radio" name="ws_plugin__s2member_gateway_debug_logs" id="ws-plugin--s2member-gateway-debug-logs-0" value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-gateway-debug-logs-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_gateway_debug_logs" id="ws-plugin--s2member-gateway-debug-logs-1" value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"] ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-gateway-debug-logs-1">Yes, enable debugging, with API, IPN &amp; Return Page logging.</label><br />' . "\n";
             echo '<em>This enables API, IPN and Return Page logging. The log files are stored here: <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) . '</code></em><br />' . "\n";
             echo '<em class="ws-menu-page-hilite">If you have any trouble, please review your s2Member log files for problems. See: <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")) . '">Log Viewer</a></em>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<div class="info" style="margin-bottom:0;">' . "\n";
             echo '<p style="margin-top:0;"><span>We highly recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during payment processing. See: <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")) . '">Log Files (Debug)</a>.</span></p>' . "\n";
             echo '<p style="margin-bottom:0;"><span class="ws-menu-page-error">However, it is very important to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We strongly suggest that logging be disabled on a live site (for security reasons).</span></p>' . "\n";
             echo '</div>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Sandbox Tip:</strong> If you\'re testing your site through a PayPal Sandbox account, please remember that Email Confirmations from s2Member will not be received after a test purchase. s2Member sends its Confirmation Emails to the PayPal Email Address of the Customer. Since PayPal Sandbox addresses are usually bogus (for testing), you will have to run live transactions before Email Confirmations from s2Member are received. That being said, all other s2Member functionality can be tested through a PayPal Sandbox account. Email Confirmations are the only hang-up.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_details_after_sandbox_tip", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_paypal_account_details", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_paypal_payflow_account_details", c_ws_plugin__s2member_utils_conds::pro_is_installed(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_paypal_payflow_account_details", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Payflow Account Details">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-payflow-account-details-section">' . "\n";
         echo '<a href="http://www.s2member.com/paypal" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/paypal-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
         echo '<h3>Payflow Account Details (required, if using Payflow)</h3>' . "\n";
         echo '<p>Newer PayPal Pro accounts (i.e., PayPal Pro w/ Payflow Edition), come with the Payflow API for Recurring Billing service. If you have a newer PayPal Pro account, and you wish to integrate PayPal\'s Recurring Billing service with s2Member Pro-Forms, you will need to fill in the details here. Providing Payflow API Credentials below, will automatically put s2Member\'s Recurring Billing integration through Pro-Forms into Payflow mode. Just fill in the details below, and you\'re ready to generate Pro-Forms that charge customers on a recurring basis. s2Member will use the Payflow Edition API instead of the older PayPal Pro DPRP service; which is being slowly phased out in favor of Payflow Edition APIs.</p>' . "\n";
         echo '<p><em><strong>Payflow API Credentials:</strong> Once you have a PayPal Pro account, you\'ll need access to your <a href="http://s2member.com/r/paypal-profile-api-access/" target="_blank" rel="external">Payflow API Credentials</a>. Log into your PayPal account, and navigate to <strong>Profile → API Access (or → Request API Credentials)</strong>. From the available options, please choose "Payflow / API Access". You will need the following credentials: Username, Password, Partner, and Vendor.</em></p>' . "\n";
         echo '<p><em><strong>Important Note:</strong> Supplying Payflow API Credentials here does not mean you can bypass other areas of s2Member\'s configuration; i.e., please supply s2Member with all of your PayPal account details. Your PayPal Pro (Payflow Edition) account is configured here, but up above you will need to configure other Account Details also.</em></p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://s2member.com/kb-article/supported-paypal-account-types/" target="_blank" rel="external">PayPal Account Types</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_payflow_account_details", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-payflow-api-username">' . "\n";
         echo 'Your Payflow API Username:'******'</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_paypal_payflow_api_username" id="ws-plugin--s2member-paypal-payflow-api-username" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_username"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → API Access (or → Request API Credentials) → Payflow API Access</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-payflow-api-password">' . "\n";
         echo 'Your Payflow API Password:'******'</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_paypal_payflow_api_password" id="ws-plugin--s2member-paypal-payflow-api-password" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_password"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → API Access (or → Request API Credentials) → Payflow API Access</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-payflow-api-partner">' . "\n";
         echo 'Your Payflow API Partner:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" name="ws_plugin__s2member_paypal_payflow_api_partner" id="ws-plugin--s2member-paypal-payflow-api-partner" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_partner"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → API Access (or → Request API Credentials) → Payflow API Access</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-payflow-api-vendor">' . "\n";
         echo 'Your Payflow API Vendor:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" name="ws_plugin__s2member_paypal_payflow_api_vendor" id="ws-plugin--s2member-paypal-payflow-api-vendor" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_vendor"]) . '" /><br />' . "\n";
         echo 'At PayPal, see: <strong>Profile → API Access (or → Request API Credentials) → Payflow API Access</strong>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_payflow_account_detail_rows", get_defined_vars());
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_paypal_payflow_account_details", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_paypal_ipn", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_paypal_ipn", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="PayPal IPN Integration">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-ipn-section">' . "\n";
         echo '<h3>PayPal IPN / Instant Payment Notifications (required, please enable)</h3>' . "\n";
         echo '<p>Log into your PayPal account and navigate to this section:<br /><strong>Account Profile → Instant Payment Notification Preferences</strong></p>' . "\n";
         echo '<p>Edit your IPN settings &amp; turn IPN Notifications: <strong><code>On</code></strong></p>' . "\n";
         echo '<p>You\'ll need your IPN URL, which is:<br /><code>' . esc_html(home_url("/?s2member_paypal_notify=1")) . '</code></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn", get_defined_vars());
         echo '<h3 style="margin:0;">More Information (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-details\').toggle(); return false;" class="ws-dotted-link">click here</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-paypal-ipn-details" style="margin-top:10px; display:none;">' . "\n";
         echo '<p><em><strong>Quick Tip:</strong> In addition to the <a href="http://s2member.com/r/paypal-ipn-setup/" target="_blank" rel="external">default IPN settings inside your PayPal account</a>, the IPN URL is also set on a per-transaction basis by the special PayPal Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal account, that\'s OK. s2Member dynamically sets the IPN URL for each transaction. The result is that the IPN URL configured from within your PayPal account, becomes the default, which is then overwritten on a per-transaction basis. In fact, PayPal recently updated their system to support IPN URL preservation. One PayPal account can handle multiple sites, all using different IPN URLs.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_quick_tip", get_defined_vars());
         echo '<p><em><strong>IPN Communications:</strong> You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations (e.g., refunds &amp; chargebacks) for you automatically. If you log into your PayPal account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal IPN service that runs silently behind-the-scene. The PayPal IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically (based on your configuration). The communication from PayPal → s2Member is seamless.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3 style="margin:0;">IPN w/ Proxy Key (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-proxy-details\').toggle(); return false;" class="ws-dotted-link">optional, for 3rd-party integrations</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-paypal-ipn-proxy-details" style="margin-top:10px; display:none;">' . "\n";
         echo '<p>If you\'re using a 3rd-party application that needs to POST simulated IPN transactions to your s2Member installation, you can use this alternate IPN URL, which includes a Proxy Key. This encrypted Proxy Key verifies incoming data being received by s2Member\'s IPN processor. You can change <em>[proxy-gateway]</em> to whatever you like. The <em>[proxy-gateway]</em> value is required. It will be stored by s2Member as the Customer\'s Paid Subscr. Gateway. Your [proxy-gateway] value will also be reflected in s2Member\'s IPN log.</p>' . "\n";
         echo '<input type="text" autocomplete="off" value="' . format_to_edit(home_url("/?s2member_paypal_notify=1&s2member_paypal_proxy=[proxy-gateway]&s2member_paypal_proxy_verification=" . urlencode(c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen()))) . '" style="width:99%;" />' . "\n";
         echo '<p><em>Any 3rd-party application that is sending IPN transactions to your s2Member installation must include the <code>custom</code> POST variable, and that variable must always start with your installation domain (i.e., custom=<code>' . esc_html($_SERVER["HTTP_HOST"]) . '</code>). In addition, the <code>item_number</code> variable must always match a format that s2Member looks for. Generally speaking, the <code>item_number</code> should be <code>1, 2, 3, or 4</code>, indicating a specific s2Member Level #. However, s2Member also uses some advanced formats in this field. Just to be sure, we suggest creating a PayPal Button with the s2Member Button Generator, and then taking a look at the Full Button Code to see how s2Member expects <code>item_number</code> to be formatted. Other than the aforementioned exceptions, all other POST variables should follow PayPal standards. Please see: <a href="http://www.s2member.com/paypal-ipn-pdt-vars" target="_blank" rel="external">PayPal\'s IPN/PDT reference guide</a> for full documentation.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_proxy", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_paypal_ipn", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_paypal_pdt", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_paypal_pdt", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="PayPal PDT/Auto-Return Integration">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-pdt-section">' . "\n";
         echo '<h3>PayPal PDT Identity Token (required, please enable)</h3>' . "\n";
         echo '<p>Log into your PayPal account and navigate to this section:<br /><strong>Account Profile → Website Payment Preferences</strong></p>' . "\n";
         echo '<p>Turn the Auto-Return feature: <strong><code>On</code></strong></p>' . "\n";
         echo '<p>You\'ll need your <a href="' . esc_attr(home_url("/?s2member_paypal_return=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">Auto-Return URL</a>, which is:<br /><code>' . esc_html(home_url("/?s2member_paypal_return=1")) . '</code></p>' . "\n";
         echo '<p>You must also enable PDT (Payment Data Transfer): <strong><code>On</code></strong><br /><em>You\'ll be issued an Identity Token that you can enter below.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-paypal-identity-token">' . "\n";
         echo 'PayPal PDT Identity Token:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_paypal_identity_token" id="ws-plugin--s2member-paypal-identity-token" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_identity_token"]) . '" /><br />' . "\n";
         echo 'Your PDT Identity Token will appear under <strong>Profile → Website Payment Preferences</strong> in your PayPal account.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3 style="margin:0;">More Information (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-pdt-details\').toggle(); return false;" class="ws-dotted-link">click here</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-paypal-pdt-details" style="margin-top:10px; display:none;">' . "\n";
         echo '<p><em><strong>Quick Tip:</strong> In addition to the <a href="http://s2member.com/r/paypal-pdt-setup/" target="_blank" rel="external">default Auto-Return/PDT configuration inside your PayPal account</a>, the Auto-Return URL is also set on a per-transaction basis from within the special PayPal Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal account, that\'s OK. s2Member sets the Auto-Return URL (dynamically) for each transaction. The result is that the Auto-Return URL configured from within your PayPal account becomes the default, which is then overwritten on a per-transaction basis by the s2Member software.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt_after_quick_tip", get_defined_vars());
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt_after_more_info", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_paypal_pdt", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_signup_confirmation_email", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_signup_confirmation_email", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Signup Confirmation Email (Standard)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-confirmation-email-section">' . "\n";
         echo '<h3>Signup Confirmation Email (required, but the default works fine)</h3>' . "\n";
         echo '<p>This email is sent to new Customers after they return from a successful signup at PayPal. The <strong>primary</strong> purpose of this email is to provide the Customer with instructions, along with a link to register a Username for their Membership. You may also customize this further by providing details that are specifically geared to your site.</p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_signup_confirmation_email", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-signup-email-recipients">' . "\n";
         echo 'Signup Confirmation Recipients:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_signup_email_recipients" id="ws-plugin--s2member-signup-email-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_email_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"%%full_name%%" &lt;%%payer_email%%&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-signup-email-subject">' . "\n";
         echo 'Signup Confirmation Email Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_signup_email_subject" id="ws-plugin--s2member-signup-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email sent to a Customer after a successful signup has occurred through PayPal.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-signup-email-message">' . "\n";
         echo 'Signup Confirmation Email Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_signup_email_message" id="ws-plugin--s2member-signup-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email sent to a Customer after a successful signup has occurred through PayPal.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%registration_url%%</code> = The full URL (generated by s2Member) where the Customer can get registered.</li>' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The PayPal Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. PayPal does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e., there is only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%initial%%</code> = The Initial Fee charged during signup. If you offered a 100% Free Trial, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent, whenever they initially signed up, no matter what. If a Customer signs up, under the terms of a 100% Free Trial Period, this will be 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. If you offer something 100% free, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) that the Subscription is for.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D (this means 1 Day)\\n%%initial_term%% = 1 W (this means 1 Week)\\n%%initial_term%% = 1 M (this means 1 Month)\\n%%initial_term%% = 1 Y (this means 1 Year)\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%initial_cycle%%</code> = This is the <code>%%initial_term%%</code> from above, converted to a cycle representation of: <code><em>X days/weeks/months/years</em></code>.</li>' . "\n";
         echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D (this means 1 Day)\\n%%regular_term%% = 1 W (this means 1 Week)\\n%%regular_term%% = 1 M (this means 1 Month)\\n%%regular_term%% = 1 Y (this means 1 Year)\\n%%regular_term%% = 1 L (this means 1 Lifetime)\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period (or duration) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular_cycle%%</code> = This is the <code>%%regular_term%%</code> from above, converted to a cycle representation of: <code><em>[every] X days/weeks/months/years—OR daily, weekly, bi-weekly, monthly, bi-monthly, quarterly, yearly, or lifetime</em></code>. This is a very useful Replacment Code. Its value is dynamic; depending on term length, recurring status, and period/term lengths configured.</li>' . "\n";
         echo '<li><code>%%recurring/regular_cycle%%</code> = Example (<code>14.95 / Monthly</code>), or ... (<code>0 / non-recurring</code>); depending on the value of <code>%%recurring%%</code>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<div class="ws-menu-page-hr"></div>' . "\n" . '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags—optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$paypal</code> variable is the most important one. It contains all of the <code>$_POST</code> variables received from PayPal\'s IPN service—or from an s2Member Pro-Form integration (e.g., <code>$paypal["item_number"]</code>, <code>$paypal["item_name"]</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_signup_confirmation_email", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_modification_confirmation_email", c_ws_plugin__s2member_utils_conds::pro_is_installed(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_modification_confirmation_email", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Modification Confirmation Email ' . (c_ws_plugin__s2member_utils_conds::pro_is_installed() ? '(Standard/Pro-Form)' : '(Standard)') . '">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-modification-confirmation-email-section">' . "\n";
         echo '<h3>Modification Confirmation Email (required, but the default works fine)</h3>' . "\n";
         echo '<p>This email is sent to existing Users after they complete an upgrade/downgrade (if and when you make this possible). For instance, if a Free Subscriber upgrades to a paid Membership Level, s2Member considers this a Modification (NOT a Signup; a Signup is associated only with someone completely new). The <strong>primary</strong> purpose of this email is to provide the Customer with a confirmation that their account was updated. You may also customize this further by providing details that are specifically geared to your site.</p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_modification_confirmation_email", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-modification-email-recipients">' . "\n";
         echo 'Modification Confirmation Recipients:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_modification_email_recipients" id="ws-plugin--s2member-modification-email-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["modification_email_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"%%full_name%%" &lt;%%payer_email%%&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-modification-email-subject">' . "\n";
         echo 'Modification Confirmation Email Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_modification_email_subject" id="ws-plugin--s2member-modification-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["modification_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email sent to a Customer after a successful modification has occurred through PayPal.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-modification-email-message">' . "\n";
         echo 'Modification Confirmation Email Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_modification_email_message" id="ws-plugin--s2member-modification-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["modification_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email sent to a Customer after a successful modification has occurred through PayPal.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The PayPal Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. PayPal does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e., there is only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e., it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%initial%%</code> = The Initial Fee. If you offered a 100% Free Trial, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent when they completed checkout, no matter what. Even if that amount is 0. If a Customer upgrades/downgrades under the terms of a 100% Free Trial Period, this will be 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. If you offer something 100% free, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) that the Subscription is for.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D (this means 1 Day)\\n%%initial_term%% = 1 W (this means 1 Week)\\n%%initial_term%% = 1 M (this means 1 Month)\\n%%initial_term%% = 1 Y (this means 1 Year)\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%initial_cycle%%</code> = This is the <code>%%initial_term%%</code> from above, converted to a cycle representation of: <code><em>X days/weeks/months/years</em></code>.</li>' . "\n";
         echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D (this means 1 Day)\\n%%regular_term%% = 1 W (this means 1 Week)\\n%%regular_term%% = 1 M (this means 1 Month)\\n%%regular_term%% = 1 Y (this means 1 Year)\\n%%regular_term%% = 1 L (this means 1 Lifetime)\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period (or duration) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular_cycle%%</code> = This is the <code>%%regular_term%%</code> from above, converted to a cycle representation of: <code><em>[every] X days/weeks/months/years—OR daily, weekly, bi-weekly, monthly, bi-monthly, quarterly, yearly, or lifetime</em></code>. This is a very useful Replacment Code. Its value is dynamic; depending on term length, recurring status, and period/term lengths configured.</li>' . "\n";
         echo '<li><code>%%recurring/regular_cycle%%</code> = Example (<code>14.95 / Monthly</code>), or ... (<code>0 / non-recurring</code>); depending on the value of <code>%%recurring%%</code>.</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro-Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member → General Options → Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<div class="ws-menu-page-hr"></div>' . "\n" . '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags—optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$paypal</code> variable is the most important one. It contains all of the <code>$_POST</code> variables received from PayPal\'s IPN service—or from an s2Member Pro-Form integration (e.g., <code>$paypal["item_number"]</code>, <code>$paypal["item_name"]</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_modification_confirmation_email", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_ccap_confirmation_email", c_ws_plugin__s2member_utils_conds::pro_is_installed(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_ccap_confirmation_email", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Capability Confirmation Email ' . (c_ws_plugin__s2member_utils_conds::pro_is_installed() ? '(Standard/Pro-Form)' : '(Standard)') . '">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-ccap-confirmation-email-section">' . "\n";
         echo '<h3>Capability Confirmation Email (required, but the default works fine)</h3>' . "\n";
         echo '<p>This email is sent to existing Users after they complete a Buy Now purchase for one or more Custom Capabilities (if and when you make this possible); see: <strong>Dashboard → s2Member → PayPal Buttons/Forms → Capability (Buy Now)</strong>. The <strong>primary</strong> purpose of this email is to provide the Customer with a confirmation that their account was updated. You may also customize this further by providing details that are specifically geared to your site.</p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_ccap_confirmation_email", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-ccap-email-recipients">' . "\n";
         echo 'Capability Confirmation Recipients:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_ccap_email_recipients" id="ws-plugin--s2member-ccap-email-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ccap_email_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"%%full_name%%" &lt;%%payer_email%%&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-ccap-email-subject">' . "\n";
         echo 'Capability Confirmation Email Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_ccap_email_subject" id="ws-plugin--s2member-ccap-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ccap_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email sent to a Customer after a purchase is completed through PayPal.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-ccap-email-message">' . "\n";
         echo 'Capability Confirmation Email Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_ccap_email_message" id="ws-plugin--s2member-ccap-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ccap_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email sent to a Customer after a purchase is completed through PayPal.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%txn_id%%</code> = The PayPal Transaction ID. PayPal assigns a unique identifier for every purchase.</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%amount%%</code> = The full Amount that you charged for Custom Capability access.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who completed the purchase.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who completed the purchase.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who completed the purchase.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who completed the purchase.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>*:custom_capabilities</em></code>); where <code>custom_capabilities</code> is a comma-delimited list of the Custom Capabilities they purchased.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with PayPal.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n";
         echo '</ul>' . "\n";
         if (c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<strong>Coupon Replacement Codes (applicable only w/ s2Member Pro-Forms):</strong>' . "\n";
             echo '<ul class="ws-menu-page-li-margins">' . "\n";
             echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
             echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
             echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
             echo '</ul>' . "\n";
         }
         echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member → General Options → Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<div class="ws-menu-page-hr"></div>' . "\n" . '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags—optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$paypal</code> variable is the most important one. It contains all of the <code>$_POST</code> variables received from PayPal\'s IPN service—or from an s2Member Pro-Form integration (e.g., <code>$paypal["item_number"]</code>, <code>$paypal["item_name"]</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_ccap_confirmation_email", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_sp_confirmation_email", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_sp_confirmation_email", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Specific Post/Page Confirmation Email (Standard)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-confirmation-email-section">' . "\n";
         echo '<h3>Specific Post/Page Confirmation Email (required, but the default works fine)</h3>' . "\n";
         echo '<p>This email is sent to new Customers after they return from a successful purchase at PayPal, for Specific Post/Page Access. (see: <strong>s2Member → Restriction Options → Specific Post/Page Access</strong>). This is NOT used for Membership sales, only for Specific Post/Page Access. The <strong>primary</strong> purpose of this email is to provide the Customer with instructions, along with a link to access the Specific Post/Page they\'ve purchased access to. If you\'ve created a Specific Post/Page Package (with multiple Posts/Pages bundled together into one transaction), this ONE link (<code>%%sp_access_url%%</code>) will automatically authenticate them for access to ALL of the Posts/Pages included in their transaction. You may customize this email further by providing details that are specifically geared to your site.</p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_sp_confirmation_email", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-sp-email-recipients">' . "\n";
         echo 'Specific Post/Page Confirmation Recipients:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_sp_email_recipients" id="ws-plugin--s2member-sp-email-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"%%full_name%%" &lt;%%payer_email%%&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-sp-email-subject">' . "\n";
         echo 'Specific Post/Page Confirmation Email Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_sp_email_subject" id="ws-plugin--s2member-sp-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email sent to a Customer after a successful purchase has occurred through PayPal, for Specific Post/Page Access.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-sp-email-message">' . "\n";
         echo 'Specific Post/Page Confirmation Email Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__s2member_sp_email_message" id="ws-plugin--s2member-sp-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email sent to a Customer after a successful purchase has occurred through PayPal, for Specific Post/Page Access.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%sp_access_url%%</code> = The full URL (generated by s2Member) where the Customer can gain access.</li>' . "\n";
         echo '<li><code>%%sp_access_exp%%</code> = Human readable expiration for <code>%%sp_access_url%%</code>. Ex: <em>(link expires in <code>%%sp_access_exp%%</code>)</em>.</li>' . "\n";
         echo '<li><code>%%txn_id%%</code> = The PayPal Transaction ID. PayPal assigns a unique identifier for every purchase.</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%amount%%</code> = The full Amount that you charged for Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> (translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code>).</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<div class="ws-menu-page-hr"></div>' . "\n" . '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags—optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$paypal</code> variable is the most important one. It contains all of the <code>$_POST</code> variables received from PayPal\'s IPN service—or from an s2Member Pro-Form integration (e.g., <code>$paypal["item_number"]</code>, <code>$paypal["item_name"]</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_sp_confirmation_email", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_display_eot_behavior", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_eot_behavior", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Automatic EOT Behavior">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-eot-behavior-section">' . "\n";
         echo '<h3>PayPal EOT Behavior (required, please choose)</h3>' . "\n";
         echo '<p>EOT = End Of Term. By default, s2Member will demote a paid Member to a Free Subscriber whenever their Subscription term has ended (i.e., expired), been cancelled, refunded, charged back to you, etc. s2Member demotes them to a Free Subscriber, so they will no longer have Member Level Access to your site. However, in some cases, you may prefer to have Customer accounts deleted completely, instead of just being demoted. This is where you choose which method works best for your site. If you don\'t want s2Member to take ANY action at all, you can disable s2Member\'s EOT System temporarily, or even completely. There are also a few other configurable options here, so please read carefully. These options are all very important.</p>' . "\n";
         echo '<p><strong>PayPal IPNs:</strong> The PayPal IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. For example, if you issue a refund to an unhappy Customer through PayPal, s2Member will eventually be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically (based on your configuration). The communication from PayPal → s2Member is seamless.</p>' . "\n";
         echo '<p><em><strong>Some Hairy Details:</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through PayPal... but, s2Member continues allowing the User  access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT (End Of Term) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member.</em></p>' . "\n";
         echo '<p><em>s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system (based on your configuration). s2Member also calculates one extra day (24 hours) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_eot_behavior", get_defined_vars());
         echo '<p id="ws-plugin--s2member-auto-eot-system-enabled-via-cron"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists("wp_cron") || !wp_get_schedule("ws_plugin__s2member_auto_eot_system__schedule")) ? '' : ' style="display:none;"') . '>If you\'d like to run s2Member\'s Auto-EOT System through a more traditional Cron Job; instead of through <code>WP-Cron</code>, you will need to configure a Cron Job through your server control panel; provided by your hosting company. Set the Cron Job to run <code>once about every 10 minutes to an hour</code>. You\'ll want to configure an HTTP Cron Job that loads this URL:<br /><code>' . esc_html(home_url("/?s2member_auto_eot_system_via_cron=1")) . '</code></p>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-auto-eot-system-enabled">' . "\n";
         echo 'Enable s2Member\'s Auto-EOT System?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_auto_eot_system_enabled" id="ws-plugin--s2member-auto-eot-system-enabled">' . "\n";
         // Very advanced conditionals here. If the Auto-EOT System is NOT running, or NOT fully configured, this will indicate that no option is set - as sort of a built-in acknowledgment/warning in the UI panel.
         echo $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1 && (!function_exists("wp_cron") || !wp_get_schedule("ws_plugin__s2member_auto_eot_system__schedule")) || $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (function_exists("wp_cron") && wp_get_schedule("ws_plugin__s2member_auto_eot_system__schedule")) || !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] && (function_exists("wp_cron") && wp_get_schedule("ws_plugin__s2member_auto_eot_system__schedule")) ? '<option value=""></option>' . "\n" : '';
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1 && function_exists("wp_cron") && wp_get_schedule("ws_plugin__s2member_auto_eot_system__schedule") ? ' selected="selected"' : '') . '>Yes (enable the Auto-EOT System through WP-Cron)</option>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<option value="2"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists("wp_cron") || !wp_get_schedule("ws_plugin__s2member_auto_eot_system__schedule")) ? ' selected="selected"' : '') . '>Yes (but, I\'ll run it with my own Cron Job)</option>' . "\n" : '';
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] && (!function_exists("wp_cron") || !wp_get_schedule("ws_plugin__s2member_auto_eot_system__schedule")) ? ' selected="selected"' : '') . '>No (disable the Auto-EOT System)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting: (<code>Yes / enable via WP-Cron</code>)' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-membership-eot-behavior">' . "\n";
         echo 'Membership EOT Behavior (Demote or Delete)?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_membership_eot_behavior" id="ws-plugin--s2member-membership-eot-behavior">' . "\n";
         echo '<option value="demote"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "demote" ? ' selected="selected"' : '') . '>Demote (convert them to a Free Subscriber)</option>' . "\n";
         echo '<option value="delete"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "delete" ? ' selected="selected"' : '') . '>Delete (erase their account completely)</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-eots-remove-ccaps">' . "\n";
         echo 'Membership EOTs also Remove all Custom Capabilities?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_eots_remove_ccaps" id="ws-plugin--s2member-eots-remove-ccaps">' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eots_remove_ccaps"] ? ' selected="selected"' : '') . '>Yes (an EOT also results in the loss of any Custom Capabilities a User/Member may have)</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eots_remove_ccaps"] ? ' selected="selected"' : '') . '>No (an EOT has no impact on any Custom Capabilities a User/Member may have)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo '<em>NOTE: If Refunds/Reversals trigger an Immediate EOT (see setting below); Custom Capabilities will always be removed when/if a Refund or Reversal occurs. In other words, this setting is ignored for Refunds/Reversals (IF they trigger an Immediate EOT—based on your configuration below). If you prefer to review all Refunds/Reversals for yourself, please choose that option below.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-eot-grace-time">' . "\n";
         echo 'EOT Grace Time (in seconds):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_eot_grace_time" id="ws-plugin--s2member-eot-grace-time" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_grace_time"]) . '" /><br />' . "\n";
         echo '<em>This is represented in seconds. For example, a value of: <code>86400</code> = 1 day. Your EOT Grace Time; is the amount of time you will offer as a grace period (if any). Most site owners will give customers an additional 24 hours of access; just to help avoid any negativity that may result from a customer losing access sooner than they might expect. You can disable EOT Grace Time by setting this to: <code>0</code>. Note: there is NO Grace Time applied when/if a Refund or Reversal occurs. If Refunds/Reversals trigger an Immediate EOT (see setting below); there is never any Grace Time applied in that scenario.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-triggers-immediate-eot">' . "\n";
         echo 'Refunds/Partial Refunds/Reversals (trigger Immediate EOT)?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_triggers_immediate_eot" id="ws-plugin--s2member-triggers-immediate-eot">' . "\n";
         echo '<option value="none"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "none" ? ' selected="selected"' : '') . '>None (I\'ll review these events manually)</option>' . "\n";
         echo '<option value="refunds"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "refunds" ? ' selected="selected"' : '') . '>Full Refunds (full refunds only; ALWAYS trigger an Immediate EOT action)</option>' . "\n";
         echo '<option value="reversals"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "reversals" ? ' selected="selected"' : '') . '>Reversals (chargebacks only; ALWAYS trigger an Immediate EOT action)</option>' . "\n";
         echo '<option value="refunds,reversals"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "refunds,reversals" ? ' selected="selected"' : '') . '>Full Refunds, Reversals (these ALWAYS trigger an Immediate EOT action)</option>' . "\n";
         echo '<option value="refunds,partial_refunds,reversals"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "refunds,partial_refunds,reversals" ? ' selected="selected"' : '') . '>Full Refunds, Partial Refunds, Reversals (these ALWAYS trigger an Immediate EOT action)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo '<em><strong>Note:</strong> s2Member is not equipped to detect partial refunds against multi-payment Subscriptions reliably. Therefore, all refunds processed against Subscriptions (of any kind) are considered <strong>Partial</strong> Refunds. Full refunds (in the eyes of s2Member) occur only against Buy Now transactions where it is easy for s2Member to see that the refund amount is &gt;= the original Buy Now purchase price (i.e., a Full Refund). <strong>Also Note:</strong> This setting (no matter what you choose) will NOT impact s2Member\'s internal API Notifications for Refund/Reversal events. <a href="#" onclick="alert(\'A Full or Partial Refund; and/or a Reversal Notification will ALWAYS be processed internally by s2Member, even if no action is taken by s2Member in accordance with your configuration here.\\n\\nIn this way, you\\\'ll have the full ability to listen for these events on your own (via API Notifications); if you prefer (optional). For more information, check your Dashboard under: `s2Member → API Notifications → Refunds/Reversals`.\'); return false;">Click here for details</a>.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-eot-time-ext-behavior">' . "\n";
         echo 'Fixed-Term Extensions (Auto-Extend)?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_eot_time_ext_behavior" id="ws-plugin--s2member-eot-time-ext-behavior">' . "\n";
         echo '<option value="extend"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_time_ext_behavior"] === "extend" ? ' selected="selected"' : '') . '>Yes (default, automatically extend any existing EOT Time)</option>' . "\n";
         echo '<option value="reset"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_time_ext_behavior"] === "reset" ? ' selected="selected"' : '') . '>No (do NOT extend; s2Member should reset EOT Time completely)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo '<em>This setting will only affect Buy Now transactions for fixed-term lengths. By default, s2Member will automatically extend any existing EOT Time that a Customer may have. For example, if I buy one year of access, and then I buy another year of access (before my first year is totally used up); I end up with everything I paid you for (now over 1 year of access) if this is set to <code>Yes</code>. If this was set to <code>No</code>, the EOT Time would be reset when I make the second purchase; leaving me with only 1 year of access, starting the date of my second purchase.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_after_eot_behavior", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_paypal_ops_page_after_left_sections", get_defined_vars());
     echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Ejemplo n.º 21
0
 /**
  * Adds option menus / sub-menus.
  *
  * @package s2Member\Menu_Pages
  * @since 3.5
  *
  * @attaches-to ``add_action("admin_menu");``
  *
  * @return null
  */
 public static function add_admin_options()
 {
     do_action("ws_plugin__s2member_before_add_admin_options", get_defined_vars());
     add_filter("plugin_action_links", "c_ws_plugin__s2member_menu_pages::_add_settings_link", 10, 2);
     if (apply_filters("ws_plugin__s2member_during_add_admin_options_create_menu_items", true, get_defined_vars())) {
         if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() || apply_filters("ws_plugin__s2member_during_add_admin_options_clear_right_side", false, get_defined_vars())) {
             $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"] = array();
         }
         $menu = apply_filters("ws_plugin__s2member_during_add_admin_options_menu_slug", "ws-plugin--s2member-start", get_defined_vars());
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_menu_page", true, get_defined_vars())) {
             add_menu_page(c_ws_plugin__s2member_utils_conds::pro_is_installed() ? "s2Member (Pro)" : "s2Member", c_ws_plugin__s2member_utils_conds::pro_is_installed() ? "s2Member (Pro)" : "s2Member", "create_users", $menu, "c_ws_plugin__s2member_menu_pages::start_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/brand-favicon.png");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member Quick-Start Guide", "Quick-Start Guide", "create_users", "ws-plugin--s2member-start", "c_ws_plugin__s2member_menu_pages::start_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_1", true, get_defined_vars())) {
             add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_mms_ops_page", !is_multisite() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, "s2Member Multisite Configuration", "Multisite (Config)", "create_users", "ws-plugin--s2member-mms-ops", "c_ws_plugin__s2member_menu_pages::mms_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_gen_ops_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member General Options", "General Options", "create_users", "ws-plugin--s2member-gen-ops", "c_ws_plugin__s2member_menu_pages::gen_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_res_ops_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member Restriction Options", "Restriction Options", "create_users", "ws-plugin--s2member-res-ops", "c_ws_plugin__s2member_menu_pages::res_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_down_ops_page", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, "s2Member Download Options", "Download Options", "create_users", "ws-plugin--s2member-down-ops", "c_ws_plugin__s2member_menu_pages::down_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_2", true, get_defined_vars())) {
             add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member PayPal Options", "PayPal Options", "create_users", "ws-plugin--s2member-paypal-ops", "c_ws_plugin__s2member_menu_pages::paypal_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_paypal_buttons_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member PayPal Buttons", "PayPal Buttons", "create_users", "ws-plugin--s2member-paypal-buttons", "c_ws_plugin__s2member_menu_pages::paypal_buttons_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_3", true, get_defined_vars())) {
             add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_trk_ops_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member API / Tracking", "API / Tracking", "create_users", "ws-plugin--s2member-trk-ops", "c_ws_plugin__s2member_menu_pages::trk_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_els_ops_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member API / List Servers", "API / List Servers", "create_users", "ws-plugin--s2member-els-ops", "c_ws_plugin__s2member_menu_pages::els_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_api_ops_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member API / Notifications", "API / Notifications", "create_users", "ws-plugin--s2member-api-ops", "c_ws_plugin__s2member_menu_pages::api_ops_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_scripting_page", true, get_defined_vars())) {
             add_submenu_page($menu, "s2Member API / Scripting", "API / Scripting", "create_users", "ws-plugin--s2member-scripting", "c_ws_plugin__s2member_menu_pages::scripting_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_4", true, get_defined_vars())) {
             add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_integrations_page", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, "s2Member / Other Integrations", "Other Integrations", "create_users", "ws-plugin--s2member-integrations", "c_ws_plugin__s2member_menu_pages::integrations_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_5", true, get_defined_vars())) {
             add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_logs_page", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, "s2Member Logs", "Log Files (Debug)", "create_users", "ws-plugin--s2member-logs", "c_ws_plugin__s2member_menu_pages::logs_page");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_divider_6", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, "", '<span style="display:block; margin:1px 0 1px -5px; padding:0; height:1px; line-height:1px; background:#CCCCCC;"></span>', "create_users", "#");
         }
         if (apply_filters("ws_plugin__s2member_during_add_admin_options_add_info_page", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
             add_submenu_page($menu, "s2Member Information", "s2Member Info", "create_users", "ws-plugin--s2member-info", "c_ws_plugin__s2member_menu_pages::info_page");
         }
         do_action("ws_plugin__s2member_during_add_admin_options_additional_pages", get_defined_vars());
     }
     do_action("ws_plugin__s2member_after_add_admin_options", get_defined_vars());
     return;
 }
Ejemplo n.º 22
0
 /**
  * Saves Custom Fields after an admin updates Profile.
  *
  * @package s2Member\Users_List
  * @since 3.5
  *
  * @attaches-to ``add_action("edit_user_profile_update");``
  * @attaches-to ``add_action("personal_options_update");``
  *
  * @param int|str $user_id Expects a numeric WordPress User ID passed in by the Action Hook.
  * @return null
  */
 public static function users_list_update_cols($user_id = FALSE)
 {
     global $current_site, $current_blog;
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_users_list_update_cols", get_defined_vars());
     unset($__refs, $__v);
     $user = new WP_User($user_id);
     $current_user = is_user_logged_in() ? wp_get_current_user() : false;
     if (is_object($user) && !empty($user->ID) && ($user_id = $user->ID) && is_object($current_user) && !empty($current_user->ID)) {
         if (current_user_can("edit_users") && (!is_multisite() || is_super_admin() || is_user_member_of_blog($user_id))) {
             if (!empty($_POST) && is_array($_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST)))) {
                 $old_user = unserialize(serialize($user));
                 $old_role = c_ws_plugin__s2member_user_access::user_access_role($old_user);
                 $role = isset($_p["role"]) && $_p["role"] !== $old_role ? $_p["role"] : $old_role;
                 $level = c_ws_plugin__s2member_user_access::user_access_role_to_level($role);
                 $user->roles = isset($_p["role"]) && $_p["role"] !== $old_role ? array($_p["role"]) : $old_user->roles;
                 $user->user_email = isset($_p["email"]) && is_email($_p["email"]) && $_p["email"] !== $old_user->user_email && !email_exists($_p["email"]) ? $_p["email"] : $old_user->user_email;
                 $user->first_name = isset($_p["first_name"]) && $_p["first_name"] !== $old_user->first_name ? $_p["first_name"] : $old_user->first_name;
                 $user->last_name = isset($_p["last_name"]) && $_p["last_name"] !== $old_user->last_name ? $_p["last_name"] : $old_user->last_name;
                 $auto_eot_time = !empty($_p["ws_plugin__s2member_profile_s2member_auto_eot_time"]) ? strtotime($_p["ws_plugin__s2member_profile_s2member_auto_eot_time"]) : "";
                 if ($role !== $old_role) {
                     // In this case, we need to fire Hook: `ws_plugin__s2member_during_collective_mods`.
                     do_action("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars(), "user-role-change", "modification", $role, $user, $old_user);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_originating_blog"]) && is_multisite() && is_super_admin()) {
                     update_user_meta($user_id, "s2member_originating_blog", $_p["ws_plugin__s2member_profile_s2member_originating_blog"]);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_subscr_gateway"])) {
                     update_user_option($user_id, "s2member_subscr_gateway", $_p["ws_plugin__s2member_profile_s2member_subscr_gateway"]);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_subscr_id"])) {
                     update_user_option($user_id, "s2member_subscr_id", $_p["ws_plugin__s2member_profile_s2member_subscr_id"]);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_custom"])) {
                     update_user_option($user_id, "s2member_custom", $_p["ws_plugin__s2member_profile_s2member_custom"]);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_registration_ip"])) {
                     update_user_option($user_id, "s2member_registration_ip", $_p["ws_plugin__s2member_profile_s2member_registration_ip"]);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_notes"])) {
                     update_user_option($user_id, "s2member_notes", $_p["ws_plugin__s2member_profile_s2member_notes"]);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_auto_eot_time"]) && isset($auto_eot_time)) {
                     update_user_option($user_id, "s2member_auto_eot_time", $auto_eot_time);
                 }
                 if (isset($_p["ws_plugin__s2member_profile_s2member_ccaps"])) {
                     foreach ($user->allcaps as $cap => $cap_enabled) {
                         if (preg_match("/^access_s2member_ccap_/", $cap)) {
                             $user->remove_cap($ccap = $cap);
                         }
                     }
                     if (!empty($_p["ws_plugin__s2member_profile_s2member_ccaps"])) {
                         foreach (preg_split("/[\r\n\t\\s;,]+/", $_p["ws_plugin__s2member_profile_s2member_ccaps"]) as $ccap) {
                             if (strlen($ccap = trim(strtolower(preg_replace("/[^a-z_0-9]/i", "", $ccap))))) {
                                 $user->add_cap("access_s2member_ccap_" . $ccap);
                             }
                         }
                     }
                 }
                 if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) {
                     foreach (json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field) {
                         $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
                         $field_id_class = preg_replace("/_/", "-", $field_var);
                         if (isset($_p["ws_plugin__s2member_profile_" . $field_var])) {
                             if (is_array($_p["ws_plugin__s2member_profile_" . $field_var]) && !empty($_p["ws_plugin__s2member_profile_" . $field_var]) || is_string($_p["ws_plugin__s2member_profile_" . $field_var]) && strlen($_p["ws_plugin__s2member_profile_" . $field_var])) {
                                 $fields[$field_var] = $_p["ws_plugin__s2member_profile_" . $field_var];
                             } else {
                                 unset($fields[$field_var]);
                             }
                         } else {
                             unset($fields[$field_var]);
                         }
                     }
                 }
                 if (!empty($fields)) {
                     update_user_option($user_id, "s2member_custom_fields", $fields);
                 } else {
                     delete_user_option($user_id, "s2member_custom_fields");
                 }
                 if ($level > 0) {
                     $pr_times = get_user_option("s2member_paid_registration_times", $user_id);
                     $pr_times["level"] = empty($pr_times["level"]) ? time() : $pr_times["level"];
                     $pr_times["level" . $level] = empty($pr_times["level" . $level]) ? time() : $pr_times["level" . $level];
                     update_user_option($user_id, "s2member_paid_registration_times", $pr_times);
                     // Update now.
                 }
                 if (!empty($_p["ws_plugin__s2member_profile_opt_in"]) && !empty($role) && $level >= 0) {
                     c_ws_plugin__s2member_list_servers::process_list_servers($role, $level, $user->user_login, !empty($_p["pass1"]) ? $_p["pass1"] : "", $user->user_email, $user->first_name, $user->last_name, false, true, true, $user_id);
                 }
                 if (!empty($_p["ws_plugin__s2member_profile_ip_restrictions"])) {
                     c_ws_plugin__s2member_ip_restrictions::delete_reset_specific_ip_restrictions(strtolower($user->user_login));
                 }
                 if (!empty($_p["ws_plugin__s2member_profile_reset_pass_resend"]) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                     c_ws_plugin__s2member_email_configs::reset_pass_resend_new_user_notification($user_id, !empty($_p["pass1"]) ? $_p["pass1"] : "", array("user"), $user->user_email);
                 }
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 do_action("ws_plugin__s2member_during_users_list_update_cols", get_defined_vars());
                 unset($__refs, $__v);
             }
         } else {
             if ($current_user->ID === $user->ID) {
                 if (!empty($_POST) && is_array($_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST)))) {
                     $role = c_ws_plugin__s2member_user_access::user_access_role($user);
                     $level = c_ws_plugin__s2member_user_access::user_access_role_to_level($role);
                     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) {
                         if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level($level, "profile")) {
                             $_existing_fields = get_user_option("s2member_custom_fields", $user_id);
                             foreach (json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field) {
                                 $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
                                 $field_id_class = preg_replace("/_/", "-", $field_var);
                                 if (!in_array($field["id"], $fields_applicable) || strpos($field["editable"], "no") === 0) {
                                     if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
                                         $fields[$field_var] = $_existing_fields[$field_var];
                                     } else {
                                         // Else ``unset()``.
                                         unset($fields[$field_var]);
                                     }
                                 } else {
                                     if ($field["required"] === "yes" && (!isset($_p["ws_plugin__s2member_profile_" . $field_var]) || !is_array($_p["ws_plugin__s2member_profile_" . $field_var]) && !is_string($_p["ws_plugin__s2member_profile_" . $field_var]) || is_array($_p["ws_plugin__s2member_profile_" . $field_var]) && empty($_p["ws_plugin__s2member_profile_" . $field_var]) || is_string($_p["ws_plugin__s2member_profile_" . $field_var]) && !strlen($_p["ws_plugin__s2member_profile_" . $field_var]))) {
                                         if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
                                             $fields[$field_var] = $_existing_fields[$field_var];
                                         } else {
                                             // Else ``unset()``.
                                             unset($fields[$field_var]);
                                         }
                                     } else {
                                         if (isset($_p["ws_plugin__s2member_profile_" . $field_var])) {
                                             if (is_array($_p["ws_plugin__s2member_profile_" . $field_var]) && !empty($_p["ws_plugin__s2member_profile_" . $field_var]) || is_string($_p["ws_plugin__s2member_profile_" . $field_var]) && strlen($_p["ws_plugin__s2member_profile_" . $field_var])) {
                                                 $fields[$field_var] = $_p["ws_plugin__s2member_profile_" . $field_var];
                                             } else {
                                                 unset($fields[$field_var]);
                                             }
                                         } else {
                                             unset($fields[$field_var]);
                                         }
                                     }
                                 }
                             }
                             if (!empty($fields)) {
                                 update_user_option($user_id, "s2member_custom_fields", $fields);
                             } else {
                                 delete_user_option($user_id, "s2member_custom_fields");
                             }
                         }
                     }
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     do_action("ws_plugin__s2member_during_users_list_update_cols", get_defined_vars());
                     unset($__refs, $__v);
                 }
             }
         }
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_after_users_list_update_cols", get_defined_vars());
     unset($__refs, $__v);
     return;
 }
 /**
  * s2Member's PayPal IPN handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110815
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_notify_in::paypal_notify()}.
  *
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars, EXTR_OVERWRITE | EXTR_REFS);
     // Extract all vars passed in from: ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``.
     if (!empty($paypal['txn_type']) && preg_match('/^web_accept$/i', $paypal['txn_type']) && (!empty($paypal['item_number']) && preg_match($GLOBALS['WS_PLUGIN__']['s2member']['c']['membership_item_number_wo_level_regex'], $paypal['item_number'])) && (empty($paypal['payment_status']) || empty($payment_status_issues) || !preg_match($payment_status_issues, $paypal['payment_status'])) && !empty($paypal['txn_id']) && !empty($paypal['payer_email']) && (!empty($paypal['txn_baid']) || ($paypal['txn_baid'] = $paypal['txn_id'])) && (!empty($paypal['txn_cid']) || ($paypal['txn_cid'] = $paypal['txn_id']))) {
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__s2member_during_paypal_notify_before_new_ccaps', get_defined_vars());
         unset($__refs, $__v);
         if (!get_transient($transient_ipn = 's2m_ipn_' . md5('s2member_transient_' . $_paypal_s)) && set_transient($transient_ipn, time(), 31556926 * 10)) {
             $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept` ) w/ update vars for Capabilities w/o Level.';
             list($paypal['level'], $paypal['ccaps'], $paypal['eotper']) = preg_split('/\\:/', $paypal['item_number'], 3);
             $paypal['ip'] = preg_match('/ip address/i', $paypal['option_name2']) && $paypal['option_selection2'] ? $paypal['option_selection2'] : '';
             $paypal['ip'] = !$paypal['ip'] && preg_match('/^[a-z0-9]+~[0-9\\.]+$/i', $paypal['invoice']) ? preg_replace('/^[a-z0-9]+~/i', '', $paypal['invoice']) : $paypal['ip'];
             $paypal['currency'] = strtoupper($paypal['mc_currency']);
             // Normalize input currency.
             $paypal['currency_symbol'] = c_ws_plugin__s2member_utils_cur::symbol($paypal['currency']);
             if (!empty($coupon['coupon_code']) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 $coupon_class = new c_ws_plugin__s2member_pro_coupons();
                 $coupon_class->update_uses($coupon['coupon_code']);
             }
             if (preg_match('/(referenc|associat|updat|upgrad)/i', $paypal['option_name1']) && $paypal['option_selection1']) {
                 if (($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with($paypal['txn_id'], $paypal['option_selection1'])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                     if (!$user->has_cap('administrator')) {
                         $processing = $during = TRUE;
                         // Yes, we ARE processing this.
                         foreach (array_keys(get_defined_vars()) as $__v) {
                             $__refs[$__v] =& ${$__v};
                         }
                         do_action('ws_plugin__s2member_during_paypal_notify_during_before_new_ccaps', get_defined_vars());
                         unset($__refs, $__v);
                         $fields = get_user_option('s2member_custom_fields', $user_id);
                         // These will be needed in the routines below.
                         $user_reg_ip = get_user_option('s2member_registration_ip', $user_id);
                         // Original IP during Registration.
                         $user_reg_ip = $paypal['ip'] = $user_reg_ip ? $user_reg_ip : $paypal['ip'];
                         // Now merge conditionally.
                         if (is_multisite() && !is_user_member_of_blog($user_id)) {
                             add_existing_user_to_blog(array('user_id' => $user_id, 'role' => get_option('default_role')));
                             $user = new WP_User($user_id);
                         }
                         if ($paypal['ccaps'] && preg_match('/^-all/', str_replace('+', '', $paypal['ccaps']))) {
                             foreach ($user->allcaps as $cap => $cap_enabled) {
                                 if (preg_match('/^access_s2member_ccap_/', $cap)) {
                                     $user->remove_cap($ccap = $cap);
                                 }
                             }
                         }
                         if ($paypal['ccaps'] && preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $paypal['ccaps']))) {
                             foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $paypal['ccaps']))) as $ccap) {
                                 if (strlen($ccap = trim(strtolower(preg_replace('/[^a-z_0-9]/i', '', $ccap))))) {
                                     $user->add_cap('access_s2member_ccap_' . $ccap);
                                 }
                             }
                         }
                         if (!get_user_option('s2member_registration_ip', $user_id)) {
                             update_user_option($user_id, 's2member_registration_ip', $paypal['ip']);
                         }
                         if (!empty($coupon['full_coupon_code']) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                             $user_coupons = is_array($user_coupons = get_user_option('s2member_coupon_codes', $user_id)) ? $user_coupons : array();
                             $user_coupons = array_unique(array_merge($user_coupons, (array) $coupon['full_coupon_code']));
                             update_user_option($user_id, 's2member_coupon_codes', $user_coupons);
                         }
                         $paypal['s2member_log'][] = 's2Member Custom Capabilities updated w/ advanced update routines.';
                         $sbj = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ccap_email_subject'];
                         // The same for standard and w/ Pro-Forms.
                         $msg = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ccap_email_message'];
                         // The same for standard and w/ Pro-Forms.
                         $rec = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ccap_email_recipients'];
                         // The same for standard and w/ Pro-Forms.
                         if (($rec = c_ws_plugin__s2member_utils_strings::fill_cvs($rec, $paypal['custom'])) && ($rec = preg_replace('/%%(?:subscr|txn)_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $rec))) {
                             if (($rec = preg_replace('/%%(?:subscr|txn)_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $rec)) && ($rec = preg_replace('/%%(?:subscr|txn)_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $rec))) {
                                 if (($rec = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $rec)) && ($rec = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $rec))) {
                                     if (($rec = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $rec)) && ($rec = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $rec))) {
                                         if (($rec = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $rec)) && ($rec = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $rec))) {
                                             if (($rec = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name'])), $rec)) && ($rec = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name'])), $rec))) {
                                                 if ($rec = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $rec)) {
                                                     // **NOTE** c_ws_plugin__s2member_utils_strings::esc_dq() is applied here. (ex. 'N\'ame' <email>).
                                                     if ($rec = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $rec)) {
                                                         if (($rec = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $rec))) {
                                                             if (($rec = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $rec)) && ($rec = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $rec))) {
                                                                 if ($rec = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $rec)) {
                                                                     if ($rec = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $rec)) {
                                                                         if ($rec = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $rec)) {
                                                                             if ($rec = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $rec)) {
                                                                                 if ($rec = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $rec)) {
                                                                                     if (($sbj = c_ws_plugin__s2member_utils_strings::fill_cvs($sbj, $paypal['custom'])) && ($sbj = preg_replace('/%%(?:subscr|txn)_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $sbj))) {
                                                                                         if (($sbj = preg_replace('/%%(?:subscr|txn)_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $sbj)) && ($sbj = preg_replace('/%%(?:subscr|txn)_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $sbj))) {
                                                                                             if (($sbj = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $sbj)) && ($sbj = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $sbj))) {
                                                                                                 if (($sbj = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $sbj)) && ($sbj = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $sbj))) {
                                                                                                     if (($sbj = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $sbj)) && ($sbj = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $sbj))) {
                                                                                                         if (($sbj = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $sbj)) && ($sbj = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $sbj))) {
                                                                                                             if ($sbj = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $sbj)) {
                                                                                                                 if ($sbj = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $sbj)) {
                                                                                                                     if (($sbj = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $sbj))) {
                                                                                                                         if (($sbj = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $sbj)) && ($sbj = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $sbj))) {
                                                                                                                             if ($sbj = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $sbj)) {
                                                                                                                                 if ($sbj = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $sbj)) {
                                                                                                                                     if ($sbj = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $sbj)) {
                                                                                                                                         if ($sbj = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $sbj)) {
                                                                                                                                             if ($sbj = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $sbj)) {
                                                                                                                                                 if (($msg = c_ws_plugin__s2member_utils_strings::fill_cvs($msg, $paypal['custom'])) && ($msg = preg_replace('/%%(?:subscr|txn)_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $msg))) {
                                                                                                                                                     if (($msg = preg_replace('/%%(?:subscr|txn)_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $msg)) && ($msg = preg_replace('/%%(?:subscr|txn)_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $msg))) {
                                                                                                                                                         if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                                                                                                                                             if (($msg = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $msg)) && ($msg = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $msg))) {
                                                                                                                                                                 if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                                                                                                                                                     if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                                                                                                                                         if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                                                                                                                                             if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                                                                                                                                                 if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                                                                                                                                     if (($msg = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $msg)) && ($msg = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $msg))) {
                                                                                                                                                                                         if ($msg = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $msg)) {
                                                                                                                                                                                             if ($msg = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $msg)) {
                                                                                                                                                                                                 if ($msg = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $msg)) {
                                                                                                                                                                                                     if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $msg)) {
                                                                                                                                                                                                         if ($msg = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $msg)) {
                                                                                                                                                                                                             if (is_array($fields) && !empty($fields)) {
                                                                                                                                                                                                                 foreach ($fields as $var => $val) {
                                                                                                                                                                                                                     $rec = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $rec);
                                                                                                                                                                                                                     $sbj = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $sbj);
                                                                                                                                                                                                                     $msg = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $msg);
                                                                                                                                                                                                                 }
                                                                                                                                                                                                             }
                                                                                                                                                                                                             if (($rec = trim(preg_replace('/%%(.+?)%%/i', '', $rec))) && ($sbj = trim(preg_replace('/%%(.+?)%%/i', '', $sbj))) && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                                                                                                                                                 if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
                                                                                                                                                                                                                     $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
                                                                                                                                                                                                                     $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
                                                                                                                                                                                                                 }
                                                                                                                                                                                                                 foreach (c_ws_plugin__s2member_utils_strings::parse_emails($rec) as $recipient) {
                                                                                                                                                                                                                     c_ws_plugin__s2member_email_configs::email_config() . wp_mail($recipient, apply_filters('ws_plugin__s2member_capabilities_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_capabilities_email_msg', $msg, get_defined_vars()), 'From: "' . preg_replace('/"/', '"', $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']) . '" <' . $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'] . '>' . "\r\n" . 'Content-Type: text/plain; charset=UTF-8') . c_ws_plugin__s2member_email_configs::email_config_release();
                                                                                                                                                                                                                 }
                                                                                                                                                                                                                 $paypal['s2member_log'][] = 'Capability Confirmation Email sent to: ' . $rec . '.';
                                                                                                                                                                                                             }
                                                                                                                                                                                                         }
                                                                                                                                                                                                     }
                                                                                                                                                                                                 }
                                                                                                                                                                                             }
                                                                                                                                                                                         }
                                                                                                                                                                                     }
                                                                                                                                                                                 }
                                                                                                                                                                             }
                                                                                                                                                                         }
                                                                                                                                                                     }
                                                                                                                                                                 }
                                                                                                                                                             }
                                                                                                                                                         }
                                                                                                                                                     }
                                                                                                                                                 }
                                                                                                                                             }
                                                                                                                                         }
                                                                                                                                     }
                                                                                                                                 }
                                                                                                                             }
                                                                                                                         }
                                                                                                                     }
                                                                                                                 }
                                                                                                             }
                                                                                                         }
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         if ($processing && $_REQUEST['s2member_paypal_proxy'] && ($url = $_REQUEST['s2member_paypal_proxy_return_url'])) {
                             if (($url = c_ws_plugin__s2member_utils_strings::fill_cvs($url, $paypal['custom'], true)) && ($url = preg_replace('/%%(?:subscr|txn)_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_id'])), $url))) {
                                 if (($url = preg_replace('/%%(?:subscr|txn)_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_baid'])), $url)) && ($url = preg_replace('/%%(?:subscr|txn)_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_cid'])), $url))) {
                                     if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                         if (($url = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['mc_gross'])), $url)) && ($url = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_id'])), $url))) {
                                             if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                                 if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                     if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                         if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                             if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                                 if (($url = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->first_name)), $url)) && ($url = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->last_name)), $url))) {
                                                                     if ($url = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($user->first_name . ' ' . $user->last_name))), $url)) {
                                                                         if ($url = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_email)), $url)) {
                                                                             if ($url = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_login)), $url)) {
                                                                                 if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_reg_ip)), $url)) {
                                                                                     if ($url = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_id)), $url)) {
                                                                                         if (is_array($fields) && !empty($fields)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 if (!($url = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(maybe_serialize($val))), $url))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                         if ($url = trim($url)) {
                                                                                             // Preserve remaining replacements.
                                                                                             // Because the parent routine may perform replacements too.
                                                                                             $paypal['s2member_paypal_proxy_return_url'] = $url;
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             $paypal['s2member_log'][] = 'Capability Return, a Proxy Return URL is ready.';
                         }
                         if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_urls']) {
                             foreach (preg_split('/[' . "\r\n\t" . ']+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_urls']) as $url) {
                                 if (($url = c_ws_plugin__s2member_utils_strings::fill_cvs($url, $paypal['custom'], true)) && ($url = preg_replace('/%%(?:subscr|txn)_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_id'])), $url))) {
                                     if (($url = preg_replace('/%%(?:subscr|txn)_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_baid'])), $url)) && ($url = preg_replace('/%%(?:subscr|txn)_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_cid'])), $url))) {
                                         if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                             if (($url = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['mc_gross'])), $url)) && ($url = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_id'])), $url))) {
                                                 if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                                     if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                         if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                             if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                                 if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                                     if (($url = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->first_name)), $url)) && ($url = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->last_name)), $url))) {
                                                                         if ($url = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($user->first_name . ' ' . $user->last_name))), $url)) {
                                                                             if ($url = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_email)), $url)) {
                                                                                 if ($url = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user->user_login)), $url)) {
                                                                                     if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_reg_ip)), $url)) {
                                                                                         if ($url = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_id)), $url)) {
                                                                                             if (is_array($fields) && !empty($fields)) {
                                                                                                 foreach ($fields as $var => $val) {
                                                                                                     if (!($url = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(maybe_serialize($val))), $url))) {
                                                                                                         break;
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                             if ($url = trim(preg_replace('/%%(.+?)%%/i', '', $url))) {
                                                                                                 c_ws_plugin__s2member_utils_urls::remote($url);
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             $paypal['s2member_log'][] = 'Payment Notification URLs have been processed.';
                         }
                         if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_recipients']) {
                             $msg = $sbj = '(s2Member / API Notification Email) - Payment';
                             $msg .= "\n\n";
                             // Spacing in the message body.
                             $msg .= 'currency: %%currency%%' . "\n";
                             $msg .= 'currency_symbol: %%currency_symbol%%' . "\n";
                             $msg .= 'amount: %%amount%%' . "\n";
                             $msg .= 'txn_id: %%txn_id%%' . "\n";
                             $msg .= 'txn_baid: %%txn_baid%%' . "\n";
                             $msg .= 'txn_cid: %%txn_cid%%' . "\n";
                             $msg .= 'item_number: %%item_number%%' . "\n";
                             $msg .= 'item_name: %%item_name%%' . "\n";
                             $msg .= 'first_name: %%first_name%%' . "\n";
                             $msg .= 'last_name: %%last_name%%' . "\n";
                             $msg .= 'full_name: %%full_name%%' . "\n";
                             $msg .= 'payer_email: %%payer_email%%' . "\n";
                             $msg .= 'full_coupon_code: %%full_coupon_code%%' . "\n";
                             $msg .= 'coupon_code: %%coupon_code%%' . "\n";
                             $msg .= 'coupon_affiliate_id: %%coupon_affiliate_id%%' . "\n";
                             $msg .= 'user_first_name: %%user_first_name%%' . "\n";
                             $msg .= 'user_last_name: %%user_last_name%%' . "\n";
                             $msg .= 'user_full_name: %%user_full_name%%' . "\n";
                             $msg .= 'user_email: %%user_email%%' . "\n";
                             $msg .= 'user_login: %%user_login%%' . "\n";
                             $msg .= 'user_ip: %%user_ip%%' . "\n";
                             $msg .= 'user_id: %%user_id%%' . "\n";
                             if (is_array($fields) && !empty($fields)) {
                                 foreach ($fields as $var => $val) {
                                     $msg .= $var . ': %%' . $var . '%%' . "\n";
                                 }
                             }
                             $msg .= 'cv0: %%cv0%%' . "\n";
                             $msg .= 'cv1: %%cv1%%' . "\n";
                             $msg .= 'cv2: %%cv2%%' . "\n";
                             $msg .= 'cv3: %%cv3%%' . "\n";
                             $msg .= 'cv4: %%cv4%%' . "\n";
                             $msg .= 'cv5: %%cv5%%' . "\n";
                             $msg .= 'cv6: %%cv6%%' . "\n";
                             $msg .= 'cv7: %%cv7%%' . "\n";
                             $msg .= 'cv8: %%cv8%%' . "\n";
                             $msg .= 'cv9: %%cv9%%';
                             if (($msg = c_ws_plugin__s2member_utils_strings::fill_cvs($msg, $paypal['custom'])) && ($msg = preg_replace('/%%(?:subscr|txn)_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $msg))) {
                                 if (($msg = preg_replace('/%%(?:subscr|txn)_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $msg)) && ($msg = preg_replace('/%%(?:subscr|txn)_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $msg))) {
                                     if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                         if (($msg = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $msg)) && ($msg = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $msg))) {
                                             if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                                 if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                     if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                         if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                             if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                 if (($msg = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $msg)) && ($msg = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $msg))) {
                                                                     if ($msg = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $msg)) {
                                                                         if ($msg = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $msg)) {
                                                                             if ($msg = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $msg)) {
                                                                                 if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $msg)) {
                                                                                     if ($msg = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $msg)) {
                                                                                         if (is_array($fields) && !empty($fields)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 if (!($msg = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $msg))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                         if ($sbj && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                             // Still have a ``$sbj`` and a ``$msg``?
                                                                                             foreach (c_ws_plugin__s2member_utils_strings::parse_emails($GLOBALS['WS_PLUGIN__']['s2member']['o']['payment_notification_recipients']) as $recipient) {
                                                                                                 wp_mail($recipient, apply_filters('ws_plugin__s2member_payment_notification_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_payment_notification_email_msg', $msg, get_defined_vars()), 'Content-Type: text/plain; charset=UTF-8');
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             $paypal['s2member_log'][] = 'Payment Notification Emails have been processed.';
                         }
                         if ($processing && ($code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ccap_tracking_codes'])) {
                             if (($code = c_ws_plugin__s2member_utils_strings::fill_cvs($code, $paypal['custom'])) && ($code = preg_replace('/%%(?:subscr|txn)_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $code))) {
                                 if (($code = preg_replace('/%%(?:subscr|txn)_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $code)) && ($code = preg_replace('/%%(?:subscr|txn)_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $code))) {
                                     if (($code = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $code)) && ($code = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $code))) {
                                         if (($code = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $code)) && ($code = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $code))) {
                                             if (($code = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $code)) && ($code = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $code))) {
                                                 if (($code = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $code)) && ($code = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $code))) {
                                                     if ($code = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $code)) {
                                                         if ($code = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $code)) {
                                                             if (($code = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $code)) && ($code = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $code)) && ($code = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $code))) {
                                                                 if (($code = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->first_name), $code)) && ($code = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->last_name), $code))) {
                                                                     if ($code = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($user->first_name . ' ' . $user->last_name)), $code)) {
                                                                         if ($code = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_email), $code)) {
                                                                             if ($code = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user->user_login), $code)) {
                                                                                 if ($code = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_reg_ip), $code)) {
                                                                                     if ($code = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $code)) {
                                                                                         if (is_array($fields) && !empty($fields)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 if (!($code = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $code))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                         if ($code = trim(preg_replace('/%%(.+?)%%/i', '', $code))) {
                                                                                             $paypal['s2member_log'][] = 'Storing Payment Tracking Codes into a Transient Queue. These will be processed on-site.';
                                                                                             set_transient('s2m_' . md5('s2member_transient_ccap_tracking_codes_' . $paypal['txn_id']), $code, 43200);
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         foreach (array_keys(get_defined_vars()) as $__v) {
                             $__refs[$__v] =& ${$__v};
                         }
                         do_action('ws_plugin__s2member_during_paypal_notify_during_new_ccaps', get_defined_vars());
                         unset($__refs, $__v);
                     } else {
                         $paypal['s2member_log'][] = 'Unable to add new Capabilities. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.';
                     }
                 } else {
                     $paypal['s2member_log'][] = 'Unable to add new Capabilities. Could not get the existing User ID from the DB. Please check the `on0` and `os0` variables in your Button Code.';
                 }
             } else {
                 $paypal['s2member_log'][] = 'Unable to add new Capabilities. Missing User/Member details. Please check the `on0` and `os0` variables in your Button Code.';
             }
         } else {
             $paypal['s2member_log'][] = 'Not processing. Duplicate IPN.';
             $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept` ) w/ update vars for Capabilities w/o Level.';
             $paypal['s2member_log'][] = 'Duplicate IPN. Already processed. This IPN will be ignored.';
         }
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__s2member_during_paypal_notify_after_new_ccaps', get_defined_vars());
         unset($__refs, $__v);
         return apply_filters('c_ws_plugin__s2member_paypal_notify_in_wa_ccaps_wo_level', $paypal, get_defined_vars());
     } else {
         return apply_filters('c_ws_plugin__s2member_paypal_notify_in_wa_ccaps_wo_level', FALSE, get_defined_vars());
     }
 }
Ejemplo n.º 24
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>API / List Servers</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form">' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-options-save")) . '" />' . "\n";
     do_action("ws_plugin__s2member_during_els_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_els_ops_page_during_left_sections_display_mailchimp", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_before_mailchimp", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="MailChimp Integration">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-mailchimp-section">' . "\n";
         echo '<a href="http://www.s2member.com/mailchimp" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/mailchimp-stamp.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
         echo '<h3>MailChimp List Server Integration (optional)</h3>' . "\n";
         echo '<p>s2Member can be integrated with MailChimp. MailChimp is an email marketing service. MailChimp makes it easy to send email newsletters to your Customers, manage your MailChimp subscriber lists, and track campaign performance. Although s2Member can be integrated with almost ANY list server, we highly recommend MailChimp; because of their <a href="http://www.s2member.com/mailchimp-api-docs" target="_blank" rel="external">powerful API for MailChimp services</a>. In future versions of s2Member, we plan to build additional features into s2Member that work with, and extend MailChimp services.</p>' . "\n";
         echo '<p>For now, we\'ve covered the basics. You can have your Members automatically subscribed to your MailChimp marketing lists <em>(e.g. newsletters / auto-responders)</em>. You\'ll need a <a href="http://www.s2member.com/mailchimp" target="_blank" rel="external">MailChimp account</a>, a <a href="http://www.s2member.com/mailchimp-api-key" target="_blank" rel="external">MailChimp API Key</a>, and your <a href="#" onclick="alert(\'To obtain your MailChimp List ID(s), log into your MailChimp account and click the Lists tab. Now click the (View) button, for the List(s) you want to integrate with s2Member. Then, click the (Settings) link. At the bottom of the (Settings) page, for each list; you\\\'ll find a Unique List ID.\'); return false;">MailChimp List IDs</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_mailchimp", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-mailchimp-api-key">' . "\n";
         echo 'MailChimp API Key:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_mailchimp_api_key" id="ws-plugin--s2member-mailchimp-api-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]) . '" /><br />' . "\n";
         echo 'Once you have a MailChimp account, you\'ll need to <a href="http://www.s2member.com/mailchimp-api-key" target="_blank" rel="external">add an API Key</a>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-mailchimp-list-ids">' . "\n";
             echo 'List ID(s) for ' . ($n === 0 ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' (comma-delimited):' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_mailchimp_list_ids" id="ws-plugin--s2member-level' . $n . '-mailchimp-list-ids" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_mailchimp_list_ids"]) . '" /><br />' . "\n";
             echo 'New ' . ($n === 0 ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' will be subscribed to these List IDs.<br />' . "\n";
             echo 'Ex: <code>4a44fRio5d, 434ksvviEdf, 8834jsdf923, ee9djfs4jel3</code><br />' . "\n";
             echo 'Or: <code>4a44fRio5d::Group Title::Group|Another Group</code>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<div class="info" style="margin-bottom:0;">' . "\n";
         echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during MailChimp processing. See: <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")) . '">Log Files (Debug)</a>.</span></p>' . "\n";
         echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_after_mailchimp", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_els_ops_page_during_left_sections_display_getresponse", c_ws_plugin__s2member_utils_conds::pro_is_installed(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_before_getresponse", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="GetResponse Integration">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-getresponse-section">' . "\n";
         echo '<a href="http://www.s2member.com/r/getresponse/" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/getresponse-logo.png" class="ws-menu-page-right" style="width:256px; height:89px; border:0;" alt="." /></a>' . "\n";
         echo '<h3>GetResponse List Server Integration (optional)</h3>' . "\n";
         echo '<p>s2Member can be integrated with GetResponse. GetResponse is a complete email marketing solution. It provides turnkey newsletter publishing and hosting features, as well as unlimited autoresponders to deliver information to your subscribers and convert them to paying customers.</p>' . "\n";
         echo '<p>You can have your Members automatically subscribed to your GetResponse marketing lists <em>(e.g. newsletters / auto-responders)</em>. You\'ll need a <a href="http://www.s2member.com/r/getresponse" target="_blank" rel="external">GetResponse account</a>, a <a href="http://www.s2member.com/r/getresponse-api-key" target="_blank" rel="external">GetResponse API Key</a>, and your <a href="http://www.s2member.com/r/getresponse-campaigns-list" target="_blank" rel="external" onclick="alert(\'To obtain your GetResponse Campaign Token(s), log into your GetResponse account and navigate to your entire list of Campaigns. In the left-hand column you\\\'ll find a list of Unique Campaign Tokens.\\n\\nPlease click OK and we\\\'ll take you there now :-)\');">GetResponse Campaign Tokens</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_getresponse", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-getresponse-api-key">' . "\n";
         echo 'GetResponse API Key:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_getresponse_api_key" id="ws-plugin--s2member-getresponse-api-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["getresponse_api_key"]) . '" /><br />' . "\n";
         echo 'Once you have a GetResponse account, you\'ll need to login; then <a href="http://www.s2member.com/r/getresponse-api-key" target="_blank" rel="external">get your API Key</a>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-getresponse-list-ids">' . "\n";
             echo 'Campaign Token(s) for ' . ($n === 0 ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' (comma-delimited):' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_getresponse_list_ids" id="ws-plugin--s2member-level' . $n . '-getresponse-list-ids" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_getresponse_list_ids"]) . '" /><br />' . "\n";
             echo 'New ' . ($n === 0 ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' will be subscribed to these Campaign Tokens.<br />' . "\n";
             echo 'Ex: <code>4ksdX</code> or <code>4ksdX, koeeXs, ggjXk, aakSc</code>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<div class="info" style="margin-bottom:0;">' . "\n";
         echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during GetResponse processing. See: <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")) . '">Log Files (Debug)</a>.</span></p>' . "\n";
         echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_after_getresponse", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_els_ops_page_during_left_sections_display_aweber", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_before_aweber", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="AWeber Integration">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-aweber-section">' . "\n";
         echo '<a href="http://www.s2member.com/aweber" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/aweber-logo.png" class="ws-menu-page-right screenshot" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
         echo '<h3>AWeber List Server Integration (optional)</h3>' . "\n";
         echo '<p>s2Member can be integrated with AWeber. AWeber is an email marketing service. Whether you\'re looking to get your first email campaign off the ground, or you\'re a seasoned veteran who wants to dig into advanced tools like detailed email web analytics, activity based segmentation, geo-targeting and broadcast split-testing, AWeber\'s got just what you need to make email marketing work for you.</p>' . "\n";
         echo '<p>You can have your Members automatically subscribed to your AWeber marketing lists <em>(e.g. newsletters / auto-responders)</em>. You\'ll need an <a href="http://www.s2member.com/aweber" target="_blank" rel="external">AWeber account</a> and your <a href="#" onclick="alert(\'To obtain your AWeber List ID(s), log into your AWeber account. Click on the Lists tab. On that page you\\\'ll find a Unique List ID associated with each of your lists. AWeber sometimes refers to this as a List Name instead of a List ID.\'); return false;">AWeber List IDs</a>. You will ALSO need to configure a <a href="http://www.s2member.com/kb/aweber-email-parser-for-s2member/" target="_blank" rel="external">Custom Email Parser</a> inside your AWeber account.</p>' . "\n";
         echo '<p>Log into AWeber, and go to <em>My Lists -› Email Parser</em>. If you like, choose the PayPal Parser <em>(even if you\'re not using PayPal as your Payment Gateway)</em>. You can safely ignore the additional instructions they provide. s2Member just needs the PayPal box checked, and that\'s all. Or, even better, integrate <a href="http://www.s2member.com/kb/aweber-email-parser-for-s2member/" target="_blank" rel="external">s2Member\'s Custom Email Parser</a> for AWeber, which <strong>will improve reliability</strong> and flexibility.</p>' . "\n";
         echo '<p><em><strong>AWeber Tip:</strong> If you want your Members to be subscribed to multiple AWeber List IDs at the same time, instead of comma-delimiting those List IDs here; we suggest a single List ID in your s2Member integration; then use <a href="https://help.aweber.com/entries/21696463-Can-I-Add-Subscribers-to-More-Than-One-List-At-Once-" target="_blank" rel="external">AWeber Automation Rules</a> for this. Automation Rules can also reduce the number of email confirmation notices that Members receive.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_aweber", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-aweber-list-ids">' . "\n";
             echo 'List ID(s) for ' . ($n === 0 ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' (comma-delimited):' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_aweber_list_ids" id="ws-plugin--s2member-level' . $n . '-aweber-list-ids" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_aweber_list_ids"]) . '" /><br />' . "\n";
             echo 'New ' . ($n === 0 ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' will be subscribed to these List IDs.<br />' . "\n";
             echo 'Ex: <code>mylist, anotherlist</code> — See also: <a href="https://help.aweber.com/entries/21696463-Can-I-Add-Subscribers-to-More-Than-One-List-At-Once-" target="_blank" rel="external">Automation Rules</a>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<div class="info" style="margin-bottom:0;">' . "\n";
         echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during AWeber processing. See: <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")) . '">Log Files (Debug)</a>.</span></p>' . "\n";
         echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_after_aweber", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_els_ops_page_during_left_sections_display_opt_in", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_before_opt_in", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Registration / Double Opt-In Box?">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-opt-in-section">' . "\n";
         echo '<h3>Double Opt-In Checkbox Field (optional)</h3>' . "\n";
         echo '<p>A Double Opt-In Checkbox will ONLY be displayed, if you\'ve integrated one <em>or more</em> List Servers. See also: <a href="http://www.s2member.com/kb/double-opt-in-checkbox/" target="_blank" rel="external">this KB article</a>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_opt_in", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr class="ws-plugin--s2member-custom-reg-opt-in-label-row"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] ? ' style="display:none;"' : '') . '>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-opt-in-label">' . "\n";
         echo 'Double Opt-In Checkbox Label:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr class="ws-plugin--s2member-custom-reg-opt-in-label-row"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] ? ' style="display:none;"' : '') . '>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_custom_reg_opt_in_label" id="ws-plugin--s2member-custom-reg-opt-in-label" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in_label"]) . '" /><br />' . "\n";
         echo 'Example: <code><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] == 1 ? 'checked' : 'unchecked') . '.png" class="ws-plugin--s2member-custom-reg-opt-in-label-prev-img ws-menu-page-img-16" style="vertical-align:middle;" alt="" /> Your Label will appear next to a Checkbox.</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-opt-in">' . "\n";
         echo 'Require Double Opt-In Checkbox?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_custom_reg_opt_in" id="ws-plugin--s2member-custom-reg-opt-in">' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] == 1 ? ' selected="selected"' : '') . '>Yes (the Box MUST be checked — checked by default)</option>' . "\n";
         echo '<option value="2"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] == 2 ? ' selected="selected"' : '') . '>Yes (the Box MUST be checked — unchecked by default)</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] ? ' selected="selected"' : '') . '>No (disable — do NOT display or require the Checkbox)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'An email confirmation will NOT be sent to the User, unless the Box is checked, or you\'ve disabled the Box; by choosing <code>No</code>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_after_opt_in", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_els_ops_page_during_left_sections_display_opt_out", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_before_opt_out", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Automate Un-Subscribe/Opt-Outs?">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-opt-out-section">' . "\n";
         echo '<h3>Automate Un-Subscribe/Opt-Out Removals (optional)</h3>' . "\n";
         echo '<p>s2Member can automatically <em>(and silently)</em> remove Users/Members from the List Servers you\'ve configured above. s2Member is also capable of automating this, based on your own personal configuration preferences. Below, you can choose which Events you consider grounds for List Removal. It is also important to point out that s2Member will ONLY remove Users/Members from the Lists you\'ve configured at the Level the User/Member is or was at during the time of the Event. For example, if a Level #1 Member is deleted, they will ONLY be removed from the List(s) you\'ve configured at Level #1. If an account is upgraded from Level #1 to Level #2, they will ONLY be removed from the List(s) you\'ve configured at Level #1. Of course, all of this is based on the configuration below.</p>' . "\n";
         echo '<p><em><strong>*Regarding AWeber*</strong> these will NOT work for AWeber until you <a href="http://www.s2member.com/aweber-notification-email" target="_blank" rel="external">add a Notification Email</a> to your AWeber account matching the "EMail From Address" configured in <code>s2Member -› General Options -› EMail Configuration</code>. Which is currently set to: <code>' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]) . '</code>. This is a required step if you want s2Member to be authenticated when it emails List Removal requests to AWeber.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_opt_out", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-auto-opt-outs">' . "\n";
         echo 'Process List Removals Automatically? (choose events)' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<div class="ws-menu-page-scrollbox" style="height:150px;">' . "\n";
         echo '<input type="hidden" name="ws_plugin__s2member_custom_reg_auto_opt_outs[]" value="update-signal" />' . "\n";
         foreach (array("removal-deletion" => "<strong>Anytime a User is deleted (including manual deletions)</strong>", "ipn-refund-reversal-deletion" => "&#9492;&#9472; Anytime s2Member deletes an account because of a Refund/Reversal.", "(ipn|auto-eot)-cancellation-expiration-deletion" => "&#9492;&#9472; Anytime s2Member deletes an account because of a Cancellation/Expiration.", "modification" => "<strong>Anytime a User's Role changes (including manual changes)</strong>", "ipn-refund-reversal-demotion" => "&#9492;&#9472; Anytime s2Member demotes an account because of a Refund/Reversal.", "(ipn|auto-eot)-cancellation-expiration-demotion" => "&#9492;&#9472; Anytime s2Member demotes an account because of a Cancellation/Expiration.", "(rtn|ipn)-upgrade-downgrade" => "&#9492;&#9472; Anytime s2Member changes a User's Role after a paid Subscr. Modification.") as $ws_plugin__s2member_temp_s_value => $ws_plugin__s2member_temp_s_label) {
             echo '<input type="checkbox" name="ws_plugin__s2member_custom_reg_auto_opt_outs[]" id="ws-plugin--s2member-custom-reg-auto-opt-outs-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__s2member_temp_s_value)) . '" value="' . esc_attr($ws_plugin__s2member_temp_s_value) . '"' . (in_array($ws_plugin__s2member_temp_s_value, $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_auto_opt_outs"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-custom-reg-auto-opt-outs-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__s2member_temp_s_value)) . '">' . $ws_plugin__s2member_temp_s_label . '</label><br />' . "\n";
         }
         echo '</div>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-custom-reg-auto-opt-out-transitions">' . "\n";
         echo 'Also Process List Transitions Automatically?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_custom_reg_auto_opt_out_transitions" id="ws-plugin--s2member-custom-reg-auto-opt-out-transitions">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_auto_opt_out_transitions"] ? ' selected="selected"' : '') . '>No (do NOT transition mailing list subscribers automatically)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_auto_opt_out_transitions"] === "1" ? ' selected="selected"' : '') . '>Yes (automatically transition, if able to remove from a previous list)</option>' . "\n";
         echo '<option value="2"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_auto_opt_out_transitions"] === "2" ? ' selected="selected"' : '') . '>Yes (always automatically transition, even if NOT removed from a previous list)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo '<em><strong>*Transitions*</strong> When/if s2Member automatically removes a Member from Lists at their current Level# (based on your configuration in the previous section), this setting tells s2Member that it should <strong>also</strong> transition the Member to any Lists you\'ve configured at the new Access Level# (i.e. Role) they are being changed to. For example, if a Member is demoted from Level #1 to Level #0, do you want s2Member to add them to the Level #0 List(s) after it removes them from the Level #1 List(s)?</em><br /><br />' . "\n";
         echo '<em><strong>*If removed from a previous list, or NOT?*</strong> You can choose your preference above. When/if s2Member automatically transitions a mailing list subscriber, it will first try to remove the subscriber from a previous mailing list. If s2Member is able to remove the subscriber from a previous list before the transition takes place, s2Member will then make an attempt (based on your configuration) to transition the subscriber to a new/different list silently (e.g. without a new confirmation email being sent out). If s2Member is NOT able to remove a subscriber from a previous list, it can (if configured to do so) still transition a subscriber to a new list, by sending the subscriber a new email confirmation letter (e.g. this is NOT silent, because you absolutely NEED the subscriber\'s permission in this case).</em><br /><br />' . "\n";
         echo '<em><strong>*Seamless with MailChimp*</strong> If enabled, Automatic List Transitions work seamlessly with MailChimp. Automatic List Transitions also work with GetResponse/AWeber, but GetResponse/AWeber will ALWAYS send the User/Member a new confirmation email, asking them to confirm changes to their mailing list subscription with you. Work is underway to improve this aspect of s2Member\'s integration with GetResponse/AWeber in a future release. Ideally, a Customer would be transitioned silently behind the scene with GetResponse/AWeber too, when appropriate.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_after_opt_out", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_els_ops_page_during_left_sections_display_other_methods", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_before_other_methods", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Other List Server Integration Methods">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-other-methods-section">' . "\n";
         echo '<h3>Other List Server Integrations (there\'s always a way)</h3>' . "\n";
         echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page` Notifications that are available to you through the s2Member API. These make it possible to integrate with 3rd party applications; like list servers, affiliate programs, and other back-office routines; in more advanced ways. You will probably need to get help from a web developer though. s2Member API Notifications require some light PHP scripting by someone familiar with web service connections.</p>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_other_methods", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_els_ops_page_during_left_sections_after_other_methods", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_els_ops_page_after_left_sections", get_defined_vars());
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
 /**
  * s2Member's PayPal IPN handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_notify_in::paypal_notify()}.
  *
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars, EXTR_OVERWRITE | EXTR_REFS);
     // Extract all vars passed in from: ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``.
     if (!empty($paypal['txn_type']) && preg_match('/^web_accept$/i', $paypal['txn_type']) && (!empty($paypal['item_number']) && preg_match($GLOBALS['WS_PLUGIN__']['s2member']['c']['sp_access_item_number_regex'], $paypal['item_number'])) && (empty($paypal['payment_status']) || empty($payment_status_issues) || !preg_match($payment_status_issues, $paypal['payment_status'])) && !empty($paypal['payer_email']) && !empty($paypal['txn_id']) && (!empty($paypal['txn_baid']) || ($paypal['txn_baid'] = $paypal['txn_id'])) && (!empty($paypal['txn_cid']) || ($paypal['txn_cid'] = $paypal['txn_id']))) {
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__s2member_during_paypal_notify_before_sp_access', get_defined_vars());
         unset($__refs, $__v);
         if (!get_transient($transient_ipn = 's2m_ipn_' . md5('s2member_transient_' . $_paypal_s)) && set_transient($transient_ipn, time(), 31556926 * 10)) {
             $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept` ) for Specific Post/Page Access.';
             list(, $paypal['sp_ids'], $paypal['hours']) = preg_split('/\\:/', $paypal['item_number'], 3);
             $paypal['ip'] = preg_match('/ip address/i', $paypal['option_name2']) && $paypal['option_selection2'] ? $paypal['option_selection2'] : '';
             $paypal['ip'] = !$paypal['ip'] && preg_match('/^[a-z0-9]+~[0-9\\.]+$/i', $paypal['invoice']) ? preg_replace('/^[a-z0-9]+~/i', '', $paypal['invoice']) : $paypal['ip'];
             $paypal['currency'] = strtoupper($paypal['mc_currency']);
             // Normalize input currency.
             $paypal['currency_symbol'] = c_ws_plugin__s2member_utils_cur::symbol($paypal['currency']);
             if (!empty($coupon['coupon_code']) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                 $coupon_class = new c_ws_plugin__s2member_pro_coupons();
                 $coupon_class->update_uses($coupon['coupon_code']);
             }
             if ($sp_access_url = c_ws_plugin__s2member_sp_access::sp_access_link_gen($paypal['sp_ids'], $paypal['hours'])) {
                 $processing = $during = TRUE;
                 // Yes, we ARE processing this.
                 if (preg_match('/(referenc|associat)/i', $paypal['option_name1']) && $paypal['option_selection1']) {
                     // Associating this purchase with a Member?
                     if (($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with($paypal['option_selection1'], $paypal['option_selection1'])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                         $sp_references = (array) get_user_option('s2member_sp_references', $user_id);
                         $_sp_reference = array('time' => time(), 'ids' => $paypal['sp_ids'], 'hours' => $paypal['hours'], 'url' => $sp_access_url);
                         $sp_references = c_ws_plugin__s2member_utils_arrays::array_unique(array_merge($sp_references, $_sp_reference));
                         update_user_option($user_id, 's2member_sp_references', $sp_references);
                         if (!empty($coupon['full_coupon_code']) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
                             $user_coupons = is_array($user_coupons = get_user_option('s2member_coupon_codes', $user_id)) ? $user_coupons : array();
                             $user_coupons = array_unique(array_merge($user_coupons, (array) $coupon['full_coupon_code']));
                             update_user_option($user_id, 's2member_coupon_codes', $user_coupons);
                         }
                         $paypal['s2member_log'][] = 'Specific Post/Page ~ Sale associated with User ID: ' . $user_id . '.';
                     }
                 }
                 $sbj = preg_replace('/%%sp_access_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($sp_access_url), $GLOBALS['WS_PLUGIN__']['s2member']['o'][($_REQUEST['s2member_paypal_proxy'] && preg_match('/pro-emails/', $_REQUEST['s2member_paypal_proxy_use']) ? 'pro_' : '') . 'sp_email_subject']);
                 $sbj = preg_replace('/%%sp_access_exp%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::approx_time_difference(time(), strtotime('+' . $paypal['hours'] . ' hours'))), $sbj);
                 $msg = preg_replace('/%%sp_access_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($sp_access_url), $GLOBALS['WS_PLUGIN__']['s2member']['o'][($_REQUEST['s2member_paypal_proxy'] && preg_match('/pro-emails/', $_REQUEST['s2member_paypal_proxy_use']) ? 'pro_' : '') . 'sp_email_message']);
                 $msg = preg_replace('/%%sp_access_exp%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::approx_time_difference(time(), strtotime('+' . $paypal['hours'] . ' hours'))), $msg);
                 $rec = preg_replace('/%%sp_access_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($sp_access_url), $GLOBALS['WS_PLUGIN__']['s2member']['o'][($_REQUEST['s2member_paypal_proxy'] && preg_match('/pro-emails/', $_REQUEST['s2member_paypal_proxy_use']) ? 'pro_' : '') . 'sp_email_recipients']);
                 $rec = preg_replace('/%%sp_access_exp%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::approx_time_difference(time(), strtotime('+' . $paypal['hours'] . ' hours'))), $rec);
                 if (($rec = c_ws_plugin__s2member_utils_strings::fill_cvs($rec, $paypal['custom'])) && ($rec = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $rec))) {
                     if ($rec = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $rec)) {
                         // Full amount of the payment, before fee is subtracted.
                         if (($rec = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $rec)) && ($rec = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $rec))) {
                             if (($rec = preg_replace('/%%txn_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $rec)) && ($rec = preg_replace('/%%txn_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $rec))) {
                                 if (($rec = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $rec)) && ($rec = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $rec))) {
                                     if (($rec = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name'])), $rec)) && ($rec = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name'])), $rec))) {
                                         if ($rec = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq(c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $rec)) {
                                             // **NOTE** c_ws_plugin__s2member_utils_strings::esc_dq() is applied here. (ex. 'N\'ame' <email>).
                                             if ($rec = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $rec)) {
                                                 if ($rec = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $rec)) {
                                                     if (($rec = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $rec)) && ($rec = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $rec))) {
                                                         if (($sbj = c_ws_plugin__s2member_utils_strings::fill_cvs($sbj, $paypal['custom'])) && ($sbj = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $sbj))) {
                                                             if ($sbj = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $sbj)) {
                                                                 // Full amount of the payment, before fee is subtracted.
                                                                 if (($sbj = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $sbj)) && ($sbj = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $sbj))) {
                                                                     if (($sbj = preg_replace('/%%txn_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $sbj)) && ($sbj = preg_replace('/%%txn_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $sbj))) {
                                                                         if (($sbj = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $sbj)) && ($sbj = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $sbj))) {
                                                                             if (($sbj = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $sbj)) && ($sbj = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $sbj))) {
                                                                                 if ($sbj = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $sbj)) {
                                                                                     if ($sbj = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $sbj)) {
                                                                                         if ($sbj = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $sbj)) {
                                                                                             if (($sbj = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $sbj)) && ($sbj = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $sbj))) {
                                                                                                 if (($msg = c_ws_plugin__s2member_utils_strings::fill_cvs($msg, $paypal['custom'])) && ($msg = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $msg))) {
                                                                                                     if ($msg = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $msg)) {
                                                                                                         // Full amount of the payment, before fee is subtracted.
                                                                                                         if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                                                                                             if (($msg = preg_replace('/%%txn_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $msg)) && ($msg = preg_replace('/%%txn_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $msg))) {
                                                                                                                 if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                                                                                                     if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                                                                                         if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                                                                                             if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                                                                                                 if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $msg)) {
                                                                                                                                     if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                                                                                         if (($rec = trim(preg_replace('/%%(.+?)%%/i', '', $rec))) && ($sbj = trim(preg_replace('/%%(.+?)%%/i', '', $sbj))) && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                                                                             if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
                                                                                                                                                 $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
                                                                                                                                                 $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
                                                                                                                                             }
                                                                                                                                             foreach (c_ws_plugin__s2member_utils_strings::parse_emails($rec) as $recipient) {
                                                                                                                                                 // Go through a possible list of recipients.
                                                                                                                                                 c_ws_plugin__s2member_email_configs::email_config() . wp_mail($recipient, apply_filters('ws_plugin__s2member_sp_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_sp_email_msg', $msg, get_defined_vars()), 'From: "' . preg_replace('/"/', '"', $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']) . '" <' . $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'] . '>' . "\r\n" . 'Content-Type: text/plain; charset=UTF-8') . c_ws_plugin__s2member_email_configs::email_config_release();
                                                                                                                                             }
                                                                                                                                             $paypal['s2member_log'][] = 'Specific Post/Page Confirmation Email sent to: ' . $rec . '.';
                                                                                                                                         }
                                                                                                                                     }
                                                                                                                                 }
                                                                                                                             }
                                                                                                                         }
                                                                                                                     }
                                                                                                                 }
                                                                                                             }
                                                                                                         }
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['sp_sale_notification_urls']) {
                     foreach (preg_split('/[' . "\r\n\t" . ']+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['sp_sale_notification_urls']) as $url) {
                         if (($url = c_ws_plugin__s2member_utils_strings::fill_cvs($url, $paypal['custom'], true)) && ($url = preg_replace('/%%sp_access_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(rawurlencode($sp_access_url)), $url))) {
                             if ($url = preg_replace('/%%sp_access_exp%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(c_ws_plugin__s2member_utils_time::approx_time_difference(time(), strtotime('+' . $paypal['hours'] . ' hours')))), $url)) {
                                 if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                     if (($url = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['mc_gross'])), $url)) && ($url = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_id'])), $url))) {
                                         if (($url = preg_replace('/%%txn_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_baid'])), $url)) && ($url = preg_replace('/%%txn_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_cid'])), $url))) {
                                             if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                                 if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                     if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                         if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                             if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['ip'])), $url)) {
                                                                 if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                                     if ($url = trim(preg_replace('/%%(.+?)%%/i', '', $url))) {
                                                                         c_ws_plugin__s2member_utils_urls::remote($url);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     $paypal['s2member_log'][] = 'Specific Post/Page ~ Sale Notification URLs have been processed.';
                 }
                 if ($processing && $GLOBALS['WS_PLUGIN__']['s2member']['o']['sp_sale_notification_recipients']) {
                     $msg = $sbj = '(s2Member / API Notification Email) - Specific Post/Page ~ Sale';
                     $msg .= "\n\n";
                     // Spacing in the message body.
                     $msg .= 'sp_access_url: %%sp_access_url%%' . "\n";
                     $msg .= 'sp_access_exp: %%sp_access_exp%%' . "\n";
                     $msg .= 'currency: %%currency%%' . "\n";
                     $msg .= 'currency_symbol: %%currency_symbol%%' . "\n";
                     $msg .= 'amount: %%amount%%' . "\n";
                     $msg .= 'txn_id: %%txn_id%%' . "\n";
                     $msg .= 'txn_baid: %%txn_baid%%' . "\n";
                     $msg .= 'txn_cid: %%txn_cid%%' . "\n";
                     $msg .= 'item_number: %%item_number%%' . "\n";
                     $msg .= 'item_name: %%item_name%%' . "\n";
                     $msg .= 'first_name: %%first_name%%' . "\n";
                     $msg .= 'last_name: %%last_name%%' . "\n";
                     $msg .= 'full_name: %%full_name%%' . "\n";
                     $msg .= 'payer_email: %%payer_email%%' . "\n";
                     $msg .= 'user_ip: %%user_ip%%' . "\n";
                     $msg .= 'full_coupon_code: %%full_coupon_code%%' . "\n";
                     $msg .= 'coupon_code: %%coupon_code%%' . "\n";
                     $msg .= 'coupon_affiliate_id: %%coupon_affiliate_id%%' . "\n";
                     $msg .= 'cv0: %%cv0%%' . "\n";
                     $msg .= 'cv1: %%cv1%%' . "\n";
                     $msg .= 'cv2: %%cv2%%' . "\n";
                     $msg .= 'cv3: %%cv3%%' . "\n";
                     $msg .= 'cv4: %%cv4%%' . "\n";
                     $msg .= 'cv5: %%cv5%%' . "\n";
                     $msg .= 'cv6: %%cv6%%' . "\n";
                     $msg .= 'cv7: %%cv7%%' . "\n";
                     $msg .= 'cv8: %%cv8%%' . "\n";
                     $msg .= 'cv9: %%cv9%%';
                     if (($msg = c_ws_plugin__s2member_utils_strings::fill_cvs($msg, $paypal['custom'])) && ($msg = preg_replace('/%%sp_access_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($sp_access_url), $msg))) {
                         if ($msg = preg_replace('/%%sp_access_exp%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(c_ws_plugin__s2member_utils_time::approx_time_difference(time(), strtotime('+' . $paypal['hours'] . ' hours'))), $msg)) {
                             if (($msg = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $msg)) && ($msg = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $msg))) {
                                 if (($msg = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $msg)) && ($msg = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $msg))) {
                                     if (($msg = preg_replace('/%%txn_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $msg)) && ($msg = preg_replace('/%%txn_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $msg))) {
                                         if (($msg = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $msg)) && ($msg = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $msg))) {
                                             if (($msg = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $msg)) && ($msg = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $msg))) {
                                                 if ($msg = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $msg)) {
                                                     if ($msg = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $msg)) {
                                                         if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $msg)) {
                                                             if (($msg = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $msg)) && ($msg = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $msg))) {
                                                                 if ($sbj && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                     // Still have a ``$sbj`` and a ``$msg``?
                                                                     foreach (c_ws_plugin__s2member_utils_strings::parse_emails($GLOBALS['WS_PLUGIN__']['s2member']['o']['sp_sale_notification_recipients']) as $recipient) {
                                                                         wp_mail($recipient, apply_filters('ws_plugin__s2member_sp_sale_notification_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_sp_sale_notification_email_msg', $msg, get_defined_vars()), 'Content-Type: text/plain; charset=UTF-8');
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     $paypal['s2member_log'][] = 'Specific Post/Page ~ Sale Notification Emails have been processed.';
                 }
                 if ($processing && $_REQUEST['s2member_paypal_proxy'] && ($url = $_REQUEST['s2member_paypal_proxy_return_url'])) {
                     if (($url = c_ws_plugin__s2member_utils_strings::fill_cvs($url, $paypal['custom'], true)) && ($url = preg_replace('/%%sp_access_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(rawurlencode($sp_access_url)), $url))) {
                         if ($url = preg_replace('/%%sp_access_exp%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(c_ws_plugin__s2member_utils_time::approx_time_difference(time(), strtotime('+' . $paypal['hours'] . ' hours')))), $url)) {
                             if (($url = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency'])), $url)) && ($url = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['currency_symbol'])), $url))) {
                                 if (($url = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['mc_gross'])), $url)) && ($url = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_id'])), $url))) {
                                     if (($url = preg_replace('/%%txn_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_baid'])), $url)) && ($url = preg_replace('/%%txn_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['txn_cid'])), $url))) {
                                         if (($url = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_number'])), $url)) && ($url = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['item_name'])), $url))) {
                                             if (($url = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['first_name'])), $url)) && ($url = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['last_name'])), $url))) {
                                                 if ($url = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(trim($paypal['first_name'] . ' ' . $paypal['last_name']))), $url)) {
                                                     if ($url = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['payer_email'])), $url)) {
                                                         if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($paypal['ip'])), $url)) {
                                                             if (($url = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['full_coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['coupon_code'])), $url)) && ($url = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($coupon['affiliate_id'])), $url))) {
                                                                 if ($url = trim($url)) {
                                                                     // Preserve Remaining replacements.
                                                                     // Because the parent routine may perform replacements too.
                                                                     $paypal['s2member_paypal_proxy_return_url'] = $url;
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     $paypal['s2member_log'][] = 'Specific Post/Page Return, a Proxy Return URL is ready.';
                 }
                 if ($processing && ($code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['sp_tracking_codes'])) {
                     if (($code = c_ws_plugin__s2member_utils_strings::fill_cvs($code, $paypal['custom'])) && ($code = preg_replace('/%%amount%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['mc_gross']), $code)) && ($code = preg_replace('/%%txn_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_id']), $code))) {
                         if (($code = preg_replace('/%%currency%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency']), $code)) && ($code = preg_replace('/%%currency_symbol%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['currency_symbol']), $code))) {
                             if (($code = preg_replace('/%%txn_baid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_baid']), $code)) && ($code = preg_replace('/%%txn_cid%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['txn_cid']), $code))) {
                                 if (($code = preg_replace('/%%item_number%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_number']), $code)) && ($code = preg_replace('/%%item_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['item_name']), $code))) {
                                     if (($code = preg_replace('/%%first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['first_name']), $code)) && ($code = preg_replace('/%%last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['last_name']), $code))) {
                                         if ($code = preg_replace('/%%full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(trim($paypal['first_name'] . ' ' . $paypal['last_name'])), $code)) {
                                             if ($code = preg_replace('/%%payer_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['payer_email']), $code)) {
                                                 if ($code = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($paypal['ip']), $code)) {
                                                     if (($code = preg_replace('/%%full_coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['full_coupon_code']), $code)) && ($code = preg_replace('/%%coupon_code%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['coupon_code']), $code)) && ($code = preg_replace('/%%coupon_affiliate_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($coupon['affiliate_id']), $code))) {
                                                         if ($code = trim(preg_replace('/%%(.+?)%%/i', '', $code))) {
                                                             $paypal['s2member_log'][] = 'Storing Specific Post/Page Tracking Codes into a Transient Queue. These will be processed on-site.';
                                                             set_transient('s2m_' . md5('s2member_transient_sp_tracking_codes_' . $paypal['txn_id']), $code, 43200);
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 do_action('ws_plugin__s2member_during_paypal_notify_during_sp_access', get_defined_vars());
                 unset($__refs, $__v);
             } else {
                 $paypal['s2member_log'][] = 'Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?';
             }
         } else {
             $paypal['s2member_log'][] = 'Not processing. Duplicate IPN.';
             $paypal['s2member_log'][] = 's2Member `txn_type` identified as ( `web_accept` ) for Specific Post/Page Access.';
             $paypal['s2member_log'][] = 'Duplicate IPN. Already processed. This IPN will be ignored.';
         }
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__s2member_during_paypal_notify_after_sp_access', get_defined_vars());
         unset($__refs, $__v);
         return apply_filters('c_ws_plugin__s2member_paypal_notify_in_web_accept_sp', $paypal, get_defined_vars());
     } else {
         return apply_filters('c_ws_plugin__s2member_paypal_notify_in_web_accept_sp', FALSE, get_defined_vars());
     }
 }
Ejemplo n.º 26
0
 /**
  * String with all version details *(for PHP, WordPress, s2Member, and Pro)*.
  *
  * @package s2Member\Utilities
  * @since 3.5
  *
  * @return string String with `PHP vX.XX :: WordPress vX.XX :: s2Member vX.XX :: s2Member Pro vX.XX`.
  */
 public static function ver_details()
 {
     $details = 'PHP v' . PHP_VERSION . ' :: WordPress v' . get_bloginfo('version') . ' :: s2Member v' . WS_PLUGIN__S2MEMBER_VERSION;
     $details .= c_ws_plugin__s2member_utils_conds::pro_is_installed() ? ' :: s2Member Pro v' . WS_PLUGIN__S2MEMBER_PRO_VERSION : '';
     return $details;
     // Return all details.
 }
Ejemplo n.º 27
0
 /**
  * Configures all new Users.
  *
  * The Hook `user_register` is also fired by calling:
  * ``c_ws_plugin__s2member_registrations::ms_create_existing_user()`` and/or ``wpmu_create_user()``.
  *
  * This function also receives hand-offs from s2Member's handlers for these two Hooks:
  * `wpmu_activate_user` and `wpmu_activate_blog`.
  *
  * @package s2Member\Registrations
  * @since 3.5
  *
  * @attaches-to ``add_action('user_register');``
  *
  * @param int|string $user_id A numeric WordPress User ID.
  * @param string     $password Optional in most cases. A User's plain text Password. If unspecified, attempts are made to collect the plain text Password from other sources.
  * @param array      $meta Optional in most cases. Defaults to false. An array of meta data for a User/Member.
  *
  * @TODO Impossible to delete cookies when fired inside: `/wp-activate.php`?
  */
 public static function configure_user_registration($user_id = '', $password = '', $meta = array())
 {
     global $wpdb;
     // Global database object reference.
     global $pagenow;
     // We need this to detect the current administration page.
     global $current_site, $current_blog;
     // Adds support for Multisite Networking.
     static $email_config, $processed;
     // Static vars prevent duplicate processing.
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_configure_user_registration', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
     // With Multisite Networking, we need this to run on `user_register` ahead of `wpmu_activate_[user|blog]`.
     if (!isset($email_config) && ($email_config = TRUE)) {
         // Anytime this routine is fired; we configure email.
         c_ws_plugin__s2member_email_configs::email_config();
     }
     // Configures `From:` email header.
     $_p = isset($_POST) ? $_POST : NULL;
     // Grab global ``$_POST`` array here, if it's possible to do so.
     $rvs = isset($GLOBALS['ws_plugin__s2member_registration_vars']) ? $GLOBALS['ws_plugin__s2member_registration_vars'] : NULL;
     if (!$processed) {
         if (is_array($_p) || is_array($meta) || is_array($rvs)) {
             if (!(is_multisite() && is_blog_admin() && $pagenow === 'user-new.php' && isset($_p['noconfirmation']) && is_super_admin() && !is_array($meta))) {
                 if (!(preg_match('/\\/wp-activate\\.php/', $_SERVER['REQUEST_URI']) && !is_array($meta))) {
                     if (!(c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_activation_page() && !is_array($meta))) {
                         if (!(c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user') && !is_array($rvs))) {
                             if ($user_id && is_object($user = new WP_User($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && ($processed = TRUE)) {
                                 settype($_p, 'array') . settype($meta, 'array') . settype($rvs, 'array');
                                 // Force arrays here.
                                 $_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_p));
                                 $meta = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($meta));
                                 $rvs = c_ws_plugin__s2member_utils_strings::trim_deep($rvs);
                                 foreach ($_p as $_key => $_value) {
                                     // Scan ``$_p`` vars; adding `custom_reg_field` keys.
                                     if (preg_match('/^ws_plugin__s2member_user_new_/', $_key)) {
                                         // Look for keys.
                                         if ($_key = str_replace('_user_new_', '_custom_reg_field_', $_key)) {
                                             $_p[$_key] = $_value;
                                         }
                                     }
                                 }
                                 // Add each of these key conversions.
                                 unset($_key, $_value);
                                 if (!is_admin() && (isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_id']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_baid']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_cid']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_custom']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_ccaps']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_notes']))) {
                                     exit(_x('s2Member security violation. You attempted to POST administrative variables that will NOT be trusted in a NON-administrative zone!', 's2member-front', 's2member'));
                                 }
                                 $_pmr = array_merge($_p, $meta, $rvs);
                                 // Merge all of these arrays together now, in this specific order.
                                 unset($_p, $meta, $rvs);
                                 // These variables can all be unset now; we have them all in the ``$_pmr`` array.
                                 $custom_reg_display_name = $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_display_name'];
                                 // Can be configured by the site owner.
                                 if (!is_admin() && (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user')) && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
                                     /* This routine could be processed through `/wp-login.php?action=register`, `/wp-activate.php`, or `/activate` via BuddyPress`.
                                     			This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
                                     			If processed through `/wp-activate.php`, it could've originated inside the admin—via `/user-new.php`. */
                                     /**
                                      * @var $subscr_gateway string Reference for IDEs.
                                      * @var $subscr_id string Reference for IDEs.
                                      * @var $custom string Reference for IDEs.
                                      * @var $item_number string Reference for IDEs.
                                      */
                                     $processed = 'yes';
                                     // Mark this as yes.
                                     $current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
                                     @(list($level, $ccaps, $eotper) = preg_split('/\\:/', $item_number, 3));
                                     $role = 's2member_level' . $level;
                                     // Membership Level.
                                     $email = $user->user_email;
                                     $login = $user->user_login;
                                     $ip = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_registration_ip'];
                                     $ip = !$ip ? $_SERVER['REMOTE_ADDR'] : $ip;
                                     // Else use environment variable.
                                     $subscr_baid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_baid'];
                                     $subscr_cid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_cid'];
                                     $cv = preg_split('/\\|/', $custom);
                                     if (!($auto_eot_time = '') && $eotper) {
                                         // If a specific EOT Period is included.
                                         $auto_eot_time = c_ws_plugin__s2member_utils_time::auto_eot_time('', '', '', $eotper);
                                     }
                                     $notes = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_notes'];
                                     $opt_in = !$GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_opt_in'] ? TRUE : FALSE;
                                     $opt_in = !$opt_in && !empty($_pmr['ws_plugin__s2member_custom_reg_field_opt_in']) ? TRUE : $opt_in;
                                     if (!($fname = $user->first_name)) {
                                         if (!empty($_pmr['ws_plugin__s2member_custom_reg_field_first_name'])) {
                                             $fname = (string) $_pmr['ws_plugin__s2member_custom_reg_field_first_name'];
                                         }
                                     }
                                     if (!$fname) {
                                         // Also try BuddyPress.
                                         if (!empty($_pmr['field_1'])) {
                                             // BuddyPress?
                                             $fname = trim(preg_replace('/ (.*)$/', '', (string) $_pmr['field_1']));
                                         }
                                     }
                                     if (!($lname = $user->last_name)) {
                                         if (!empty($_pmr['ws_plugin__s2member_custom_reg_field_last_name'])) {
                                             $lname = (string) $_pmr['ws_plugin__s2member_custom_reg_field_last_name'];
                                         }
                                     }
                                     if (!$lname) {
                                         // Also try BuddyPress.
                                         if (!empty($_pmr['field_1']) && preg_match('/^(.+?) (.+)$/', (string) $_pmr['field_1'])) {
                                             $lname = trim(preg_replace('/^(.+?) (.+)$/', '$2', (string) $_pmr['field_1']));
                                         }
                                     }
                                     if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_names'] && !$fname && $login) {
                                         $fname = trim($login);
                                         $lname = '';
                                         // Username and empty Last Name.
                                     }
                                     $name = trim($fname . ' ' . $lname);
                                     // Both names.
                                     if (!($pass = $password)) {
                                         // Try s2Member's generator.
                                         if (!empty($GLOBALS['ws_plugin__s2member_plain_text_pass'])) {
                                             $pass = (string) $GLOBALS['ws_plugin__s2member_plain_text_pass'];
                                         }
                                     }
                                     if (!$pass) {
                                         // Also try BuddyPress Password.
                                         if (!empty($_pmr['signup_password'])) {
                                             // BuddyPress?
                                             $pass = (string) $_pmr['signup_password'];
                                         }
                                     }
                                     if ($pass) {
                                         !headers_sent() ? delete_user_setting('default_password_nag', $user_id) : NULL;
                                         update_user_option($user_id, 'default_password_nag', FALSE, TRUE);
                                     }
                                     update_user_option($user_id, 's2member_registration_ip', $ip);
                                     update_user_option($user_id, 's2member_auto_eot_time', $auto_eot_time);
                                     update_user_option($user_id, 's2member_subscr_gateway', $subscr_gateway);
                                     update_user_option($user_id, 's2member_subscr_id', $subscr_id);
                                     update_user_option($user_id, 's2member_subscr_baid', $subscr_baid);
                                     update_user_option($user_id, 's2member_subscr_cid', $subscr_cid);
                                     update_user_option($user_id, 's2member_custom', $custom);
                                     update_user_option($user_id, 's2member_notes', $notes);
                                     if (!$user->first_name && $fname) {
                                         update_user_meta($user_id, 'first_name', $fname);
                                     }
                                     if (!$user->last_name && $lname) {
                                         update_user_meta($user_id, 'last_name', $lname);
                                     }
                                     if (!$user->display_name || $user->display_name === $user->user_login) {
                                         if ($custom_reg_display_name === 'full' && $name) {
                                             wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $name)));
                                         } else {
                                             if ($custom_reg_display_name === 'first' && $fname) {
                                                 wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $fname)));
                                             } else {
                                                 if ($custom_reg_display_name === 'last' && $lname) {
                                                     wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $lname)));
                                                 } else {
                                                     if ($custom_reg_display_name === 'login' && $login) {
                                                         wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $login)));
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     if (is_multisite()) {
                                         if (!is_main_site() && strtotime($user->user_registered) >= strtotime('-10 seconds')) {
                                             remove_user_from_blog($user_id, $current_site->blog_id);
                                         }
                                         // No Main Site Role.
                                         if (!get_user_meta($user_id, 's2member_originating_blog', TRUE)) {
                                             // Recorded yet?
                                             update_user_meta($user_id, 's2member_originating_blog', $current_blog->blog_id);
                                         }
                                     }
                                     if ($current_role !== $role) {
                                         // Only if NOT the current Role.
                                         $user->set_role($role);
                                     }
                                     // s2Member.
                                     if ($ccaps && preg_match('/^-all/', str_replace('+', '', $ccaps))) {
                                         foreach ($user->allcaps as $cap => $cap_enabled) {
                                             if (preg_match('/^access_s2member_ccap_/', $cap)) {
                                                 $user->remove_cap($ccap = $cap);
                                             }
                                         }
                                     }
                                     if ($ccaps && preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $ccaps))) {
                                         foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $ccaps))) as $ccap) {
                                             if (strlen($ccap = trim(strtolower(preg_replace('/[^a-z_0-9]/i', '', $ccap))))) {
                                                 $user->add_cap('access_s2member_ccap_' . $ccap);
                                             }
                                         }
                                     }
                                     if (!($fields = array()) && $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields']) {
                                         foreach (json_decode($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields'], TRUE) as $field) {
                                             $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
                                             $field_id_class = preg_replace('/_/', '-', $field_var);
                                             if (isset($_pmr['ws_plugin__s2member_custom_reg_field_' . $field_var])) {
                                                 $fields[$field_var] = $_pmr['ws_plugin__s2member_custom_reg_field_' . $field_var];
                                             }
                                         }
                                     }
                                     unset($field, $field_var, $field_id_class);
                                     // Housekeeping.
                                     if (!empty($fields)) {
                                         // Only if NOT empty.
                                         update_user_option($user_id, 's2member_custom_fields', $fields);
                                     }
                                     if ($level > 0) {
                                         $pr_times = get_user_option('s2member_paid_registration_times', $user_id);
                                         $pr_times['level'] = empty($pr_times['level']) ? time() : $pr_times['level'];
                                         $pr_times['level' . $level] = empty($pr_times['level' . $level]) ? time() : $pr_times['level' . $level];
                                         update_user_option($user_id, 's2member_paid_registration_times', $pr_times);
                                         // Update now.
                                     }
                                     if (!is_multisite() && c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_register_page()) {
                                         update_user_option($user_id, 's2member_bp_activation_role', $role);
                                         update_user_option($user_id, 's2member_bp_activation_ccaps', c_ws_plugin__s2member_user_access::user_access_ccaps($user));
                                     }
                                     if (($transient = 's2m_' . md5('s2member_transient_ipn_signup_vars_' . $subscr_id)) && is_array($ipn_signup_vars = get_transient($transient))) {
                                         update_user_option($user_id, 's2member_ipn_signup_vars', $ipn_signup_vars);
                                         // For future reference.
                                         delete_transient($transient);
                                         // This can be deleted now.
                                     }
                                     if (($transient = 's2m_' . md5('s2member_transient_ipn_subscr_payment_' . $subscr_id)) && is_array($subscr_payment = get_transient($transient)) && !empty($subscr_payment['subscr_gateway'])) {
                                         $proxy = array('s2member_paypal_proxy' => stripslashes((string) $subscr_payment['subscr_gateway']), 's2member_paypal_proxy_verification' => c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen());
                                         c_ws_plugin__s2member_utils_urls::remote(home_url('/?s2member_paypal_notify=1'), array_merge(stripslashes_deep($subscr_payment), $proxy), array('timeout' => 20));
                                         delete_transient($transient);
                                         // This can be deleted now.
                                     }
                                     if (($transient = 's2m_' . md5('s2member_transient_ipn_subscr_eot_' . $subscr_id)) && is_array($subscr_eot = get_transient($transient)) && !empty($subscr_eot['subscr_gateway'])) {
                                         $proxy = array('s2member_paypal_proxy' => stripslashes((string) $subscr_eot['subscr_gateway']), 's2member_paypal_proxy_verification' => c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen());
                                         c_ws_plugin__s2member_utils_urls::remote(home_url('/?s2member_paypal_notify=1'), array_merge(stripslashes_deep($subscr_eot), $proxy), array('timeout' => 20));
                                         delete_transient($transient);
                                         // This can be deleted now.
                                     }
                                     if (!headers_sent()) {
                                         // Only if headers are NOT yet sent. Here we establish both Signup and Payment Tracking Cookies.
                                         @setcookie('s2member_tracking', $s2member_tracking = c_ws_plugin__s2member_utils_encryption::encrypt($subscr_id), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie('s2member_tracking', $s2member_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE['s2member_tracking'] = $s2member_tracking);
                                     }
                                     foreach (array_keys(get_defined_vars()) as $__v) {
                                         $__refs[$__v] =& ${$__v};
                                     }
                                     do_action('ws_plugin__s2member_during_configure_user_registration_front_side_paid', get_defined_vars());
                                     do_action('ws_plugin__s2member_during_configure_user_registration_front_side', get_defined_vars());
                                     unset($__refs, $__v);
                                 } else {
                                     if (!is_admin() && (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user'))) {
                                         /* This routine could be processed through `/wp-login.php?action=register`, `/wp-activate.php`, or `/activate` via BuddyPress`.
                                         			This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
                                         			If processed through `/wp-activate.php`, it could've originated inside the admin, via `/user-new.php`. */
                                         $processed = 'yes';
                                         // Mark this as yes.
                                         $current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
                                         $role = '';
                                         // Initialize ``$role`` to an empty string here, before processing.
                                         $role = !$role && ($level = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_level']) > 0 ? 's2member_level' . $level : $role;
                                         $role = !$role && ($level = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_level']) === '0' ? 'subscriber' : $role;
                                         $role = !$role && $current_role ? $current_role : $role;
                                         // Use existing Role?
                                         $role = !$role ? get_option('default_role') : $role;
                                         // Otherwise default.
                                         $level = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_level'];
                                         $level = !$level && preg_match('/^(administrator|editor|author|contributor)$/i', $role) ? $GLOBALS['WS_PLUGIN__']['s2member']['c']['levels'] : $level;
                                         $level = !$level && preg_match('/^s2member_level[1-9][0-9]*$/i', $role) ? preg_replace('/^s2member_level/', '', $role) : $level;
                                         $level = !$level && preg_match('/^subscriber$/i', $role) ? '0' : $level;
                                         $level = !$level ? '0' : $level;
                                         $ccaps = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_ccaps'];
                                         $email = $user->user_email;
                                         $login = $user->user_login;
                                         $ip = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_registration_ip'];
                                         $ip = !$ip ? $_SERVER['REMOTE_ADDR'] : $ip;
                                         // Else use environment variable.
                                         $custom = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_custom'];
                                         $subscr_id = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_id'];
                                         $subscr_baid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_baid'];
                                         $subscr_cid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_cid'];
                                         $subscr_gateway = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway'];
                                         $cv = preg_split('/\\|/', (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_custom']);
                                         $auto_eot_time = ($eot = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time']) ? strtotime($eot) : '';
                                         $notes = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_notes'];
                                         $opt_in = !$GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_opt_in'] ? TRUE : FALSE;
                                         $opt_in = !$opt_in && !empty($_pmr['ws_plugin__s2member_custom_reg_field_opt_in']) ? TRUE : $opt_in;
                                         if (!($fname = $user->first_name)) {
                                             if (!empty($_pmr['ws_plugin__s2member_custom_reg_field_first_name'])) {
                                                 $fname = (string) $_pmr['ws_plugin__s2member_custom_reg_field_first_name'];
                                             }
                                         }
                                         if (!$fname) {
                                             // Also try BuddyPress.
                                             if (!empty($_pmr['field_1'])) {
                                                 // BuddyPress?
                                                 $fname = trim(preg_replace('/ (.*)$/', '', (string) $_pmr['field_1']));
                                             }
                                         }
                                         if (!($lname = $user->last_name)) {
                                             if (!empty($_pmr['ws_plugin__s2member_custom_reg_field_last_name'])) {
                                                 $lname = (string) $_pmr['ws_plugin__s2member_custom_reg_field_last_name'];
                                             }
                                         }
                                         if (!$lname) {
                                             // Also try BuddyPress.
                                             if (!empty($_pmr['field_1']) && preg_match('/^(.+?) (.+)$/', (string) $_pmr['field_1'])) {
                                                 $lname = trim(preg_replace('/^(.+?) (.+)$/', '$2', (string) $_pmr['field_1']));
                                             }
                                         }
                                         if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_names'] && !$fname && $login) {
                                             $fname = trim($login);
                                             $lname = '';
                                             // Username and empty Last Name.
                                         }
                                         $name = trim($fname . ' ' . $lname);
                                         // Both names.
                                         if (!($pass = $password)) {
                                             // Try s2Member's generator.
                                             if (!empty($GLOBALS['ws_plugin__s2member_plain_text_pass'])) {
                                                 $pass = (string) $GLOBALS['ws_plugin__s2member_plain_text_pass'];
                                             }
                                         }
                                         if (!$pass) {
                                             // Also try BuddyPress Password.
                                             if (!empty($_pmr['signup_password'])) {
                                                 // BuddyPress?
                                                 $pass = (string) $_pmr['signup_password'];
                                             }
                                         }
                                         if ($pass) {
                                             !headers_sent() ? delete_user_setting('default_password_nag', $user_id) : NULL;
                                             update_user_option($user_id, 'default_password_nag', FALSE, TRUE);
                                         }
                                         update_user_option($user_id, 's2member_registration_ip', $ip);
                                         update_user_option($user_id, 's2member_auto_eot_time', $auto_eot_time);
                                         update_user_option($user_id, 's2member_subscr_gateway', $subscr_gateway);
                                         update_user_option($user_id, 's2member_subscr_id', $subscr_id);
                                         update_user_option($user_id, 's2member_subscr_baid', $subscr_baid);
                                         update_user_option($user_id, 's2member_subscr_cid', $subscr_cid);
                                         update_user_option($user_id, 's2member_custom', $custom);
                                         update_user_option($user_id, 's2member_notes', $notes);
                                         if (!$user->first_name && $fname) {
                                             update_user_meta($user_id, 'first_name', $fname);
                                         }
                                         if (!$user->last_name && $lname) {
                                             update_user_meta($user_id, 'last_name', $lname);
                                         }
                                         if (!$user->display_name || $user->display_name === $user->user_login) {
                                             if ($custom_reg_display_name === 'full' && $name) {
                                                 wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $name)));
                                             } else {
                                                 if ($custom_reg_display_name === 'first' && $fname) {
                                                     wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $fname)));
                                                 } else {
                                                     if ($custom_reg_display_name === 'last' && $lname) {
                                                         wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $lname)));
                                                     } else {
                                                         if ($custom_reg_display_name === 'login' && $login) {
                                                             wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $login)));
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                         if (is_multisite()) {
                                             if (!is_main_site() && strtotime($user->user_registered) >= strtotime('-10 seconds')) {
                                                 remove_user_from_blog($user_id, $current_site->blog_id);
                                             }
                                             // No Main Site Role.
                                             if (!get_user_meta($user_id, 's2member_originating_blog', TRUE)) {
                                                 // Recorded yet?
                                                 update_user_meta($user_id, 's2member_originating_blog', $current_blog->blog_id);
                                             }
                                         }
                                         if ($current_role !== $role) {
                                             // Only if NOT the current Role.
                                             $user->set_role($role);
                                         }
                                         // s2Member.
                                         if ($ccaps && preg_match('/^-all/', str_replace('+', '', $ccaps))) {
                                             foreach ($user->allcaps as $cap => $cap_enabled) {
                                                 if (preg_match('/^access_s2member_ccap_/', $cap)) {
                                                     $user->remove_cap($ccap = $cap);
                                                 }
                                             }
                                         }
                                         if ($ccaps && preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $ccaps))) {
                                             foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $ccaps))) as $ccap) {
                                                 if (strlen($ccap = trim(strtolower(preg_replace('/[^a-z_0-9]/i', '', $ccap))))) {
                                                     $user->add_cap('access_s2member_ccap_' . $ccap);
                                                 }
                                             }
                                         }
                                         if (!($fields = array()) && $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields']) {
                                             foreach (json_decode($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields'], TRUE) as $field) {
                                                 $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
                                                 $field_id_class = preg_replace('/_/', '-', $field_var);
                                                 if (isset($_pmr['ws_plugin__s2member_custom_reg_field_' . $field_var])) {
                                                     $fields[$field_var] = $_pmr['ws_plugin__s2member_custom_reg_field_' . $field_var];
                                                 }
                                             }
                                         }
                                         unset($field, $field_var, $field_id_class);
                                         // Housekeeping.
                                         if (!empty($fields)) {
                                             // Only if NOT empty.
                                             update_user_option($user_id, 's2member_custom_fields', $fields);
                                         }
                                         if ($level > 0) {
                                             $pr_times = get_user_option('s2member_paid_registration_times', $user_id);
                                             $pr_times['level'] = empty($pr_times['level']) ? time() : $pr_times['level'];
                                             $pr_times['level' . $level] = empty($pr_times['level' . $level]) ? time() : $pr_times['level' . $level];
                                             update_user_option($user_id, 's2member_paid_registration_times', $pr_times);
                                             // Update now.
                                         }
                                         if (!is_multisite() && c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_register_page()) {
                                             update_user_option($user_id, 's2member_bp_activation_role', $role);
                                             update_user_option($user_id, 's2member_bp_activation_ccaps', c_ws_plugin__s2member_user_access::user_access_ccaps($user));
                                         }
                                         foreach (array_keys(get_defined_vars()) as $__v) {
                                             $__refs[$__v] =& ${$__v};
                                         }
                                         do_action('ws_plugin__s2member_during_configure_user_registration_front_side_free', get_defined_vars());
                                         do_action('ws_plugin__s2member_during_configure_user_registration_front_side', get_defined_vars());
                                         unset($__refs, $__v);
                                     } else {
                                         if (is_blog_admin() && $pagenow === 'user-new.php' || c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user')) {
                                             // Can only be processed through `/user-new.php` in the Admin panel, or through Remote Op: `create_user`.
                                             $processed = 'yes';
                                             // Mark this as yes, to indicate that a routine was processed.
                                             $current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
                                             $role = '';
                                             // Initialize $role to an empty string here, before processing.
                                             $role = !$role && ($level = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_level']) > 0 ? 's2member_level' . $level : $role;
                                             $role = !$role && ($level = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_level']) === '0' ? 'subscriber' : $role;
                                             $role = !$role && $current_role ? $current_role : $role;
                                             // Use existing Role?
                                             $role = !$role ? get_option('default_role') : $role;
                                             // Otherwise default.
                                             $level = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_level'];
                                             $level = !$level && preg_match('/^(administrator|editor|author|contributor)$/i', $role) ? $GLOBALS['WS_PLUGIN__']['s2member']['c']['levels'] : $level;
                                             $level = !$level && preg_match('/^s2member_level[1-9][0-9]*$/i', $role) ? preg_replace('/^s2member_level/', '', $role) : $level;
                                             $level = !$level && preg_match('/^subscriber$/i', $role) ? '0' : $level;
                                             $level = !$level ? '0' : $level;
                                             $ccaps = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_ccaps'];
                                             $email = $user->user_email;
                                             $login = $user->user_login;
                                             $ip = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_registration_ip'];
                                             $custom = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_custom'];
                                             $subscr_id = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_id'];
                                             $subscr_baid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_baid'];
                                             $subscr_cid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_cid'];
                                             $subscr_gateway = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway'];
                                             $cv = preg_split('/\\|/', (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_custom']);
                                             $auto_eot_time = ($eot = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time']) ? strtotime($eot) : '';
                                             $notes = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_notes'];
                                             $opt_in = !empty($_pmr['ws_plugin__s2member_custom_reg_field_opt_in']) ? TRUE : FALSE;
                                             if (!($fname = $user->first_name)) {
                                                 // `Users → Add New`.
                                                 if (!empty($_pmr['ws_plugin__s2member_custom_reg_field_first_name'])) {
                                                     $fname = (string) $_pmr['ws_plugin__s2member_custom_reg_field_first_name'];
                                                 }
                                             }
                                             if (!($lname = $user->last_name)) {
                                                 // `Users → Add New`.
                                                 if (!empty($_pmr['ws_plugin__s2member_custom_reg_field_last_name'])) {
                                                     $lname = (string) $_pmr['ws_plugin__s2member_custom_reg_field_last_name'];
                                                 }
                                             }
                                             if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_names'] && !$fname && $login) {
                                                 $fname = trim($login);
                                                 $lname = '';
                                                 // Username and empty Last Name.
                                             }
                                             $name = trim($fname . ' ' . $lname);
                                             // Both names.
                                             if (!($pass = $password)) {
                                                 // Try s2Member's generator.
                                                 if (!empty($GLOBALS['ws_plugin__s2member_plain_text_pass'])) {
                                                     $pass = (string) $GLOBALS['ws_plugin__s2member_plain_text_pass'];
                                                 }
                                             }
                                             if (!$pass) {
                                                 // Also try the `Users → Add New` form.
                                                 if (!empty($_pmr['pass1'])) {
                                                     // Field in `/user-new.php`.
                                                     $pass = (string) $_pmr['pass1'];
                                                 }
                                             }
                                             if ($pass) {
                                                 !headers_sent() ? delete_user_setting('default_password_nag', $user_id) : NULL;
                                                 update_user_option($user_id, 'default_password_nag', FALSE, TRUE);
                                             }
                                             update_user_option($user_id, 's2member_registration_ip', $ip);
                                             update_user_option($user_id, 's2member_auto_eot_time', $auto_eot_time);
                                             update_user_option($user_id, 's2member_subscr_gateway', $subscr_gateway);
                                             update_user_option($user_id, 's2member_subscr_id', $subscr_id);
                                             update_user_option($user_id, 's2member_subscr_baid', $subscr_baid);
                                             update_user_option($user_id, 's2member_subscr_cid', $subscr_cid);
                                             update_user_option($user_id, 's2member_custom', $custom);
                                             update_user_option($user_id, 's2member_notes', $notes);
                                             if (!$user->first_name && $fname) {
                                                 update_user_meta($user_id, 'first_name', $fname);
                                             }
                                             if (!$user->last_name && $lname) {
                                                 update_user_meta($user_id, 'last_name', $lname);
                                             }
                                             if (!$user->display_name || $user->display_name === $user->user_login) {
                                                 if ($custom_reg_display_name === 'full' && $name) {
                                                     wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $name)));
                                                 } else {
                                                     if ($custom_reg_display_name === 'first' && $fname) {
                                                         wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $fname)));
                                                     } else {
                                                         if ($custom_reg_display_name === 'last' && $lname) {
                                                             wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $lname)));
                                                         } else {
                                                             if ($custom_reg_display_name === 'login' && $login) {
                                                                 wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $login)));
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                             if (is_multisite()) {
                                                 if (!is_main_site() && strtotime($user->user_registered) >= strtotime('-10 seconds')) {
                                                     remove_user_from_blog($user_id, $current_site->blog_id);
                                                 }
                                                 // No Main Site Role.
                                                 if (!get_user_meta($user_id, 's2member_originating_blog', TRUE)) {
                                                     // Recorded yet?
                                                     update_user_meta($user_id, 's2member_originating_blog', $current_blog->blog_id);
                                                 }
                                             }
                                             if ($current_role !== $role) {
                                                 // Only if NOT the current Role.
                                                 $user->set_role($role);
                                             }
                                             // s2Member.
                                             if ($ccaps && preg_match('/^-all/', str_replace('+', '', $ccaps))) {
                                                 foreach ($user->allcaps as $cap => $cap_enabled) {
                                                     if (preg_match('/^access_s2member_ccap_/', $cap)) {
                                                         $user->remove_cap($ccap = $cap);
                                                     }
                                                 }
                                             }
                                             if ($ccaps && preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $ccaps))) {
                                                 foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', preg_replace('/^-all[' . "\r\n\t" . '\\s;,]*/', '', str_replace('+', '', $ccaps))) as $ccap) {
                                                     if (strlen($ccap = trim(strtolower(preg_replace('/[^a-z_0-9]/i', '', $ccap))))) {
                                                         $user->add_cap('access_s2member_ccap_' . $ccap);
                                                     }
                                                 }
                                             }
                                             if (!($fields = array()) && $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields']) {
                                                 foreach (json_decode($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields'], TRUE) as $field) {
                                                     $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
                                                     $field_id_class = preg_replace('/_/', '-', $field_var);
                                                     if (isset($_pmr['ws_plugin__s2member_custom_reg_field_' . $field_var])) {
                                                         $fields[$field_var] = $_pmr['ws_plugin__s2member_custom_reg_field_' . $field_var];
                                                     }
                                                 }
                                             }
                                             unset($field, $field_var, $field_id_class);
                                             // Housekeeping.
                                             if (!empty($fields)) {
                                                 // Only if NOT empty.
                                                 update_user_option($user_id, 's2member_custom_fields', $fields);
                                             }
                                             if ($level > 0) {
                                                 $pr_times = get_user_option('s2member_paid_registration_times', $user_id);
                                                 $pr_times['level'] = empty($pr_times['level']) ? time() : $pr_times['level'];
                                                 $pr_times['level' . $level] = empty($pr_times['level' . $level]) ? time() : $pr_times['level' . $level];
                                                 update_user_option($user_id, 's2member_paid_registration_times', $pr_times);
                                                 // Update now.
                                             }
                                             foreach (array_keys(get_defined_vars()) as $__v) {
                                                 $__refs[$__v] =& ${$__v};
                                             }
                                             do_action('ws_plugin__s2member_during_configure_user_registration_admin_side', get_defined_vars());
                                             unset($__refs, $__v);
                                         }
                                     }
                                 }
                                 if ($processed === 'yes') {
                                     /**
                                      * If processed, all of these will have been defined by now.
                                      *
                                      * @var $role string Reference for IDEs.
                                      * @var $level string Reference for IDEs.
                                      * @var $ccaps string Reference for IDEs.
                                      * @var $auto_eot_time string|integer Reference for IDEs.
                                      * @var $fname string Reference for IDEs.
                                      * @var $lname string Reference for IDEs.
                                      * @var $name string Reference for IDEs.
                                      * @var $email string Reference for IDEs.
                                      * @var $login string Reference for IDEs.
                                      * @var $pass string Reference for IDEs.
                                      * @var $ip string Reference for IDEs.
                                      * @var $opt_in boolean Reference for IDEs.
                                      * @var $fields array Reference for IDEs.
                                      */
                                     if ($urls = $GLOBALS['WS_PLUGIN__']['s2member']['o']['registration_notification_urls']) {
                                         foreach (preg_split('/[' . "\r\n\t" . ']+/', $urls) as $url) {
                                             // Notify each of the URLs.
                                             if ($url = preg_replace('/%%cv([0-9]+)%%/ei', 'urlencode(trim(@$cv[$1]))', $url)) {
                                                 if ($url = preg_replace('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($role)), $url)) {
                                                     if ($url = preg_replace('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($level)), $url)) {
                                                         if ($url = preg_replace('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($ccaps)), $url)) {
                                                             if ($url = preg_replace('/%%auto_eot_time%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($auto_eot_time)), $url)) {
                                                                 if ($url = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($fname)), $url)) {
                                                                     if ($url = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($lname)), $url)) {
                                                                         if ($url = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($name)), $url)) {
                                                                             if ($url = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($email)), $url)) {
                                                                                 if ($url = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($login)), $url)) {
                                                                                     if ($url = preg_replace('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($pass)), $url)) {
                                                                                         if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($ip)), $url)) {
                                                                                             if ($url = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_id)), $url)) {
                                                                                                 foreach ($fields as $var => $val) {
                                                                                                     // Custom Fields.
                                                                                                     if (!($url = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(maybe_serialize($val))), $url))) {
                                                                                                         break;
                                                                                                     }
                                                                                                 }
                                                                                                 if ($url = trim(preg_replace('/%%(.+?)%%/i', '', $url))) {
                                                                                                     c_ws_plugin__s2member_utils_urls::remote($url);
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     unset($urls, $url, $var, $val);
                                     // Housekeeping.
                                     if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['registration_notification_recipients']) {
                                         $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status();
                                         c_ws_plugin__s2member_email_configs::email_config_release();
                                         $msg = $sbj = '(s2Member / API Notification Email) - Registration';
                                         $msg .= "\n\n";
                                         // Spacing in the message body.
                                         $msg .= 'role: %%role%%' . "\n";
                                         $msg .= 'level: %%level%%' . "\n";
                                         $msg .= 'ccaps: %%ccaps%%' . "\n";
                                         $msg .= 'auto_eot_time: %%auto_eot_time%%' . "\n";
                                         $msg .= 'user_first_name: %%user_first_name%%' . "\n";
                                         $msg .= 'user_last_name: %%user_last_name%%' . "\n";
                                         $msg .= 'user_full_name: %%user_full_name%%' . "\n";
                                         $msg .= 'user_email: %%user_email%%' . "\n";
                                         $msg .= 'user_login: %%user_login%%' . "\n";
                                         $msg .= 'user_pass: %%user_pass%%' . "\n";
                                         $msg .= 'user_ip: %%user_ip%%' . "\n";
                                         $msg .= 'user_id: %%user_id%%' . "\n";
                                         foreach ($fields as $var => $val) {
                                             $msg .= $var . ': %%' . $var . '%%' . "\n";
                                         }
                                         $msg .= 'cv0: %%cv0%%' . "\n";
                                         $msg .= 'cv1: %%cv1%%' . "\n";
                                         $msg .= 'cv2: %%cv2%%' . "\n";
                                         $msg .= 'cv3: %%cv3%%' . "\n";
                                         $msg .= 'cv4: %%cv4%%' . "\n";
                                         $msg .= 'cv5: %%cv5%%' . "\n";
                                         $msg .= 'cv6: %%cv6%%' . "\n";
                                         $msg .= 'cv7: %%cv7%%' . "\n";
                                         $msg .= 'cv8: %%cv8%%' . "\n";
                                         $msg .= 'cv9: %%cv9%%';
                                         if ($msg = preg_replace('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)) {
                                             if ($msg = preg_replace('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($role), $msg)) {
                                                 if ($msg = preg_replace('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($level), $msg)) {
                                                     if ($msg = preg_replace('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($ccaps), $msg)) {
                                                         if ($msg = preg_replace('/%%auto_eot_time%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($auto_eot_time), $msg)) {
                                                             if ($msg = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($fname), $msg)) {
                                                                 if ($msg = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($lname), $msg)) {
                                                                     if ($msg = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($name), $msg)) {
                                                                         if ($msg = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($email), $msg)) {
                                                                             if ($msg = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($login), $msg)) {
                                                                                 if ($msg = preg_replace('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($pass), $msg)) {
                                                                                     if ($msg = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($ip), $msg)) {
                                                                                         if ($msg = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs($user_id), $msg)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 // Custom Fields.
                                                                                                 if (!($msg = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(maybe_serialize($val)), $msg))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                             if ($sbj && ($msg = trim(preg_replace('/%%(.+?)%%/i', '', $msg)))) {
                                                                                                 // Still have a ``$sbj`` and a ``$msg``?
                                                                                                 foreach (c_ws_plugin__s2member_utils_strings::parse_emails($GLOBALS['WS_PLUGIN__']['s2member']['o']['registration_notification_recipients']) as $recipient) {
                                                                                                     wp_mail($recipient, apply_filters('ws_plugin__s2member_registration_notification_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_registration_notification_email_msg', $msg, get_defined_vars()), 'Content-Type: text/plain; charset=UTF-8');
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                         if ($email_configs_were_on) {
                                             // Back on?
                                             c_ws_plugin__s2member_email_configs::email_config();
                                         }
                                         unset($sbj, $msg, $var, $val, $recipient, $email_configs_were_on);
                                         // Housekeeping.
                                     }
                                     if (!empty($GLOBALS['ws_plugin__s2member_registration_return_url']) && ($url = $GLOBALS['ws_plugin__s2member_registration_return_url'])) {
                                         if ($url = preg_replace('/%%cv([0-9]+)%%/ei', 'urlencode(trim(@$cv[$1]))', $url)) {
                                             if ($url = preg_replace('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($role)), $url)) {
                                                 if ($url = preg_replace('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($level)), $url)) {
                                                     if ($url = preg_replace('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($ccaps)), $url)) {
                                                         if ($url = preg_replace('/%%auto_eot_time%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($auto_eot_time)), $url)) {
                                                             if ($url = preg_replace('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($fname)), $url)) {
                                                                 if ($url = preg_replace('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($lname)), $url)) {
                                                                     if ($url = preg_replace('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($name)), $url)) {
                                                                         if ($url = preg_replace('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($email)), $url)) {
                                                                             if ($url = preg_replace('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($login)), $url)) {
                                                                                 if ($url = preg_replace('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($pass)), $url)) {
                                                                                     if ($url = preg_replace('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($ip)), $url)) {
                                                                                         if ($url = preg_replace('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode($user_id)), $url)) {
                                                                                             foreach ($fields as $var => $val) {
                                                                                                 // Custom Fields.
                                                                                                 if (!($url = preg_replace('/%%' . preg_quote($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(urlencode(maybe_serialize($val))), $url))) {
                                                                                                     break;
                                                                                                 }
                                                                                             }
                                                                                             if ($url = trim($url)) {
                                                                                                 // Preserve remaining Replacements; because the parent routine may perform replacements too.
                                                                                                 $GLOBALS['ws_plugin__s2member_registration_return_url'] = $url;
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     unset($url, $var, $val);
                                     // Housekeeping.
                                     c_ws_plugin__s2member_list_servers::process_list_servers($role, $level, $login, $pass, $email, $fname, $lname, $ip, $opt_in, TRUE, $user_id);
                                     /*
                                     Suppress errors here in case this routine is fired in unexpected locations; or with odd output buffering techniques.
                                     	@TODO It may also be impossible to delete cookies when fired inside: `/wp-activate.php`.
                                     */
                                     if (!headers_sent()) {
                                         @setcookie('s2member_subscr_gateway', '', time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie('s2member_subscr_gateway', '', time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                         @setcookie('s2member_subscr_id', '', time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie('s2member_subscr_id', '', time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                         @setcookie('s2member_custom', '', time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie('s2member_custom', '', time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                         @setcookie('s2member_item_number', '', time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie('s2member_item_number', '', time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                                     }
                                     /* If debugging/logging is enabled; we need to append ``$reg_vars`` to the log file.
                                     			Logging now supports Multisite Networking as well. */
                                     $reg_vars = get_defined_vars();
                                     // All defined vars.
                                     $reg_vars['_COOKIE'] = $_COOKIE;
                                     // Record cookies also.
                                     // No need to include these in the logs. Unset before log entry.
                                     unset($reg_vars['wpdb'], $reg_vars['current_site'], $reg_vars['current_blog']);
                                     c_ws_plugin__s2member_utils_logs::log_entry('reg-handler', $reg_vars);
                                     foreach (array_keys(get_defined_vars()) as $__v) {
                                         $__refs[$__v] =& ${$__v};
                                     }
                                     do_action('ws_plugin__s2member_during_configure_user_registration', get_defined_vars());
                                     unset($__refs, $__v);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_after_configure_user_registration', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
 }
Ejemplo n.º 28
0
 /**
  * Stops anyone attempting a Brute Force attack.
  *
  * Prevents an attacker from guessing Usernames/Passwords.
  * Allows only 5 failed login attempts every 30 minutes.
  *
  * @package s2Member\Brute_Force
  * @since 3.5
  *
  * @attaches-to ``add_filter('authenticate');``
  *
  * @param WP_User $user Expects a WP_User object, or possibly a null value.
  *   This parameter value is simply passed through this routine.
  *
  * @return WP_User|null Either null, the ``$user`` obj, or a `WP_Error` obj.
  */
 public static function stop_brute_force_logins($user = NULL)
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_stop_brute_force_logins', get_defined_vars());
     unset($__refs, $__v);
     if ($max = $GLOBALS['WS_PLUGIN__']['s2member']['o']['max_failed_login_attempts']) {
         $ip = $_SERVER['REMOTE_ADDR'];
         // Default value.
         if (!empty($GLOBALS['s2member_pro_remote_op_auth_check_user_ip']) && c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op('auth_check_user')) {
             $ip = $GLOBALS['s2member_pro_remote_op_auth_check_user_ip'];
         }
         if ((int) get_transient('s2m_ipr_' . md5('s2member_transient_failed_login_attempts_' . $ip)) > $max) {
             $exp_secs = strtotime('+' . apply_filters('ws_plugin__s2member_track_failed_logins__exp_time', '30 minutes', get_defined_vars())) - time();
             // If you add Filters to this value, you should use a string that is compatible with PHP's strtotime() function.
             $about = c_ws_plugin__s2member_utils_time::approx_time_difference(time(), time() + $exp_secs);
             $errors = new WP_Error('incorrect_password', sprintf(_x('Max failed logins. Please wait %s and try again.', 's2member-front', 's2member'), $about));
             foreach (array_keys(get_defined_vars()) as $__v) {
                 $__refs[$__v] =& ${$__v};
             }
             do_action('ws_plugin__s2member_during_stop_brute_force_logins', get_defined_vars());
             unset($__refs, $__v);
         }
     }
     return apply_filters('ws_plugin__s2member_stop_brute_force_logins', !empty($errors) ? $errors : $user, get_defined_vars());
 }
Ejemplo n.º 29
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>Restriction Options</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form" autocomplete="off">' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-options-save")) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n";
     do_action("ws_plugin__s2member_during_res_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_post_level_access", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_post_level_access", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Post Access Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-post-level-access-section">' . "\n";
         echo '<h3>Post Level Access Restrictions (optional)</h3>' . "\n";
         echo '<p>Here you can specify Posts that are restricted to certain Membership Access Levels. s2Member also supports Custom <a href="http://codex.wordpress.org/Post_Types" target="_blank" rel="external">Post Types</a> here. If you have a theme or plugin installed, which has enabled Custom Post Types <em>(i.e., Music/Videos or something else)</em>, you can put the IDs for those Posts here.</p>' . "\n";
         echo '<p><strong>What do I enter?</strong> Post IDs in comma-delimited format. Example: <code>1,2,3,84,8,21</code>. Or, you can type: <code>all</code> <em>(to protect all Posts, of any type)</em>. You can also include all Post IDs of a specific <a href="http://codex.wordpress.org/Post_Types" target="_blank" rel="external">Post Type</a>. e.g., <code>1,2,3,all-newspapers</code> <em>(protects several Post IDs, and all Posts of type: <code>newspaper</code>)</em>.</p>' . "\n";
         echo '<p><em><strong>Note:</strong> Protecting individual Posts, <strong>only</strong> protects the Permalinks for those Posts. It is still possible for excerpts of protected content to be seen in search results generated by WordPress, feeds, and Archive views; such as your Home Page, inside a Category listing, or through other queries formulated by your theme. This is the intended functionality. Excerpts are a great way to "tease" public visitors. In other words, public visitors may have access to excerpts introduced by your theme, but any attempt to view the full Post (i.e., the Permalink) will result in an automatic redirect to your Membership Options Page; requiring registration.</em></p>' . "\n";
         echo '<p><em><strong>Note:</strong> If you would like to protect many Posts at once (including Archive views), you can use Category Level Restrictions, Tag Level Restrictions, or have a look down below at s2Member\'s options for "Alternative View Protection", which deals with search results, as well as feeds.</em></p>' . "\n";
         echo (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) && empty($GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>Tip:</strong> Can\'t find your Post IDs? Get <a href="http://wordpress.org/extend/plugins/wp-show-ids/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_post_level_access", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-posts">' . "\n";
             echo $n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? 'Posts That Require Highest Level #' . $n . ':' . "\n" : 'Posts That Require Level #' . $n . ' Or Higher:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_posts" id="ws-plugin--s2member-level' . $n . '-posts" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]) . '" />' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_post_level_access", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_page_level_access", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_page_level_access", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Page Access Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-page-level-access-section">' . "\n";
         echo '<h3>Page Level Access Restrictions (optional)</h3>' . "\n";
         echo '<p>Here you can specify Pages that are restricted to certain Membership Access Levels.</p>' . "\n";
         echo '<p><strong>What do I enter?</strong> Page IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code>. Or, you can type: <code>all</code> <em>(to protect all Pages)</em>.</p>' . "\n";
         echo (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) && empty($GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>Tip:</strong> Can\'t find your Page IDs? Get <a href="http://wordpress.org/extend/plugins/wp-show-ids/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_page_level_access", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-pages">' . "\n";
             echo $n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? 'Pages That Require Highest Level #' . $n . ':' . "\n" : 'Pages That Require Level #' . $n . ' Or Higher:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_pages" id="ws-plugin--s2member-level' . $n . '-pages" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]) . '" />' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_page_level_access", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_tag_level_access", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_tag_level_access", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Tag Access Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-tag-level-access-section">' . "\n";
         echo '<h3>Tag Level Access Restrictions (optional)</h3>' . "\n";
         echo '<p>Here you can specify Tags that are restricted to certain Membership Access Levels. This is similar to Category Level Access. When you restrict access to a Tag Archive, it also restricts access to any Post having that Tag; even if a Post has other Tags. <strong>Tip:</strong> Tags can be applied to any Post, without affecting your Category structure at all. If you\'d like to use Tags with Pages get the <a href="https://wordpress.org/plugins/tag-pages/" target="_blank" rel="external">Tag Pages</a> plugin.</p>' . "\n";
         echo '<p><strong>What do I enter?</strong> Tags in comma-delimited format. Example: <code>members, members only, free subscribers, premium</code>. Or, you can type: <code>all</code> <em>(to protect all Tags)</em>. <strong>Note:</strong> tags are caSe sensitive. The Tag <code>members only</code> is not the same as <code>Members Only</code>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_tag_level_access", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-ptags">' . "\n";
             echo $n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? 'Tags That Require Highest Level #' . $n . ':' . "\n" : 'Tags That Require Level #' . $n . ' Or Higher:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_ptags" id="ws-plugin--s2member-level' . $n . '-ptags" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"]) . '" />' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_tag_level_access", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_category_level_access", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_category_level_access", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Category Access Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-category-level-access-section">' . "\n";
         echo '<h3>Category Level Access Restrictions (optional)</h3>' . "\n";
         echo '<p>Here you can specify Categories that are restricted to certain Membership Access Levels. Category restrictions are a bit more complex. When you restrict access to a Category, it also restricts access to any child Categories it may have <em>(aka: sub-Categories)</em>. In other words, restricting a Category protects a Category Archive, all of its child Category Archives, and any Posts contained within the Category or its child Categories. This is a very powerful form of protection, so please be careful. It\'s very easy to protect too much content by accident.</p>' . "\n";
         echo '<p><strong>What do I enter?</strong> Category IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code>. Or, you can type: <code>all</code> <em>(to protect all Categories)</em>.</p>' . "\n";
         echo (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) && empty($GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>Tip:</strong> Can\'t find your Category IDs? Get <a href="http://wordpress.org/extend/plugins/wp-show-ids/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_category_level_access", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-catgs">' . "\n";
             echo $n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? 'Categories That Require Highest Level #' . $n . ':' . "\n" : 'Categories That Require Level #' . $n . ' Or Higher:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_catgs" id="ws-plugin--s2member-level' . $n . '-catgs" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]) . '" />' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_category_level_access", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_uri_level_access", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_uri_level_access", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="URI Restrictions (typical w/BuddyPress)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-uri-level-access-section">' . "\n";
         echo '<h3>URI Level Access Restrictions (optional)</h3>' . "\n";
         echo '<p>Here you can specify URIs (or word fragments found in URIs) that are restricted to certain Membership Access Levels. Control over URIs is a little more complex. This section is intended for advanced webmasters only. A <code>REQUEST_URI</code> is the portion of a <code>URL</code> that comes immediately after the domain. This is a URL <code>http://www.example.com/path/to/file.php</code>, and this is the URI: <code>/path/to/file.php</code>. In other words, a <code>REQUEST_URI</code> is the full path to a real <em>(or virtual)</em> directory and/or file on your domain. s2Member can match a URI in whole, or in part.</p>' . "\n";
         echo '<p><strong>What do I enter?</strong> In the fields below, you can provide a list of URIs <strong>(one per line; i.e., line-delimited)</strong> that should be off-limits based on Membership Level. You can also use word fragments instead of a full URI. If a word fragment is found anywhere in the URI, it will be protected. Wildcards and other regex patterns are <em>not</em> supported here, and therefore you don\'t need to escape special characters or anything. Please note, depending on your caSe configuration option (as seen below), your exclusion patterns might be caSe sensitive. If you choose to make these caSe sensitive, you must be specific. The word fragment <code>some-path/</code> would not match a URI that contains <code>some-Path/</code>.</p>' . "\n";
         echo '<p><em><strong>Replacement Codes:</strong> A few <a href="#" onclick="alert(\'URI Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s Username, lowercase (deprecated, please use %%current_user_nicename%%).\\n\\n%%current_user_nicename%% = The current User\\\'s Nicename in lowercase format (i.e., a cleaner version of the username for URLs; recommended for best compatibility).\\n\\n%%current_user_id%% = The current User\\\'s ID.\\n\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\n%%current_user_role%% = The current User\\\'s WordPress Role.' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '\\n\\n%%current_user_ccaps%% = The current User\\\'s Custom Capabilities.' : '') . '\\n\\n%%current_user_logins%% = Number of times the current User has logged in.\\n\\nFor example, if you\\\'re using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: /members/%%current_user_nicename%%/groups/\'); return false;">Replacement Codes</a> are also supported here.</em></p>' . "\n";
         echo '<p><em><strong>BuddyPress (and similar):</strong> URI Restrictions work great with plugins like BuddyPress that add new areas to your site (where those new areas are not necessarily a Post/Page/Tag/Category). In other words, anytime you\'d like to protect a specific feature offered by BuddyPress (or other plugins), you\'ll need to nail-down specific word fragments found in the URIs associated with those areas. For instance, with BuddyPress you might have something like: [<a href="#" onclick="alert(\'/members/\\n/groups/\\n/blogs/\\n/activity/\\n/messages/\\n/profile/\\n/friends/\\n/settings/\'); return false;">click for example</a>].</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_uri_level_access", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-ruris-case-sensitive">' . "\n";
         echo 'URI Restrictions caSe Sensitive?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_ruris_case_sensitive" id="ws-plugin--s2member-ruris-case-sensitive">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ruris_case_sensitive"] ? ' selected="selected"' : '') . '>No (caSe-insensitive; recommended)</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ruris_case_sensitive"] ? ' selected="selected"' : '') . '>Yes (caSe-sensitive; e.g., /some-path/ is not the same as /some-Path/)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting: (<code>No; caSe-insensitive</code>)' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-ruris">' . "\n";
             echo $n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? 'URIs That Require Highest Level #' . $n . ':' . "\n" : 'URIs That Require Level #' . $n . ' Or Higher:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<textarea name="ws_plugin__s2member_level' . $n . '_ruris" id="ws-plugin--s2member-level' . $n . '-ruris" rows="3" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"]) . '</textarea>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_uri_level_access", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_query_level_access", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_query_level_access", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Alternative View Protection (feeds, search results, etc.)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-query-level-access-section">' . "\n";
         echo '<h3>Alternative View Protection (optional)</h3>' . "\n";
         echo '<p>s2Member protects Categories, Tags, Posts, Pages, Files, URIs &amp; more. However, even with all of those security restrictions, it\'s still possible for protected content excerpts to be seen through XML feeds, in search results generated by WordPress; and/or (depending on your theme), possibly in other Archive views; which might include things like: Posts by Author, Posts by Date, a list of featured items formulated by your theme; or even through other widgets/plugins adding functionality to your site. We refer to all of these collectively, as "Alternative Views".</p>' . "\n";
         echo '<p>Using the options below, you can tell s2Member to protect some (or all) of these "Alternative Views" by filtering WordPress database queries for you. s2Member can automatically hide protected content that is not available to the current User/Member. In other words, s2Member is capable of pre-filtering all database queries so that excerpts of protected content will not be allowed to slip through.</p>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_uri_level_access", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-filter-wp-query">' . "\n";
         echo 'Protect Alternative Views?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<div class="ws-menu-page-scrollbox" style="height:105px;">' . "\n";
         echo '<input type="hidden" name="ws_plugin__s2member_filter_wp_query[]" value="update-signal" />' . "\n";
         foreach (array("all" => "<strong>Filter ALL WordPress queries</strong>; protecting all Alternative Views.", "searches" => "&#9492;&#9472; Searches (hide protected content in search results)", "feeds" => "&#9492;&#9472; Feeds (hide protected content in standard XML/RSS/ATOM feeds)", "comment-feeds" => "&#9492;&#9472; Comment Feeds (hide comments associated with protected content, in comment feeds)", "nav-menus" => "&#9492;&#9472; Nav Menus (hide protected content in menus generated with <em>WordPress → Appearance → Menus</em>)", "pages" => "&#9492;&#9472; Pages (hide protected content in widgets that list Pages)") as $ws_plugin__s2member_temp_s_value => $ws_plugin__s2member_temp_s_label) {
             echo '<input type="checkbox" name="ws_plugin__s2member_filter_wp_query[]" id="ws-plugin--s2member-filter-wp-query-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__s2member_temp_s_value)) . '" value="' . esc_attr($ws_plugin__s2member_temp_s_value) . '"' . (in_array($ws_plugin__s2member_temp_s_value, $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["filter_wp_query"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-filter-wp-query-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__s2member_temp_s_value)) . '">' . $ws_plugin__s2member_temp_s_label . '</label><br />' . "\n";
         }
         echo '</div>' . "\n";
         echo '<strong>Attn Developers:</strong> Filters can be suppressed dynamically using this technique:<br />' . "\n";
         echo '<code><a href="http://codex.wordpress.org/Function_Reference/query_posts" target="_blank" rel="external">query_posts</a>("suppress_filters=true");</code><br />' . "\n";
         echo '<code><a href="http://codex.wordpress.org/Function_Reference/get_posts" target="_blank" rel="external">get_posts</a>()</code> auto-suppresses filters.<br />' . "\n";
         echo 'Also see <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_attach_s2member_query_filters()" target="_blank" rel="external">this article</a> in the s2Member Codex.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_query_level_access", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_conditionals", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_conditionals", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Simple Shortcode Conditionals (protect only parts of your content)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-conditionals-section">' . "\n";
         echo '<h3>Simple Shortcode Conditionals (optional; to protect only parts of your content)</h3>' . "\n";
         echo '<p>s2Member makes it very easy to protect entire Posts, Pages, Categories, Tags, URIs, etc. This can be accomplished here in your WordPress Dashboard, using one of the many tools made available on this page. Or, from your Post/Page editing station in WordPress. We consider this to be point-and-click functionality—very easy. However, s2Member also makes it possible for you to protect "parts" of a Post or Page. You can even get creative about what you display to certain Users/Members, based upon your own custom criteria. s2Member\'s Simple Shortcode Conditionals are the key to accomplishing this.</p>' . "\n";
         echo '<p>Please see this KB article to learn more about <code>[s2If /]</code>: <a href="http://www.s2member.com/kb/simple-shortcode-conditionals/" target="_blank" rel="external">s2Member Simple Shortcode Conditionals</a></p>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_conditionals", get_defined_vars());
         echo '</div>' . "\n";
         if ((!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             echo '<h3>Arbitrary PHP Code via <code>[s2If php=&quot;&quot;]</code></h3>' . "\n";
             echo '<p>By default, the <code>[s2If]</code> Shortcode is limited to a specific set of Conditional Tags provided by WordPress and the s2Member plugin; e.g., <code>[s2If current_user_can(access_s2member_level1)]</code>; as one quick example. Arbitrary PHP code is not allowed with this syntax. However, a second syntax variation exists; where it <em>is</em> possible to use arbitrary PHP code (only if enabled below). The second syntax variation uses one <code>php</code> Shortcode Attribute to run a single conditional check; e.g., <code>[s2If php="is_user_logged_in() && current_user_can(\'access_s2member_ccap_music\')"]</code>. For developers, this has some obvious advantages. The code inside the <code>php</code> attribute is evaluated at runtime, so it\'s possible to accomplish more when necessary. Of course, you could also use a plugin like <a href="https://www.s2member.com/kb/ezphp-plugin/" target="_blank" rel="external">ezPHP</a> to accomplish the same thing (if you prefer).</p>' . "\n";
             echo '<table class="form-table">' . "\n";
             echo '<tbody>' . "\n";
             echo '<tr>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--s2member-sc-conds-allow-arbitrary-php">' . "\n";
             echo 'Allow Arbitrary PHP Code via the <code>[s2If php=&quot;&quot;]</code> Attribute?' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<select name="ws_plugin__s2member_sc_conds_allow_arbitrary_php" id="ws-plugin--s2member-sc-conds-allow-arbitrary-php">' . "\n";
             echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sc_conds_allow_arbitrary_php"] ? ' selected="selected"' : '') . '>No (recommended for best security; e.g., on sites with multiple authors/editors)</option>' . "\n";
             echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sc_conds_allow_arbitrary_php"] ? ' selected="selected"' : '') . '>Yes (allow me to use PHP via the [s2If php=&quot;&quot;][/s2If] shortcode)</option>' . "\n";
             echo '</select>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
             echo '</tbody>' . "\n";
             echo '</table>' . "\n";
         }
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_conditionals", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_sp_access", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_sp_access", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Specific Post/Page Access Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-access-section">' . "\n";
         echo '<h3>Specific Post/Page Access Restrictions (optional)</h3>' . "\n";
         echo '<p>s2Member now supports an additional layer of functionality that allows you to sell access to specific Posts/Pages that you\'ve created in WordPress. s2Member\'s "Specific Post/Page Access" works independently from Membership Level Access. That is, you can sell an unlimited number of Posts/Pages using "Buy Now" Buttons (or Pro-Forms; if you\'re running s2Member Pro)—your Customers will not be required to have a Membership Account with your site in order to receive access. If they are already a Member, that\'s fine, but they won\'t need to be.</p>' . "\n";
         echo '<p>In other words, Customers will not need to log in (or even have an account) to receive access to the Specific Post/Page they purchased access to. s2Member will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link (see: <strong>s2Member → PayPal Options → Specific Post/Page Email</strong>). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
         echo '<p>Specific Post/Page Access is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress. A Specific Post/Page that is protected by s2Member might contain a download link for your eBook, access to file &amp; music downloads, access to additional support services, and the list goes on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress Post/Page that you\'ve created.</p>' . "\n";
         echo '<p>Very simple. All you do is protect the Specific Post/Page IDs that are being sold on your site. Then, you can go to <strong>s2Member → PayPal Buttons → Specific Post/Page</strong> to generate "Buy Now" Buttons that you can insert into your WordPress Editor and make available on your site. The Button Generator for s2Member will even let you Package Additional Posts/Pages together into one transaction.</p>' . "\n";
         echo '<p><strong>What do I enter?</strong> Post/Page IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code>. <strong>Note:</strong> the word <code>all</code> does not work here. You must supply a list of Specific Post/Page IDs.</p>' . "\n";
         echo '<p><em><strong>Avoid Conflicts!</strong> Please be careful not to create a conflict with any of your other Access Restrictions. If you are going to sell Specific Post/Page Access you should enter specific Post/Page IDs that have not already been protected by other Restrictions (either directly or indirectly). In short, <strong>make sure that you haven\'t protected any of your Specific Posts/Pages with Member Level Access Restrictions already</strong>. If you configure s2Member in such as a way, that a Post/Page requires both Membership Level Access and Specific Post/Page Access too, you will create a conflict. Customers that purchase Specific Post/Page Access would be unable to access the Post/Page without also having a Membership.</em></p>' . "\n";
         echo (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) && empty($GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>Tip:</strong> Can\'t find your Post/Page IDs? Get <a href="http://wordpress.org/extend/plugins/wp-show-ids/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_sp_access", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-specific-ids">' . "\n";
         echo 'Specific Post/Page IDs Being Sold On Your Site:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_specific_ids" id="ws-plugin--s2member-specific-ids" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) . '" />' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_sp_access", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_brute_force_restrictions", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_brute_force_restrictions", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Brute Force IP/Login Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-brute-force-restrictions-section">' . "\n";
         echo '<h3>Brute Force IP/Login Restrictions (prevents username/password guessing)</h3>' . "\n";
         echo '<input type="button" id="ws-plugin--s2member-brute-force-restrictions-reset-button" value="Reset Brute Force Logs" class="ws-menu-page-right" style="min-width:175px;" />' . "\n";
         echo '<p>As with any Membership system, it is possible for someone to try and guess Username/Password combinations by attempting a <a href="https://en.wikipedia.org/wiki/Brute-force_attack" target="_blank" rel="external">Brute Force Attack</a>; whereby multiple/repeated logins are strategically attempted with various Username/Password combinations until a correct guess is made. It is not likely that you\'ll be attacked in this way, but it\'s still a good idea to protect your system; just in case somebody tries this. s2Member thwarts this behavior by monitoring failed login attempts that occur within a short period of time. Whenever s2Member detects an IP address <em>(i.e., a remote user)</em> that is consistently failing to enter a valid Username/Password, a temporary ban is created; preventing additional attempts from taking place for 30 minutes. This temporary ban, will only affect the offending IP address.</p>' . "\n";
         echo '<p><em><strong>Note:</strong> an empty IP address (associated with someone browsing anonymously) is also considered a unique IP address. This way it cannot circumvent s2Member\'s security.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_ip_restrictions", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-max-failed-login-attempts">' . "\n";
         echo 'Maximum Failed Login Attempts:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_max_failed_login_attempts" id="ws-plugin--s2member-max-failed-login-attempts">' . "\n";
         $ws_plugin__s2member_temp_s = apply_filters("ws_plugin__s2member_track_failed_logins__exp_time", "30 minutes");
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 1 ? ' selected="selected"' : '') . '>Allow 1 failed login attempt ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="2"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 2 ? ' selected="selected"' : '') . '>Allow 2 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="3"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 3 ? ' selected="selected"' : '') . '>Allow 3 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="4"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 4 ? ' selected="selected"' : '') . '>Allow 4 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="5"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 5 ? ' selected="selected"' : '') . '>Allow 5 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="10"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 10 ? ' selected="selected"' : '') . '>Allow 10 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="20"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 20 ? ' selected="selected"' : '') . '>Allow 20 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="30"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 30 ? ' selected="selected"' : '') . '>Allow 30 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="40"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 40 ? ' selected="selected"' : '') . '>Allow 40 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="50"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 50 ? ' selected="selected"' : '') . '>Allow 50 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="75"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 75 ? ' selected="selected"' : '') . '>Allow 75 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="100"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 100 ? ' selected="selected"' : '') . '>Allow 100 failed login attempts ( then punish for ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="0"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"] == 0 ? ' selected="selected"' : '') . '>Allow infinite failed logins (Brute Force Restrictions disabled)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'When/if you change this, you should also <strong>Reset Brute Force Logs</strong> (click button above).' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<br /><br />The default period of "30 minutes" could be modified through this WordPress Filter:<br /><code>ws_plugin__s2member_track_failed_logins__exp_time</code>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_ip_restrictions", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_ip_restrictions", TRUE, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_ip_restrictions", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Unique IP Access Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-ip-restrictions-section">' . "\n";
         echo '<h3>Unique IP Access Restrictions (prevents username/link sharing)</h3>' . "\n";
         echo '<input type="button" id="ws-plugin--s2member-ip-restrictions-reset-button" value="Reset IP Restriction Logs" class="ws-menu-page-right" style="min-width:175px;" />' . "\n";
         echo '<p>As with any Membership system, it is possible for one Member to signup, and then share their Username with someone else; or even post it online for the whole world to see. This is known as Link Sharing (or Username Sharing). It is not likely that you\'ll be attacked in this way, but it\'s still a good idea to protect your system; just in case somebody tries this. s2Member\'s IP Restrictions work for Membership Level Access (i.e., account logins), Specific Post/Page Access, Registration Links, and other secure Entry Points. In all cases, the rules are simple. A single Username, Access Link, and/or Entry Point is only valid for a certain number of unique IP addresses. Once that limit is reached, s2Member assumes there has been a security breach. At that time, s2Member will create a temporary ban; preventing access to a Specific Post/Page, or to an account associated with a particular Username. This temporary ban will only affect the offending Link and/or Username associated with the security breach. You can fine-tune this behavior using the options below.</p>' . "\n";
         echo '<p><em><strong>Note:</strong> an empty IP address (associated with someone browsing anonymously) is also considered a unique IP address. This way it cannot circumvent s2Member\'s security.</em></p>' . "\n";
         echo '<p><em><strong>Note:</strong> This feature can work with or without <strong>Simultaneous Login Monitoring</strong> (Simultaneous Login Monitoring is an s2Member Pro feature). You can choose to implement both Unique IP Access Restrictions and Simultaneous Login Monitoring together, just one of them, or neither. It\'s a matter of preference. Simultaneous Login Monitoring has the added benefit of not being dependent upon IP address tracking—making it more user-friendly and reliable. Particularly in cases where you\'d like to support users who might travel a lot, have multiple devices, or be on ISPs that change their IP address frequently.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_ip_restrictions", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-max-ip-restriction">' . "\n";
         echo 'Maximum Unique IP Addresses Allowed:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_max_ip_restriction" id="ws-plugin--s2member-max-ip-restriction">' . "\n";
         $ws_plugin__s2member_temp_s = apply_filters("ws_plugin__s2member_ip_restrictions__concurrency_time_per_ip", "30 days");
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 1 ? ' selected="selected"' : '') . '>Allow up to 1 unique IP per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="2"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 2 ? ' selected="selected"' : '') . '>Allow up to 2 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="3"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 3 ? ' selected="selected"' : '') . '>Allow up to 3 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="4"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 4 ? ' selected="selected"' : '') . '>Allow up to 4 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="5"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 5 ? ' selected="selected"' : '') . '>Allow up to 5 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="10"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 10 ? ' selected="selected"' : '') . '>Allow up to 10 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="20"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 20 ? ' selected="selected"' : '') . '>Allow up to 20 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="30"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 30 ? ' selected="selected"' : '') . '>Allow up to 30 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="40"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 40 ? ' selected="selected"' : '') . '>Allow up to 40 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="50"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 50 ? ' selected="selected"' : '') . '>Allow up to 50 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="75"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 75 ? ' selected="selected"' : '') . '>Allow up to 75 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="100"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 100 ? ' selected="selected"' : '') . '>Allow up to 100 different IPs per Customer ( every ' . $ws_plugin__s2member_temp_s . ' )</option>' . "\n";
         echo '<option value="0"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 0 ? ' selected="selected"' : '') . '>Allow infinite IPs (all IP Restrictions are disabled)</option>' . "\n";
         echo '</select>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<br />The default period of "30 days" could be modified through this WordPress Filter:<br /><code>ws_plugin__s2member_ip_restrictions__concurrency_time_per_ip</code>' . "\n" : '';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-max-ip-restriction-time">' . "\n";
         echo 'Security Breach Timeout Period:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_max_ip_restriction_time" id="ws-plugin--s2member-max-ip-restriction-time">' . "\n";
         echo '<option value="300"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 300 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 5 mins)</option>' . "\n";
         echo '<option value="900"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 900 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 15 mins)</option>' . "\n";
         echo '<option value="1800"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 1800 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 30 mins)</option>' . "\n";
         echo '<option value="3600"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 3600 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 1 hour)</option>' . "\n";
         echo '<option value="7200"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 7200 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 2 hours)</option>' . "\n";
         echo '<option value="14400"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 14400 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 4 hours)</option>' . "\n";
         echo '<option value="21600"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 21600 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 6 hours)</option>' . "\n";
         echo '<option value="28800"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 28800 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 8 hours)</option>' . "\n";
         echo '<option value="43200"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 43200 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 12 hours)</option>' . "\n";
         echo '<option value="86400"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 86400 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 24 hours)</option>' . "\n";
         echo '<option value="172800"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 172800 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 2 days)</option>' . "\n";
         echo '<option value="345600"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 345600 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 4 days)</option>' . "\n";
         echo '<option value="604800"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 604800 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 1 week)</option>' . "\n";
         echo '<option value="1209600"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 1209600 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 2 weeks)</option>' . "\n";
         echo '<option value="2629743"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 2629743 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 1 month)</option>' . "\n";
         echo '<option value="5259487"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 5259487 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 2 months)</option>' . "\n";
         echo '<option value="7889231"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 7889231 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 3 months)</option>' . "\n";
         echo '<option value="15778463"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 15778463 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 6 months)</option>' . "\n";
         echo '<option value="31556926"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction_time"] == 31556926 ? ' selected="selected"' : '') . '>If limit is exceeded (punish for 1 year)</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'When/if you change this, you should also <strong>Reset IP Restriction Logs</strong> (click button above).' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_ip_restrictions", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_res_ops_page_during_left_sections_display_slogin_restrictions", c_ws_plugin__s2member_utils_conds::pro_is_installed(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_before_slogin_restrictions", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Simultaneous Login Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-slogin-restrictions-section">' . "\n";
         echo '<h3>Simultaneous Login Restrictions (prevents username sharing)</h3>' . "\n";
         echo '<p>As with any Membership system, it is possible for one Member to signup, then share their Username with someone else; or even post it online for the whole world to see. This is known as Username Sharing. It is not likely that you\'ll be attacked in this way, but it\'s not a bad idea to protect your system; just in case somebody tries this.</p>' . "\n";
         echo '<p>s2Member\'s Simultaneous Login Monitoring (for Membership Access only) works with account logins (Usernames), to help you prevent a security issue. The rules are simple. A single Username can only have X number of simultaneous logins (as configured below). Once that limit is reached, s2Member assumes there has been a security breach. At that time, s2Member will create a temporary ban; preventing the offending Username from being able to log in until somebody else (who is already logged into the account) has logged-out; clearing the way for someone new.</p>' . "\n";
         echo '<p>This can be a tricky feature to configure, because most people do not click a "Logout" link when they are done with their account. This makes it challenging to know when someone is still logged-in, and when they\'re not. s2Member monitors simultaneous logins by updating a timer whenever someone actually logs in; and then again on each page view while they navigate the site. If there is no activity after X amount of time, s2Member\'s Simultaneous Login Monitor considers that person inactive, and will not include them in security checks until they log in again, or visit a new page on the site. You can configure the timeout period below. The default value is <code>30 minutes</code>.</p>' . "\n";
         echo '<p><em><strong>Note:</strong> This feature can work with or without <strong>Unique IP Restrictions</strong>. You can choose to implement both Unique IP Access Restrictions and Simultaneous Login Monitoring together, just one of them, or neither. It\'s a matter of preference. Simultaneous Login Monitoring has the added benefit of not being dependent upon IP address tracking—making it more user-friendly and reliable. Particularly in cases where you\'d like to support users who might travel a lot, have multiple devices, or be on ISPs that change their IP address frequently.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_during_slogin_restrictions", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-max-simultaneous-logins">' . "\n";
         echo 'Max Simultaneous Logins Allowed; for each Username:'******'</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_max_simultaneous_logins" id="ws-plugin--s2member-max-simultaneous-logins" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_simultaneous_logins"]) . '" /><br />' . "\n";
         echo 'Examples: <code>0</code> (to disable this functionality), <code>1</code> (maximum of 1 login at a time), <code>2</code>, <code>3</code>, <code>10</code>, <code>20</code>, etc.<br />' . "\n";
         echo 'Suggestion: <code>3</code>—the chance to open your site in multiple browsers; but still prevents major security issues.<br />' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-max-simultaneous-logins-timeout">' . "\n";
         echo 'Inactivity Timeout Period; this impacts Simultaneous Login Monitoring only.<br />' . "\n";
         echo 'Simultaneous Login Monitoring should assume a Username is logged-out after this amount of time:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_max_simultaneous_logins_timeout" id="ws-plugin--s2member-max-simultaneous-logins-timeout" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_simultaneous_logins_timeout"]) . '" /><br />' . "\n";
         echo 'Examples: <code>30 minutes</code>, <code>1 hour</code>, <code>2 hours</code>; anything compatible with PHP\'s <a href="http://php.net/manual/en/function.strtotime.php" target="_blank" rel="external">strtotime()</a>.<br />' . "\n";
         echo 'Recommended Setting: <code>30 minutes</code>; if they stop browsing the site, they\'re considered inactive.<br />' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_res_ops_page_during_left_sections_after_slogin_restrictions", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_res_ops_page_after_left_sections", get_defined_vars());
     echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }