Beispiel #1
0
 /**
  * Handles Registration Links.
  *
  * @package optimizeMember\Registrations
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection.
  */
 public static function register()
 {
     do_action("ws_plugin__optimizemember_before_register", get_defined_vars());
     /**/
     if (!empty($_GET["optimizemember_register"])) {
         eval('while (@ob_end_clean ());');
         /* First we end/clean any output buffers that may exist already. */
         /**/
         $msg_503 = _x('<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.', "s2member-front", "s2member");
         /**/
         if (is_array($register = preg_split("/\\:\\.\\:\\|\\:\\.\\:/", c_ws_plugin__optimizemember_utils_encryption::decrypt(trim(stripslashes((string) $_GET["optimizemember_register"])))))) {
             if (count($register) === 6 && $register[0] === "subscr_gateway_subscr_id_custom_item_number_time") {
                 if (is_numeric($register[5]) && $register[5] <= strtotime("now") && $register[5] >= strtotime("-" . apply_filters("ws_plugin__optimizemember_register_link_exp_time", "2 days", get_defined_vars()))) {
                     $_COOKIE["optimizemember_subscr_gateway"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($register[1]);
                     $_COOKIE["optimizemember_subscr_id"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($register[2]);
                     $_COOKIE["optimizemember_custom"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($register[3]);
                     $_COOKIE["optimizemember_item_number"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($register[4]);
                     /**/
                     if (($reg_cookies = c_ws_plugin__optimizemember_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
                         status_header(200);
                         /* Send a 200 OK status header. */
                         header("Content-Type: text/html; charset=utf-8");
                         /* Content-Type with UTF-8. */
                         /**/
                         setcookie("optimizemember_subscr_gateway", $_COOKIE["optimizemember_subscr_gateway"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_subscr_gateway", $_COOKIE["optimizemember_subscr_gateway"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         setcookie("optimizemember_subscr_id", $_COOKIE["optimizemember_subscr_id"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_subscr_id", $_COOKIE["optimizemember_subscr_id"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         setcookie("optimizemember_custom", $_COOKIE["optimizemember_custom"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_custom", $_COOKIE["optimizemember_custom"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         setcookie("optimizemember_item_number", $_COOKIE["optimizemember_item_number"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_item_number", $_COOKIE["optimizemember_item_number"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         /**/
                         do_action("ws_plugin__optimizemember_during_register", get_defined_vars());
                         /**/
                         if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && is_main_site() && ($location = c_ws_plugin__optimizemember_utils_urls::wp_signup_url())) {
                             echo '<script type="text/javascript">' . "\n";
                             echo "window.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($location) . "';";
                             echo '</script>' . "\n";
                         } else {
                             if ($location = c_ws_plugin__optimizemember_utils_urls::wp_register_url()) {
                                 echo '<script type="text/javascript">' . "\n";
                                 echo "window.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($location) . "';";
                                 echo '</script>' . "\n";
                             }
                         }
                         exit;
                         /* Clean exit. The browser will now be redirected to ``$location``. */
                     } else {
                         status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
                     }
                 } else {
                     status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
                 }
             } else {
                 status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
             }
         } else {
             status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
         }
     }
     /**/
     do_action("ws_plugin__optimizemember_after_register", get_defined_vars());
 }
Beispiel #2
0
 /**
  * Handles the Shortcode for: `[opmGet /]`.
  *
  * @package optimizeMember\opmGet
  * @since 3.5
  *
  * @attaches-to ``add_shortcode("opmGet");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return mixed Value of the requested data, or null on failure.
  *
  * @todo Prevent this routine from potentially returning objects/arrays?
  */
 public static function sc_get_details($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_get_details", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /* Force array; trim quote entities. */
     /**/
     $attr = shortcode_atts(array("constant" => "", "user_field" => "", "user_option" => "", "user_id" => ""), $attr);
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_get_details_after_shortcode_atts", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($attr["constant"] && defined($attr["constant"])) {
         if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() || preg_match("/^OPTIMIZEMEMBER_/i", $attr["constant"])) {
             $get = constant($attr["constant"]);
         }
     } else {
         if ($attr["user_field"] && (is_user_logged_in() || $attr["user_id"])) {
             $get = c_ws_plugin__optimizemember_utils_users::get_user_field($attr["user_field"], (int) $attr["user_id"]);
         } else {
             if ($attr["user_option"] && (is_user_logged_in() || $attr["user_id"])) {
                 $get = get_user_option($attr["user_option"], (int) $attr["user_id"]);
             }
         }
     }
     /**/
     return apply_filters("ws_plugin__optimizemember_sc_get_details", isset($get) ? $get : null, get_defined_vars());
 }
 /**
  * Builds a reCAPTCHA™ JavaScript `script` tag for display.
  *
  * @package optimizeMember\Utilities
  * @since 3.5
  *
  * @param str $theme Optional. The theme used in display. Defaults to `clean`.
  * @param str $tabindex Optional. Value of `tabindex=""` attribute. Defaults to `-1`.
  * @param str $error Optional. An error message to display.
  * @return str HTML markup for JavaScript tag.
  */
 public static function recaptcha_script_tag($theme = FALSE, $tabindex = FALSE, $error = FALSE)
 {
     $theme = $theme ? $theme : "clean";
     $tabindex = strlen($tabindex) ? (int) $tabindex : -1;
     $keys = c_ws_plugin__optimizemember_utils_captchas::recaptcha_keys();
     /**/
     $options = '<script type="text/javascript">' . "if(typeof RecaptchaOptions !== 'object'){ var RecaptchaOptions = {theme: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($theme) . "', lang: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["recaptcha"]["lang"]) . "', tabindex: " . $tabindex . " }; }" . '</script>' . "\n";
     $no_tabindex_icons = '<script type="text/javascript">' . "if(typeof jQuery === 'function'){ jQuery('td a[id^=\"recaptcha\"]').removeAttr('tabindex'); }" . '</script>';
     $adjustments = !apply_filters("c_ws_plugin__optimizemember_utils_tabindex_recaptcha_icons", false, get_defined_vars()) ? $no_tabindex_icons : "";
     /**/
     return $options . '<script type="text/javascript" src="' . esc_attr('https://www.google.com/recaptcha/api/challenge?k=' . urlencode($keys["public"])) . '' . ($error ? '&amp;error=' . urlencode($error) : '') . '"></script>' . $adjustments;
 }
 public function __construct()
 {
     if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site()) {
         echo '<p><strong>OPTIMIZEMEMBER_PRO_VERSION</strong><br />This will always be a (string) with the current optimizeMember Pro version. Available since optimizeMember Pro v1.0. Dated versions began with optimizeMember Pro v110604.</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
     } else {
         echo '<p><strong>OPTIMIZEMEMBER_PRO_VERSION</strong><br />This will always be a (string) with the current optimizeMember Pro version. Available since optimizeMember Pro v1.0. Dated versions began with optimizeMember Pro v110604.</p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/pro-version.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
     }
 }
Beispiel #5
0
 /**
  * Handles the Shortcode for: `[optimizeMember-Security-Badge /]`.
  *
  * @package optimizeMember\Security_Badges
  * @since 110524RC
  *
  * @attaches-to ``add_shortcode("optimizeMember-Security-Badge");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str Resulting Security Badge code; HTML markup.
  */
 public static function sc_s_badge($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_s_badge", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /**/
     $attr = shortcode_atts(array("v" => "1"), $attr);
     /* One attribute. */
     /**/
     $code = c_ws_plugin__optimizemember_utilities::s_badge_gen($attr["v"], false, false);
     /**/
     return apply_filters("ws_plugin__optimizemember_sc_s_badge", $code, get_defined_vars());
 }
Beispiel #6
0
 /**
  * Adds Pro Module JavaScript.
  *
  * @package optimizeMember\CSS_JS
  * @since 1.5
  *
  * @attaches-to ``add_action("ws_plugin__optimizemember_during_js_w_globals");``
  *
  * @param array $vars Expects array of defined variables, passed in by the Action Hook.
  * @return null
  */
 public static function js_w_globals($vars = FALSE)
 {
     $g = "var OPTIMIZEMEMBER_PRO_VERSION = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(OPTIMIZEMEMBER_PRO_VERSION) . "',";
     /**/
     $g = trim($g, " ,") . ";";
     /* Trim & add semicolon. */
     /**/
     $u = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"];
     $i = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images";
     /**/
     echo "\n" . $g . "\n";
     /* Add a line break before inclusion. */
     /**/
     include_once dirname(dirname(__FILE__)) . "/optimizemember-pro-min.js";
     /**/
     return;
     /* Return unformity. */
 }
 public function __construct()
 {
     if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="Pro Login Widget via PHP">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-login-widget-section">' . "\n";
         echo '<h3>Pro Login Widget via PHP Tag ( some scripting required )</h3>' . "\n";
         echo '<p>With optimizeMember Pro installed, you have access to the optimizeMember Pro Login Widget. This is made available in your Dashboard under: <code>Appearance -> Widgets</code>. Very simple to use; just drag &amp; drop ( that\'s it ). For developers though, sometimes it is necessary to include the Pro Login Widget in non-widgetized sections of a WordPress theme; or even into another plugin that you run in concert with optimizeMember. You can use this PHP tag to build the Pro Login Widget dynamically: <code>' . c_ws_plugin__optimizemember_utils_strings::highlight_php('<?php echo optimizemember_pro_login_widget(); ?>') . '</code></p>' . "\n";
         echo '<p>The Pro Login Widget can also be configured with an <em>optional</em> array of configuration parameters.</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.optimizepress.com/codex/" target="_blank" rel="external">optimizeMember Codex</a>.<br />' . "\n";
         //echo '<strong>See Also:</strong> <a href="http://www.optimizepress.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">optimizeMember Codex -> API Constants</a>, and <a href="http://www.optimizepress.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">optimizeMember Codex -> API Functions</a>.</p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
     }
 }
 /**
  * Handles processing of Pro Form billing updates.
  *
  * @package optimizeMember\Stripe
  * @since 140617
  *
  * @attaches-to ``add_action('init');``
  */
 public static function stripe_update()
 {
     if (!empty($_POST['optimizemember_pro_stripe_update']['nonce']) && ($nonce = $_POST['optimizemember_pro_stripe_update']['nonce']) && wp_verify_nonce($nonce, 'optimizemember-pro-stripe-update')) {
         $GLOBALS['ws_plugin__optimizemember_pro_stripe_update_response'] = array();
         // This holds the global response details.
         $global_response =& $GLOBALS['ws_plugin__optimizemember_pro_stripe_update_response'];
         $post_vars = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST['optimizemember_pro_stripe_update']));
         $post_vars['attr'] = !empty($post_vars['attr']) ? (array) unserialize(c_ws_plugin__optimizemember_utils_encryption::decrypt($post_vars['attr'])) : array();
         $post_vars['attr'] = apply_filters('ws_plugin__optimizemember_pro_stripe_update_post_attr', $post_vars['attr'], get_defined_vars());
         $post_vars['recaptcha_challenge_field'] = isset($_POST['recaptcha_challenge_field']) ? trim(stripslashes($_POST['recaptcha_challenge_field'])) : '';
         $post_vars['recaptcha_response_field'] = isset($_POST['recaptcha_response_field']) ? trim(stripslashes($_POST['recaptcha_response_field'])) : '';
         if (!c_ws_plugin__optimizemember_pro_stripe_responses::stripe_form_attr_validation_errors($post_vars['attr'])) {
             if (!($form_submission_validation_errors = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_form_submission_validation_errors('update', $post_vars))) {
                 if (is_user_logged_in() && ($user = wp_get_current_user()) && ($user_id = $user->ID)) {
                     if (($cur__subscr_cid = get_user_option('optimizemember_subscr_cid')) && ($cur__subscr_id = get_user_option('optimizemember_subscr_id'))) {
                         if (is_object($stripe_subscription = c_ws_plugin__optimizemember_pro_stripe_utilities::get_customer_subscription($cur__subscr_cid, $cur__subscr_id)) && !preg_match('/^canceled$/i', $stripe_subscription->status) && !$stripe_subscription->cancel_at_period_end) {
                             unset($_POST['optimizemember_pro_stripe_update']['card_token']);
                             // These are good one-time only.
                             unset($_POST['optimizemember_pro_stripe_update']['card_token_summary']);
                             if (is_object($set_customer_card_token = c_ws_plugin__optimizemember_pro_stripe_utilities::set_customer_card_token($cur__subscr_cid, $post_vars['card_token']))) {
                                 $global_response = array('response' => _x('<strong>Confirmed.</strong> Your billing information has been updated.', 's2member-front', 's2member'));
                                 if ($post_vars['attr']['success'] && ($custom_success_url = str_ireplace(array('%%s_response%%', '%%response%%'), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response['response'])), urlencode($global_response['response'])), $post_vars['attr']['success'])) && ($custom_success_url = trim(preg_replace('/%%(.+?)%%/i', '', $custom_success_url)))) {
                                     wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, 's2p-v')) . exit;
                                 }
                             } else {
                                 $global_response = array('response' => $set_customer_card_token, 'error' => TRUE);
                             }
                         } else {
                             $global_response = array('response' => _x('<strong>Unable to update.</strong> You have NO recurring fees. Or, your billing profile is no longer active. Please contact Support if you need assistance.', 's2member-front', 's2member'), 'error' => TRUE);
                         }
                     } else {
                         $global_response = array('response' => _x('<strong>Oops.</strong> No Customer|Subscr. ID. Please contact Support for assistance.', 's2member-front', 's2member'), 'error' => TRUE);
                     }
                 } else {
                     $global_response = array('response' => _x('You\'re <strong>NOT</strong> logged in.', 's2member-front', 's2member'), 'error' => TRUE);
                 }
             } else {
                 // Input form field validation errors.
                 $global_response = $form_submission_validation_errors;
             }
         }
     }
 }
Beispiel #9
0
 /**
  * Forces a redirection to the Membership Options Page for optimizeMember.
  *
  * This can be used by 3rd party apps that are not aware of which Page is currently set as the Membership Options Page.
  * Example usage: `http://example.com/?optimizemember_membership_options_page=1`
  *
  * Redirection URLs containing array brackets MUST be URL encoded to get through: ``wp_sanitize_redirect()``.
  * 	So we pass everything to ``urlencode_deep()``, as an array. It handles this via ``_http_build_query()``.
  * 	See bug report here: {@link http://core.trac.wordpress.org/ticket/17052}
  *
  * @package optimizeMember\Membership_Options_Page
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection w/ `301` status.
  */
 public static function membership_options_page()
 {
     do_action("ws_plugin__optimizemember_before_membership_options_page", get_defined_vars());
     /**/
     if (!empty($_GET["optimizemember_membership_options_page"]) && is_array($_g = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_GET)))) {
         $args = array();
         /**/
         foreach ($_g as $var => $value) {
             /* Include all of the `_?optimizemember_` variables. */
             /* Do NOT include `optimizemember_membership_options_page`; creates a redirection loop. */
             if (preg_match("/^_?optimizemember_/", $var) && $var !== "optimizemember_membership_options_page") {
                 $args[$var] = $value;
             }
         }
         /**/
         wp_redirect(add_query_arg(urlencode_deep($args), get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"])), 301) . exit;
     }
     /**/
     do_action("ws_plugin__optimizemember_after_membership_options_page", get_defined_vars());
 }
 /**
  * Handles Return templates w/ response message.
  *
  * @package optimizeMember\Return_Templates
  * @since 110720
  *
  * @param str $template Optional A Subscr. Gateway code should be used as the template name, or `default` is a multipurpose template. Defaults to `default`. Used in template selection.
  * @param str $response Optional. Response message to fill template with, using the Replacement Code `%%response%%` inside the template file. Defaults to: `Thank you. Please click the link below.`.
  * @param str $continue_html Optional. The HTML value of the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: `Continue`.
  * @param str $continue_link Optional. The HREF value for the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: ``home_url ("/")``.
  * @return str The full HTML code of the template. All Replacement Codes inside the template file will have already been filled by this routine.
  */
 public static function return_template($template = FALSE, $response = FALSE, $continue_html = FALSE, $continue_link = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_return_template", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $template = $template ? $template : "default";
     $continue_link = $continue_link ? $continue_link : home_url("/");
     $continue_html = $continue_html ? $continue_html : _x("Continue", "s2member-front", "s2member");
     $response = $response ? $response : _x("Thank you. Please click the link below.", "s2member-front", "s2member");
     /**/
     $custom_template = file_exists(TEMPLATEPATH . "/" . $template . "-return.php") ? TEMPLATEPATH . "/" . $template . "-return.php" : false;
     $custom_template = file_exists(TEMPLATEPATH . "/" . $template . "-return.html") ? TEMPLATEPATH . "/" . $template . "-return.html" : $custom_template;
     /**/
     $custom_template = file_exists(WP_CONTENT_DIR . "/" . $template . "-return.php") ? WP_CONTENT_DIR . "/" . $template . "-return.php" : $custom_template;
     $custom_template = file_exists(WP_CONTENT_DIR . "/" . $template . "-return.html") ? WP_CONTENT_DIR . "/" . $template . "-return.html" : $custom_template;
     /**/
     $custom_template = !$custom_template && file_exists(TEMPLATEPATH . "/default-return.php") ? TEMPLATEPATH . "/default-return.php" : $custom_template;
     $custom_template = !$custom_template && file_exists(TEMPLATEPATH . "/default-return.html") ? TEMPLATEPATH . "/default-return.html" : $custom_template;
     /**/
     $custom_template = !$custom_template && file_exists(WP_CONTENT_DIR . "/default-return.php") ? WP_CONTENT_DIR . "/default-return.php" : $custom_template;
     $custom_template = !$custom_template && file_exists(WP_CONTENT_DIR . "/default-return.html") ? WP_CONTENT_DIR . "/default-return.html" : $custom_template;
     /**/
     $specific_template = $custom_template ? $custom_template : (file_exists($_default_specific_template = dirname(dirname(__FILE__)) . "/templates/returns/" . $template . "-return.php") ? $_default_specific_template : false);
     /**/
     $code = trim(file_get_contents($specific_template ? $specific_template : ($_default_template = dirname(dirname(__FILE__)) . "/templates/returns/default-return.php")));
     $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code);
     /**/
     $doctype_html_head = c_ws_plugin__optimizemember_utils_html::doctype_html_head(get_bloginfo("name"), "ws_plugin__optimizemember_during_return_template_head_" . ($specific_template ? basename($specific_template) : "default-return.php"));
     $code = preg_replace("/%%doctype_html_head%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_doctype_html_head", $doctype_html_head, get_defined_vars())), $code);
     /**/
     $code = preg_replace("/%%header%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_header", sprintf(_x('[ %s ] <strong><em>says&hellip;</em></strong>', "s2member-front", "s2member"), esc_html($_SERVER["HTTP_HOST"])), get_defined_vars())), $code);
     /**/
     $code = preg_replace("/%%response%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_response", $response, get_defined_vars())), $code);
     $code = preg_replace("/%%continue%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_continue", '<a href="' . esc_attr($continue_link) . '">' . $continue_html . '</a>', get_defined_vars())), $code);
     $code = preg_replace("/%%support%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_support", sprintf(_x('If you need assistance, please <a href="%s" target="_blank">contact support</a>.', "s2member-front", "s2member"), esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["reg_email_support_link"])), get_defined_vars())), $code);
     $code = preg_replace("/%%tracking%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_tracking", c_ws_plugin__optimizemember_tracking_codes::generate_all_tracking_codes(), get_defined_vars())), $code);
     /**/
     return apply_filters("ws_plugin__optimizemember_return_template", $code, get_defined_vars());
 }
 public function __construct()
 {
     if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="Pro API For Remote Operations">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-remote-operations-section">' . "\n";
         echo '<h3>Pro API For Remote Operations ( PHP scripting required )</h3>' . "\n";
         echo '<p>With optimizeMember Pro installed, you have access to the optimizeMember Pro API For Remote Operations. This is made available for developers that wish to create User/Member accounts dynamically through custom scripts of their own. optimizeMember\'s Remote Operations API requires a secret API Key in order to POST authenticated requests to your installation of optimizeMember.</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h4>Remote Operations API: <strong>Your secret API Key</strong></h4>' . "\n";
         echo '<input type="text" autocomplete="off" value="' . format_to_edit(c_ws_plugin__optimizemember_pro_remote_ops::remote_ops_key_gen()) . '" style="width:99%;" />' . "\n";
         /**/
         echo '<p><em><strong class="ws-menu-page-hilite">Experimental:</strong> The Remote Operations API is currently in an experimental state. The Operations that are currently possible include: <code>create_user</code>, <code>modify_user</code>, <code>delete_user</code>. In a future release of optimizeMember Pro, we will add further documentation and some additional Remote Operations to this API. Thanks for your patience.</em></p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h4>Remote Operation: <code>create_user</code> (or update existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__optimizemember_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-create-user.x-php"))))) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h4>Remote Operation: <code>modify_user</code> (updates existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__optimizemember_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-modify-user.x-php"))))) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h4>Remote Operation: <code>delete_user</code> (deletes existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__optimizemember_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-delete-user.x-php"))))) . '</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.optimizepress.com/codex/" target="_blank" rel="external">optimizeMember Codex</a>.<br />' . "\n";
         //echo '<strong>See Also:</strong> <a href="http://www.optimizepress.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">optimizeMember Codex -> API Constants</a>, and <a href="http://www.optimizepress.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">optimizeMember Codex -> API Functions</a>.</p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
     }
 }
Beispiel #12
0
 /**
  * Returns a DOCTYPE tag along with the HEAD section and title tag.
  *
  * This method should NOT be called upon until
  * {@link optimizeMember\API_Constants\c_ws_plugin__optimizemember_constants::constants()}
  * has been processed. We need access to: ``WS_PLUGIN__OPTIMIZEMEMBER_API_CONSTANTS_MD5``.
  *
  * @package optimizeMember\Utilities
  * @since 110720
  *
  * @param str $doctype_html_head_title Optional. The title of the HTML document being generated.
  * @param str $doctype_html_head_action Optional. An action Hook to process during HEAD generation.
  * @return str A DOCTYPE tag along with the HEAD section and title tag, configured by parameters.
  */
 public static function doctype_html_head($doctype_html_head_title = FALSE, $doctype_html_head_action = FALSE)
 {
     $s2o = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["s2o_url"];
     /* Loads optimizeMember only. */
     /**/
     ob_start();
     /* Start output buffering here so we can "return" the output from this utility. */
     /**/
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
     /**/
     echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
     echo '<head>' . "\n";
     /**/
     echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
     /**/
     echo '<script type="text/javascript" src="' . esc_attr(site_url("/wp-includes/js/jquery/jquery.js?ver=" . urlencode(c_ws_plugin__optimizemember_utilities::ver_checksum()))) . '"></script>' . "\n";
     /**/
     echo '<script type="text/javascript">' . "var pwsL10n = {empty: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Strength indicator", "s2member-front", "s2member")) . "', short: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Very weak", "s2member-front", "s2member")) . "', bad: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Weak", "s2member-front", "s2member")) . "', good: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Medium", "s2member-front", "s2member")) . "', strong: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Strong", "s2member-front", "s2member")) . "', mismatch: '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Mismatch", "s2member-front", "s2member")) . "'};</script>" . "\n";
     echo '<script type="text/javascript" src="' . esc_attr(site_url("/wp-includes/js/zxcvbn.min.js?ver=" . urlencode(c_ws_plugin__optimizemember_utilities::ver_checksum()))) . '"></script>' . "\n";
     echo '<script type="text/javascript" src="' . esc_attr(site_url("/wp-admin/js/password-strength-meter.js?ver=" . urlencode(c_ws_plugin__optimizemember_utilities::ver_checksum()))) . '"></script>' . "\n";
     /**/
     echo '<script type="text/javascript" src="' . esc_attr($s2o . "?ws_plugin__optimizemember_js_w_globals=" . urlencode(WS_PLUGIN__OPTIMIZEMEMBER_API_CONSTANTS_MD5) . "&amp;qcABC=1&amp;ver=" . urlencode(c_ws_plugin__optimizemember_utilities::ver_checksum())) . '"></script>' . "\n";
     /**/
     echo '<link href="' . esc_attr($s2o . "?ws_plugin__optimizemember_css=1&amp;qcABC=1&amp;ver=" . urlencode(c_ws_plugin__optimizemember_utilities::ver_checksum())) . '" type="text/css" rel="stylesheet" media="all" />' . "\n";
     /**/
     if ($doctype_html_head_title) {
         /* Add <title></title> tag? */
         echo '<title>' . $doctype_html_head_title . '</title>' . "\n";
     }
     /**/
     if ($doctype_html_head_action) {
         /* Add content from Hook? */
         do_action($doctype_html_head_action, get_defined_vars());
     }
     /**/
     echo '</head>' . "\n";
     /**/
     return ob_get_clean();
 }
Beispiel #13
0
 /**
  * Handles the Shortcode for: `[opmKey /]`.
  *
  * @package optimizeMember\opmKey
  * @since 110912
  *
  * @attaches-to ``add_shortcode("opmKey");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str Value of the requested key, or null on failure.
  */
 public static function sc_get_key($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_get_key", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /**/
     $attr = shortcode_atts(array("file_download" => "", "directive" => ""), $attr);
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_get_key_after_shortcode_atts", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($attr["file_download"]) {
         /* Requesting a File Download Key? */
         $get = c_ws_plugin__optimizemember_files::file_download_key($attr["file_download"], $attr["directive"]);
     }
     /**/
     return apply_filters("ws_plugin__optimizemember_sc_get_key", isset($get) ? $get : null, get_defined_vars());
 }
Beispiel #14
0
 /**
  * Handles the Shortcode for: `[opmStream /]`.
  *
  * @package optimizeMember\opmFile
  * @since 130119
  *
  * @attaches-to ``add_shortcode("opmStream");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str HTML markup that produces an audio/video stream for a specific player.
  */
 public static function sc_get_stream($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_get_stream", get_defined_vars());
     unset($__refs, $__v);
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /**/
     $attr = shortcode_atts(array("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", "file_download" => "", "player" => "jwplayer-v6-rtmp", "player_id" => "s2-stream-" . md5(uniqid("", TRUE)), "player_path" => "/jwplayer/jwplayer.js", "player_key" => "", "player_image" => "", "player_title" => "", "player_controls" => "yes", "player_height" => "270", "player_skin" => "", "player_stretching" => "uniform", "player_width" => "480", "player_autostart" => "no", "player_fallback" => "yes", "player_mute" => "no", "player_primary" => "flash", "player_repeat" => "no", "player_startparam" => "", "player_option_blocks" => ""), $attr);
     $attr["download"] = !empty($attr["file_download"]) ? $attr["file_download"] : $attr["download"];
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_get_stream_after_shortcode_atts", get_defined_vars());
     unset($__refs, $__v);
     /**/
     foreach ($attr as $key => $value) {
         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);
     /**/
     if (!empty($config) && isset($config["file_download"])) {
         $_get = c_ws_plugin__optimizemember_files::create_file_download_url($config, TRUE);
         /**/
         if (is_array($_get) && !empty($_get) && $attr["player"] && file_exists(dirname(dirname(__FILE__)) . "/templates/players/" . $attr["player"] . ".php") && $attr["player_id"] && $attr["player_path"]) {
             if (strpos($attr["player"], "jwplayer-v6") === 0) {
                 $get = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/players/" . $attr["player"] . ".php")));
                 /**/
                 $get = preg_replace("/%%streamer%%/", $_get["streamer"], $get);
                 $get = preg_replace("/%%prefix%%/", $_get["prefix"], $get);
                 $get = preg_replace("/%%file%%/", $_get["file"], $get);
                 $get = preg_replace("/%%url%%/", $_get["url"], $get);
                 /**/
                 $get = preg_replace("/%%player_id%%/", $attr["player_id"], $get);
                 $get = preg_replace("/%%player_path%%/", $attr["player_path"], $get);
                 $get = preg_replace("/%%player_key%%/", $attr["player_key"], $get);
                 /**/
                 $get = preg_replace("/%%player_image%%/", $attr["player_image"], $get);
                 $get = preg_replace("/%%player_title%%/", $attr["player_title"], $get);
                 /**/
                 $get = preg_replace("/%%player_controls%%/", filter_var($attr["player_controls"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_height%%/", (int) $attr["player_height"], $get);
                 $get = preg_replace("/%%player_skin%%/", $attr["player_skin"], $get);
                 $get = preg_replace("/%%player_stretching%%/", $attr["player_stretching"], $get);
                 $get = preg_replace("/%%player_width%%/", (int) $attr["player_width"], $get);
                 /**/
                 $get = preg_replace("/%%player_autostart%%/", filter_var($attr["player_autostart"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_fallback%%/", filter_var($attr["player_fallback"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_mute%%/", filter_var($attr["player_mute"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_primary%%/", $attr["player_primary"], $get);
                 $get = preg_replace("/%%player_repeat%%/", filter_var($attr["player_repeat"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_startparam%%/", $attr["player_startparam"], $get);
                 /**/
                 $get = preg_replace("/%%player_option_blocks%%/", strpos($attr["player_option_blocks"], ":") !== false ? $attr["player_option_blocks"] : base64_decode($attr["player_option_blocks"]), $get);
             }
         }
     }
     return apply_filters("ws_plugin__optimizemember_sc_get_stream", isset($get) ? $get : null, get_defined_vars());
 }
Beispiel #15
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page op-bsw-wizard op-bsw-content">' . "\n";
     /**/
     echo '<div class="op-bsw-header">';
     echo '<div class="op-logo"><img src="' . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images/" . 'logo-optimizepress.png" alt="OptimizePress" height="50" class="animated flipInY"></div>';
     echo '</div>';
     echo '<div class="op-bsw-main-content inline-input-fields">';
     echo '<h2>OptimizeMember Pro / PayPal Pro Forms</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 '<div class="ws-menu-page-group" title="Quick-Start Guide For PayPal Pro">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-forms-guide-section">' . "\n";
     echo '<img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/large-icon.png" title="optimizeMember ( a Membership management system for WordPress )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
     echo '<h3>Quick-Start Guide For PayPal Pro Integration</h3>' . "\n";
     //echo '<p style="margin-bottom:0;"><strong>See also:</strong> This KB article: <a href="http://www.optimizepress.com/kb/pro-forms/" target="_blank" rel="external">optimizeMember Pro Forms</a>.</p>'."\n";
     //echo '<p style="margin-top:0;"><strong>See also:</strong> This KB article: <a href="http://www.optimizepress.com/kb/paypal-account-types/" target="_blank" rel="external">PayPal Compatibility (Account Types)</a>.</p>'."\n";
     echo '<p>The optimizeMember Pro Module makes it possible for optimizeMember to use PayPal Pro Forms ( instead of standard PayPal Buttons ). PayPal Pro Forms integrate seamlessly with WordPress Shortcodes. This allows you to keep Customers on your site at all times, and it consolidates the Checkout / Registration steps into a single form that you can dress up just the way you like. If you would like to take advantage of PayPal Pro integration, please supply your PayPal API Username, Password, and Signature. See <code>optimizeMember -> PayPal Options</code>.</p>' . "\n";
     echo '<p><em><strong>*PayPal Pro Integration*</strong> You will need a <a href="http://www.optimizepress.com/paypal" target="_blank" rel="external">PayPal Business Account, w/Pro Service</a>. PayPal Pro accounts require a formal application, along with a small monthly fee. Once you have a PayPal Pro account, you\'ll need access to your <a href="http://www.optimizepress.com/paypal-profile-api-access" target="_blank" rel="external">PayPal API Credentials</a>. Log into your PayPal Pro account, and navigate to <code>Profile -> API Access (or Request API Credentials)</code>. You\'ll choose <code>( Request API Signature )</code>.</em></p>' . "\n";
     echo '<p><em><strong>*Recurring Billing*</strong> If you plan to use any of the ( `Subscription` ) options in the Form Generators below, you will ALSO need <a href="http://www.optimizepress.com/paypal-pro-recurring-payments-faqs" target="_blank" rel="external">Recurring Billing</a> enabled for your PayPal Pro account. PayPal\'s Recurring Billing service for Pro accounts is <strong>required</strong> for all types of ( `Subscriptions` ), whether you intend for them to be recurring or not. However, it is NOT required for ( `Buy Now` ) functionality. The drop-down menus, in the sections below, have been marked ( `Subscription` ) and ( `Buy Now` ) just for this reason. This way you can see which options will require the use of PayPal\'s Recurring Billing service. PayPal will charge you a small monthly fee for their Recurring Billing service; which is an add-on for PayPal Pro accounts.</em></p>' . "\n";
     echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>*Secure Server*</strong> In order to comply with PayPal and PCI Compliance policies, as set forth by major credit card companies; you will need to host all of your PayPal Pro Forms on an SSL enabled site. Please check with your hosting provider to ask about obtaining an SSL certificate for your domain. Please note... when you create PayPal Pro Forms with optimizeMember; you\'ll be supplied with WordPress Shortcodes, which you\'ll insert into Posts/Pages of your choosing. These special Posts/Pages will need to be displayed in SSL mode, using links that start with ( <code>https://</code> ). &mdash; You can skip the SSL certificate during Sandbox testing. SSL is not required until you officially go live. Once you\'re live, you can add the Custom Field <code>optimizemember_force_ssl = yes</code> to any Post/Page.</em></p>' . "\n" : '<p><em><strong>*Secure Server*</strong> In order to comply with PayPal and PCI Compliance policies, as set forth by major credit card companies; you will need to host all of your PayPal Pro Forms on an SSL enabled page. When you create PayPal Pro Forms with optimizeMember; you\'ll be supplied with WordPress Shortcodes, which you\'ll insert into Posts/Pages of your choosing. These special Posts/Pages will need to be displayed in SSL mode, using links that start with ( <code>https://</code> ). You can add the Custom Field <code>optimizemember_force_ssl = yes</code> to any Post/Page that contains a Pro Form Shortcode. This tells optimizeMember to force those special Posts/Pages to be viewed over SSL at all times; no matter what.</em></p>' . "\n";
     echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>*SSL Compatibility*</strong> All themes available at <a href="http://www.optimizepress.com/" target="_blank" rel="external">optimizePress.com</a> include full support for SSL, as does WordPress itself. However, there are many themes/plugins that do NOT support SSL enabled Posts/Pages like they should. For this reason, you should be very careful when choosing a WordPress theme to use with optimizeMember Pro. Otherwise, your visitors could see the famous "Secure/Insecure" warnings in Internet Explorer browsers. With optimizeMember installed, you can add the Custom Field <code>optimizemember_force_ssl = yes</code> to any Post/Page. optimizeMember will buffer output on those special Posts/Pages, converting everything over to <code>https://</code> for you automatically, and forcing those specific Posts/Pages to be viewed over a secure SSL connection; so long as your server supports the https protocol.</em></p>' . "\n" : '';
     echo '<p><em><strong>*PayPal Pro is NOT Absolutely Required*</strong> optimizeMember is very flexible. It is now possible to integrate Pro Forms without a PayPal Pro account, whereby the enhanced Form Shortcodes that optimizeMember provides can be integrated ONLY with PayPal Express Checkout. In other words, if you get declined for PayPal Pro service, you can still use optimizeMember Pro Forms. Ask PayPal to activate Express Checkout for you. ( it\'s free ). Once Express Checkout is enabled, you will have access to your <a href="http://www.optimizepress.com/paypal-profile-api-access" target="_blank" rel="external">PayPal API Credentials</a>. Log into your PayPal account, and navigate to <code>Profile -> API Access (or Request API Credentials)</code>. You\'ll choose <code>( Request API Signature )</code>. Now ... here is the tricky part; whenever you generate a Pro Form Shortcode with optimizeMember, be sure to change  <code>accept="paypal,visa,mastercard,amex,discover,maestro,solo"</code> to just <code>accept="paypal"</code>; thereby excluding the on-site credit card processing functionality; which is available only with PayPal Pro.</em></p>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     echo '<div class="ws-menu-page-group" title="PayPal Pro / Free Registration Forms">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-registration-forms-section">' . "\n";
     echo '<h3>One Form Does It All For Free Registrations ( copy/paste )</h3>' . "\n";
     echo '<p>Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0.</p>' . "\n";
     echo '<p><em><strong>*Note*</strong> the use of this particular Form will override your Open Registration configuration. In other words, making this Form available is the same as turning Open Registration <code>(on)</code>. One of the benefits to this functionality, is that it makes it possible for you to integrate this Free Registration Form in creative ways ( i.e. making it available ONLY under certain circumstances ); while still leaving Open Registration <code>(off)</code> throughout the rest of the site.</em></p>' . "\n";
     echo '<p><em><strong>*Tip ( optional )*</strong> It is also possible to change the <code>level="0"</code> Attribute to something other than the default Level #0 ( Free Subscriber ). For example, if you need to, you can change it to <code>level="1"</code>, attach Custom Capabilities with the <code>ccaps=""</code> Attribute, and even limit this access to a certain timeframe with <code>tp="30" tt="D"</code> ( i.e. 30 Days ). So this Form is very flexible. It can be used to allow free access to just about any aspect of your service. For more information on Attributes, please see the section below: Shortcode Attributes ( Explained ).</em></p>' . "\n";
     /**/
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
     $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-registration-form-shortcode.php")));
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("0")), $ws_plugin__optimizemember_pro_temp_s);
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level0_label"])), $ws_plugin__optimizemember_pro_temp_s);
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s);
     echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-registration-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) {
         $labelText = ws_plugin__optimizemember_getMembershipLabel($n);
         echo '<div class="ws-menu-page-group" title="PayPal Pro Forms For Level ' . $labelText . ' Access">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-level' . $n . '-forms-section">' . "\n";
         echo '<h3>Pro Form Generator For Level ' . $labelText . ' Access</h3>' . "\n";
         echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Form Code). These special PayPal Forms are customized to work with optimizeMember seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, optimizeMember will automatically terminate their Membership privileges. optimizeMember makes extensive use of the PayPal IPN service. optimizeMember receives updates from PayPal behind-the-scene.</p>' . "\n";
         echo '<p><em>* Forms are NOT saved here. This is only a Form Generator. Once you\'ve generated your Form, copy/paste it into any Post/Page you like. You\'ll want to provide your visitors with a link to the Post/Page where this Form is located. We suggest placing a link to this Form on your Membership Options Page. That way your visitors can get registered &amp; checkout!</em></p>' . "\n";
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;">' . "\n";
         echo '<p id="ws-plugin--optimizemember-pro-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-pro-level' . $n . '-trial-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n";
         echo '<p><span id="ws-plugin--optimizemember-pro-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-level' . $n . '-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_payflow_api_username"] ? "payflow" : "paypal") . "-membership-regular-terms.php"))) . '</select></p>' . "\n";
         echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-desc" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="68" /></p>' . "\n";
         echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-level' . $n . '-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalFormGenerate(\'level' . $n . '\');" class="button-primary" /></p>' . "\n";
         echo '<p' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember 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> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-ccaps" size="40" /></p>' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;">' . "\n";
         echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
         $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-form-shortcode.php")));
         $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($n)), $ws_plugin__optimizemember_pro_temp_s);
         $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"])), $ws_plugin__optimizemember_pro_temp_s);
         $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
     }
     /**/
     echo '<div class="ws-menu-page-group" title="PayPal Pro Billing Modification Forms">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-modification-forms-section">' . "\n";
     echo '<h3>Pro Form Generator For Billing Modifications</h3>' . "\n";
     echo '<p>If you\'d like to give your Members ( and/or your Free Subscribers ) the ability to change ( modify ) their billing plan; you can generate a new PayPal Modification Form here. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Form available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade link into your Login Welcome Page, which would up-sell existing Level #1 Members to a more expensive plan that you offer.</p>' . "\n";
     echo '<p><em><strong>*Modification Process*</strong> Very simple. A Member clicks a link to a special Post/Page, which contains a Modification Form you\'ve generated. The Member fills in their billing information. After a successful form submission, optimizeMember will update the status of their account to the Level, pricing, and terms that you configure below. If the Member already has an existing paid Subscription with you, that paid Subscription will be cancelled automatically behind-the-scene, and a new paid Subscription will be created to replace the old one. Again, the new paid Subscription is based on the Level, pricing, and terms that you specify below. If you need to give Customers some sort of grace period when/if they upgrade to a more expensive plan, please feel free to handle this through the application of free days, or with special pricing configured below.</em></p>' . "\n";
     echo '<p><em><strong>*Integrating Conditionals*</strong> Since each Modification Form is configured for a specific Level, you may want to create multiple Modification Forms, one for each combination you intend to make available. optimizeMember\'s API Conditionals can help you display the proper Form to each Customer, based on the status of their existing account. For further details, see: <code>optimizeMember -> API Scripting</code>.</em></p>' . "\n";
     echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>*Independent Custom Capabilities*</strong> If you just want to sell an existing Member new Custom Capabilities, without affecting their paid Subscription in any way, please see the next Form Generator: <code>Capability (Buy Now) Forms</code>. Independent Capability Forms facilitate Buy Now functionality, specifically for Custom Capabilities, without affecting the Customer\'s primary Subscription and Membership Level Access.</em></p>' . "\n" : '';
     /**/
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     /**/
     echo '<p>Modification: <select id="ws-plugin--optimizemember-pro-modification-level">' . "\n";
     /**/
     for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) {
         $labelText = ws_plugin__optimizemember_getMembershipLabel($n);
         echo '<optgroup label="Level ' . $labelText . '">' . "\n";
         echo '<option value="upgrade:' . $n . '">&uarr; Upgrade To Level ' . $labelText . '</option>' . "\n";
         echo $n < $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"] ? '<option value="downgrade:' . $n . '">&darr; Downgrade To Level ' . $labelText . '</option>' . "\n" : '';
         echo '</optgroup>' . "\n";
         /**/
         echo $n < $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"] ? '<option disabled="disabled"></option>' . "\n" : '';
     }
     /**/
     echo '</select></p>' . "\n";
     /**/
     echo '<p id="ws-plugin--optimizemember-pro-modification-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-pro-modification-trial-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
     echo '<p><span id="ws-plugin--optimizemember-pro-modification-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-modification-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_payflow_api_username"] ? "payflow" : "paypal") . "-membership-regular-terms.php"))) . '</select></p>' . "\n";
     echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-desc" value="Description and pricing details here." size="68" /></p>' . "\n";
     echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-modification-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalFormGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
     echo '<p' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember 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> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-ccaps" size="40" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
     $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-form-shortcode.php")));
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("1")), $ws_plugin__optimizemember_pro_temp_s);
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level1_label"])), $ws_plugin__optimizemember_pro_temp_s);
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s);
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/\\/]\$/", 'modify="1" /]', $ws_plugin__optimizemember_pro_temp_s);
     /* Adds modify="1" to the end of the Shortcode. */
     echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="PayPal Pro Capability (Buy Now) Forms">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-ccap-forms-section">' . "\n";
         echo '<h3>Pro Form Generator For Independent Custom Capabilities</h3>' . "\n";
         echo '<p>This is VERY advanced. For further details, please check your Dashboard: <code>optimizeMember -> API Scripting -> Custom Capabiities</code>.</p>' . "\n";
         echo '<p>With optimizeMember, you can 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. Independent Custom Capabilities do NOT rely on any specific Membership Level. That\'s why optimizeMember refers to these as `Independent` Custom Capabilities, because you can sell Capabilities this way, through Buy Now functionality, and the Customer\'s Membership Level Access, along with any existing paid Subscription they may already have with you, will remain completely unaffected. That being said, if you intend to charge a recurring fee for Custom Capabilities, please use a <code>Billing Modification Form</code> instead; because Independent Custom Capabilities can only be sold through Buy Now functionality.</p>' . "\n";
         echo '<p>Independent Custom Capabilities are added to a Customer\'s account immediately after checkout, and the Customer will have the Custom Capabilities for as long as their Membership lasts, based on their primary Subscription with your site, and/or forever, if they have a Lifetime account with you. In other words, Independent Custom Capabilities will exist on the Customer\'s account forever, or until an EOT <em>( End Of Term )</em> occurs on their primary Subscription with you; in which case optimizeMember would demote or delete the Customer\'s account <em>( based on your EOT configuration )</em>, and all Custom Capabilities are removed as well.</p>' . "\n";
         echo '<p>Very simple. All you do is customize the form fields provided, for each set of Custom Capabilities that you plan to sell. Then press (Generate Form Code). These special PayPal Forms are customized to work with optimizeMember seamlessly. The Customer will be granted additional access to one or more Custom Capabilities that you specify; while the Customer\'s Membership Level Access and any existing paid Subscription they may already have with you, will remain completely unaffected.</p>' . "\n";
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;">' . "\n";
         /**/
         echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-ccap-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-ccap-terms.php"))) . '</select></p>' . "\n";
         echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-desc" value="Description and pricing details here." size="68" /></p>' . "\n";
         echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-ccap-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalCcapFormGenerate();" class="button-primary" /></p>' . "\n";
         echo '<p>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember 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\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-ccaps" size="40" /></p>' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;">' . "\n";
         echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
         $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-ccaps-checkout-form-shortcode.php")));
         $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
     }
     /**/
     echo '<div class="ws-menu-page-group" title="PayPal Pro Billing Update Forms">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-update-forms-section">' . "\n";
     echo '<h3>One Form Does It All For Billing Updates ( copy/paste )</h3>' . "\n";
     echo '<p>An Update Form can be provided to existing Members, as a way for them to update their billing information; without modifying their existing paid Subscription in any way. For instance, a Customer may need to update their billing information, because their credit card is expiring, or because they moved their bank account.</p>' . "\n";
     /**/
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
     $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-update-form-shortcode.php")));
     echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-update-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     echo '<div class="ws-menu-page-group" title="PayPal Pro Billing Cancellation Forms">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-cancellation-forms-section">' . "\n";
     echo '<h3>One Form Does It All For Cancellations ( copy/paste )</h3>' . "\n";
     echo '<p>According to PayPal\'s policy on recurring billing, you MUST provide each and every Customer with an easy to way to cancel future charges. Generating a Cancellation Form here, and making that Form available to all Customers is our recommendation. For further details and legalities, please visit the <a href="https://www.x.com/" target="_blank" rel="external">PayPal Developer Network</a>.</p>' . "\n";
     echo '<p><em><strong>*Cancellation Process*</strong> Very simple. A Member clicks a link to a Post/Page that contains a Cancellation Form you\'ve generated. The Member clicks the Submit button to confirm the cancellation. optimizeMember is notified silently behind-the-scene, and will immediately cancel all future billing. optimizeMember will later terminate their account access, at the correct point in time. This works in conjunction with the optimizeMember Auto-EOT System. For further details, see: <code>optimizeMember -> PayPal Options -> EOT Behavior</code>.</em></p>' . "\n";
     /**/
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
     $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-cancellation-form-shortcode.php")));
     echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-cancellation-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     echo '<div class="ws-menu-page-group" title="PayPal Member Registration Access Links">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-reg-links-section">' . "\n";
     echo '<h3>Registration Access Link Generator ( for Customer Service )</h3>' . "\n";
     echo '<p>optimizeMember Pro Forms consolidate the Registration/Checkout process into a single-step solution, so it is unlikely that you will ever need this tool. That being said, if you DO need to deal with a Customer Service issue that requires a simple paid Registration Access Link to be created manually, you can use this tool for that. Alternatively, you can create their account yourself/manually by going to <code>optimizeMember -> Add A Member</code>. Either of these methods will work fine.</p>' . "\n";
     /**/
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     echo '<p>Paid Membership Level#: <select id="ws-plugin--optimizemember-pro-reg-link-level">' . "\n";
     for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) {
         $labelText = ws_plugin__optimizemember_getMembershipLabel($n);
         echo '<option value="' . $n . '">optimizeMember Level ' . $labelText . '</option>' . "\n";
     }
     echo '</select></p>' . "\n";
     echo '<p>Paid Subscr. ID: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-subscr-id" value="" size="50" /> <a href="#" onclick="alert(\'The Customer\\\'s Paid Subscr. ID ( aka: Recurring Profile ID, Transaction ID ) must be unique. This value can be obtained from inside your PayPal account in the History tab. Each paying Customer MUST be associated with a unique Paid Subscr. ID. If the Customer is NOT associated with a Paid Subscr. ID, you will need to generate a unique value for this field on your own. But keep in mind, optimizeMember will be unable to maintain future communication with the PayPal IPN ( i.e. Notification ) service if this value does not reflect a real Paid Subscr. ID that exists in your PayPal History log.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p>Custom String Value: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-custom" value="' . esc_attr($_SERVER["HTTP_HOST"]) . '" size="30" /> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\\n' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_pro_paypalRegLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-pro-reg-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
     echo '<p' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-ccaps" size="40" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \\-]/g, \'_\').replace (/[^a-z_0-9,]/gi, \'\').toLowerCase ());" /></p>' . "\n";
     echo '<p>Fixed Term Length ( for Buy Now transactions ): <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-fixed-term" value="" size="10" /> <a href="#" onclick="alert(\'If the Customer purchased Membership through a Buy Now transaction ( i.e. there is no Initial/Trial Period and no recurring charges for ongoing access ), you may configure a Fixed Term Length in this field. This way the Customer\\\'s Membership Access is revoked by optimizeMember at the appropriate time. This will be a numeric value, followed by a space, then a single letter.\\n\\nHere are some examples:\\n\\n1 D ( this means 1 Day )\\n1 W ( this means 1 Week )\\n1 M ( this means 1 Month )\\n1 Y ( this means 1 Year )\\n1 L ( this means 1 Lifetime )\'); return false;">[?]</a></p>' . "\n";
     echo '<p id="ws-plugin--optimizemember-pro-reg-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     echo '<div class="ws-menu-page-group" title="PayPal Specific Post/Page (Buy Now) Forms">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-sp-forms-section">' . "\n";
     echo '<h3>Pro Form Generator For Specific Post/Page Forms</h3>' . "\n";
     echo '<p>optimizeMember now supports an additional layer of functionality ( very powerful ), which allows you to sell access to specific Posts/Pages that you\'ve created in WordPress. Specific Post/Page Access works independently from Member Level Access. That is, you can sell an unlimited number of Posts/Pages using "Buy Now" functionality. 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 login, just to receive access to the Specific Post/Page they purchased access to. optimizeMember 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: <code>optimizeMember -> PayPal Options -> Specific Post/Page Email</code> ). 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 optimizeMember, might contain a download link for your eBook, access to file &amp; music downloads, access to additional support services, and the list goes on and 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. To protect Specific Posts/Pages, please see: <code>optimizeMember -> Restriction Options -> Specific Post/Page Access</code>. Once you\'ve configured your Specific Post/Page Restrictions, those Posts/Pages will be available in the menus below.</p>' . "\n";
     echo '<p>Very simple. All you do is customize the form fields provided, for each Post/Page that you plan to sell. Then press (Generate Form Code). These special PayPal Forms are customized to work with optimizeMember seamlessly. You can even Package Additional Posts/Pages together into one transaction.</p>' . "\n";
     echo '<p><em>* Forms are NOT saved here. This is only a Form Generator. Once you\'ve generated your Form, copy/paste it into any Post/Page you like. You\'ll want to provide your visitors with a link to the Post/Page where this Form is located.</em></p>' . "\n";
     /**/
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     /**/
     echo '<p><select id="ws-plugin--optimizemember-pro-sp-leading-id">' . "\n";
     echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
     /**/
     $ws_plugin__optimizemember_pro_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
     /**/
     foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n";
     }
     /**/
     echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     /**/
     echo '<p><select id="ws-plugin--optimizemember-pro-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
     echo '<optgroup label="&mdash; Package Additional Posts/Pages that you\'ve protected &mdash;">' . "\n";
     /**/
     foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n";
     }
     /**/
     echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     /**/
     echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-sp-hours">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-sp-hours.php"))) . '</select></p>' . "\n";
     echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-desc" value="Description and pricing details here." size="68" /></p>' . "\n";
     echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-sp-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalSpFormGenerate();" class="button-primary" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
     $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-form-shortcode.php")));
     $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s);
     echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     echo '<div class="ws-menu-page-group" title="PayPal Specific Post/Page Access Links">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-sp-links-section">' . "\n";
     echo '<h3>Specific Post/Page Link Generator ( for Customer Service )</h3>' . "\n";
     echo '<p>optimizeMember automatically generates Specific Post/Page Links for your Customers after checkout, and also sends them a link in a Confirmation Email. However, if you ever need to deal with a Customer Service issue that requires a new Specific Post/Page Link to be created manually, you can use this tool for that.</p>' . "\n";
     /**/
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     /**/
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;">' . "\n";
     /**/
     echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-leading-id">' . "\n";
     echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
     /**/
     $ws_plugin__optimizemember_pro_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
     /**/
     foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n";
     }
     /**/
     echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     /**/
     echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n";
     echo '<optgroup label="&mdash; Package Additional Posts/Pages that you\'ve protected &mdash;">' . "\n";
     /**/
     foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n";
     }
     /**/
     echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     /**/
     echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-hours">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-sp-hours.php"))) . '</select> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_pro_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-pro-sp-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
     echo '<p id="ws-plugin--optimizemember-pro-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="Custom Return URLs Upon Success">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-forms-success-section">' . "\n";
         echo '<h3>Custom Return URLs Upon Success ( optional, for developers )</h3>' . "\n";
         echo '<p>optimizeMember Pro opens the door for Custom Return URLs upon success. You can add a special attribute to any Form Shortcode ( <code>success="/my-thank-you-page/"</code> ). This makes it possible to integrate PayPal Pro Forms in very creative ways; and even receive/verify Replacement Code variables, as needed. For example, ( <code>success="/my-thank-you-page/?subscr_id=%%subscr_id%%"</code> ).</p>' . "\n";
         echo '<p><em>A Custom Return URL is 100% optional. In fact, if you only need to obtain details for the purpose of tracking sales, you should just use the simpler API Tracking methods provided by optimizeMember, under: <code>optimizeMember -> API / Tracking</code>. In other words, if you don\'t use the <code>success=""</code> attribute in your Shortcode, optimizeMember will handle things gracefully, all on its own. So using a Custom Return URL is only necessary when you need advanced customization for one reason or another.</em></p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Free Registration Forms ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-free-registration\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n";
         echo '<div id="ws-plugin--optimizemember-pro-forms-success-free-registration" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n";
         echo '<li><code>%%role%%</code> = The Role ID <code>( subscriber, optimizemember_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, 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>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n";
         echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use <a href="http://www.optimizepress.com/codex/stable/s2member/api_functions/package-functions/#src_doc_optimizemember_decrypt()" target="_blank" rel="external">optimizemember_decrypt()</a>.</li>' . "\n";
         echo '</ul>' . "\n";
         /**/
         echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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> optimizeMember -> 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 style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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 '</div>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Membership Sales / Signups &amp; Modifications ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-sales\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n";
         echo '<div id="ws-plugin--optimizemember-pro-forms-success-sales" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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>%%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 `optimizeMember -> API Notifications -> Payment Notifications` instead.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. This value is <code>always > 0</code>, no matter what. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. The %%regular%% rate is always > 0. 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>%%modification%%</code> = <code>1</code> if/when a Billing Modification has just taken place; otherwise <code>0</code> indicates a new Customer.</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 '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n";
         echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n";
         echo '</ul>' . "\n";
         /**/
         echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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> optimizeMember -> 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 style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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 '</div>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Independent Custom Capability Sales ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-ccaps\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n";
         echo '<div id="ws-plugin--optimizemember-pro-forms-success-ccaps" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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 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 '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n";
         echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n";
         echo '</ul>' . "\n";
         /**/
         echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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> optimizeMember -> 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 style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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 '</div>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Specific Post/Page Transactions ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-sp-sales\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n";
         echo '<div id="ws-plugin--optimizemember-pro-forms-success-sp-sales" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n";
         echo '<li><code>%%sp_access_url%%</code> = The full URL ( generated by optimizeMember ) 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>%%amount%%</code> = The full Amount of the sale. Most affiliate programs calculate commissions from this.</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 '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link to the Specific Post/Page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n";
         echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link to the Specific Post/Page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n";
         echo '</ul>' . "\n";
         /**/
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\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 '</div>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Cancellations &amp; Billing Updates ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-cancellations-updates\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n";
         echo '<div id="ws-plugin--optimizemember-pro-forms-success-cancellations-updates" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n";
         echo '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link back to their account page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n";
         echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link back to their account page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n";
         echo '</ul>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Verify The Integrity Of Replacement Codes ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-verification\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n";
         echo '<div id="ws-plugin--optimizemember-pro-forms-success-verification" style="display:none;">' . "\n";
         echo '<p>If you know a little PHP, you can verify the integrity of the Replacement Codes returned by optimizeMember. This is important, because in this particular situation, Replacement Codes are passed publicly in the query string of your Custom Return URL. In other words, a Customer could manually change one of the values; like the dollar amounts. For this reason, you should always verify the integrity of the details being returned to any processing routines that receive this information. In the PHP code for your Custom Return URL, you can use this optimizeMember API Function: <code>optimizemember_pro_paypal_s2p_v_query_ok()</code>.</p>' . "\n";
         echo '<p>Here are some examples:</p>' . "\n";
         echo '<p>1. <strong>Shortcode attribute:</strong> <code>success="/thank-you/?subscr_id=%%subscr_id%%&amp;initial=%%initial%%&amp;regular=%%regular%%"</code></p>' . "\n";
         echo '<p>2. <strong>optimizeMember returns Customer to:</strong> <code>/thank-you/?subscr_id=123&amp;initial=0.00&amp;regular=24.95&amp;s2p-v=234098234-23409sdfs234sd234209sdf</code></p>' . "\n";
         echo '<p>3. <strong>Now, in your Custom Return Page, you will need to do this before trusting anything:</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-s2p-v-query-ok-1.x-php")) . '</p>' . "\n";
         echo '<p>optimizeMember will only verify a query string for up to 10 seconds. After 10 seconds, <code>optimizemember_pro_paypal_s2p_v_query_ok()</code> will always return <code>false</code>, even if the integrity of the query string is valid. This prevents a Customer from bookmarking your Return URL; thereby causing duplicate commissions; in case you\'re using it for tracking purposes.</p>' . "\n";
         echo '<p>Again, if you only need to obtain details for the purpose of tracking sales, you should just use the simpler API Tracking methods provided by optimizeMember, under: <code>optimizeMember -> API / Tracking</code>. The API Tracking methods are specifically designed for tracking sales, exactly ONE time for each Customer.</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><em>If it is your intention to allow Customers to bookmark your Custom Return URL, you can still do that. Just be aware that <code>optimizemember_pro_paypal_s2p_v_query_ok()</code> will return <code>false</code> after the first 10 seconds. If you want to verify after 10 seconds, you can pass a second argument to the function, like this:</em></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-s2p-v-query-ok-2.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Could a Customer change the timestamp in the URL?</h3>' . "\n";
         echo '<p>Based on the structure of the URL, it would appear possible; however, it\'s NOT. optimizeMember uses an advanced checksum.</p>' . "\n";
         echo '<h3>Can I get rid of the <code>s2p-v</code> variable?</h3>' . "\n";
         echo '<p>No, this variable is always passed to your Custom Return URL, it\'s for important verification purposes.</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
     }
     /**/
     echo '<div class="ws-menu-page-group" title="Shortcode Attributes ( Explained )">' . "\n";
     /**/
     echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-shortcode-attrs-section">' . "\n";
     echo '<h3>Shortcode Attributes ( Explained In Full Detail )</h3>' . "\n";
     echo '<p>When you generate a Form, optimizeMember will make a <a href="http://codex.wordpress.org/Shortcode_API#Overview" target="_blank" rel="external">Shortcode</a> available to you. Like most Shortcodes for WordPress, optimizeMember reads Attributes in your Shortcode. These Attributes will be pre-configured by one of optimizeMember\'s Form Generators automatically; so there really is nothing more you need to do. However, many site owners like to know exactly how these Shortcode Attributes work. Below, is a brief overview of each possible Shortcode Attribute.</p>' . "\n";
     /**/
     echo '<table class="form-table" style="margin-top:0;">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr style="padding-top:0;">' . "\n";
     /**/
     echo '<td style="padding-top:0;">' . "\n";
     echo '<ul>' . "\n";
     echo '<li><code>accept="paypal,visa,mastercard,amex,discover,maestro,solo"</code> Accepted Billing Methods. A comma-delimited list of Billing Methods you want to accept. Due to a PayPal policy, you may NOT exclude PayPal from this list; optimizeMember won\'t let you. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>accept_via_paypal="paypal"</code> Accepted Billing via PayPal. A comma-delimited list of Billing Methods you want to accept through PayPal, as opposed to processing them on-site. Due to a PayPal policy, you may NOT exclude PayPal from this list; optimizeMember won\'t let you. <strong>Tip:</strong> If you don\'t have a PayPal Pro account, you can set <code>accept="paypal"</code>, or set <code>accept_via_paypal="paypal,visa,mastercard,amex,discover,maestro,solo"</code>. With one or both of these configurations, all you need is a PayPal Standard account with Express Checkout <em>( which is free )</em>. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>accept_coupons="1"</code> Accept Coupons? Possible values: <code>0</code> = do NOT accept Coupons on this particular Form; <code>1</code> = DO accept Coupon Codes on this particular Form.</li>' . "\n";
     echo '<li><code>cancel="0"</code> Cancellation Form. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Cancellation Form, <code>1</code> = this IS a Cancellation Form.</li>' . "\n";
     echo '<li><code>captcha="clean"</code> When you set this Attribute, visitors must prove they\'re human by typing a <a href="http://en.wikipedia.org/wiki/CAPTCHA" target="_blank" rel="external">captcha/security code</a>. Possible values: <code>0</code> = do NOT require a captcha code on this Form; <code>clean</code> = DO require a captcha code on this Form; using the <code>clean</code> theme style. Possible theme styles include: <code>red</code>, <code>white</code>, <code>clean</code>, and <code>blackglass</code>. This service is powered by Google\'s reCaptcha system.</li>' . "\n";
     echo '<li><code>cc="USD"</code> 3 character Currency Code. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>ccaps="music,videos"</code> A comma-delimited list of Custom Capabilities. Only valid w/ Membership Level Access and/or Independent Custom Capabilities.</li>' . "\n" : '';
     echo '<li><code>coupon="SAVE-10"</code> Default/pre-filled Coupon Code. This is optional, and the Coupon Code ( if supplied ) must exist in your Coupon Code configuration.</li>' . "\n";
     echo '<li><code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '"</code> must start with your domain. Additional values can be piped in ( ex: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3|etc"</code> ). Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>default_country_code="US"</code> If you set this 2-character value, it will pre-configure the default Country that is selected in the drop-down menu for Checkout and Billing Update Forms. This MUST be an uppercase country code, following the <a href="http://www.iso.org/iso/english_country_names_and_code_elements" target="_blank" rel="external">ISO-3166-1 specification</a>. If this is empty ( i.e. <code>""</code> ) optimizeMember will set the default country code automatically; based on currency. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>desc="Gold Membership @ $29/mo"</code> A brief purchase Description. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>dg="0"</code> The Digital Goods directive. optimizeMember will eventually be integrated with <a href="http://www.optimizepress.com/paypal-express-co-digitals" target="_blank" rel="external">Digital Goods</a> for inline Express Checkout. But for now, this should always be <code>0</code>.</li>' . "\n";
     echo '<li><code>exp="72"</code> Access Expires ( in hours ). Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
     echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
     echo '<li><code>lc=""</code> Optional 2 character Locale Code <em>( i.e. Country Code )</em>. This controls the interface language used if/when a Customer chooses PayPal Express Checkout as their payment method. If unspecified, the language is determined by PayPal Express Checkout when possible, defaulting to <code>US</code> <em>english</em> when not possible. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>level="1"</code> Membership Level [1-4] <em>( or, up to the number of configured Levels )</em>. Only valid for Forms providing Membership Level Access, which includes Free Registration Forms too. Free Registration Forms allow a value of <code>level="0"</code> whenever <code>register="1"</code> for Free Registration. In addition, Free Registration Forms will also allow visitors to register for free, even at higher Levels if you wish. Free Registration Forms will accept any value [0-4] <em>( or, up to the number of configured Levels )</em>.' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' With Independent Custom Capabilities this MUST be set to <code>level="*"</code>, and <code>ccaps=""</code> must NOT be empty <em>( i.e. <code>level="*" ccaps="music,videos"</code> )</em>.') . '</li>' . "\n";
     echo '<li><code>modify="0"</code> Modification directive. Only valid w/ Membership Level Access. Possible values: <code>0</code> = allows Customers to modify their current Subscription or sign up for a new one, <code>1</code> = allows Customers to only modify their current Subscription. When <code>modify="1"</code>, optimizeMember will force a Customer to be logged-in before they can fill out the Form ( very handy ). This is slightly different than PayPal "Button" Codes; there is no "2" option for "Forms"; only <code>0</code> &amp; <code>1</code> are valid values.</li>' . "\n";
     echo '<li><code>ns="1"</code> The <em>no_shipping</em> directive. Possible values: <code>0</code> = prompt for an address, but do not require one, <code>1</code> = do not prompt for a shipping address, <code>2</code> = prompt for an address, and require one. Applies only to PayPal Express Checkout; because Pro Forms do not ask for a Shipping Address. However, you may request a Shipping Address by creating Custom Fields under: <em>optimizeMember -> General Options -> Registration/Profile Fields</em>. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>ps="paypal"</code> PayPal checkout Page Style. Applies only to PayPal Express Checkout. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>register="0"</code> Free Registration Form. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Free Registration Form, <code>1</code> = this IS a Free Registration Form.</li>' . "\n";
     echo '<li><code>ra="0.01"</code> Regular, Buy Now, and/or Recurring Amount. Must be &gt;= <code>0.01</code>. Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>rp="1"</code> Regular Period. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Must be &gt;= <code>1</code> ( ex: <code>1</code> Week, <code>2</code> Months, <code>1</code> Month, <code>3</code> Days ).</li>' . "\n";
     echo '<li><code>rt="M"</code> Regular Term. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years, <code>L</code> = Lifetime. — <strong>NOTICE (regarding Payflow):</strong> Please be aware that <code>D</code> = Days is NOT possible under PayPal Pro (Payflow Edition). If you are operating a PayPal Pro account, with the Payflow Edition, please take note. Payflow supports ONLY a specific set of recurring intervals. Pro Forms integrated with the Payflow API, can be configured to charge: weekly, bi-weekly, monthly, quarterly, every six months, or yearly.</li>' . "\n";
     echo '<li><code>rr="1"</code> Recurring directive. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>0</code> = non-recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>1</code> = recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>BN</code> = non-recurring "Buy Now" functionality, no Trial Period possible.</li>' . "\n";
     echo '<li><code>rrt=""</code> Recurring Times <em>( i.e. a fixed number of installments )</em>. Only valid w/ Membership Level Access. When unspecified, any recurring charges will remain ongoing until cancelled, or until payments start failing. If this is set to <code>1 or higher</code> the regular recurring charges will only continue for X billing cycles, depending on what you specify. This is only valid when <code>rr="1"</code> for recurring "Subscriptions". Please note that a fixed number of installments, also means a fixed period of access. If a Customer\'s billing is monthly, and you set <code>rrt="3"</code>, billing will continue for only 3 monthly installments. After that, billing would stop, and their access to the site would be revoked as well <em>( based on your EOT Behavior setting under: optimizeMember -> PayPal Options )</em>.</li>' . "\n";
     echo '<li><code>rra="2"</code> Reattempt failed payments? Possible values: <code>0</code> = do NOT reattempt billing when/if a recurring payment fails; <code>1 or higher</code> = yes, DO reattempt billing when/if a recurring payment fails. With PayPal Pro integration, PayPal will retry a maximum of 2 times whenever <code>rra="2"</code>; after that, a Subscription would be terminated due to Max Failed Payments having been reached. With PayPal Pro integration, the value of this attribute also configures Max Failed Payments. So a setting of <code>rra="2"</code> means that you allow a maximum of 2 failed payments.</li>' . "\n";
     echo '<li><code>sp="0"</code> Specific Post/Page Form. Possible values: <code>0</code> = this is NOT a Specific Post/Page Access Form, <code>1</code> = this IS a Specific Post/Page Access Form.</li>' . "\n";
     echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>success=""</code> 100% optional. This can be used to create a Custom Return URL on success. Please see the sub-section above titled: <em>Custom Return URLs on Success</em>.</li>' . "\n" : '';
     echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>template=""</code> 100% optional. This can be a custom template file that exists inside your WordPress theme directory. For example: <code>template="checkout.php"</code>.</li>' . "\n" : '';
     echo '<li><code>ta="0.00"</code> Trial Amount. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n";
     echo '<li><code>tp="0"</code> Trial Period. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n";
     echo '<li><code>tt="D"</code> Trial Term. Only valid w/ Membership Level Access. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years.</li>' . "\n";
     echo '<li><code>update="0"</code> Billing Update Form. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Billing Update Form, <code>1</code> = this IS a Billing Update Form.</li>' . "\n";
     echo '</ul>' . "\n";
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
     /**/
     echo '</div>' . "\n";
     /**/
     echo '</td>' . "\n";
     /**/
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__optimizemember_menu_pages_rs::display();
     echo '</td>' . "\n";
     /**/
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     /**/
     echo '</div>' . "\n";
     echo '</div>' . "\n";
 }
Beispiel #16
0
 /**
  * Shortcode `[optimizeMember-Pro-Stripe-Form /]`.
  *
  * @package optimizeMember\Stripe
  * @since 140617
  *
  * @attaches-to ``add_shortcode('optimizeMember-Pro-Stripe-Form');``
  *
  * @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 resulting Form Code, HTML markup.
  */
 public static function sc_stripe_form($attr, $content = '', $shortcode = '')
 {
     $raw_content = $content;
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__optimizemember_pro_before_sc_stripe_form', get_defined_vars());
     unset($__refs, $__v);
     // Ditch these temporary vars.
     c_ws_plugin__optimizemember_no_cache::no_cache_constants(TRUE);
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     $options = array();
     // Initialize options to an empty array.
     $option_selections = '';
     // Initialize w/ no options.
     if ($content && ($content = strip_tags($content))) {
         // This allows for nested Pro Form Shortcodes as options.
         $content = str_replace('optimizeMember-Pro-Stripe-Form ', 'optimizeMember-Pro-Stripe-xFormOption ', $content);
     }
     if ($content && ($content_options = do_shortcode($content))) {
         foreach (preg_split('/\\s*\\|\\:\\:\\|\\s*/', $content_options, NULL, PREG_SPLIT_NO_EMPTY) as $_content_option_key => $_content_option) {
             $_content_option_id = $_content_option_key + 1;
             $options[$_content_option_id] = maybe_unserialize(trim($_content_option));
             if (!is_array($options[$_content_option_id])) {
                 unset($options[$_content_option_id]);
                 continue;
                 // Invalid option.
             }
             if (!empty($_REQUEST['s2p-option']) && (int) $_REQUEST['s2p-option'] === $_content_option_id) {
                 $options[$_content_option_id]['selected'] = TRUE;
             }
         }
         unset($_content_option_key, $_content_option, $_content_option_id);
         // Housekeeping.
         foreach ($options as $_option_id => $_option) {
             if (!empty($_option['selected'])) {
                 $attr = array_merge($attr, $_option);
                 $_selected_option_id = $_option_id;
             }
         }
         unset($_option_id, $_option);
         // Housekeeping.
         if (empty($_selected_option_id)) {
             foreach ($options as $_option_id => $_option) {
                 $attr = array_merge($attr, $_option);
                 break;
                 // Force a selected option (default).
             }
         }
         unset($_option_id, $_option, $_selected_option_id);
         // Housekeeping.
         foreach ($options as $_option_id => $_option) {
             // Build option selections.
             $option_selections .= '<option value="' . esc_attr($_option_id) . '"' . (!empty($_option['selected']) ? ' selected="selected"' : '') . '>' . esc_html($_option['desc']) . '</option>';
         }
         unset($_option_id, $_option);
         // Housekeeping.
     }
     $attr = shortcode_atts(array('ids' => '0', 'exp' => '72', 'level' => @$attr['register'] ? '0' : '1', 'ccaps' => '', 'desc' => '', 'cc' => 'USD', 'custom' => $_SERVER['HTTP_HOST'], 'ta' => '0', 'tp' => '0', 'tt' => 'D', 'ra' => '0.01', 'rp' => '1', 'rt' => 'M', 'rr' => '1', 'rrt' => '', 'modify' => '0', 'cancel' => '0', 'sp' => '0', 'register' => '0', 'update' => '0', 'coupon' => '', 'accept_coupons' => '0', 'default_country_code' => 'US', 'captcha' => '', 'template' => '', 'success' => ''), $attr);
     $attr['tt'] = strtoupper($attr['tt']);
     // Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts().
     $attr['rt'] = strtoupper($attr['rt']);
     // Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts().
     $attr['rr'] = strtoupper($attr['rr']);
     // Must be provided in upper-case format. Numerical, or BN value. Only after running shortcode_atts().
     $attr['ccaps'] = strtolower($attr['ccaps']);
     // Custom Capabilities must be typed in lower-case format. Only after running shortcode_atts().
     $attr['ccaps'] = str_replace(' ', '', $attr['ccaps']);
     // Custom Capabilities should not have spaces.
     $attr['rr'] = $attr['rt'] === 'L' ? 'BN' : $attr['rr'];
     // Lifetime Subscriptions require Buy Now. Only after running shortcode_atts().
     $attr['rr'] = $attr['level'] === '*' ? 'BN' : $attr['rr'];
     // Independent Ccaps require Buy Now. Only after running shortcode_atts().
     $attr['rr'] = !$attr['tp'] && !$attr['rr'] ? 'BN' : $attr['rr'];
     // No Trial / non-recurring. Only after running shortcode_atts().
     $attr['default_country_code'] = strtoupper($attr['default_country_code']);
     // This MUST be in uppercase format.
     $attr['success'] = c_ws_plugin__optimizemember_utils_urls::n_amps($attr['success']);
     // Normalize ampersands.
     $attr['coupon'] = !empty($_GET['s2p-coupon']) ? trim(strip_tags(stripslashes($_GET['s2p-coupon']))) : $attr['coupon'];
     $attr['singular'] = get_the_ID();
     // Collect the Singular ID for this Post/Page.
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__optimizemember_pro_before_sc_stripe_form_after_shortcode_atts', get_defined_vars());
     unset($__refs, $__v);
     // Ditch these temporary vars.
     if ($attr['cancel']) {
         $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
         $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_cancellation_response($attr);
         $_p = $response['response'] && !$response['error'] ? array() : $_p;
         if ($attr['captcha']) {
             $captcha = '<div id="optimizemember-pro-stripe-cancellation-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-cancellation-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-cancellation-form-captcha-section">' . "\n";
             $captcha .= '<div id="optimizemember-pro-stripe-cancellation-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-cancellation-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-cancellation-form-captcha-section-title">' . "\n";
             $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n";
             $captcha .= '</div>' . "\n";
             $captcha .= '<div id="optimizemember-pro-stripe-cancellation-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-cancellation-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-cancellation-form-captcha-div">' . "\n";
             $captcha .= '<label id="optimizemember-pro-stripe-cancellation-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-cancellation-form-captcha-label">' . "\n";
             $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 10) . "\n";
             $captcha .= '</label>' . "\n";
             $captcha .= '</div>' . "\n";
             $captcha .= '</div>' . "\n";
         } else {
             $captcha = '';
         }
         // Not applicable.
         $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_cancellation[nonce]" id="optimizemember-pro-stripe-cancellation-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-cancellation')) . '" />';
         $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_cancellation[attr]" id="optimizemember-pro-stripe-cancellation-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
         $hidden_inputs .= '<input type="hidden" name="s2p-option" value="' . esc_attr((string) @$_REQUEST['s2p-option']) . '" />';
         $custom_template = file_exists(TEMPLATEPATH . '/stripe-cancellation-form.php') ? TEMPLATEPATH . '/stripe-cancellation-form.php' : FALSE;
         $custom_template = file_exists(TEMPLATEPATH . '/stripe-cancellation-form.html') ? TEMPLATEPATH . '/stripe-cancellation-form.html' : $custom_template;
         $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template;
         $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template;
         $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-cancellation-form.php'));
         $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code);
         $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code);
         $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code);
         $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code);
         $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code);
         $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code);
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__optimizemember_pro_during_sc_stripe_cancellation_form', get_defined_vars());
         unset($__refs, $__v);
         // Ditch these temporary vars.
     } else {
         if ($attr['register']) {
             $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
             $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_registration_response($attr);
             $_p = $response['response'] && !$response['error'] ? array() : $_p;
             $custom_fields = '';
             // Initialize custom fields.
             if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields']) {
                 // Only display Custom Fields if configured.
                 if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level($attr['level'], 'registration')) {
                     $tabindex = 99;
                     // Start tabindex at 99 ( +1 below = 100 ).
                     $custom_fields = '<div id="optimizemember-pro-stripe-registration-form-custom-fields-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-registration-form-section optimizemember-pro-stripe-form-custom-fields-section optimizemember-pro-stripe-registration-form-custom-fields-section">' . "\n";
                     $custom_fields .= '<div id="optimizemember-pro-stripe-registration-form-custom-fields-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-registration-form-section-title optimizemember-pro-stripe-form-custom-fields-section-title optimizemember-pro-stripe-registration-form-custom-fields-section-title">' . "\n";
                     $custom_fields .= _x('Additional Info', 's2member-front', 's2member') . "\n";
                     $custom_fields .= '</div>' . "\n";
                     foreach (json_decode($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields'], TRUE) as $field) {
                         if (in_array($field['id'], $fields_applicable)) {
                             $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
                             $field_id_class = preg_replace('/_/', '-', $field_var);
                             if (!empty($field['section']) && $field['section'] === 'yes') {
                                 // Starts a new section?
                                 $custom_fields .= '<div id="optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-divider-section" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-custom-reg-field-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . '">' . (!empty($field['sectitle']) ? $field['sectitle'] : '') . '</div>';
                             }
                             $custom_fields .= '<div id="optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-div optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-div">' . "\n";
                             $custom_fields .= '<label for="optimizemember-pro-stripe-registration-custom-reg-field-' . esc_attr($field_id_class) . '" id="optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-label" class="optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-label optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-label">' . "\n";
                             $custom_fields .= '<span' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? ' style="display:none;"' : '') . '>' . $field['label'] . ($field['required'] === 'yes' ? ' *' : '') . '</span></label>' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? '' : '<br />') . "\n";
                             $custom_fields .= c_ws_plugin__optimizemember_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, 'optimizemember_pro_stripe_registration[custom_fields][', 'optimizemember-pro-stripe-registration-custom-reg-field-', 'optimizemember-pro-stripe-custom-reg-field-' . $field_id_class . ' optimizemember-pro-stripe-registration-custom-reg-field-' . $field_id_class, '', $tabindex = $tabindex + 1, '', $_p, @$_p['optimizemember_pro_stripe_registration']['custom_fields'][$field_var], 'registration');
                             $custom_fields .= '</div>' . "\n";
                         }
                     }
                     $custom_fields .= '</div>' . "\n";
                 }
             }
             if ($attr['captcha']) {
                 $captcha = '<div id="optimizemember-pro-stripe-registration-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-registration-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-registration-form-captcha-section">' . "\n";
                 $captcha .= '<div id="optimizemember-pro-stripe-registration-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-registration-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-registration-form-captcha-section-title">' . "\n";
                 $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n";
                 $captcha .= '</div>' . "\n";
                 $captcha .= '<div id="optimizemember-pro-stripe-registration-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-registration-form-captcha-div">' . "\n";
                 $captcha .= '<label id="optimizemember-pro-stripe-registration-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-registration-form-captcha-label">' . "\n";
                 $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 200) . "\n";
                 $captcha .= '</label>' . "\n";
                 $captcha .= '</div>' . "\n";
                 $captcha .= '</div>' . "\n";
             } else {
                 $captcha = '';
             }
             // Not applicable.
             if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) {
                 $opt_in = '<div id="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-custom-reg-field-opt-in-div optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-div">' . "\n";
                 $opt_in .= '<label for="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in" id="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-label" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in-label optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-label">' . "\n";
                 $opt_in .= '<input type="checkbox" name="optimizemember_pro_stripe_registration[custom_fields][opt_in]" id="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] == 1 || @$_p['optimizemember_pro_stripe_registration']['custom_fields']['opt_in'] ? ' checked="checked"' : '') . ' tabindex="300" />' . "\n";
                 $opt_in .= $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in_label'] . "\n";
                 $opt_in .= '</label>' . '\\n';
                 $opt_in .= '</div>' . '\\n';
             } else {
                 $opt_in = '';
             }
             // Not applicable.
             $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_registration[nonce]" id="optimizemember-pro-stripe-registration-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-registration')) . '" />';
             $hidden_inputs .= !$GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_names'] ? '<input type="hidden" id="optimizemember-pro-stripe-registration-names-not-required-or-not-possible" value="1" />' : '';
             $hidden_inputs .= !$GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_password'] ? '<input type="hidden" id="optimizemember-pro-stripe-registration-password-not-required-or-not-possible" value="1" />' : '';
             $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_registration[attr]" id="optimizemember-pro-stripe-registration-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
             $hidden_inputs .= '<input type="hidden" name="s2p-option" value="' . esc_attr((string) @$_REQUEST['s2p-option']) . '" />';
             $custom_template = file_exists(TEMPLATEPATH . '/stripe-registration-form.php') ? TEMPLATEPATH . '/stripe-registration-form.php' : FALSE;
             $custom_template = file_exists(TEMPLATEPATH . '/stripe-registration-form.html') ? TEMPLATEPATH . '/stripe-registration-form.html' : $custom_template;
             $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template;
             $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template;
             $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-registration-form.php'));
             $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code);
             $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code);
             $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code);
             $code = preg_replace('/%%options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($option_selections), $code);
             $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code);
             $code = preg_replace('/%%first_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_registration']['first_name'])), $code);
             $code = preg_replace('/%%last_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_registration']['last_name'])), $code);
             $code = preg_replace('/%%email_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['email'])), $code);
             $code = preg_replace('/%%username_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['username'])), $code);
             $code = preg_replace('/%%password1_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['password1'])), $code);
             $code = preg_replace('/%%password2_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['password2'])), $code);
             $code = preg_replace('/%%custom_fields%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($custom_fields), $code);
             $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code);
             $code = preg_replace('/%%opt_in%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($opt_in), $code);
             $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code);
             foreach (array_keys(get_defined_vars()) as $__v) {
                 $__refs[$__v] =& ${$__v};
             }
             do_action('ws_plugin__optimizemember_pro_during_sc_stripe_registration_form', get_defined_vars());
             unset($__refs, $__v);
             // Ditch these temporary vars.
         } else {
             if ($attr['update']) {
                 $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
                 $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_update_response($attr);
                 $_p = $response['response'] && !$response['error'] ? array() : $_p;
                 if ($attr['captcha']) {
                     $captcha = '<div id="optimizemember-pro-stripe-update-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-update-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-update-form-captcha-section">' . "\n";
                     $captcha .= '<div id="optimizemember-pro-stripe-update-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-update-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-update-form-captcha-section-title">' . "\n";
                     $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n";
                     $captcha .= '</div>' . "\n";
                     $captcha .= '<div id="optimizemember-pro-stripe-update-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-update-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-update-form-captcha-div">' . "\n";
                     $captcha .= '<label id="optimizemember-pro-stripe-update-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-update-form-captcha-label">' . "\n";
                     $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 200) . "\n";
                     $captcha .= '</label>' . "\n";
                     $captcha .= '</div>' . "\n";
                     $captcha .= '</div>' . "\n";
                 } else {
                     $captcha = '';
                 }
                 // Not applicable.
                 $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_update[nonce]" id="optimizemember-pro-stripe-update-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-update')) . '" />';
                 $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_update[card_token]" id="optimizemember-pro-stripe-update-card-token" value="' . esc_attr(@$_p['optimizemember_pro_stripe_update']['card_token']) . '" />';
                 $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_update[card_token_summary]" id="optimizemember-pro-stripe-update-card-token-summary" value="' . esc_attr(@$_p['optimizemember_pro_stripe_update']['card_token_summary']) . '" />';
                 $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_update[attr]" id="optimizemember-pro-stripe-update-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
                 $hidden_inputs .= '<input type="hidden" name="s2p-option" value="' . esc_attr((string) @$_REQUEST['s2p-option']) . '" />';
                 $custom_template = file_exists(TEMPLATEPATH . '/stripe-update-form.php') ? TEMPLATEPATH . '/stripe-update-form.php' : FALSE;
                 $custom_template = file_exists(TEMPLATEPATH . '/stripe-update-form.html') ? TEMPLATEPATH . '/stripe-update-form.html' : $custom_template;
                 $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template;
                 $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template;
                 $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-update-form.php'));
                 $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code);
                 $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code);
                 $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code);
                 $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code);
                 $code = preg_replace('/%%card_token%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_update']['card_token'])), $code);
                 $code = preg_replace('/%%card_token_summary%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_update']['card_token_summary'])), $code);
                 $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code);
                 $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code);
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 do_action('ws_plugin__optimizemember_pro_during_sc_stripe_update_form', get_defined_vars());
                 unset($__refs, $__v);
                 // Ditch these temporary vars.
             } else {
                 if ($attr['sp']) {
                     $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
                     $attr['sp_ids_exp'] = 'sp:' . $attr['ids'] . ':' . $attr['exp'];
                     // Combined `sp:ids:expiration hours`.
                     $attr['coupon'] = !empty($_p['optimizemember_pro_stripe_sp_checkout']['coupon']) ? $_p['optimizemember_pro_stripe_sp_checkout']['coupon'] : $attr['coupon'];
                     $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_sp_checkout_response($attr);
                     $_p = $response['response'] && !$response['error'] ? array() : $_p;
                     $country_default_by_currency = !@$_p['optimizemember_pro_stripe_sp_checkout']['country'] && $attr['cc'] === 'USD' ? 'US' : '';
                     $country_default_by_currency = !@$_p['optimizemember_pro_stripe_sp_checkout']['country'] && $attr['cc'] === 'CAD' ? 'CA' : $country_default_by_currency;
                     $country_default_by_currency = !@$_p['optimizemember_pro_stripe_sp_checkout']['country'] && $attr['cc'] === 'GBP' ? 'GB' : $country_default_by_currency;
                     $country_default_by_currency = apply_filters('ws_plugin__optimizemember_pro_stripe_default_country', $country_default_by_currency, get_defined_vars());
                     $default_country_v = $attr['default_country_code'] ? $attr['default_country_code'] : $country_default_by_currency;
                     $country_options = '<option value=""></option>';
                     // Start with an empty option value.
                     foreach (preg_split('/[' . "\r\n" . ']+/', file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . '/iso-3166-1.txt')) as $country) {
                         list($country_l, $country_v) = preg_split('/;/', $country, 2);
                         if ($country_l && $country_v) {
                             // Here we also check on the default pre-selected country; as determined above; based on currency.
                             $country_options .= '<option value="' . esc_attr(strtoupper($country_v)) . '"' . (@$_p['optimizemember_pro_stripe_sp_checkout']['country'] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>';
                         }
                     }
                     if ($attr['captcha']) {
                         $captcha = '<div id="optimizemember-pro-stripe-sp-checkout-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-sp-checkout-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-sp-checkout-form-captcha-section">' . "\n";
                         $captcha .= '<div id="optimizemember-pro-stripe-sp-checkout-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-sp-checkout-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-sp-checkout-form-captcha-section-title">' . "\n";
                         $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n";
                         $captcha .= '</div>' . "\n";
                         $captcha .= '<div id="optimizemember-pro-stripe-sp-checkout-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-sp-checkout-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-sp-checkout-form-captcha-div">' . "\n";
                         $captcha .= '<label id="optimizemember-pro-stripe-sp-checkout-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-sp-checkout-form-captcha-label">' . "\n";
                         $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 300) . "\n";
                         $captcha .= '</label>' . "\n";
                         $captcha .= '</div>' . "\n";
                         $captcha .= '</div>' . "\n";
                     } else {
                         $captcha = '';
                     }
                     // Not applicable.
                     /*
                     Build the opt-in checkbox.
                     */
                     if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) {
                         $opt_in = '<div id="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-sp-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-opt-in-div optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-div">' . "\n";
                         $opt_in .= '<label for="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in" id="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-label" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in-label optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-label">' . "\n";
                         $opt_in .= '<input type="checkbox" name="optimizemember_pro_stripe_sp_checkout[custom_fields][opt_in]" id="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] == 1 || @$_p['optimizemember_pro_stripe_sp_checkout']['custom_fields']['opt_in'] ? ' checked="checked"' : '') . ' tabindex="400" />' . "\n";
                         $opt_in .= $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in_label'] . "\n";
                         $opt_in .= '</label>' . "\n";
                         $opt_in .= '</div>' . "\n";
                     } else {
                         $opt_in = '';
                     }
                     // Not applicable.
                     $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[nonce]" id="optimizemember-pro-stripe-sp-checkout-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-sp-checkout')) . '" />';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[card_token]" id="optimizemember-pro-stripe-sp-checkout-card-token" value="' . esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token']) . '" />';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[card_token_summary]" id="optimizemember-pro-stripe-sp-checkout-card-token-summary" value="' . esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token_summary']) . '" />';
                     $hidden_inputs .= !$attr['accept_coupons'] ? '<input type="hidden" id="optimizemember-pro-stripe-sp-checkout-coupons-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= !c_ws_plugin__optimizemember_pro_stripe_utilities::tax_may_apply() ? '<input type="hidden" id="optimizemember-pro-stripe-sp-checkout-tax-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= ($cp_attr = c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'])) && $cp_attr['ta'] <= 0.0 && $cp_attr['ra'] <= 0.0 ? '<input type="hidden" id="optimizemember-pro-stripe-sp-checkout-payment-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[attr]" id="optimizemember-pro-stripe-sp-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
                     $custom_template = file_exists(TEMPLATEPATH . '/stripe-sp-checkout-form.php') ? TEMPLATEPATH . '/stripe-sp-checkout-form.php' : FALSE;
                     $custom_template = file_exists(TEMPLATEPATH . '/stripe-sp-checkout-form.html') ? TEMPLATEPATH . '/stripe-sp-checkout-form.html' : $custom_template;
                     $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template;
                     $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template;
                     $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-sp-checkout-form.php'));
                     $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code);
                     $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code);
                     $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code);
                     $code = preg_replace('/%%options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($option_selections), $code);
                     $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code);
                     $code = preg_replace('/%%coupon_response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'], 'response', array('affiliates-1px-response'))), $code);
                     $code = preg_replace('/%%coupon_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit($attr['coupon'])), $code);
                     $code = preg_replace('/%%first_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['first_name'])), $code);
                     $code = preg_replace('/%%last_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['last_name'])), $code);
                     $code = preg_replace('/%%email_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_sp_checkout']['email'])), $code);
                     $code = preg_replace('/%%card_token%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token'])), $code);
                     $code = preg_replace('/%%card_token_summary%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token_summary'])), $code);
                     $code = preg_replace('/%%state_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_sp_checkout']['state'])), $code);
                     $code = preg_replace('/%%country_options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($country_options), $code);
                     $code = preg_replace('/%%zip_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_sp_checkout']['zip'])), $code);
                     $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code);
                     $code = preg_replace('/%%opt_in%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($opt_in), $code);
                     $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code);
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     do_action('ws_plugin__optimizemember_pro_during_sc_stripe_sp_form', get_defined_vars());
                     unset($__refs, $__v);
                     // Ditch these temporary vars.
                 } else {
                     $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
                     $attr['level_ccaps_eotper'] = $attr['rr'] === 'BN' && $attr['rt'] !== 'L' ? $attr['level'] . ':' . $attr['ccaps'] . ':' . $attr['rp'] . ' ' . $attr['rt'] : $attr['level'] . ':' . $attr['ccaps'];
                     $attr['level_ccaps_eotper'] = rtrim($attr['level_ccaps_eotper'], ':');
                     // Clean any trailing separators from this string.
                     $attr['coupon'] = !empty($_p['optimizemember_pro_stripe_checkout']['coupon']) ? $_p['optimizemember_pro_stripe_checkout']['coupon'] : $attr['coupon'];
                     $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_checkout_response($attr);
                     $_p = $response['response'] && !$response['error'] ? array() : $_p;
                     $country_default_by_currency = !@$_p['optimizemember_pro_stripe_checkout']['country'] && $attr['cc'] === 'USD' ? 'US' : '';
                     $country_default_by_currency = !@$_p['optimizemember_pro_stripe_checkout']['country'] && $attr['cc'] === 'CAD' ? 'CA' : $country_default_by_currency;
                     $country_default_by_currency = !@$_p['optimizemember_pro_stripe_checkout']['country'] && $attr['cc'] === 'GBP' ? 'GB' : $country_default_by_currency;
                     $country_default_by_currency = apply_filters('ws_plugin__optimizemember_pro_stripe_default_country', $country_default_by_currency, get_defined_vars());
                     $default_country_v = $attr['default_country_code'] ? $attr['default_country_code'] : $country_default_by_currency;
                     $country_options = '<option value=""></option>';
                     // Start with an empty option value.
                     foreach (preg_split('/[' . "\r\n" . ']+/', file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . '/iso-3166-1.txt')) as $country) {
                         list($country_l, $country_v) = preg_split('/;/', $country, 2);
                         if ($country_l && $country_v) {
                             // Here we also check on the default pre-selected country; as determined above; based on currency.
                             $country_options .= '<option value="' . esc_attr(strtoupper($country_v)) . '"' . (@$_p['optimizemember_pro_stripe_checkout']['country'] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>';
                         }
                     }
                     $custom_fields = '';
                     // Initialize custom fields.
                     if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields']) {
                         // Only display Custom Fields if configured.
                         if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level($attr['level'] === '*' ? 'auto-detection' : $attr['level'], 'registration')) {
                             $tabindex = 99;
                             // Start tabindex at 99 (+1 below = 100).
                             $custom_fields = '<div id="optimizemember-pro-stripe-checkout-form-custom-fields-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-checkout-form-section optimizemember-pro-stripe-form-custom-fields-section optimizemember-pro-stripe-checkout-form-custom-fields-section">' . "\n";
                             $custom_fields .= '<div id="optimizemember-pro-stripe-checkout-form-custom-fields-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-checkout-form-section-title optimizemember-pro-stripe-form-custom-fields-section-title optimizemember-pro-stripe-checkout-form-custom-fields-section-title">' . "\n";
                             $custom_fields .= _x('Additional Info', 's2member-front', 's2member') . "\n";
                             $custom_fields .= '</div>' . "\n";
                             foreach (json_decode($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields'], TRUE) as $field) {
                                 if (in_array($field['id'], $fields_applicable)) {
                                     $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
                                     $field_id_class = preg_replace('/_/', '-', $field_var);
                                     if (!empty($field['section']) && $field['section'] === 'yes') {
                                         // Starts a new section?
                                         $custom_fields .= '<div id="optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . '">' . (!empty($field['sectitle']) ? $field['sectitle'] : '') . '</div>';
                                     }
                                     $custom_fields .= '<div id="optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-div optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-div">' . "\n";
                                     $custom_fields .= '<label for="optimizemember-pro-stripe-checkout-custom-reg-field-' . esc_attr($field_id_class) . '" id="optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-label" class="optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-label optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-label">' . "\n";
                                     $custom_fields .= '<span' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? ' style="display:none;"' : '') . '>' . $field['label'] . ($field['required'] === 'yes' ? ' *' : '') . '</span></label>' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? '' : '<br />') . "\n";
                                     $custom_fields .= c_ws_plugin__optimizemember_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, 'optimizemember_pro_stripe_checkout[custom_fields][', 'optimizemember-pro-stripe-checkout-custom-reg-field-', 'optimizemember-pro-stripe-custom-reg-field-' . $field_id_class . ' optimizemember-pro-stripe-checkout-custom-reg-field-' . $field_id_class, '', $tabindex = $tabindex + 1, '', $_p, @$_p['optimizemember_pro_stripe_checkout']['custom_fields'][$field_var], 'registration');
                                     $custom_fields .= '</div>' . "\n";
                                 }
                             }
                             $custom_fields .= '</div>' . "\n";
                         }
                     }
                     if ($attr['captcha']) {
                         $captcha = '<div id="optimizemember-pro-stripe-checkout-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-checkout-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-checkout-form-captcha-section">' . "\n";
                         $captcha .= '<div id="optimizemember-pro-stripe-checkout-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-checkout-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-checkout-form-captcha-section-title">' . "\n";
                         $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n";
                         $captcha .= '</div>' . "\n";
                         $captcha .= '<div id="optimizemember-pro-stripe-checkout-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-checkout-form-captcha-div">' . "\n";
                         $captcha .= '<label id="optimizemember-pro-stripe-checkout-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-checkout-form-captcha-label">' . "\n";
                         $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 400) . "\n";
                         $captcha .= '</label>' . "\n";
                         $captcha .= '</div>' . "\n";
                         $captcha .= '</div>' . "\n";
                     } else {
                         $captcha = '';
                     }
                     // Not applicable.
                     if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) {
                         $opt_in = '<div id="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-opt-in-div optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-div">' . "\n";
                         $opt_in .= '<label for="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in" id="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-label" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in-label optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-label">' . "\n";
                         $opt_in .= '<input type="checkbox" name="optimizemember_pro_stripe_checkout[custom_fields][opt_in]" id="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] == 1 || @$_p['optimizemember_pro_stripe_checkout']['custom_fields']['opt_in'] ? ' checked="checked"' : '') . ' tabindex="500" />' . "\n";
                         $opt_in .= $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in_label'] . "\n";
                         $opt_in .= '</label>' . "\n";
                         $opt_in .= '</div>' . "\n";
                     } else {
                         $opt_in = '';
                     }
                     // Not applicable.
                     $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_checkout[nonce]" id="optimizemember-pro-stripe-checkout-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-checkout')) . '" />';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_checkout[card_token]" id="optimizemember-pro-stripe-checkout-card-token" value="' . esc_attr(@$_p['optimizemember_pro_stripe_checkout']['card_token']) . '" />';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_checkout[card_token_summary]" id="optimizemember-pro-stripe-checkout-card-token-summary" value="' . esc_attr(@$_p['optimizemember_pro_stripe_checkout']['card_token_summary']) . '" />';
                     $hidden_inputs .= !$attr['accept_coupons'] ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-coupons-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= !$GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_password'] ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-password-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= !c_ws_plugin__optimizemember_pro_stripe_utilities::tax_may_apply() ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-tax-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= ($cp_attr = c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'])) && $cp_attr['ta'] <= 0.0 && $cp_attr['ra'] <= 0.0 ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-payment-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_checkout[attr]" id="optimizemember-pro-stripe-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
                     $custom_template = file_exists(TEMPLATEPATH . '/stripe-checkout-form.php') ? TEMPLATEPATH . '/stripe-checkout-form.php' : FALSE;
                     $custom_template = file_exists(TEMPLATEPATH . '/stripe-checkout-form.html') ? TEMPLATEPATH . '/stripe-checkout-form.html' : $custom_template;
                     $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template;
                     $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template;
                     $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-checkout-form.php'));
                     $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code);
                     $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code);
                     $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code);
                     $code = preg_replace('/%%options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($option_selections), $code);
                     $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code);
                     $code = preg_replace('/%%coupon_response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'], 'response', array('affiliates-1px-response'))), $code);
                     $code = preg_replace('/%%coupon_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit($attr['coupon'])), $code);
                     $code = preg_replace('/%%first_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_checkout']['first_name'])), $code);
                     $code = preg_replace('/%%last_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_checkout']['last_name'])), $code);
                     $code = preg_replace('/%%email_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['email'])), $code);
                     $code = preg_replace('/%%username_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['username'])), $code);
                     $code = preg_replace('/%%password1_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['password1'])), $code);
                     $code = preg_replace('/%%password2_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['password2'])), $code);
                     $code = preg_replace('/%%custom_fields%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($custom_fields), $code);
                     $code = preg_replace('/%%card_token%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_checkout']['card_token'])), $code);
                     $code = preg_replace('/%%card_token_summary%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_checkout']['card_token_summary'])), $code);
                     $code = preg_replace('/%%state_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['state'])), $code);
                     $code = preg_replace('/%%country_options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($country_options), $code);
                     $code = preg_replace('/%%zip_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['zip'])), $code);
                     $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code);
                     $code = preg_replace('/%%opt_in%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($opt_in), $code);
                     $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code);
                     if (!empty($raw_content)) {
                         $code = preg_replace('/%%submit_button%%/', $raw_content, $code);
                     } else {
                         $button_code = '<button style="padding:15px;" type="submit" id="optimizemember-pro-stripe-checkout-submit" class="optimizemember-pro-stripe-submit optimizemember-pro-stripe-checkout-submit btn btn-primary" tabindex="600">' . esc_html(_x("Submit Form", "s2member-front", "s2member")) . '</button>';
                         $code = preg_replace('/%%submit_button%%/', $button_code, $code);
                     }
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     $attr['modify'] ? do_action('ws_plugin__optimizemember_pro_during_sc_stripe_modification_form', get_defined_vars()) : do_action('ws_plugin__optimizemember_pro_during_sc_stripe_form', get_defined_vars());
                     unset($__refs, $__v);
                     // Ditch these temporary vars.
                 }
             }
         }
     }
     return apply_filters('ws_plugin__optimizemember_pro_sc_stripe_form', $code, get_defined_vars());
 }
 /**
  * Parses s2Vars passed through by ClickBank®.
  *
  * @package optimizeMember\ClickBank
  * @since 111205
  *
  * @param str $cvendthru Expects the URL-encoded query string of s2Vars, including `_optimizemember_sig`.
  * @param str $type Optional. The type of ClickBank® transaction. This deals with backward compatibility.
  * 	For SALE transactions, do NOT accept the older format. For others, remain backward compatible.
  * @return array Array of s2Vars. Possibly an empty array.
  */
 public static function clickbank_parse_s2vars($cvendthru = FALSE, $type = FALSE)
 {
     wp_parse_str((string) $cvendthru, $s2vars);
     $s2vars = c_ws_plugin__optimizemember_utils_strings::trim_deep($s2vars);
     foreach ($s2vars as $var => $value) {
         if (!in_array($var, array("cbskin", "cbfid", "cbur", "cbf"), TRUE)) {
             // These may be included in a signature too.
             if (!preg_match("/^(?:s2_|_optimizemember_sig)/", $var)) {
                 // These will always be included in a signature.
                 unset($s2vars[$var]);
             }
         }
     }
     $is_sale = preg_match("/^(?:TEST_)?SALE\$/i", (string) $type);
     if (!$is_sale || c_ws_plugin__optimizemember_utils_urls::optimizemember_sig_ok(http_build_query($s2vars, null, "&"))) {
         return $s2vars;
     }
     return array();
 }
 /**
  * optimizeMember's PayPal IPN handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110815
  *
  * @param array $vars Required. An array of defined variables passed by {@link optimizeMember\PayPal\c_ws_plugin__optimizemember_paypal_notify_in::paypal_notify()}.
  * @return array|bool The original ``$paypal`` array passed in ( extracted ) from ``$vars``, or false when conditions do NOT apply.
  *
  * @todo Optimize with ``empty()`` and ``isset()``.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     /* Extract all vars passed in from: ``c_ws_plugin__optimizemember_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__"]["optimizemember"]["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"]) && ($paypal["subscr_id"] = $paypal["txn_id"])) && !empty($paypal["payer_email"])) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_notify_before_new_ccaps", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         if (!get_transient($transient_ipn = "s2m_ipn_" . md5("optimizemember_transient_" . $_paypal_s)) && set_transient($transient_ipn, time(), 31556926 * 10)) {
             $paypal["optimizemember_log"][] = "optimizeMember `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"];
             /**/
             if (preg_match("/(referenc|associat|updat|upgrad)/i", $paypal["option_name1"]) && $paypal["option_selection1"]) {
                 if (($user_id = c_ws_plugin__optimizemember_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. */
                         /**/
                         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                         do_action("ws_plugin__optimizemember_during_paypal_notify_during_before_new_ccaps", get_defined_vars());
                         unset($__refs, $__v);
                         /* Unset defined __refs, __v. */
                         /**/
                         $fields = get_user_option("optimizemember_custom_fields", $user_id);
                         /* These will be needed in the routines below. */
                         $user_reg_ip = get_user_option("optimizemember_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_optimizemember_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_optimizemember_ccap_" . $ccap);
                                 }
                             }
                         }
                         /**/
                         if (!get_user_option("optimizemember_registration_ip", $user_id)) {
                             update_user_option($user_id, "optimizemember_registration_ip", $paypal["ip"]);
                         }
                         /**/
                         $paypal["optimizemember_log"][] = "optimizeMember Custom Capabilities updated w/ advanced update routines.";
                         /**/
                         c_ws_plugin__optimizemember_email_configs::email_config() . wp_mail($paypal["payer_email"], apply_filters("ws_plugin__optimizemember_capabilities_email_sbj", _x("Thank you! Your account has been updated.", "s2member-front", "s2member"), get_defined_vars()), apply_filters("ws_plugin__optimizemember_capabilities_email_msg", _x("Thank you! You now have access to:", "s2member-front", "s2member") . "\n" . $paypal["item_name"] . "\n\n" . _x("Please log back in now.", "s2member-front", "s2member") . "\n" . wp_login_url(), get_defined_vars()), "From: \"" . preg_replace('/"/', "'", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") . c_ws_plugin__optimizemember_email_configs::email_config_release();
                         /**/
                         $paypal["optimizemember_log"][] = "Capability Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
                         /**/
                         if ($processing && $_GET["optimizemember_paypal_proxy"] && ($url = $_GET["optimizemember_paypal_proxy_return_url"]) && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                             if (($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["subscr_id"])), $url))) {
                                 if (($url = preg_replace("/%%amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["mc_gross"])), $url)) && ($url = preg_replace("/%%txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["txn_id"])), $url))) {
                                     if (($url = preg_replace("/%%item_number%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["item_number"])), $url)) && ($url = preg_replace("/%%item_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["item_name"])), $url))) {
                                         if (($url = preg_replace("/%%first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["first_name"])), $url)) && ($url = preg_replace("/%%last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["last_name"])), $url))) {
                                             if ($url = preg_replace("/%%full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(trim($paypal["first_name"] . " " . $paypal["last_name"]))), $url)) {
                                                 if ($url = preg_replace("/%%payer_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["payer_email"])), $url)) {
                                                     if (($url = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->first_name)), $url)) && ($url = preg_replace("/%%user_last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->last_name)), $url))) {
                                                         if ($url = preg_replace("/%%user_full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(trim($user->first_name . " " . $user->last_name))), $url)) {
                                                             if ($url = preg_replace("/%%user_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->user_email)), $url)) {
                                                                 if ($url = preg_replace("/%%user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->user_login)), $url)) {
                                                                     if ($url = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user_reg_ip)), $url)) {
                                                                         if ($url = preg_replace("/%%user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user_id)), $url)) {
                                                                             if (is_array($fields) && !empty($fields)) {
                                                                                 foreach ($fields as $var => $val) {
                                                                                     /* Custom Registration/Profile Fields. */
                                                                                     if (!($url = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__optimizemember_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. */
                                                                                 $paypal["optimizemember_paypal_proxy_return_url"] = $url;
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             /**/
                             $paypal["optimizemember_log"][] = "Capability Return, a Proxy Return URL is ready.";
                         }
                         /**/
                         if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["payment_notification_urls"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                             foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["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__optimizemember_utils_strings::esc_ds(urlencode($paypal["subscr_id"])), $url))) {
                                     if (($url = preg_replace("/%%amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["mc_gross"])), $url)) && ($url = preg_replace("/%%txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["txn_id"])), $url))) {
                                         if (($url = preg_replace("/%%item_number%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["item_number"])), $url)) && ($url = preg_replace("/%%item_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["item_name"])), $url))) {
                                             if (($url = preg_replace("/%%first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["first_name"])), $url)) && ($url = preg_replace("/%%last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["last_name"])), $url))) {
                                                 if ($url = preg_replace("/%%full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(trim($paypal["first_name"] . " " . $paypal["last_name"]))), $url)) {
                                                     if ($url = preg_replace("/%%payer_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["payer_email"])), $url)) {
                                                         if (($url = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->first_name)), $url)) && ($url = preg_replace("/%%user_last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->last_name)), $url))) {
                                                             if ($url = preg_replace("/%%user_full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(trim($user->first_name . " " . $user->last_name))), $url)) {
                                                                 if ($url = preg_replace("/%%user_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->user_email)), $url)) {
                                                                     if ($url = preg_replace("/%%user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user->user_login)), $url)) {
                                                                         if ($url = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user_reg_ip)), $url)) {
                                                                             if ($url = preg_replace("/%%user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($user_id)), $url)) {
                                                                                 if (is_array($fields) && !empty($fields)) {
                                                                                     foreach ($fields as $var => $val) {
                                                                                         /* Custom Registration/Profile Fields. */
                                                                                         if (!($url = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(maybe_serialize($val))), $url))) {
                                                                                             break;
                                                                                         }
                                                                                     }
                                                                                 }
                                                                                 /**/
                                                                                 if ($url = trim(preg_replace("/%%(.+?)%%/i", "", $url))) {
                                                                                     c_ws_plugin__optimizemember_utils_urls::remote($url);
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             /**/
                             $paypal["optimizemember_log"][] = "Payment Notification URLs have been processed.";
                         }
                         /**/
                         if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["payment_notification_recipients"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                             $msg = $sbj = "( optimizeMember / API Notification Email ) - Payment";
                             $msg .= "\n\n";
                             /* Spacing in the message body. */
                             /**/
                             $msg .= "subscr_id: %%subscr_id%%\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 .= "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__optimizemember_utils_strings::esc_ds($paypal["subscr_id"]), $msg))) {
                                 if (($msg = preg_replace("/%%amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_gross"]), $msg)) && ($msg = preg_replace("/%%txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["txn_id"]), $msg))) {
                                     if (($msg = preg_replace("/%%item_number%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_number"]), $msg)) && ($msg = preg_replace("/%%item_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_name"]), $msg))) {
                                         if (($msg = preg_replace("/%%first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["first_name"]), $msg)) && ($msg = preg_replace("/%%last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["last_name"]), $msg))) {
                                             if ($msg = preg_replace("/%%full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(trim($paypal["first_name"] . " " . $paypal["last_name"])), $msg)) {
                                                 if ($msg = preg_replace("/%%payer_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["payer_email"]), $msg)) {
                                                     if (($msg = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->first_name), $msg)) && ($msg = preg_replace("/%%user_last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->last_name), $msg))) {
                                                         if ($msg = preg_replace("/%%user_full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(trim($user->first_name . " " . $user->last_name)), $msg)) {
                                                             if ($msg = preg_replace("/%%user_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_email), $msg)) {
                                                                 if ($msg = preg_replace("/%%user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_login), $msg)) {
                                                                     if ($msg = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_reg_ip), $msg)) {
                                                                         if ($msg = preg_replace("/%%user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_id), $msg)) {
                                                                             if (is_array($fields) && !empty($fields)) {
                                                                                 foreach ($fields as $var => $val) {
                                                                                     /* Custom Registration/Profile Fields. */
                                                                                     if (!($msg = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__optimizemember_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__optimizemember_utils_strings::parse_emails($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["payment_notification_recipients"]) as $recipient) {
                                                                                     wp_mail($recipient, apply_filters("ws_plugin__optimizemember_payment_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_payment_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             /**/
                             $paypal["optimizemember_log"][] = "Payment Notification Emails have been processed.";
                         }
                         /**/
                         if ($processing && ($code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccap_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__optimizemember_utils_strings::esc_ds($paypal["subscr_id"]), $code))) {
                                 if (($code = preg_replace("/%%amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_gross"]), $code)) && ($code = preg_replace("/%%txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["txn_id"]), $code))) {
                                     if (($code = preg_replace("/%%item_number%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_number"]), $code)) && ($code = preg_replace("/%%item_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_name"]), $code))) {
                                         if (($code = preg_replace("/%%first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["first_name"]), $code)) && ($code = preg_replace("/%%last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["last_name"]), $code))) {
                                             if ($code = preg_replace("/%%full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(trim($paypal["first_name"] . " " . $paypal["last_name"])), $code)) {
                                                 if ($code = preg_replace("/%%payer_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["payer_email"]), $code)) {
                                                     if (($code = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->first_name), $code)) && ($code = preg_replace("/%%user_last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->last_name), $code))) {
                                                         if ($code = preg_replace("/%%user_full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(trim($user->first_name . " " . $user->last_name)), $code)) {
                                                             if ($code = preg_replace("/%%user_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_email), $code)) {
                                                                 if ($code = preg_replace("/%%user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_login), $code)) {
                                                                     if ($code = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_reg_ip), $code)) {
                                                                         if ($code = preg_replace("/%%user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_id), $code)) {
                                                                             if (is_array($fields) && !empty($fields)) {
                                                                                 foreach ($fields as $var => $val) {
                                                                                     /* Custom Registration/Profile Fields. */
                                                                                     if (!($code = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(maybe_serialize($val)), $code))) {
                                                                                         break;
                                                                                     }
                                                                                 }
                                                                             }
                                                                             /**/
                                                                             if ($code = trim(preg_replace("/%%(.+?)%%/i", "", $code))) {
                                                                                 $paypal["optimizemember_log"][] = "Storing Payment Tracking Codes into a Transient Queue. These will be processed on-site.";
                                                                                 set_transient("s2m_" . md5("optimizemember_transient_ccap_tracking_codes_" . $paypal["txn_id"]), $code, 43200);
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         /**/
                         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                         do_action("ws_plugin__optimizemember_during_paypal_notify_during_new_ccaps", get_defined_vars());
                         unset($__refs, $__v);
                         /* Unset defined __refs, __v. */
                     } else {
                         $paypal["optimizemember_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["optimizemember_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["optimizemember_log"][] = "Unable to add new Capabilities. Missing User/Member details. Please check the `on0` and `os0` variables in your Button Code.";
             }
         } else {
             $paypal["optimizemember_log"][] = "Not processing. Duplicate IPN.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept` ) w/ update vars for Capabilities w/o Level.";
             $paypal["optimizemember_log"][] = "Duplicate IPN. Already processed. This IPN will be ignored.";
         }
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_notify_after_new_ccaps", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_wa_ccaps_wo_level", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_wa_ccaps_wo_level", false, get_defined_vars());
     }
 }
 /**
  * Handles processing of Pro Form checkouts.
  *
  * @package optimizeMember\PayPal
  * @since 1.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after a custom URL redirection; or upon Express Checkout redirection.
  */
 public static function paypal_checkout()
 {
     if (!empty($_POST["optimizemember_pro_paypal_checkout"]["nonce"]) && ($nonce = $_POST["optimizemember_pro_paypal_checkout"]["nonce"]) && wp_verify_nonce($nonce, "s2member-pro-paypal-checkout") || !empty($_GET["optimizemember_paypal_xco"]) && $_GET["optimizemember_paypal_xco"] === "optimizemember_pro_paypal_checkout_return" && !empty($_GET["token"]) && ($_GET["token"] = esc_html($_GET["token"])) && (empty($_GET["PayerID"]) || ($_GET["PayerID"] = esc_html($_GET["PayerID"]))) && ($xco_post_vars = get_transient("s2m_" . md5("optimizemember_transient_express_checkout_" . $_GET["token"])))) {
         $GLOBALS["ws_plugin__optimizemember_pro_paypal_checkout_response"] = array();
         /* This holds the global response details. */
         $global_response =& $GLOBALS["ws_plugin__optimizemember_pro_paypal_checkout_response"];
         /* This is a shorter reference. */
         /**/
         $post_vars = $xco_post_vars ? $xco_post_vars : $_POST["optimizemember_pro_paypal_checkout"];
         $post_vars = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($post_vars));
         /* And Filter. */
         $post_vars["attr"] = !$xco_post_vars ? unserialize(c_ws_plugin__optimizemember_utils_encryption::decrypt($post_vars["attr"])) : $post_vars["attr"];
         $post_vars["attr"] = !$xco_post_vars ? apply_filters("ws_plugin__optimizemember_pro_paypal_checkout_post_attr", $post_vars["attr"], get_defined_vars()) : $post_vars["attr"];
         /**/
         if ($xco_post_vars) {
             /* No need to re-validate this upon return from Express Checkout. */
             $post_vars["attr"]["captcha"] = "0";
         }
         /**/
         $post_vars["recaptcha_challenge_field"] = !$post_vars["recaptcha_challenge_field"] ? trim(stripslashes($_POST["recaptcha_challenge_field"])) : $post_vars["recaptcha_challenge_field"];
         $post_vars["recaptcha_response_field"] = !$post_vars["recaptcha_response_field"] ? trim(stripslashes($_POST["recaptcha_response_field"])) : $post_vars["recaptcha_response_field"];
         /**/
         $post_vars["name"] = trim($post_vars["first_name"] . " " . $post_vars["last_name"]);
         $post_vars["email"] = apply_filters("user_registration_email", sanitize_email($post_vars["email"]), get_defined_vars());
         $post_vars["username"] = preg_replace("/\\s+/", "", sanitize_user($post_vars["username"], is_multisite()));
         /**/
         !empty($_GET["token"]) ? delete_transient("s2m_" . md5("optimizemember_transient_express_checkout_" . $_GET["token"])) : null;
         /**/
         if (!c_ws_plugin__optimizemember_pro_paypal_responses::paypal_form_attr_validation_errors($post_vars["attr"])) {
             if (!($error = c_ws_plugin__optimizemember_pro_paypal_responses::paypal_form_submission_validation_errors("checkout", $post_vars))) {
                 $cp_attr = c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_apply_coupon($post_vars["attr"], $post_vars["coupon"], "attr", array("affiliates-silent-post"));
                 $cp_2gbp_attr = c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_maestro_solo_2gbp($cp_attr, $post_vars["card_type"]);
                 $cost_calculations = c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_cost($cp_2gbp_attr["ta"], $cp_2gbp_attr["ra"], $post_vars["state"], $post_vars["country"], $post_vars["zip"], $cp_2gbp_attr["cc"], $cp_2gbp_attr["desc"]);
                 /**/
                 $use_recurring_profile = $post_vars["attr"]["rr"] === "BN" || !$post_vars["attr"]["tp"] && !$post_vars["attr"]["rr"] ? false : true;
                 $is_independent_ccaps_sale = $post_vars["attr"]["level"] === "*" ? true : false;
                 /* Selling Independent Custom Capabilities? */
                 /**/
                 if (empty($_GET["optimizemember_paypal_xco"]) && $post_vars["card_type"] === "PayPal") {
                     $return_url = $cancel_url = is_ssl() ? "https://" : "http://";
                     $return_url = $cancel_url = ($return_url = $cancel_url) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
                     $return_url = $cancel_url = remove_query_arg(array("token", "PayerID"), $return_url = $cancel_url);
                     $return_url = add_query_arg("optimizemember_paypal_xco", urlencode("optimizemember_pro_paypal_checkout_return"), $return_url);
                     $cancel_url = add_query_arg("optimizemember_paypal_xco", urlencode("optimizemember_pro_paypal_checkout_cancel"), $cancel_url);
                     /**/
                     $user = is_user_logged_in() && is_object($user = wp_get_current_user()) && ($user_id = $user->ID) ? $user : false;
                     /**/
                     if (!($paypal_set_xco = array())) {
                         $paypal_set_xco["METHOD"] = "SetExpressCheckout";
                         /**/
                         $paypal_set_xco["RETURNURL"] = $return_url;
                         $paypal_set_xco["CANCELURL"] = $cancel_url;
                         /**/
                         $paypal_set_xco["PAGESTYLE"] = $post_vars["attr"]["ps"];
                         $paypal_set_xco["LOCALECODE"] = $post_vars["attr"]["lc"];
                         $paypal_set_xco["NOSHIPPING"] = $post_vars["attr"]["ns"];
                         $paypal_set_xco["SOLUTIONTYPE"] = "Sole";
                         $paypal_set_xco["LANDINGPAGE"] = "Billing";
                         $paypal_set_xco["ALLOWNOTE"] = "0";
                         /**/
                         if ($use_recurring_profile) {
                             $paypal_set_xco["L_BILLINGTYPE0"] = "RecurringPayments";
                             $paypal_set_xco["L_BILLINGAGREEMENTDESCRIPTION0"] = $cost_calculations["desc"];
                             if ($post_vars["attr"]["tp"] && $cost_calculations["trial_total"] > 0) {
                                 $paypal_set_xco["MAXAMT"] = $cost_calculations["trial_total"];
                             } else {
                                 $paypal_set_xco["MAXAMT"] = $cost_calculations["total"];
                             }
                         } else {
                             $paypal_set_xco["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
                             $paypal_set_xco["MAXAMT"] = $cost_calculations["total"];
                             /**/
                             $paypal_set_xco["PAYMENTREQUEST_0_DESC"] = $cost_calculations["desc"];
                             $paypal_set_xco["PAYMENTREQUEST_0_CUSTOM"] = $post_vars["attr"]["custom"];
                             /**/
                             $paypal_set_xco["PAYMENTREQUEST_0_CURRENCYCODE"] = $cost_calculations["cur"];
                             $paypal_set_xco["PAYMENTREQUEST_0_ITEMAMT"] = $cost_calculations["sub_total"];
                             $paypal_set_xco["PAYMENTREQUEST_0_TAXAMT"] = $cost_calculations["tax"];
                             $paypal_set_xco["PAYMENTREQUEST_0_AMT"] = $cost_calculations["total"];
                             /**/
                             $paypal_set_xco["L_PAYMENTREQUEST_0_QTY0"] = "1";
                             /* Always (1). */
                             $paypal_set_xco["L_PAYMENTREQUEST_0_NAME0"] = $cost_calculations["desc"];
                             $paypal_set_xco["L_PAYMENTREQUEST_0_NUMBER0"] = $post_vars["attr"]["level_ccaps_eotper"];
                             $paypal_set_xco["L_PAYMENTREQUEST_0_AMT0"] = $cost_calculations["sub_total"];
                         }
                         /**/
                         $paypal_set_xco["PAYMENTREQUEST_0_SHIPTONAME"] = $post_vars["name"];
                         $paypal_set_xco["PAYMENTREQUEST_0_SHIPTOSTREET"] = $post_vars["street"];
                         $paypal_set_xco["PAYMENTREQUEST_0_SHIPTOCITY"] = $post_vars["city"];
                         $paypal_set_xco["PAYMENTREQUEST_0_SHIPTOSTATE"] = $post_vars["state"];
                         $paypal_set_xco["PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE"] = $post_vars["country"];
                         $paypal_set_xco["PAYMENTREQUEST_0_SHIPTOZIP"] = $post_vars["zip"];
                         /**/
                         $paypal_set_xco["EMAIL"] = $user ? $user->user_email : $post_vars["email"];
                     }
                     /**/
                     if (($paypal_set_xco = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal_set_xco)) && empty($paypal_set_xco["__error"])) {
                         set_transient("s2m_" . md5("optimizemember_transient_express_checkout_" . $paypal_set_xco["TOKEN"]), $post_vars, 10800);
                         /**/
                         $endpoint = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com";
                         /**/
                         wp_redirect(add_query_arg("token", urlencode($paypal_set_xco["TOKEN"]), "https://" . $endpoint . "/cgi-bin/webscr?cmd=_express-checkout"));
                         /**/
                         exit;
                         /* Clean exit. */
                     } else {
                         $global_response = array("response" => $paypal_set_xco["__error"], "error" => true);
                     }
                 } else {
                     if ($use_recurring_profile && is_user_logged_in() && is_object($user = wp_get_current_user()) && ($user_id = $user->ID)) {
                         if (!($cur__subscr_id = get_user_option("optimizemember_subscr_id")) || !($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response(array("METHOD" => "GetRecurringPaymentsProfileDetails", "PROFILEID" => $cur__subscr_id))) || !empty($paypal["__error"]) || !preg_match("/^(Pending|PendingProfile)\$/i", $paypal["STATUS"])) {
                             $period1 = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period1($post_vars["attr"]["tp"] . " " . $post_vars["attr"]["tt"]);
                             $period3 = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period3($post_vars["attr"]["rp"] . " " . $post_vars["attr"]["rt"]);
                             /**/
                             $start_time = $post_vars["attr"]["tp"] ? c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_start_time($period1) : c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_start_time($period3);
                             /* Or next billing cycle. */
                             /**/
                             $reference = $start_time . ":" . $period1 . ":" . $period3 . "~" . $_SERVER["HTTP_HOST"] . "~" . $post_vars["attr"]["level_ccaps_eotper"];
                             /**/
                             update_user_meta($user_id, "first_name", $post_vars["first_name"]) . update_user_meta($user_id, "last_name", $post_vars["last_name"]);
                             /**/
                             if (!($paypal = array())) {
                                 $paypal["METHOD"] = "CreateRecurringPaymentsProfile";
                                 /**/
                                 $paypal["EMAIL"] = $user->user_email;
                                 $paypal["FIRSTNAME"] = $post_vars["first_name"];
                                 $paypal["LASTNAME"] = $post_vars["last_name"];
                                 $paypal["SUBSCRIBERNAME"] = $post_vars["name"];
                                 /**/
                                 $paypal["DESC"] = $cost_calculations["desc"];
                                 $paypal["PROFILEREFERENCE"] = $reference;
                                 /**/
                                 if (!$post_vars["attr"]["tp"] || $post_vars["attr"]["tp"] && $cost_calculations["trial_total"] > 0) {
                                     $paypal["INITAMT"] = $post_vars["attr"]["tp"] ? $cost_calculations["trial_total"] : $cost_calculations["total"];
                                     $paypal["FAILEDINITAMTACTION"] = "CancelOnFailure";
                                 }
                                 /**/
                                 $paypal["CURRENCYCODE"] = $cost_calculations["cur"];
                                 $paypal["AMT"] = $cost_calculations["sub_total"];
                                 $paypal["TAXAMT"] = $cost_calculations["tax"];
                                 /**/
                                 $paypal["MAXFAILEDPAYMENTS"] = $post_vars["attr"]["rra"];
                                 $paypal["AUTOBILLOUTAMT"] = apply_filters("ws_plugin__optimizemember_pro_paypal_auto_bill_op", "AddToNextBilling", get_defined_vars());
                                 /**/
                                 $paypal["PROFILESTARTDATE"] = date("Y-m-d", $start_time) . "T00:00:00Z";
                                 /**/
                                 $paypal["BILLINGPERIOD"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_term($post_vars["attr"]["rt"]);
                                 $paypal["TOTALBILLINGCYCLES"] = $post_vars["attr"]["rr"] ? $post_vars["attr"]["rrt"] ? $post_vars["attr"]["rrt"] : "0" : "1";
                                 $paypal["BILLINGFREQUENCY"] = $post_vars["attr"]["rp"];
                                 /**/
                                 if ($_GET["optimizemember_paypal_xco"] === "optimizemember_pro_paypal_checkout_return" && !empty($_GET["token"]) && ($paypal_xco_details = array("METHOD" => "GetExpressCheckoutDetails", "TOKEN" => $_GET["token"])) && ($paypal_xco_details = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal_xco_details)) && empty($paypal_xco_details["__error"])) {
                                     $paypal["TOKEN"] = $paypal_xco_details["TOKEN"];
                                 } else {
                                     $paypal["CREDITCARDTYPE"] = $post_vars["card_type"];
                                     $paypal["ACCT"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
                                     $paypal["EXPDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_expiration"]);
                                     $paypal["CVV2"] = $post_vars["card_verification"];
                                     /**/
                                     if (in_array($post_vars["card_type"], array("Maestro", "Solo"))) {
                                         if (preg_match("/^[0-9]{2}\\/[0-9]{4}\$/", $post_vars["card_start_date_issue_number"])) {
                                             $paypal["STARTDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
                                         } else {
                                             /* Otherwise, we assume they provided an Issue Number instead. */
                                             $paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
                                         }
                                     }
                                     /**/
                                     $paypal["STREET"] = $post_vars["street"];
                                     $paypal["CITY"] = $post_vars["city"];
                                     $paypal["STATE"] = $post_vars["state"];
                                     $paypal["COUNTRYCODE"] = $post_vars["country"];
                                     $paypal["ZIP"] = $post_vars["zip"];
                                 }
                             }
                             /**/
                             if (($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"])) {
                                 $old__subscr_or_wp_id = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id();
                                 $old__subscr_id = get_user_option("optimizemember_subscr_id");
                                 $new__subscr_id = $paypal["PROFILEID"];
                                 /**/
                                 if (!($ipn = array())) {
                                     $ipn["txn_type"] = "subscr_signup";
                                     $ipn["subscr_id"] = $new__subscr_id;
                                     $ipn["custom"] = $post_vars["attr"]["custom"];
                                     /**/
                                     $ipn["txn_id"] = $new__subscr_id;
                                     /**/
                                     $ipn["period1"] = $period1;
                                     $ipn["period3"] = $period3;
                                     /**/
                                     $ipn["mc_amount1"] = $cost_calculations["trial_total"];
                                     $ipn["mc_amount3"] = $cost_calculations["total"];
                                     /**/
                                     $ipn["mc_gross"] = preg_match("/^[1-9]/", $ipn["period1"]) ? $ipn["mc_amount1"] : $ipn["mc_amount3"];
                                     /**/
                                     $ipn["mc_currency"] = $cost_calculations["cur"];
                                     $ipn["tax"] = $cost_calculations["tax"];
                                     /**/
                                     $ipn["recurring"] = $post_vars["attr"]["rr"] ? "1" : "";
                                     /**/
                                     $ipn["payer_email"] = $user->user_email;
                                     $ipn["first_name"] = $post_vars["first_name"];
                                     $ipn["last_name"] = $post_vars["last_name"];
                                     /**/
                                     $ipn["option_name1"] = "Referencing Customer ID";
                                     $ipn["option_selection1"] = $old__subscr_or_wp_id;
                                     /**/
                                     $ipn["option_name2"] = "Customer IP Address";
                                     $ipn["option_selection2"] = $_SERVER["REMOTE_ADDR"];
                                     /**/
                                     $ipn["item_name"] = $cost_calculations["desc"];
                                     $ipn["item_number"] = $post_vars["attr"]["level_ccaps_eotper"];
                                     /**/
                                     $ipn_q = "&optimizemember_paypal_proxy=paypal&optimizemember_paypal_proxy_use=pro-emails";
                                     $ipn_q .= $ipn["mc_gross"] > 0 ? ",subscr-signup-as-subscr-payment" : "";
                                     /* Use as first payment? */
                                     $ipn_q .= "&optimizemember_paypal_proxy_verification=" . urlencode(c_ws_plugin__optimizemember_paypal_utilities::paypal_proxy_key_gen());
                                     $ipn_q .= "&optimizemember_paypal_proxy_return_url=" . rawurlencode($post_vars["attr"]["success"]);
                                     /**/
                                     $ipn["optimizemember_paypal_proxy_return_url"] = trim(c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20)));
                                 }
                                 /**/
                                 if (!($paypal = array()) && ($paypal["PROFILEID"] = $old__subscr_id)) {
                                     $paypal["METHOD"] = "ManageRecurringPaymentsProfileStatus";
                                     $paypal["ACTION"] = "Cancel";
                                     /**/
                                     c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal);
                                 }
                                 /**/
                                 setcookie("optimizemember_tracking", $optimizemember_tracking = c_ws_plugin__optimizemember_utils_encryption::encrypt($new__subscr_id), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_tracking", $optimizemember_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_tracking"] = $optimizemember_tracking);
                                 /**/
                                 $global_response = array("response" => sprintf(_x('<strong>Thank you.</strong> Your account has been updated.<br />&mdash; Please <a href="%s" rel="nofollow">log back in</a> now.', "s2member-front", "s2member"), esc_attr(wp_login_url())));
                                 /**/
                                 if ($post_vars["attr"]["success"] && substr($ipn["optimizemember_paypal_proxy_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $ipn["optimizemember_paypal_proxy_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                     wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                 }
                             } else {
                                 $global_response = array("response" => $paypal["__error"], "error" => true);
                             }
                         } else {
                             $global_response = array("response" => _x('<strong>Sorry.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
                         }
                     } else {
                         if ($use_recurring_profile && !is_user_logged_in()) {
                             $period1 = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period1($post_vars["attr"]["tp"] . " " . $post_vars["attr"]["tt"]);
                             $period3 = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period3($post_vars["attr"]["rp"] . " " . $post_vars["attr"]["rt"]);
                             /**/
                             $start_time = $post_vars["attr"]["tp"] ? c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_start_time($period1) : c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_start_time($period3);
                             /* Or next billing cycle. */
                             /**/
                             $reference = $start_time . ":" . $period1 . ":" . $period3 . "~" . $_SERVER["HTTP_HOST"] . "~" . $post_vars["attr"]["level_ccaps_eotper"];
                             /**/
                             if (!($paypal = array())) {
                                 $paypal["METHOD"] = "CreateRecurringPaymentsProfile";
                                 /**/
                                 $paypal["EMAIL"] = $post_vars["email"];
                                 $paypal["FIRSTNAME"] = $post_vars["first_name"];
                                 $paypal["LASTNAME"] = $post_vars["last_name"];
                                 $paypal["SUBSCRIBERNAME"] = $post_vars["name"];
                                 /**/
                                 $paypal["DESC"] = $cost_calculations["desc"];
                                 $paypal["PROFILEREFERENCE"] = $reference;
                                 /**/
                                 if (!$post_vars["attr"]["tp"] || $post_vars["attr"]["tp"] && $cost_calculations["trial_total"] > 0) {
                                     $paypal["INITAMT"] = $post_vars["attr"]["tp"] ? $cost_calculations["trial_total"] : $cost_calculations["total"];
                                     $paypal["FAILEDINITAMTACTION"] = "CancelOnFailure";
                                 }
                                 /**/
                                 $paypal["CURRENCYCODE"] = $cost_calculations["cur"];
                                 $paypal["AMT"] = $cost_calculations["sub_total"];
                                 $paypal["TAXAMT"] = $cost_calculations["tax"];
                                 /**/
                                 $paypal["MAXFAILEDPAYMENTS"] = $post_vars["attr"]["rra"];
                                 $paypal["AUTOBILLOUTAMT"] = apply_filters("ws_plugin__optimizemember_pro_paypal_auto_bill_op", "AddToNextBilling", get_defined_vars());
                                 /**/
                                 $paypal["PROFILESTARTDATE"] = date("Y-m-d", $start_time) . "T00:00:00Z";
                                 /**/
                                 $paypal["BILLINGPERIOD"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_term($post_vars["attr"]["rt"]);
                                 $paypal["TOTALBILLINGCYCLES"] = $post_vars["attr"]["rr"] ? $post_vars["attr"]["rrt"] ? $post_vars["attr"]["rrt"] : "0" : "1";
                                 $paypal["BILLINGFREQUENCY"] = $post_vars["attr"]["rp"];
                                 /**/
                                 if ($_GET["optimizemember_paypal_xco"] === "optimizemember_pro_paypal_checkout_return" && !empty($_GET["token"]) && ($paypal_xco_details = array("METHOD" => "GetExpressCheckoutDetails", "TOKEN" => $_GET["token"])) && ($paypal_xco_details = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal_xco_details)) && empty($paypal_xco_details["__error"])) {
                                     $paypal["TOKEN"] = $paypal_xco_details["TOKEN"];
                                 } else {
                                     $paypal["CREDITCARDTYPE"] = $post_vars["card_type"];
                                     $paypal["ACCT"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
                                     $paypal["EXPDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_expiration"]);
                                     $paypal["CVV2"] = $post_vars["card_verification"];
                                     /**/
                                     if (in_array($post_vars["card_type"], array("Maestro", "Solo"))) {
                                         if (preg_match("/^[0-9]{2}\\/[0-9]{4}\$/", $post_vars["card_start_date_issue_number"])) {
                                             $paypal["STARTDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
                                         } else {
                                             /* Otherwise, we assume they provided an Issue Number instead. */
                                             $paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
                                         }
                                     }
                                     /**/
                                     $paypal["STREET"] = $post_vars["street"];
                                     $paypal["CITY"] = $post_vars["city"];
                                     $paypal["STATE"] = $post_vars["state"];
                                     $paypal["COUNTRYCODE"] = $post_vars["country"];
                                     $paypal["ZIP"] = $post_vars["zip"];
                                 }
                             }
                             /**/
                             if (($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"])) {
                                 $new__subscr_id = $paypal["PROFILEID"];
                                 /**/
                                 if (!($ipn = array())) {
                                     $ipn["txn_type"] = "subscr_signup";
                                     $ipn["subscr_id"] = $new__subscr_id;
                                     $ipn["custom"] = $post_vars["attr"]["custom"];
                                     /**/
                                     $ipn["txn_id"] = $new__subscr_id;
                                     /**/
                                     $ipn["period1"] = $period1;
                                     $ipn["period3"] = $period3;
                                     /**/
                                     $ipn["mc_amount1"] = $cost_calculations["trial_total"];
                                     $ipn["mc_amount3"] = $cost_calculations["total"];
                                     /**/
                                     $ipn["mc_gross"] = preg_match("/^[1-9]/", $ipn["period1"]) ? $ipn["mc_amount1"] : $ipn["mc_amount3"];
                                     /**/
                                     $ipn["mc_currency"] = $cost_calculations["cur"];
                                     $ipn["tax"] = $cost_calculations["tax"];
                                     /**/
                                     $ipn["recurring"] = $post_vars["attr"]["rr"] ? "1" : "";
                                     /**/
                                     $ipn["payer_email"] = $post_vars["email"];
                                     $ipn["first_name"] = $post_vars["first_name"];
                                     $ipn["last_name"] = $post_vars["last_name"];
                                     /**/
                                     $ipn["option_name1"] = "Originating Domain";
                                     $ipn["option_selection1"] = $_SERVER["HTTP_HOST"];
                                     /**/
                                     $ipn["option_name2"] = "Customer IP Address";
                                     $ipn["option_selection2"] = $_SERVER["REMOTE_ADDR"];
                                     /**/
                                     $ipn["item_name"] = $cost_calculations["desc"];
                                     $ipn["item_number"] = $post_vars["attr"]["level_ccaps_eotper"];
                                     /**/
                                     $ipn_q = "&optimizemember_paypal_proxy=paypal&optimizemember_paypal_proxy_use=pro-emails";
                                     $ipn_q .= $ipn["mc_gross"] > 0 ? ",subscr-signup-as-subscr-payment" : "";
                                     /* Use as first payment? */
                                     $ipn_q .= "&optimizemember_paypal_proxy_verification=" . urlencode(c_ws_plugin__optimizemember_paypal_utilities::paypal_proxy_key_gen());
                                     $ipn_q .= "&optimizemember_paypal_proxy_return_url=" . rawurlencode($post_vars["attr"]["success"]);
                                 }
                                 /**/
                                 if (!($create_user = array())) {
                                     $_POST["ws_plugin__optimizemember_custom_reg_field_user_pass1"] = $post_vars["password1"];
                                     /* Fake this for registration configuration. */
                                     $_POST["ws_plugin__optimizemember_custom_reg_field_first_name"] = $post_vars["first_name"];
                                     /* Fake this for registration configuration. */
                                     $_POST["ws_plugin__optimizemember_custom_reg_field_last_name"] = $post_vars["last_name"];
                                     /* Fake this for registration configuration. */
                                     $_POST["ws_plugin__optimizemember_custom_reg_field_opt_in"] = $post_vars["custom_fields"]["opt_in"];
                                     /* Fake this too. */
                                     /**/
                                     if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) {
                                         foreach (json_decode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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($post_vars["custom_fields"][$field_var])) {
                                                 $_POST["ws_plugin__optimizemember_custom_reg_field_" . $field_var] = $post_vars["custom_fields"][$field_var];
                                             }
                                         }
                                     }
                                     /**/
                                     $_COOKIE["optimizemember_subscr_gateway"] = c_ws_plugin__optimizemember_utils_encryption::encrypt("paypal");
                                     /* Fake this for registration configuration. */
                                     $_COOKIE["optimizemember_subscr_id"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($new__subscr_id);
                                     /* Fake this for registration configuration. */
                                     $_COOKIE["optimizemember_custom"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($post_vars["attr"]["custom"]);
                                     /* Fake this for registration configuration. */
                                     $_COOKIE["optimizemember_item_number"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($post_vars["attr"]["level_ccaps_eotper"]);
                                     /* Fake this too. */
                                     /**/
                                     $create_user["user_login"] = $post_vars["username"];
                                     /* Copy this into a separate array for `wp_create_user()`. */
                                     $create_user["user_pass"] = wp_generate_password();
                                     /* Which may fire `c_ws_plugin__optimizemember_registrations::generate_password()`. */
                                     $create_user["user_email"] = $post_vars["email"];
                                     /* Copy this into a separate array for `wp_create_user()`. */
                                 }
                                 /**/
                                 if ($post_vars["password1"] && $post_vars["password1"] === $create_user["user_pass"]) {
                                     if ((is_multisite() && ($new__user_id = c_ws_plugin__optimizemember_registrations::ms_create_existing_user($create_user["user_login"], $create_user["user_email"], $create_user["user_pass"])) || ($new__user_id = wp_create_user($create_user["user_login"], $create_user["user_pass"], $create_user["user_email"]))) && !is_wp_error($new__user_id)) {
                                         wp_new_user_notification($new__user_id, $create_user["user_pass"]);
                                         /**/
                                         $ipn["optimizemember_paypal_proxy_return_url"] = trim(c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20)));
                                         /**/
                                         $global_response = array("response" => sprintf(_x('<strong>Thank you.</strong> Your account has been approved.<br />&mdash; Please <a href="%s" rel="nofollow">login</a>.', "s2member-front", "s2member"), esc_attr(wp_login_url())));
                                         /**/
                                         if ($post_vars["attr"]["success"] && substr($ipn["optimizemember_paypal_proxy_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $ipn["optimizemember_paypal_proxy_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                             wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                         }
                                     } else {
                                         c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20));
                                         /**/
                                         $global_response = array("response" => _x('<strong>Oops.</strong> A slight problem. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
                                     }
                                 } else {
                                     if ((is_multisite() && ($new__user_id = c_ws_plugin__optimizemember_registrations::ms_create_existing_user($create_user["user_login"], $create_user["user_email"], $create_user["user_pass"])) || ($new__user_id = wp_create_user($create_user["user_login"], $create_user["user_pass"], $create_user["user_email"]))) && !is_wp_error($new__user_id)) {
                                         update_user_option($new__user_id, "default_password_nag", true, true);
                                         /* Password nag. */
                                         wp_new_user_notification($new__user_id, $create_user["user_pass"]);
                                         /**/
                                         $ipn["optimizemember_paypal_proxy_return_url"] = trim(c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20)));
                                         /**/
                                         $global_response = array("response" => _x('<strong>Thank you.</strong> Your account has been approved.<br />&mdash; You\'ll receive an email momentarily.', "s2member-front", "s2member"));
                                         /**/
                                         if ($post_vars["attr"]["success"] && substr($ipn["optimizemember_paypal_proxy_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $ipn["optimizemember_paypal_proxy_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                             wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                         }
                                     } else {
                                         c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20));
                                         /**/
                                         $global_response = array("response" => _x('<strong>Oops.</strong> A slight problem. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
                                     }
                                 }
                             } else {
                                 $global_response = array("response" => $paypal["__error"], "error" => true);
                             }
                         } else {
                             if (!$use_recurring_profile && is_user_logged_in() && is_object($user = wp_get_current_user()) && ($user_id = $user->ID)) {
                                 if ($is_independent_ccaps_sale || !($cur__subscr_id = get_user_option("optimizemember_subscr_id")) || !($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response(array("METHOD" => "GetRecurringPaymentsProfileDetails", "PROFILEID" => $cur__subscr_id))) || !empty($paypal["__error"]) || !preg_match("/^(Pending|PendingProfile)\$/i", $paypal["STATUS"])) {
                                     update_user_meta($user_id, "first_name", $post_vars["first_name"]) . update_user_meta($user_id, "last_name", $post_vars["last_name"]);
                                     /**/
                                     if (!($paypal = array())) {
                                         if ($_GET["optimizemember_paypal_xco"] === "optimizemember_pro_paypal_checkout_return" && !empty($_GET["token"]) && ($paypal_xco_details = array("METHOD" => "GetExpressCheckoutDetails", "TOKEN" => $_GET["token"])) && ($paypal_xco_details = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal_xco_details)) && empty($paypal_xco_details["__error"])) {
                                             $paypal["METHOD"] = "DoExpressCheckoutPayment";
                                             /**/
                                             $paypal["TOKEN"] = $paypal_xco_details["TOKEN"];
                                             $paypal["PAYERID"] = $paypal_xco_details["PAYERID"];
                                             /**/
                                             $paypal["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
                                             /**/
                                             $paypal["PAYMENTREQUEST_0_DESC"] = $cost_calculations["desc"];
                                             $paypal["PAYMENTREQUEST_0_CUSTOM"] = $post_vars["attr"]["custom"];
                                             /**/
                                             $paypal["PAYMENTREQUEST_0_CURRENCYCODE"] = $cost_calculations["cur"];
                                             $paypal["PAYMENTREQUEST_0_ITEMAMT"] = $cost_calculations["sub_total"];
                                             $paypal["PAYMENTREQUEST_0_TAXAMT"] = $cost_calculations["tax"];
                                             $paypal["PAYMENTREQUEST_0_AMT"] = $cost_calculations["total"];
                                             /**/
                                             $paypal["L_PAYMENTREQUEST_0_QTY0"] = "1";
                                             /* Always (1). */
                                             $paypal["L_PAYMENTREQUEST_0_NAME0"] = $cost_calculations["desc"];
                                             $paypal["L_PAYMENTREQUEST_0_NUMBER0"] = $post_vars["attr"]["level_ccaps_eotper"];
                                             $paypal["L_PAYMENTREQUEST_0_AMT0"] = $cost_calculations["sub_total"];
                                         } else {
                                             $paypal["METHOD"] = "DoDirectPayment";
                                             $paypal["PAYMENTACTION"] = "Sale";
                                             /**/
                                             $paypal["EMAIL"] = $user->user_email;
                                             $paypal["FIRSTNAME"] = $post_vars["first_name"];
                                             $paypal["LASTNAME"] = $post_vars["last_name"];
                                             $paypal["IPADDRESS"] = $_SERVER["REMOTE_ADDR"];
                                             /**/
                                             $paypal["DESC"] = $cost_calculations["desc"];
                                             $paypal["CUSTOM"] = $post_vars["attr"]["custom"];
                                             /**/
                                             $paypal["CURRENCYCODE"] = $cost_calculations["cur"];
                                             $paypal["ITEMAMT"] = $cost_calculations["sub_total"];
                                             $paypal["TAXAMT"] = $cost_calculations["tax"];
                                             $paypal["AMT"] = $cost_calculations["total"];
                                             /**/
                                             $paypal["L_QTY0"] = "1";
                                             /* Always (1). */
                                             $paypal["L_NAME0"] = $cost_calculations["desc"];
                                             $paypal["L_NUMBER0"] = $post_vars["attr"]["level_ccaps_eotper"];
                                             $paypal["L_AMT0"] = $cost_calculations["sub_total"];
                                             /**/
                                             $paypal["CREDITCARDTYPE"] = $post_vars["card_type"];
                                             $paypal["ACCT"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
                                             $paypal["EXPDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_expiration"]);
                                             $paypal["CVV2"] = $post_vars["card_verification"];
                                             /**/
                                             if (in_array($post_vars["card_type"], array("Maestro", "Solo"))) {
                                                 if (preg_match("/^[0-9]{2}\\/[0-9]{4}\$/", $post_vars["card_start_date_issue_number"])) {
                                                     $paypal["STARTDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
                                                 } else {
                                                     /* Otherwise, we assume they provided an Issue Number instead. */
                                                     $paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
                                                 }
                                             }
                                             /**/
                                             $paypal["STREET"] = $post_vars["street"];
                                             $paypal["CITY"] = $post_vars["city"];
                                             $paypal["STATE"] = $post_vars["state"];
                                             $paypal["COUNTRYCODE"] = $post_vars["country"];
                                             $paypal["ZIP"] = $post_vars["zip"];
                                         }
                                     }
                                     /**/
                                     if (($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"])) {
                                         $old__subscr_id = get_user_option("optimizemember_subscr_id");
                                         $old__subscr_or_wp_id = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id();
                                         $new__subscr_id = $new__txn_id = !empty($paypal["PAYMENTINFO_0_TRANSACTIONID"]) ? $paypal["PAYMENTINFO_0_TRANSACTIONID"] : false;
                                         $new__subscr_id = $new__txn_id = !$new__subscr_id && !empty($paypal["TRANSACTIONID"]) ? $paypal["TRANSACTIONID"] : $new__subscr_id;
                                         /**/
                                         if (!($ipn = array())) {
                                             $ipn["txn_type"] = "web_accept";
                                             $ipn["txn_id"] = $new__subscr_id;
                                             $ipn["custom"] = $post_vars["attr"]["custom"];
                                             /**/
                                             $ipn["mc_gross"] = $cost_calculations["total"];
                                             $ipn["mc_currency"] = $cost_calculations["cur"];
                                             $ipn["tax"] = $cost_calculations["tax"];
                                             /**/
                                             $ipn["payer_email"] = $user->user_email;
                                             $ipn["first_name"] = $post_vars["first_name"];
                                             $ipn["last_name"] = $post_vars["last_name"];
                                             /**/
                                             $ipn["option_name1"] = "Referencing Customer ID";
                                             $ipn["option_selection1"] = $old__subscr_or_wp_id;
                                             /**/
                                             $ipn["option_name2"] = "Customer IP Address";
                                             $ipn["option_selection2"] = $_SERVER["REMOTE_ADDR"];
                                             /**/
                                             $ipn["item_name"] = $cost_calculations["desc"];
                                             $ipn["item_number"] = $post_vars["attr"]["level_ccaps_eotper"];
                                             /**/
                                             $ipn_q = "&optimizemember_paypal_proxy=paypal&optimizemember_paypal_proxy_use=pro-emails";
                                             $ipn_q .= "&optimizemember_paypal_proxy_verification=" . urlencode(c_ws_plugin__optimizemember_paypal_utilities::paypal_proxy_key_gen());
                                             $ipn_q .= "&optimizemember_paypal_proxy_return_url=" . rawurlencode($post_vars["attr"]["success"]);
                                             /**/
                                             $ipn["optimizemember_paypal_proxy_return_url"] = trim(c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20)));
                                         }
                                         /**/
                                         if (!$is_independent_ccaps_sale) {
                                             /* Independent? */
                                             if (!($paypal = array()) && ($paypal["PROFILEID"] = $old__subscr_id)) {
                                                 $paypal["METHOD"] = "ManageRecurringPaymentsProfileStatus";
                                                 $paypal["ACTION"] = "Cancel";
                                                 /**/
                                                 c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal);
                                             }
                                         }
                                         /**/
                                         setcookie("optimizemember_tracking", $optimizemember_tracking = c_ws_plugin__optimizemember_utils_encryption::encrypt($new__subscr_id), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_tracking", $optimizemember_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_tracking"] = $optimizemember_tracking);
                                         /**/
                                         $global_response = array("response" => sprintf(_x('<strong>Thank you.</strong> Your account has been updated.<br />&mdash; Please <a href="%s" rel="nofollow">log back in</a> now.', "s2member-front", "s2member"), esc_attr(wp_login_url())));
                                         /**/
                                         if ($post_vars["attr"]["success"] && substr($ipn["optimizemember_paypal_proxy_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $ipn["optimizemember_paypal_proxy_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                             wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                         }
                                     } else {
                                         $global_response = array("response" => $paypal["__error"], "error" => true);
                                     }
                                 } else {
                                     $global_response = array("response" => _x('<strong>Sorry.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
                                 }
                             } else {
                                 if (!$use_recurring_profile && !is_user_logged_in()) {
                                     if (!($paypal = array())) {
                                         if ($_GET["optimizemember_paypal_xco"] === "optimizemember_pro_paypal_checkout_return" && !empty($_GET["token"]) && ($paypal_xco_details = array("METHOD" => "GetExpressCheckoutDetails", "TOKEN" => $_GET["token"])) && ($paypal_xco_details = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal_xco_details)) && empty($paypal_xco_details["__error"])) {
                                             $paypal["METHOD"] = "DoExpressCheckoutPayment";
                                             /**/
                                             $paypal["TOKEN"] = $paypal_xco_details["TOKEN"];
                                             $paypal["PAYERID"] = $paypal_xco_details["PAYERID"];
                                             /**/
                                             $paypal["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
                                             /**/
                                             $paypal["PAYMENTREQUEST_0_DESC"] = $cost_calculations["desc"];
                                             $paypal["PAYMENTREQUEST_0_CUSTOM"] = $post_vars["attr"]["custom"];
                                             /**/
                                             $paypal["PAYMENTREQUEST_0_CURRENCYCODE"] = $cost_calculations["cur"];
                                             $paypal["PAYMENTREQUEST_0_ITEMAMT"] = $cost_calculations["sub_total"];
                                             $paypal["PAYMENTREQUEST_0_TAXAMT"] = $cost_calculations["tax"];
                                             $paypal["PAYMENTREQUEST_0_AMT"] = $cost_calculations["total"];
                                             /**/
                                             $paypal["L_PAYMENTREQUEST_0_QTY0"] = "1";
                                             /* Always (1). */
                                             $paypal["L_PAYMENTREQUEST_0_NAME0"] = $cost_calculations["desc"];
                                             $paypal["L_PAYMENTREQUEST_0_NUMBER0"] = $post_vars["attr"]["level_ccaps_eotper"];
                                             $paypal["L_PAYMENTREQUEST_0_AMT0"] = $cost_calculations["sub_total"];
                                         } else {
                                             $paypal["METHOD"] = "DoDirectPayment";
                                             $paypal["PAYMENTACTION"] = "Sale";
                                             /**/
                                             $paypal["EMAIL"] = $post_vars["email"];
                                             $paypal["FIRSTNAME"] = $post_vars["first_name"];
                                             $paypal["LASTNAME"] = $post_vars["last_name"];
                                             $paypal["IPADDRESS"] = $_SERVER["REMOTE_ADDR"];
                                             /**/
                                             $paypal["DESC"] = $cost_calculations["desc"];
                                             $paypal["CUSTOM"] = $post_vars["attr"]["custom"];
                                             /**/
                                             $paypal["CURRENCYCODE"] = $cost_calculations["cur"];
                                             $paypal["ITEMAMT"] = $cost_calculations["sub_total"];
                                             $paypal["TAXAMT"] = $cost_calculations["tax"];
                                             $paypal["AMT"] = $cost_calculations["total"];
                                             /**/
                                             $paypal["L_QTY0"] = "1";
                                             /* Always (1). */
                                             $paypal["L_NAME0"] = $cost_calculations["desc"];
                                             $paypal["L_NUMBER0"] = $post_vars["attr"]["level_ccaps_eotper"];
                                             $paypal["L_AMT0"] = $cost_calculations["sub_total"];
                                             /**/
                                             $paypal["CREDITCARDTYPE"] = $post_vars["card_type"];
                                             $paypal["ACCT"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
                                             $paypal["EXPDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_expiration"]);
                                             $paypal["CVV2"] = $post_vars["card_verification"];
                                             /**/
                                             if (in_array($post_vars["card_type"], array("Maestro", "Solo"))) {
                                                 if (preg_match("/^[0-9]{2}\\/[0-9]{4}\$/", $post_vars["card_start_date_issue_number"])) {
                                                     $paypal["STARTDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
                                                 } else {
                                                     /* Otherwise, we assume they provided an Issue Number instead. */
                                                     $paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
                                                 }
                                             }
                                             /**/
                                             $paypal["STREET"] = $post_vars["street"];
                                             $paypal["CITY"] = $post_vars["city"];
                                             $paypal["STATE"] = $post_vars["state"];
                                             $paypal["COUNTRYCODE"] = $post_vars["country"];
                                             $paypal["ZIP"] = $post_vars["zip"];
                                         }
                                     }
                                     /**/
                                     if (($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"])) {
                                         $new__subscr_id = !empty($paypal["PAYMENTINFO_0_TRANSACTIONID"]) ? $paypal["PAYMENTINFO_0_TRANSACTIONID"] : false;
                                         $new__subscr_id = !$new__subscr_id && !empty($paypal["TRANSACTIONID"]) ? $paypal["TRANSACTIONID"] : $new__subscr_id;
                                         /**/
                                         if (!($ipn = array())) {
                                             $ipn["txn_type"] = "web_accept";
                                             $ipn["txn_id"] = $new__subscr_id;
                                             $ipn["custom"] = $post_vars["attr"]["custom"];
                                             /**/
                                             $ipn["mc_gross"] = $cost_calculations["total"];
                                             $ipn["mc_currency"] = $cost_calculations["cur"];
                                             $ipn["tax"] = $cost_calculations["tax"];
                                             /**/
                                             $ipn["payer_email"] = $post_vars["email"];
                                             $ipn["first_name"] = $post_vars["first_name"];
                                             $ipn["last_name"] = $post_vars["last_name"];
                                             /**/
                                             $ipn["option_name1"] = "Originating Domain";
                                             $ipn["option_selection1"] = $_SERVER["HTTP_HOST"];
                                             /**/
                                             $ipn["option_name2"] = "Customer IP Address";
                                             $ipn["option_selection2"] = $_SERVER["REMOTE_ADDR"];
                                             /**/
                                             $ipn["item_name"] = $cost_calculations["desc"];
                                             $ipn["item_number"] = $post_vars["attr"]["level_ccaps_eotper"];
                                             /**/
                                             $ipn_q = "&optimizemember_paypal_proxy=paypal&optimizemember_paypal_proxy_use=pro-emails";
                                             $ipn_q .= "&optimizemember_paypal_proxy_verification=" . urlencode(c_ws_plugin__optimizemember_paypal_utilities::paypal_proxy_key_gen());
                                             $ipn_q .= "&optimizemember_paypal_proxy_return_url=" . rawurlencode($post_vars["attr"]["success"]);
                                         }
                                         /**/
                                         if (!($create_user = array())) {
                                             $_POST["ws_plugin__optimizemember_custom_reg_field_user_pass1"] = $post_vars["password1"];
                                             /* Fake this for registration configuration. */
                                             $_POST["ws_plugin__optimizemember_custom_reg_field_first_name"] = $post_vars["first_name"];
                                             /* Fake this for registration configuration. */
                                             $_POST["ws_plugin__optimizemember_custom_reg_field_last_name"] = $post_vars["last_name"];
                                             /* Fake this for registration configuration. */
                                             $_POST["ws_plugin__optimizemember_custom_reg_field_opt_in"] = $post_vars["custom_fields"]["opt_in"];
                                             /* Fake this too. */
                                             /**/
                                             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) {
                                                 foreach (json_decode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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($post_vars["custom_fields"][$field_var])) {
                                                         $_POST["ws_plugin__optimizemember_custom_reg_field_" . $field_var] = $post_vars["custom_fields"][$field_var];
                                                     }
                                                 }
                                             }
                                             /**/
                                             $_COOKIE["optimizemember_subscr_gateway"] = c_ws_plugin__optimizemember_utils_encryption::encrypt("paypal");
                                             /* Fake this for registration configuration. */
                                             $_COOKIE["optimizemember_subscr_id"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($new__subscr_id);
                                             /* Fake this for registration configuration. */
                                             $_COOKIE["optimizemember_custom"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($post_vars["attr"]["custom"]);
                                             /* Fake this for registration configuration. */
                                             $_COOKIE["optimizemember_item_number"] = c_ws_plugin__optimizemember_utils_encryption::encrypt($post_vars["attr"]["level_ccaps_eotper"]);
                                             /* Fake this too. */
                                             /**/
                                             $create_user["user_login"] = $post_vars["username"];
                                             /* Copy this into a separate array for `wp_create_user()`. */
                                             $create_user["user_pass"] = wp_generate_password();
                                             /* Which may fire `c_ws_plugin__optimizemember_registrations::generate_password()`. */
                                             $create_user["user_email"] = $post_vars["email"];
                                             /* Copy this into a separate array for `wp_create_user()`. */
                                         }
                                         /**/
                                         if ($post_vars["password1"] && $post_vars["password1"] === $create_user["user_pass"]) {
                                             if ((is_multisite() && ($new__user_id = c_ws_plugin__optimizemember_registrations::ms_create_existing_user($create_user["user_login"], $create_user["user_email"], $create_user["user_pass"])) || ($new__user_id = wp_create_user($create_user["user_login"], $create_user["user_pass"], $create_user["user_email"]))) && !is_wp_error($new__user_id)) {
                                                 wp_new_user_notification($new__user_id, $create_user["user_pass"]);
                                                 /**/
                                                 $ipn["optimizemember_paypal_proxy_return_url"] = trim(c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20)));
                                                 /**/
                                                 $global_response = array("response" => sprintf(_x('<strong>Thank you.</strong> Your account has been approved.<br />&mdash; Please <a href="%s" rel="nofollow">login</a>.', "s2member-front", "s2member"), esc_attr(wp_login_url())));
                                                 /**/
                                                 if ($post_vars["attr"]["success"] && substr($ipn["optimizemember_paypal_proxy_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $ipn["optimizemember_paypal_proxy_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                                     wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                                 }
                                             } else {
                                                 c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20));
                                                 /**/
                                                 $global_response = array("response" => _x('<strong>Oops.</strong> A slight problem. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
                                             }
                                         } else {
                                             if ((is_multisite() && ($new__user_id = c_ws_plugin__optimizemember_registrations::ms_create_existing_user($create_user["user_login"], $create_user["user_email"], $create_user["user_pass"])) || ($new__user_id = wp_create_user($create_user["user_login"], $create_user["user_pass"], $create_user["user_email"]))) && !is_wp_error($new__user_id)) {
                                                 update_user_option($new__user_id, "default_password_nag", true, true);
                                                 /* Password nag. */
                                                 wp_new_user_notification($new__user_id, $create_user["user_pass"]);
                                                 /**/
                                                 $ipn["optimizemember_paypal_proxy_return_url"] = trim(c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20)));
                                                 /**/
                                                 $global_response = array("response" => _x('<strong>Thank you.</strong> Your account has been approved.<br />&mdash; You\'ll receive an email momentarily.', "s2member-front", "s2member"));
                                                 /**/
                                                 if ($post_vars["attr"]["success"] && substr($ipn["optimizemember_paypal_proxy_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $ipn["optimizemember_paypal_proxy_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                                     wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                                 }
                                             } else {
                                                 c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20));
                                                 /**/
                                                 $global_response = array("response" => _x('<strong>Oops.</strong> A slight problem. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
                                             }
                                         }
                                     } else {
                                         $global_response = array("response" => $paypal["__error"], "error" => true);
                                     }
                                 } else {
                                     $global_response = array("response" => _x('<strong>Unknown error.</strong> Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
                                 }
                             }
                         }
                     }
                 }
             } else {
                 $global_response = $error;
             }
         }
     }
 }
 /**
  * Handles processing of Pro Forms for Specific Post/Page checkout.
  *
  * @package optimizeMember\AuthNet
  * @since 1.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after a custom URL redirection.
  */
 public static function authnet_sp_checkout()
 {
     if (!empty($_POST["optimizemember_pro_authnet_sp_checkout"]["nonce"]) && ($nonce = $_POST["optimizemember_pro_authnet_sp_checkout"]["nonce"]) && wp_verify_nonce($nonce, "s2member-pro-authnet-sp-checkout")) {
         $GLOBALS["ws_plugin__optimizemember_pro_authnet_sp_checkout_response"] = array();
         /* This holds the global response details. */
         $global_response =& $GLOBALS["ws_plugin__optimizemember_pro_authnet_sp_checkout_response"];
         /* This is a shorter reference. */
         /**/
         $post_vars = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST["optimizemember_pro_authnet_sp_checkout"]));
         $post_vars["attr"] = unserialize(c_ws_plugin__optimizemember_utils_encryption::decrypt($post_vars["attr"]));
         /* And Filter. */
         $post_vars["attr"] = apply_filters("ws_plugin__optimizemember_pro_authnet_sp_checkout_post_attr", $post_vars["attr"], get_defined_vars());
         /**/
         $post_vars["recaptcha_challenge_field"] = !$post_vars["recaptcha_challenge_field"] ? trim(stripslashes($_POST["recaptcha_challenge_field"])) : $post_vars["recaptcha_challenge_field"];
         $post_vars["recaptcha_response_field"] = !$post_vars["recaptcha_response_field"] ? trim(stripslashes($_POST["recaptcha_response_field"])) : $post_vars["recaptcha_response_field"];
         /**/
         $post_vars["name"] = trim($post_vars["first_name"] . " " . $post_vars["last_name"]);
         $post_vars["email"] = apply_filters("user_registration_email", sanitize_email($post_vars["email"]), get_defined_vars());
         /**/
         if (!c_ws_plugin__optimizemember_pro_authnet_responses::authnet_form_attr_validation_errors($post_vars["attr"])) {
             if (!($error = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_form_submission_validation_errors("sp-checkout", $post_vars))) {
                 $cp_attr = c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_apply_coupon($post_vars["attr"], $post_vars["coupon"], "attr", array("affiliates-silent-post"));
                 $cost_calculations = c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_cost(null, $cp_attr["ra"], $post_vars["state"], $post_vars["country"], $post_vars["zip"], $cp_attr["cc"], $cp_attr["desc"]);
                 /**/
                 if (!($authnet = array())) {
                     $authnet["x_type"] = "AUTH_CAPTURE";
                     $authnet["x_method"] = "CC";
                     /**/
                     $authnet["x_email"] = $post_vars["email"];
                     $authnet["x_first_name"] = $post_vars["first_name"];
                     $authnet["x_last_name"] = $post_vars["last_name"];
                     $authnet["x_customer_ip"] = $_SERVER["REMOTE_ADDR"];
                     /**/
                     $authnet["x_invoice_num"] = "s2-" . uniqid();
                     $authnet["x_description"] = $cost_calculations["desc"];
                     /**/
                     $authnet["s2_invoice"] = $post_vars["attr"]["sp_ids_exp"];
                     $authnet["s2_custom"] = $post_vars["attr"]["custom"];
                     /**/
                     $authnet["x_tax"] = $cost_calculations["tax"];
                     $authnet["x_amount"] = $cost_calculations["total"];
                     /**/
                     $authnet["x_card_num"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
                     $authnet["x_exp_date"] = c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_exp_date($post_vars["card_expiration"]);
                     $authnet["x_card_code"] = $post_vars["card_verification"];
                     /**/
                     #if (in_array ($post_vars["card_type"], array ("Maestro", "Solo")))
                     #	if (preg_match ("/^[0-9]{2}\/[0-9]{4}$/", $post_vars["card_start_date_issue_number"]))
                     #		$authnet["x_card_start_date"] = preg_replace ("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
                     #	else /* Otherwise, we assume they provided an issue number instead. */
                     #		$authnet["x_card_issue_number"] = $post_vars["card_start_date_issue_number"];
                     /**/
                     $authnet["x_address"] = $post_vars["street"];
                     $authnet["x_city"] = $post_vars["city"];
                     $authnet["x_state"] = $post_vars["state"];
                     $authnet["x_country"] = $post_vars["country"];
                     $authnet["x_zip"] = $post_vars["zip"];
                 }
                 /**/
                 if (($authnet = c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_aim_response($authnet)) && empty($authnet["__error"])) {
                     $new__txn_id = $authnet["transaction_id"];
                     /**/
                     if (!($ipn = array())) {
                         $ipn["txn_type"] = "web_accept";
                         $ipn["txn_id"] = $new__txn_id;
                         $ipn["custom"] = $post_vars["attr"]["custom"];
                         /**/
                         $ipn["mc_gross"] = $cost_calculations["total"];
                         $ipn["mc_currency"] = $cost_calculations["cur"];
                         $ipn["tax"] = $cost_calculations["tax"];
                         /**/
                         $ipn["payer_email"] = $post_vars["email"];
                         $ipn["first_name"] = $post_vars["first_name"];
                         $ipn["last_name"] = $post_vars["last_name"];
                         /**/
                         if (is_user_logged_in() && ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id())) {
                             $ipn["option_name1"] = "Referencing Customer ID";
                             $ipn["option_selection1"] = $referencing;
                         } else {
                             $ipn["option_name1"] = "Originating Domain";
                             $ipn["option_selection1"] = $_SERVER["HTTP_HOST"];
                         }
                         /**/
                         $ipn["option_name2"] = "Customer IP Address";
                         $ipn["option_selection2"] = $_SERVER["REMOTE_ADDR"];
                         /**/
                         $ipn["item_name"] = $cost_calculations["desc"];
                         $ipn["item_number"] = $post_vars["attr"]["sp_ids_exp"];
                         /**/
                         $ipn_q = "&optimizemember_paypal_proxy=authnet&optimizemember_paypal_proxy_use=pro-emails";
                         $ipn_q .= "&optimizemember_paypal_proxy_verification=" . urlencode(c_ws_plugin__optimizemember_paypal_utilities::paypal_proxy_key_gen());
                         $ipn_q .= "&optimizemember_paypal_proxy_return_url=" . rawurlencode($post_vars["attr"]["success"]);
                         /**/
                         $ipn["optimizemember_authnet_proxy_return_url"] = trim(c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20)));
                     }
                     /**/
                     if ($sp_access_url = c_ws_plugin__optimizemember_sp_access::sp_access_link_gen($post_vars["attr"]["ids"], $post_vars["attr"]["exp"])) {
                         setcookie("optimizemember_sp_tracking", $optimizemember_sp_tracking = c_ws_plugin__optimizemember_utils_encryption::encrypt($new__txn_id), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_sp_tracking", $optimizemember_sp_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_sp_tracking"] = $optimizemember_sp_tracking);
                         /**/
                         $global_response = array("response" => sprintf(_x('<strong>Thank you.</strong> Your purchase has been approved.<br />&mdash; Please <a href="%s" rel="nofollow">click here</a> to proceed.', "s2member-front", "s2member"), esc_attr($sp_access_url)));
                         /**/
                         if ($post_vars["attr"]["success"] && substr($ipn["optimizemember_authnet_proxy_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $ipn["optimizemember_authnet_proxy_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                             wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                         }
                     } else {
                         $global_response = array("response" => _x('<strong>Oops.</strong> Unable to generate Access Link. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
                     }
                 } else {
                     $global_response = array("response" => $authnet["__error"], "error" => true);
                 }
             } else {
                 $global_response = $error;
             }
         }
     }
 }
Beispiel #21
0
 /**
  * Generates Specific Post/Page Access links via AJAX.
  *
  * @package optimizeMember\SP_Access
  * @since 3.5
  *
  * @attaches-to ``add_action("wp_ajax_ws_plugin__optimizemember_sp_access_link_via_ajax");``
  *
  * @return null Exits script execution after returning data for AJAX caller.
  */
 public static function sp_access_link_via_ajax()
 {
     do_action("ws_plugin__optimizemember_before_sp_access_link_via_ajax", get_defined_vars());
     /**/
     status_header(200);
     /* Send a 200 OK status header. */
     header("Content-Type: text/plain; charset=utf-8");
     /* Content-Type with UTF-8. */
     eval('while (@ob_end_clean ());');
     /* End/clean all output buffers that may exist. */
     /**/
     if (current_user_can("create_users")) {
         /* Check priveledges as well. Ability to create Users? */
         /**/
         if (!empty($_POST["ws_plugin__optimizemember_sp_access_link_via_ajax"]) && is_string($nonce = $_POST["ws_plugin__optimizemember_sp_access_link_via_ajax"]) && wp_verify_nonce($nonce, "ws-plugin--optimizemember-sp-access-link-via-ajax")) {
             /**/
             if (($_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST))) && isset($_p["optimizemember_sp_access_link_ids"], $_p["optimizemember_sp_access_link_hours"])) {
                 $sp_access_link = c_ws_plugin__optimizemember_sp_access::sp_access_link_gen((string) $_p["optimizemember_sp_access_link_ids"], (string) $_p["optimizemember_sp_access_link_hours"]);
             }
         }
     }
     /**/
     exit(apply_filters("ws_plugin__optimizemember_sp_access_link_via_ajax", !empty($sp_access_link) ? $sp_access_link : "", get_defined_vars()));
 }
 /**
  * Adds Custom Fields to BuddyPress Registration Form.
  *
  * @package optimizeMember\Custom_Reg_Fields
  * @since 110524RC
  *
  * @attaches-to ``add_action("bp_after_signup_profile_fields");``
  *
  * @return null
  *
  * @todo Optimize with ``empty()``.
  */
 public static function custom_registration_fields_4bp()
 {
     static $processed = false;
     /* Process this routine only one time. */
     /**/
     do_action("ws_plugin__optimizemember_before_custom_registration_fields_4bp", get_defined_vars());
     /**/
     if (!$processed && in_array("registration", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields_4bp"])) {
         if (apply_filters("ws_plugin__optimizemember_custom_registration_fields_4bp_display", true, get_defined_vars())) {
             if (bp_is_register_page() && ($processed = true)) {
                 $_p = !empty($_POST) ? c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)) : array();
                 /**/
                 if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) {
                     if (($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level("auto-detection", "registration")) || $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) {
                         if ($close_section_container = true) {
                             echo '<div id="ws-plugin--optimizemember-custom-reg-fields-4bp-section" class="ws-plugin--optimizemember-custom-reg-fields-4bp-section register-section">' . "\n";
                             echo '<div id="ws-plugin--optimizemember-custom-reg-fields-4bp-container" class="ws-plugin--optimizemember-custom-reg-fields-4bp-container">' . "\n";
                             echo '<input type="hidden" name="ws_plugin__optimizemember_registration" value="' . esc_attr(wp_create_nonce("ws-plugin--optimizemember-registration")) . '" />' . "\n";
                         }
                     }
                 }
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_custom_registration_fields_4bp_before", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
                 /**/
                 if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) {
                     if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level("auto-detection", "registration")) {
                         foreach (json_decode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"], true) as $field) {
                             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                             do_action("ws_plugin__optimizemember_during_custom_registration_fields_4bp_before_custom_fields", get_defined_vars());
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                             /**/
                             if (in_array($field["id"], $fields_applicable)) {
                                 $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
                                 $field_id_class = preg_replace("/_/", "-", $field_var);
                                 /**/
                                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                                 if (apply_filters("ws_plugin__optimizemember_during_custom_registration_fields_4bp_during_custom_fields_display", true, get_defined_vars())) {
                                     if (!empty($field["section"]) && $field["section"] === "yes") {
                                         /* Starts a new section? */
                                         echo '<div class="ws-plugin--optimizemember-custom-reg-field-4bp-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . '">' . (!empty($field["sectitle"]) ? $field["sectitle"] : '') . '</div>';
                                     }
                                     /**/
                                     echo '<div class="ws-plugin--optimizemember-custom-reg-field-4bp ws-plugin--optimizemember-custom-reg-field-4bp-' . esc_attr($field_id_class) . ' field_' . esc_attr($field_var) . ' editfield">' . "\n";
                                     echo '<label for="ws-plugin--optimizemember-custom-reg-field-4bp-' . esc_attr($field_id_class) . '">' . "\n";
                                     echo '<span' . (preg_match("/^(checkbox|pre_checkbox)\$/", $field["type"]) ? ' style="display:none;"' : '') . '>' . $field["label"] . ($field["required"] === "yes" ? ' *' : '') . '</span></label>' . "\n";
                                     echo c_ws_plugin__optimizemember_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, "ws_plugin__optimizemember_custom_reg_field_", "ws-plugin--optimizemember-custom-reg-field-4bp-", "ws-plugin--optimizemember-custom-reg-field-4bp", "", "", "", $_p, $_p["ws_plugin__optimizemember_custom_reg_field_" . $field_var], "registration");
                                     echo '</div>' . "\n";
                                 }
                                 unset($__refs, $__v);
                                 /* Unset defined __refs, __v. */
                             }
                             /**/
                             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                             do_action("ws_plugin__optimizemember_during_custom_registration_fields_4bp_after_custom_fields", get_defined_vars());
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                         }
                     }
                 }
                 /**/
                 if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) {
                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                     do_action("ws_plugin__optimizemember_during_custom_registration_fields_4bp_before_opt_in", get_defined_vars());
                     unset($__refs, $__v);
                     /* Unset defined __refs, __v. */
                     /**/
                     echo '<div class="ws-plugin--optimizemember-custom-reg-field-4bp field_opt_in editfield">' . "\n";
                     echo '<label for="ws-plugin--optimizemember-custom-reg-field-4bp-opt-in">' . "\n";
                     echo '<input type="checkbox" name="ws_plugin__optimizemember_custom_reg_field_opt_in" id="ws-plugin--optimizemember-custom-reg-field-4bp-opt-in" class="ws-plugin--optimizemember-custom-reg-field-4bp" value="1"' . (empty($_p) && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] == 1 || $_p["ws_plugin__optimizemember_custom_reg_field_opt_in"] ? ' checked="checked"' : '') . ' />' . "\n";
                     echo $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in_label"] . "\n";
                     echo '</label>' . "\n";
                     echo '</div>' . "\n";
                     /**/
                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                     do_action("ws_plugin__optimizemember_during_custom_registration_fields_4bp_after_opt_in", get_defined_vars());
                     unset($__refs, $__v);
                     /* Unset defined __refs, __v. */
                 }
                 /**/
                 if (isset($close_section_container) && $close_section_container) {
                     echo '</div>' . "\n" . '</div>' . "\n";
                 }
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_custom_registration_fields_4bp_after", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
             }
         }
     }
     /**/
     do_action("ws_plugin__optimizemember_after_custom_registration_fields_4bp", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
 /**
  * Handles processing of Pro Form billing updates.
  *
  * @package optimizeMember\PayPal
  * @since 1.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after a custom URL redirection.
  */
 public static function paypal_update()
 {
     if (!empty($_POST["optimizemember_pro_paypal_update"]["nonce"]) && ($nonce = $_POST["optimizemember_pro_paypal_update"]["nonce"]) && wp_verify_nonce($nonce, "s2member-pro-paypal-update")) {
         $GLOBALS["ws_plugin__optimizemember_pro_paypal_update_response"] = array();
         /* This holds the global response details. */
         $global_response =& $GLOBALS["ws_plugin__optimizemember_pro_paypal_update_response"];
         /* This is a shorter reference. */
         /**/
         $post_vars = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST["optimizemember_pro_paypal_update"]));
         $post_vars["attr"] = unserialize(c_ws_plugin__optimizemember_utils_encryption::decrypt($post_vars["attr"]));
         /* And run a Filter. */
         $post_vars["attr"] = apply_filters("ws_plugin__optimizemember_pro_paypal_update_post_attr", $post_vars["attr"], get_defined_vars());
         /**/
         $post_vars["recaptcha_challenge_field"] = !$post_vars["recaptcha_challenge_field"] ? trim(stripslashes($_POST["recaptcha_challenge_field"])) : $post_vars["recaptcha_challenge_field"];
         $post_vars["recaptcha_response_field"] = !$post_vars["recaptcha_response_field"] ? trim(stripslashes($_POST["recaptcha_response_field"])) : $post_vars["recaptcha_response_field"];
         /**/
         if (!c_ws_plugin__optimizemember_pro_paypal_responses::paypal_form_attr_validation_errors($post_vars["attr"])) {
             if (!($error = c_ws_plugin__optimizemember_pro_paypal_responses::paypal_form_submission_validation_errors("update", $post_vars))) {
                 if ($post_vars["card_type"] === "PayPal") {
                     $global_response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal</a> to update your billing information.', "s2member-front", "s2member"), esc_attr("https://" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com") . "/")), "error" => true);
                 } else {
                     if (is_user_logged_in() && ($user = wp_get_current_user()) && ($user_id = $user->ID)) {
                         if (($paypal = array("METHOD" => "GetRecurringPaymentsProfileDetails")) && ($paypal["PROFILEID"] = $cur__subscr_id = get_user_option("optimizemember_subscr_id"))) {
                             if (($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"]) && strlen($paypal["ACCT"]) === 4 && preg_match("/^(Active|ActiveProfile|Suspended|SuspendedProfile)\$/i", $paypal["STATUS"])) {
                                 $paypal = array();
                                 /* Reset the PayPal array. */
                                 /**/
                                 $paypal["METHOD"] = "UpdateRecurringPaymentsProfile";
                                 $paypal["PROFILEID"] = $cur__subscr_id;
                                 /**/
                                 $paypal["EMAIL"] = $user->user_email;
                                 $paypal["FIRSTNAME"] = $user->first_name;
                                 $paypal["LASTNAME"] = $user->last_name;
                                 /**/
                                 $paypal["CREDITCARDTYPE"] = $post_vars["card_type"];
                                 $paypal["ACCT"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
                                 $paypal["EXPDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_expiration"]);
                                 $paypal["CVV2"] = $post_vars["card_verification"];
                                 /**/
                                 if (in_array($post_vars["card_type"], array("Maestro", "Solo"))) {
                                     if (preg_match("/^[0-9]{2}\\/[0-9]{4}\$/", $post_vars["card_start_date_issue_number"])) {
                                         $paypal["STARTDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
                                     } else {
                                         /* Otherwise, we assume they provided an issue number instead. */
                                         $paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
                                     }
                                 }
                                 /**/
                                 $paypal["STREET"] = $post_vars["street"];
                                 $paypal["CITY"] = $post_vars["city"];
                                 $paypal["STATE"] = $post_vars["state"];
                                 $paypal["COUNTRYCODE"] = $post_vars["country"];
                                 $paypal["ZIP"] = $post_vars["zip"];
                                 /**/
                                 if (($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"])) {
                                     $global_response = array("response" => _x('<strong>Confirmed.</strong> Your billing information has been updated.', "s2member-front", "s2member"));
                                     /**/
                                     if ($post_vars["attr"]["success"] && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $post_vars["attr"]["success"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                         wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                     }
                                 } else {
                                     $global_response = array("response" => $paypal["__error"], "error" => true);
                                 }
                             } else {
                                 if ($paypal && empty($paypal["__error"]) && strlen($paypal["ACCT"]) === 4 && preg_match("/^(Pending|PendingProfile)\$/i", $paypal["STATUS"])) {
                                     $global_response = array("response" => _x('<strong>Unable to update at this time.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
                                 } else {
                                     if ($paypal && empty($paypal["__error"]) && strlen($paypal["ACCT"]) === 4 && !preg_match("/^(Active|ActiveProfile|Suspended|SuspendedProfile)\$/i", $paypal["STATUS"])) {
                                         $global_response = array("response" => _x('<strong>Unable to update.</strong> You have NO recurring fees. Or, your billing profile is no longer active. Please contact Support if you need assistance.', "s2member-front", "s2member"), "error" => true);
                                     } else {
                                         if ($paypal && empty($paypal["__error"]) && strlen($paypal["ACCT"]) !== 4) {
                                             $global_response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal</a> to update your billing information.', "s2member-front", "s2member"), esc_attr("https://" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com") . "/")), "error" => true);
                                         } else {
                                             if ($paypal && !empty($paypal["__error"]) && $paypal["L_ERRORCODE0"] === "11592") {
                                                 $global_response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal</a> to update your billing information.', "s2member-front", "s2member"), esc_attr("https://" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com") . "/")), "error" => true);
                                             } else {
                                                 $global_response = array("response" => $paypal["__error"], "error" => true);
                                             }
                                         }
                                     }
                                 }
                             }
                         } else {
                             $global_response = array("response" => _x('<strong>Oops.</strong> No Subscr. ID. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
                         }
                     } else {
                         $global_response = array("response" => _x('You\'re <strong>NOT</strong> logged in.', "s2member-front", "s2member"), "error" => true);
                     }
                 }
             } else {
                 $global_response = $error;
             }
         }
     }
 }
Beispiel #24
0
/**
* Deprecated in optimizeMember v3.5+.
*
* Needed by the optimizeMember Pro upgrader prior to optimizeMember Pro v1.5+.
*
* @package optimizeMember
* @since 3.0
*
* @deprecated Starting with optimizeMember v3.5+, please use:
* 	``c_ws_plugin__optimizemember_utils_strings::trim_deep()``
*
* @see optimizeMember\Utilities\c_ws_plugin__optimizemember_utils_strings::trim_deep()
*/
function ws_plugin__optimizemember_trim_deep($data = FALSE)
{
    return c_ws_plugin__optimizemember_utils_strings::trim_deep($data);
}
 /**
  * Handles Profile modifications.
  *
  * @package optimizeMember\Profiles
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null After re-configuring the ``$current_user`` object.
  * 	May also exit script execution when handling the Stand-Alone Profile Modification Form.
  */
 public static function handle_profile_modifications()
 {
     global $current_user;
     /* We'll need to update this global object. */
     /**/
     $user =& $current_user;
     /* Shorter reference to the $current_user object. */
     /**/
     do_action("ws_plugin__optimizemember_before_handle_profile_modifications", get_defined_vars());
     /**/
     if (!empty($_POST["ws_plugin__optimizemember_profile_save"]) && is_user_logged_in() && is_object($user) && !empty($user->ID) && ($user_id = $user->ID)) {
         if (($nonce = $_POST["ws_plugin__optimizemember_profile_save"]) && wp_verify_nonce($nonce, "ws-plugin--optimizemember-profile-save")) {
             $GLOBALS["ws_plugin__optimizemember_profile_saved"] = true;
             /* Global flag as having been saved/updated successfully. */
             /**/
             $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
             /* Clean ``$_POST`` vars. */
             /**/
             $userdata["ID"] = $user_id;
             /**/
             if (!empty($_p["ws_plugin__optimizemember_profile_email"])) {
                 if (is_email($_p["ws_plugin__optimizemember_profile_email"]) && !email_exists($_p["ws_plugin__optimizemember_profile_email"])) {
                     $userdata["user_email"] = $_p["ws_plugin__optimizemember_profile_email"];
                 }
             }
             /**/
             if (!empty($_p["ws_plugin__optimizemember_profile_password1"])) {
                 if ($user->user_login !== "demo") {
                     /* No pass change on demo! */
                     $userdata["user_pass"] = $_p["ws_plugin__optimizemember_profile_password1"];
                 }
             }
             /**/
             if (!empty($_p["ws_plugin__optimizemember_profile_first_name"])) {
                 $userdata["first_name"] = $_p["ws_plugin__optimizemember_profile_first_name"];
             }
             /**/
             if (!empty($_p["ws_plugin__optimizemember_profile_display_name"])) {
                 $userdata["display_name"] = $_p["ws_plugin__optimizemember_profile_display_name"];
             }
             /**/
             if (!empty($_p["ws_plugin__optimizemember_profile_last_name"])) {
                 $userdata["last_name"] = $_p["ws_plugin__optimizemember_profile_last_name"];
             }
             /**/
             wp_update_user($userdata);
             /* OK. Now send this array for an update. */
             /**/
             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) {
                 if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level("auto-detection", "profile")) {
                     $_existing_fields = get_user_option("optimizemember_custom_fields", $user_id);
                     /**/
                     foreach (json_decode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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__optimizemember_profile_" . $field_var]) || !is_array($_p["ws_plugin__optimizemember_profile_" . $field_var]) && !is_string($_p["ws_plugin__optimizemember_profile_" . $field_var]) || is_array($_p["ws_plugin__optimizemember_profile_" . $field_var]) && empty($_p["ws_plugin__optimizemember_profile_" . $field_var]) || is_string($_p["ws_plugin__optimizemember_profile_" . $field_var]) && !strlen($_p["ws_plugin__optimizemember_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__optimizemember_profile_" . $field_var])) {
                                     if (is_array($_p["ws_plugin__optimizemember_profile_" . $field_var]) && !empty($_p["ws_plugin__optimizemember_profile_" . $field_var]) || is_string($_p["ws_plugin__optimizemember_profile_" . $field_var]) && strlen($_p["ws_plugin__optimizemember_profile_" . $field_var])) {
                                         $fields[$field_var] = $_p["ws_plugin__optimizemember_profile_" . $field_var];
                                     } else {
                                         /* Else ``unset()``. */
                                         unset($fields[$field_var]);
                                     }
                                 } else {
                                     /* Else ``unset()``. */
                                     unset($fields[$field_var]);
                                 }
                             }
                         }
                     }
                     /**/
                     if (!empty($fields)) {
                         update_user_option($user_id, "optimizemember_custom_fields", $fields);
                     } else {
                         /* Else delete their Custom Fields? */
                         delete_user_option($user_id, "optimizemember_custom_fields");
                     }
                 }
             }
             /**/
             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
             do_action("ws_plugin__optimizemember_during_handle_profile_modifications", get_defined_vars());
             unset($__refs, $__v);
             /* Unset defined __refs, __v. */
             /**/
             $user = new WP_User($user_id);
             /* Update the ``WP_User`` object for the current User/Member. */
             function_exists("setup_userdata") ? setup_userdata() : null;
             /* Update global vars. */
             /**/
             $lwp = c_ws_plugin__optimizemember_login_redirects::login_redirection_url($user);
             $lwp = !$lwp ? get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"]) : $lwp;
             /**/
             if (empty($_p["ws_plugin__optimizemember_sc_profile_save"])) {
                 echo '<script type="text/javascript">' . "\n";
                 echo "if(window.parent && window.parent != window) { window.parent.alert('" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Profile updated successfully.", "s2member-front", "s2member")) . "'); window.parent.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($lwp) . "'; }";
                 echo "else if(window.opener) { window.alert('" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Profile updated successfully.", "s2member-front", "s2member")) . "'); window.opener.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($lwp) . "'; window.close(); }";
                 echo "else { alert('" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Profile updated successfully.", "s2member-front", "s2member")) . "'); window.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($lwp) . "'; }";
                 echo '</script>' . "\n";
                 /**/
                 exit;
                 /* Clean exit. */
             }
         }
     }
     /**/
     do_action("ws_plugin__optimizemember_after_handle_profile_modifications", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
 /**
  * Handles processing of Pro Form cancellations.
  *
  * @package optimizeMember\PayPal
  * @since 1.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after a custom URL redirection.
  */
 public static function paypal_cancellation()
 {
     if (!empty($_POST["optimizemember_pro_paypal_cancellation"]["nonce"]) && ($nonce = $_POST["optimizemember_pro_paypal_cancellation"]["nonce"]) && wp_verify_nonce($nonce, "s2member-pro-paypal-cancellation")) {
         $GLOBALS["ws_plugin__optimizemember_pro_paypal_cancellation_response"] = array();
         /* This holds the global response details. */
         $global_response =& $GLOBALS["ws_plugin__optimizemember_pro_paypal_cancellation_response"];
         /* This is a shorter reference. */
         /**/
         $post_vars = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST["optimizemember_pro_paypal_cancellation"]));
         $post_vars["attr"] = unserialize(c_ws_plugin__optimizemember_utils_encryption::decrypt($post_vars["attr"]));
         /* And run a Filter. */
         $post_vars["attr"] = apply_filters("ws_plugin__optimizemember_pro_paypal_cancellation_post_attr", $post_vars["attr"], get_defined_vars());
         /**/
         $post_vars["recaptcha_challenge_field"] = !$post_vars["recaptcha_challenge_field"] ? trim(stripslashes($_POST["recaptcha_challenge_field"])) : $post_vars["recaptcha_challenge_field"];
         $post_vars["recaptcha_response_field"] = !$post_vars["recaptcha_response_field"] ? trim(stripslashes($_POST["recaptcha_response_field"])) : $post_vars["recaptcha_response_field"];
         /**/
         if (!c_ws_plugin__optimizemember_pro_paypal_responses::paypal_form_attr_validation_errors($post_vars["attr"])) {
             if (!($error = c_ws_plugin__optimizemember_pro_paypal_responses::paypal_form_submission_validation_errors("cancellation", $post_vars))) {
                 if (is_user_logged_in() && is_object($user = wp_get_current_user()) && ($user_id = $user->ID)) {
                     if ($cur__subscr_id = get_user_option("optimizemember_subscr_id")) {
                         if (($paypal = c_ws_plugin__optimizemember_pro_paypal_utilities::payflow_get_profile($cur__subscr_id)) && $paypal["TENDER"] !== "P") {
                             if (preg_match("/^(Active|ActiveProfile|Suspended|SuspendedProfile)\$/i", $paypal["STATUS"])) {
                                 if (!($ipn = array())) {
                                     $ipn["txn_type"] = "subscr_cancel";
                                     $ipn["subscr_id"] = $paypal["PROFILEID"];
                                     $ipn["custom"] = get_user_option("optimizemember_custom");
                                     /**/
                                     $ipn["period1"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period1($paypal);
                                     $ipn["period3"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period3($paypal);
                                     /**/
                                     $ipn["payer_email"] = $paypal["EMAIL"];
                                     $ipn["first_name"] = $paypal["FIRSTNAME"];
                                     $ipn["last_name"] = $paypal["LASTNAME"];
                                     /**/
                                     $ipn["option_name1"] = "Referencing Customer ID";
                                     $ipn["option_selection1"] = $paypal["PROFILEID"];
                                     /**/
                                     $ipn["option_name2"] = "Customer IP Address";
                                     /* IP Address. */
                                     $ipn["option_selection2"] = get_user_option("optimizemember_registration_ip");
                                     /**/
                                     $ipn["item_name"] = $paypal["DESC"] ? $paypal["DESC"] : $paypal["PROFILENAME"];
                                     $ipn["item_number"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_number($paypal);
                                     /**/
                                     $ipn_q = "&optimizemember_paypal_proxy=paypal&optimizemember_paypal_proxy_use=pro-emails";
                                     $ipn_q .= "&optimizemember_paypal_proxy_verification=" . urlencode(c_ws_plugin__optimizemember_paypal_utilities::paypal_proxy_key_gen());
                                     /**/
                                     c_ws_plugin__optimizemember_utils_urls::remote(site_url("/?optimizemember_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20));
                                 }
                                 /**/
                                 c_ws_plugin__optimizemember_pro_paypal_utilities::payflow_cancel_profile($paypal["PROFILEID"]);
                                 /**/
                                 $global_response = array("response" => _x('<strong>Billing termination confirmed.</strong> Your account has been cancelled.', "s2member-front", "s2member"));
                                 /**/
                                 if ($post_vars["attr"]["success"] && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $post_vars["attr"]["success"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                     wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                 }
                             } else {
                                 if (preg_match("/^(Pending|PendingProfile)\$/i", $paypal["STATUS"])) {
                                     $global_response = array("response" => _x('<strong>Unable to cancel at this time.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
                                 } else {
                                     $global_response = array("response" => _x('<strong>Billing terminated.</strong> Your account has been cancelled.', "s2member-front", "s2member"));
                                     /**/
                                     if ($post_vars["attr"]["success"] && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $post_vars["attr"]["success"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                         wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                     }
                                 }
                             }
                         } else {
                             if ($paypal && $paypal["TENDER"] === "P") {
                                 $global_response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal</a> to cancel your Subscription.', "s2member-front", "s2member"), esc_attr("https://" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com") . "/cgi-bin/webscr?cmd=_subscr-find&amp;alias=" . urlencode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"]))), "error" => true);
                             } else {
                                 $global_response = array("response" => _x('<strong>Billing terminated.</strong> Your account has been cancelled.', "s2member-front", "s2member"));
                                 /**/
                                 if ($post_vars["attr"]["success"] && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $post_vars["attr"]["success"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                                     wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                                 }
                             }
                         }
                     } else {
                         $global_response = array("response" => _x('<strong>Billing terminated.</strong> Your account has been cancelled.', "s2member-front", "s2member"));
                         /**/
                         if ($post_vars["attr"]["success"] && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $post_vars["attr"]["success"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
                             wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, "s2p-v")) . exit;
                         }
                     }
                 } else {
                     $global_response = array("response" => _x('You\'re <strong>NOT</strong> logged in.', "s2member-front", "s2member"), "error" => true);
                 }
             } else {
                 $global_response = $error;
             }
         }
     }
 }
Beispiel #27
0
 /**
  * Handles Google XML Checkout redirections.
  *
  * @package optimizeMember\Google
  * @since 1.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection to Google Checkout.
  */
 public static function google_co()
 {
     global $current_site, $current_blog;
     /**/
     if (!empty($_GET["optimizemember_pro_google_co"]) && c_ws_plugin__optimizemember_utils_urls::optimizemember_sig_ok($_SERVER["REQUEST_URI"]) && !empty($_GET["co"]) && is_array($attr = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_GET["co"]))) && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"]) {
         $attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor"), $attr);
         /**/
         $attr["tt"] = strtoupper($attr["tt"]);
         /* Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). */
         $attr["rt"] = strtoupper($attr["rt"]);
         /* Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). */
         $attr["rr"] = strtoupper($attr["rr"]);
         /* Must be provided in upper-case format. Numerical, or BN value. Only after running shortcode_atts(). */
         $attr["ccaps"] = strtolower($attr["ccaps"]);
         /* Custom Capabilities must be typed in lower-case format. Only after running shortcode_atts(). */
         $attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"];
         /* Lifetime Subscriptions require Buy Now. Only after running shortcode_atts(). */
         $attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"];
         /* Independent Ccaps do NOT recur. Only after running shortcode_atts(). */
         $attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"];
         /* No Trial / non-recurring. Only after running shortcode_atts(). */
         /**/
         if ($attr["modify"] || $attr["cancel"]) {
             $endpoint = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_sandbox"] ? "sandbox.google.com/checkout" : "checkout.google.com";
             /**/
             wp_redirect("https://" . $endpoint . "/");
         } else {
             if ($attr["sp"]) {
                 $attr["uniqid"] = uniqid();
                 /* Unique ID. */
                 $attr["referencing"] = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id();
                 /**/
                 $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
                 /* Combined "sp:ids:expiration hours". */
                 $attr["sp_access_link"] = c_ws_plugin__optimizemember_sp_access::sp_access_link_gen($attr["ids"], $attr["exp"]);
                 /**/
                 $xml = '<?xml version="1.0" encoding="UTF-8"?>';
                 $xml .= '<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">';
                 $xml .= '<shopping-cart>';
                 $xml .= '<items>';
                 /**/
                 $xml .= '<item>';
                 /**/
                 $xml .= '<quantity>1</quantity>';
                 $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                 $xml .= '<item-description>(TID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("Grants you immediate access.", "s2member-front", "s2member")) . '</item-description>';
                 $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</unit-price>';
                 /**/
                 $xml .= '<merchant-private-item-data>';
                 $xml .= '<s2_txn_id>s2-' . esc_html($attr["uniqid"]) . '</s2_txn_id>';
                 $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                 $xml .= '<s2_item_number>' . esc_html($attr["sp_ids_exp"]) . '</s2_item_number>';
                 $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                 $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                 $xml .= '</merchant-private-item-data>';
                 /**/
                 $xml .= '<digital-content>';
                 $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                 $xml .= '<description>' . esc_html($attr["desc"]) . '</description>';
                 $xml .= '<url>' . esc_html($attr["sp_access_link"]) . '</url>';
                 $xml .= '</digital-content>';
                 /**/
                 $xml .= '</item>';
                 /**/
                 $xml .= '</items>';
                 $xml .= '</shopping-cart>';
                 /**/
                 $xml .= '<checkout-flow-support>';
                 $xml .= '<merchant-checkout-flow-support>';
                 $xml .= '<edit-cart-url>' . esc_html(get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"])) . '</edit-cart-url>';
                 $xml .= '<continue-shopping-url>' . esc_html($attr["sp_access_link"]) . '</continue-shopping-url>';
                 $xml .= '</merchant-checkout-flow-support>';
                 $xml .= '</checkout-flow-support>';
                 /**/
                 $xml .= '</checkout-shopping-cart>';
                 /**/
                 $endpoint = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_sandbox"] ? "sandbox.google.com/checkout" : "checkout.google.com";
                 /**/
                 if (($xml = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"], $xml, array_merge(c_ws_plugin__optimizemember_pro_google_utilities::google_api_headers(), array("timeout" => 20)))) && preg_match("/\\<redirect-url\\>(.+?)\\<\\/redirect-url\\>/i", preg_replace("/[\r\n\t]+/", "", $xml), $m) && ($google = $m[1])) {
                     wp_redirect(wp_specialchars_decode($google, ENT_QUOTES));
                 } else {
                     /* Display error message. */
                     echo strip_tags($xml);
                 }
             } else {
                 if ($attr["level"] === "*") {
                     $attr["uniqid"] = uniqid();
                     /* Unique ID. */
                     $attr["referencing"] = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id();
                     /**/
                     $attr["level_ccaps_eotper"] = $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
                     $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
                     /* Right-trim separators from this string so we don't have trailing colons. */
                     /**/
                     $xml = '<?xml version="1.0" encoding="UTF-8"?>';
                     $xml .= '<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">';
                     $xml .= '<shopping-cart>';
                     $xml .= '<items>';
                     /**/
                     $xml .= '<item>';
                     /**/
                     $xml .= '<quantity>1</quantity>';
                     $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                     $xml .= '<item-description>(TID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("Grants you immediate access.", "s2member-front", "s2member")) . '</item-description>';
                     $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</unit-price>';
                     /**/
                     $xml .= '<merchant-private-item-data>';
                     $xml .= '<s2_txn_id>s2-' . esc_html($attr["uniqid"]) . '</s2_txn_id>';
                     $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                     $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                     $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                     $xml .= '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>';
                     $xml .= '</merchant-private-item-data>';
                     /**/
                     $xml .= '<digital-content>';
                     $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                     $xml .= '<description>' . esc_html(sprintf(_x('You now have access to:<br />%s<br />( <a href="%s">please log back in now</a> )', "s2member-front", "s2member"), $attr["desc"], esc_attr(wp_login_url()))) . '</description>';
                     $xml .= '<url>' . esc_html(wp_login_url()) . '</url>';
                     $xml .= '</digital-content>';
                     /**/
                     $xml .= '</item>';
                     /**/
                     $xml .= '</items>';
                     $xml .= '</shopping-cart>';
                     /**/
                     $xml .= '<checkout-flow-support>';
                     $xml .= '<merchant-checkout-flow-support>';
                     $xml .= '<edit-cart-url>' . esc_html(get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"])) . '</edit-cart-url>';
                     $xml .= '<continue-shopping-url>' . esc_html(wp_login_url()) . '</continue-shopping-url>';
                     $xml .= '</merchant-checkout-flow-support>';
                     $xml .= '</checkout-flow-support>';
                     /**/
                     $xml .= '</checkout-shopping-cart>';
                     /**/
                     $endpoint = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_sandbox"] ? "sandbox.google.com/checkout" : "checkout.google.com";
                     /**/
                     if (($xml = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"], $xml, array_merge(c_ws_plugin__optimizemember_pro_google_utilities::google_api_headers(), array("timeout" => 20)))) && preg_match("/\\<redirect-url\\>(.+?)\\<\\/redirect-url\\>/i", preg_replace("/[\r\n\t]+/", "", $xml), $m) && ($google = $m[1])) {
                         wp_redirect(wp_specialchars_decode($google, ENT_QUOTES));
                     } else {
                         /* Display error message. */
                         echo strip_tags($xml);
                     }
                 } else {
                     if ($attr["rr"] === "BN" || !$attr["tp"] && !$attr["rr"]) {
                         $attr["uniqid"] = uniqid();
                         /* Unique ID. */
                         $attr["referencing"] = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id();
                         /**/
                         $attr["desc"] = !$attr["desc"] ? $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $attr["level"] . "_label"] : $attr["desc"];
                         /**/
                         $attr["level_ccaps_eotper"] = $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
                         $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
                         /* Right-trim separators from this string so we don't have trailing colons. */
                         /**/
                         $attr["register_access_link"] = c_ws_plugin__optimizemember_register_access::register_link_gen("google", "s2-" . $attr["uniqid"], $attr["custom"], $attr["level_ccaps_eotper"]);
                         /**/
                         $xml = '<?xml version="1.0" encoding="UTF-8"?>';
                         $xml .= '<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">';
                         $xml .= '<shopping-cart>';
                         $xml .= '<items>';
                         /**/
                         $xml .= '<item>';
                         /**/
                         $xml .= '<quantity>1</quantity>';
                         $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                         $xml .= '<item-description>(TID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("Grants you immediate access.", "s2member-front", "s2member")) . '</item-description>';
                         $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</unit-price>';
                         /**/
                         $xml .= '<merchant-private-item-data>';
                         $xml .= '<s2_txn_id>s2-' . esc_html($attr["uniqid"]) . '</s2_txn_id>';
                         $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                         $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                         $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                         $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                         $xml .= '</merchant-private-item-data>';
                         /**/
                         $xml .= '<digital-content>';
                         $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                         /**/
                         if ($attr["referencing"]) {
                             $xml .= '<description>' . esc_html(sprintf(_x('You\'ve been updated to:<br />%s<br />( <a href="%s">please log back in now</a> )', "s2member-front", "s2member"), $attr["desc"], esc_attr(wp_login_url()))) . '</description>';
                             $xml .= '<url>' . esc_html(wp_login_url()) . '</url>';
                         } else {
                             $xml .= '<description>' . esc_html(sprintf(_x('%s<br />( the next step is to Register a Username )', "s2member-front", "s2member"), $attr["desc"])) . '</description>';
                             $xml .= '<url>' . esc_html($attr["register_access_link"]) . '</url>';
                         }
                         /**/
                         $xml .= '</digital-content>';
                         /**/
                         $xml .= '</item>';
                         /**/
                         $xml .= '</items>';
                         $xml .= '</shopping-cart>';
                         /**/
                         $xml .= '<checkout-flow-support>';
                         $xml .= '<merchant-checkout-flow-support>';
                         $xml .= '<edit-cart-url>' . esc_html(get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"])) . '</edit-cart-url>';
                         $xml .= '<continue-shopping-url>' . esc_html($attr["referencing"] ? wp_login_url() : $attr["register_access_link"]) . '</continue-shopping-url>';
                         $xml .= '</merchant-checkout-flow-support>';
                         $xml .= '</checkout-flow-support>';
                         /**/
                         $xml .= '</checkout-shopping-cart>';
                         /**/
                         $endpoint = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_sandbox"] ? "sandbox.google.com/checkout" : "checkout.google.com";
                         /**/
                         if (($xml = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"], $xml, array_merge(c_ws_plugin__optimizemember_pro_google_utilities::google_api_headers(), array("timeout" => 20)))) && preg_match("/\\<redirect-url\\>(.+?)\\<\\/redirect-url\\>/i", preg_replace("/[\r\n\t]+/", "", $xml), $m) && ($google = $m[1])) {
                             wp_redirect(wp_specialchars_decode($google, ENT_QUOTES));
                         } else {
                             /* Display error message. */
                             echo strip_tags($xml);
                         }
                     } else {
                         $attr["uniqid"] = uniqid();
                         /* Unique ID. */
                         $attr["referencing"] = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id();
                         /**/
                         $attr["desc"] = !$attr["desc"] ? $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $attr["level"] . "_label"] : $attr["desc"];
                         /**/
                         $attr["level_ccaps_eotper"] = $attr["level"] . ":" . $attr["ccaps"];
                         /* Actual Subscriptions will always end on their own. */
                         $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
                         /* Clean any trailing separators from this string. */
                         /**/
                         $attr["periodicity"] = c_ws_plugin__optimizemember_pro_google_utilities::google_periodicity($attr["rp"] . " " . $attr["rt"]);
                         /* Google periodicity. */
                         /**/
                         $attr["register_access_link"] = c_ws_plugin__optimizemember_register_access::register_link_gen("google", "s2-" . $attr["uniqid"], $attr["custom"], $attr["level_ccaps_eotper"]);
                         /**/
                         if ($attr["tp"]) {
                             $attr["start_time"] = c_ws_plugin__optimizemember_pro_google_utilities::google_start_time($attr["tp"] . " " . $attr["tt"]);
                             /**/
                             $xml = '<?xml version="1.0" encoding="UTF-8"?>';
                             $xml .= '<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">';
                             $xml .= '<shopping-cart>';
                             $xml .= '<items>';
                             /**/
                             $xml .= '<item>';
                             /**/
                             $xml .= '<quantity>1</quantity>';
                             $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                             $xml .= $attr["ta"] < 0.01 ? '<item-description>(SID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("100% free trial. NO charge today.", "s2member-front", "s2member")) . '</item-description>' : '<item-description>(SID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("First payment for immediate access.", "s2member-front", "s2member")) . '</item-description>';
                             $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ta"]) . '</unit-price>';
                             /**/
                             $xml .= '<merchant-private-item-data>';
                             $xml .= '<s2_subscr_id>s2-' . esc_html($attr["uniqid"]) . '</s2_subscr_id>';
                             $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                             $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                             $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                             $xml .= '<s2_period1>' . esc_html($attr["tp"] . " " . $attr["tt"]) . '</s2_period1>';
                             $xml .= '<s2_period3>' . esc_html($attr["rp"] . " " . $attr["rt"]) . '</s2_period3>';
                             $xml .= $attr["rr"] ? '<s2_recurring>' . esc_html($attr["rr"]) . '</s2_recurring>' : '';
                             $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                             $xml .= '</merchant-private-item-data>';
                             /**/
                             $xml .= '<digital-content>';
                             $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                             $xml .= '<description>' . esc_html(_x("You'll receive an email confirmation within 15 minutes.", "s2member-front", "s2member")) . '</description>';
                             $xml .= '</digital-content>';
                             /**/
                             $xml .= '</item>';
                             /**/
                             $xml .= '<item>';
                             /**/
                             $xml .= '<quantity>1</quantity>';
                             $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                             $xml .= '<item-description>(SID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(sprintf(_x("Cancel at any time to avoid %s.", "s2member-front", "s2member"), !$attr["rr"] ? _x("this charge", "s2member-front", "s2member") : _x("charges", "s2member-front", "s2member"))) . '</item-description>';
                             $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">0.00</unit-price>';
                             /**/
                             $xml .= '<merchant-private-item-data>';
                             $xml .= '<s2_subscr_id>s2-' . esc_html($attr["uniqid"]) . '</s2_subscr_id>';
                             $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                             $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                             $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                             $xml .= '<s2_period1>' . esc_html($attr["tp"] . " " . $attr["tt"]) . '</s2_period1>';
                             $xml .= '<s2_period3>' . esc_html($attr["rp"] . " " . $attr["rt"]) . '</s2_period3>';
                             $xml .= $attr["rr"] ? '<s2_recurring>' . esc_html($attr["rr"]) . '</s2_recurring>' : '';
                             $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                             $xml .= '</merchant-private-item-data>';
                             /**/
                             $xml .= '<digital-content>';
                             $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                             /**/
                             if ($attr["referencing"]) {
                                 $xml .= '<description>' . esc_html(sprintf(_x('You\'ve been updated to:<br />%s<br />( <a href="%s">please log back in now</a> )', "s2member-front", "s2member"), $attr["desc"], esc_attr(wp_login_url()))) . '</description>';
                                 $xml .= '<url>' . esc_html(wp_login_url()) . '</url>';
                             } else {
                                 $xml .= '<description>' . esc_html(sprintf(_x('%s<br />( the next step is to Register a Username )', "s2member-front", "s2member"), $attr["desc"])) . '</description>';
                                 $xml .= '<url>' . esc_html($attr["register_access_link"]) . '</url>';
                             }
                             /**/
                             $xml .= '</digital-content>';
                             /**/
                             $xml .= '<subscription type="google" period="' . esc_attr($attr["periodicity"]) . '" start-date="' . esc_attr(date("Y-m-d", $attr["start_time"]) . "T00:00:00Z") . '">';
                             /**/
                             $xml .= '<payments>';
                             $xml .= '<subscription-payment' . (!$attr["rr"] ? ' times="1"' : '') . '>';
                             $xml .= '<maximum-charge currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</maximum-charge>';
                             $xml .= '</subscription-payment>';
                             $xml .= '</payments>';
                             /**/
                             $xml .= '<recurrent-item>';
                             /**/
                             $xml .= '<quantity>1</quantity>';
                             $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                             $xml .= '<item-description>(SID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("Covers ongoing access.", "s2member-front", "s2member")) . '</item-description>';
                             $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</unit-price>';
                             /**/
                             $xml .= '<merchant-private-item-data>';
                             $xml .= '<s2_subscr_payment>1</s2_subscr_payment>';
                             $xml .= '<s2_subscr_id>s2-' . esc_html($attr["uniqid"]) . '</s2_subscr_id>';
                             $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                             $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                             $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                             $xml .= '<s2_period1>' . esc_html($attr["tp"] . " " . $attr["tt"]) . '</s2_period1>';
                             $xml .= '<s2_period3>' . esc_html($attr["rp"] . " " . $attr["rt"]) . '</s2_period3>';
                             $xml .= $attr["rr"] ? '<s2_recurring>' . esc_html($attr["rr"]) . '</s2_recurring>' : '';
                             $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                             $xml .= '</merchant-private-item-data>';
                             /**/
                             $xml .= '<digital-content>';
                             $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                             $xml .= '<description>' . esc_html($attr["desc"]) . '</description>';
                             $xml .= '<url>' . esc_html(home_url("/")) . '</url>';
                             $xml .= '</digital-content>';
                             /**/
                             $xml .= '</recurrent-item>';
                             /**/
                             $xml .= '</subscription>';
                             /**/
                             $xml .= '</item>';
                             /**/
                             $xml .= '</items>';
                             $xml .= '</shopping-cart>';
                             /**/
                             $xml .= '<checkout-flow-support>';
                             $xml .= '<merchant-checkout-flow-support>';
                             $xml .= '<edit-cart-url>' . esc_html(get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"])) . '</edit-cart-url>';
                             $xml .= '<continue-shopping-url>' . esc_html($attr["referencing"] ? wp_login_url() : $attr["register_access_link"]) . '</continue-shopping-url>';
                             $xml .= '</merchant-checkout-flow-support>';
                             $xml .= '</checkout-flow-support>';
                             /**/
                             $xml .= '</checkout-shopping-cart>';
                         } else {
                             if (!$attr["tp"] && $attr["rr"]) {
                                 $attr["start_time"] = c_ws_plugin__optimizemember_pro_google_utilities::google_start_time($attr["rp"] . " " . $attr["rt"]);
                                 /**/
                                 $xml = '<?xml version="1.0" encoding="UTF-8"?>';
                                 $xml .= '<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">';
                                 $xml .= '<shopping-cart>';
                                 $xml .= '<items>';
                                 /**/
                                 $xml .= '<item>';
                                 /**/
                                 $xml .= '<quantity>1</quantity>';
                                 $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                                 $xml .= '<item-description>(SID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("First payment for immediate access.", "s2member-front", "s2member")) . '</item-description>';
                                 $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</unit-price>';
                                 /**/
                                 $xml .= '<merchant-private-item-data>';
                                 $xml .= '<s2_subscr_id>s2-' . esc_html($attr["uniqid"]) . '</s2_subscr_id>';
                                 $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                                 $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                                 $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                                 $xml .= '<s2_period1>0 D</s2_period1>';
                                 /* There is no Trial Period. */
                                 $xml .= '<s2_period3>' . esc_html($attr["rp"] . " " . $attr["rt"]) . '</s2_period3>';
                                 $xml .= '<s2_recurring>' . esc_html($attr["rr"]) . '</s2_recurring>';
                                 $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                                 $xml .= '</merchant-private-item-data>';
                                 /**/
                                 $xml .= '<digital-content>';
                                 $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                                 $xml .= '<description>' . esc_html(_x("You'll receive an email confirmation within 15 minutes.", "s2member-front", "s2member")) . '</description>';
                                 $xml .= '</digital-content>';
                                 /**/
                                 $xml .= '</item>';
                                 /**/
                                 $xml .= '<item>';
                                 /**/
                                 $xml .= '<quantity>1</quantity>';
                                 $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                                 $xml .= '<item-description>(SID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("Cancel at any time to avoid charges.", "s2member-front", "s2member")) . '</item-description>';
                                 $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">0.00</unit-price>';
                                 /**/
                                 $xml .= '<merchant-private-item-data>';
                                 $xml .= '<s2_subscr_id>s2-' . esc_html($attr["uniqid"]) . '</s2_subscr_id>';
                                 $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                                 $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                                 $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                                 $xml .= '<s2_period1>0 D</s2_period1>';
                                 /* There is no Trial Period. */
                                 $xml .= '<s2_period3>' . esc_html($attr["rp"] . " " . $attr["rt"]) . '</s2_period3>';
                                 $xml .= '<s2_recurring>' . esc_html($attr["rr"]) . '</s2_recurring>';
                                 $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                                 $xml .= '</merchant-private-item-data>';
                                 /**/
                                 $xml .= '<digital-content>';
                                 $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                                 /**/
                                 if ($attr["referencing"]) {
                                     $xml .= '<description>' . esc_html(sprintf(_x('You\'ve been updated to:<br />%s<br />( <a href="%s">please log back in now</a> )', "s2member-front", "s2member"), $attr["desc"], esc_attr(wp_login_url()))) . '</description>';
                                     $xml .= '<url>' . esc_html(wp_login_url()) . '</url>';
                                 } else {
                                     $xml .= '<description>' . esc_html(sprintf(_x('%s<br />( the next step is to Register a Username )', "s2member-front", "s2member"), $attr["desc"])) . '</description>';
                                     $xml .= '<url>' . esc_html($attr["register_access_link"]) . '</url>';
                                 }
                                 /**/
                                 $xml .= '</digital-content>';
                                 /**/
                                 $xml .= '<subscription type="google" period="' . esc_attr($attr["periodicity"]) . '" start-date="' . esc_attr(date("Y-m-d", $attr["start_time"]) . "T00:00:00Z") . '">';
                                 /**/
                                 $xml .= '<payments>';
                                 $xml .= '<subscription-payment>';
                                 $xml .= '<maximum-charge currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</maximum-charge>';
                                 $xml .= '</subscription-payment>';
                                 $xml .= '</payments>';
                                 /**/
                                 $xml .= '<recurrent-item>';
                                 /**/
                                 $xml .= '<quantity>1</quantity>';
                                 $xml .= '<item-name>' . esc_html($attr["desc"]) . '</item-name>';
                                 $xml .= '<item-description>(SID:s2-' . esc_html($attr["uniqid"]) . ') ' . esc_html(_x("Covers ongoing access.", "s2member-front", "s2member")) . '</item-description>';
                                 $xml .= '<unit-price currency="' . esc_attr($attr["cc"]) . '">' . esc_html($attr["ra"]) . '</unit-price>';
                                 /**/
                                 $xml .= '<merchant-private-item-data>';
                                 $xml .= '<s2_subscr_payment>1</s2_subscr_payment>';
                                 $xml .= '<s2_subscr_id>s2-' . esc_html($attr["uniqid"]) . '</s2_subscr_id>';
                                 $xml .= '<s2_custom>' . esc_html($attr["custom"]) . '</s2_custom>';
                                 $xml .= '<s2_customer_ip>' . esc_html($_SERVER["REMOTE_ADDR"]) . '</s2_customer_ip>';
                                 $xml .= '<s2_item_number>' . esc_html($attr["level_ccaps_eotper"]) . '</s2_item_number>';
                                 $xml .= '<s2_period1>0 D</s2_period1>';
                                 /* There is no Trial Period. */
                                 $xml .= '<s2_period3>' . esc_html($attr["rp"] . " " . $attr["rt"]) . '</s2_period3>';
                                 $xml .= '<s2_recurring>' . esc_html($attr["rr"]) . '</s2_recurring>';
                                 $xml .= $attr["referencing"] ? '<s2_referencing>' . esc_html($attr["referencing"]) . '</s2_referencing>' : '';
                                 $xml .= '</merchant-private-item-data>';
                                 /**/
                                 $xml .= '<digital-content>';
                                 $xml .= '<display-disposition>PESSIMISTIC</display-disposition>';
                                 $xml .= '<description>' . esc_html($attr["desc"]) . '</description>';
                                 $xml .= '<url>' . esc_html(home_url("/")) . '</url>';
                                 $xml .= '</digital-content>';
                                 /**/
                                 $xml .= '</recurrent-item>';
                                 /**/
                                 $xml .= '</subscription>';
                                 /**/
                                 $xml .= '</item>';
                                 /**/
                                 $xml .= '</items>';
                                 $xml .= '</shopping-cart>';
                                 /**/
                                 $xml .= '<checkout-flow-support>';
                                 $xml .= '<merchant-checkout-flow-support>';
                                 $xml .= '<edit-cart-url>' . esc_html(get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"])) . '</edit-cart-url>';
                                 $xml .= '<continue-shopping-url>' . esc_html($attr["referencing"] ? wp_login_url() : $attr["register_access_link"]) . '</continue-shopping-url>';
                                 $xml .= '</merchant-checkout-flow-support>';
                                 $xml .= '</checkout-flow-support>';
                                 /**/
                                 $xml .= '</checkout-shopping-cart>';
                             }
                         }
                         /**/
                         $endpoint = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_sandbox"] ? "sandbox.google.com/checkout" : "checkout.google.com";
                         /**/
                         if (($xml = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $endpoint . "/api/checkout/v2/merchantCheckout/Merchant/" . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"], $xml, array_merge(c_ws_plugin__optimizemember_pro_google_utilities::google_api_headers(), array("timeout" => 20)))) && preg_match("/\\<redirect-url\\>(.+?)\\<\\/redirect-url\\>/i", preg_replace("/[\r\n\t]+/", "", $xml), $m) && ($google = $m[1])) {
                             wp_redirect(wp_specialchars_decode($google, ENT_QUOTES));
                         } else {
                             /* Display error message. */
                             echo strip_tags($xml);
                         }
                     }
                 }
             }
         }
         /**/
         exit;
         /* Clean exit. */
     }
 }
Beispiel #28
0
 /**
  * Decodes unreserved chars encoded by PHP's ``urlencode()``, deeply.
  *
  * For further details regarding unreserved chars, see: {@link http://www.faqs.org/rfcs/rfc3986.html}.
  *
  * @package optimizeMember\Utilities
  * @since 111017
  *
  * @see http://www.faqs.org/rfcs/rfc3986.html
  *
  * @param str|array $value Either a string, an array, or a multi-dimensional array, filled with integer and/or string values.
  * @return str|array Either the input string, or the input array; after all unreserved chars are decoded properly.
  */
 public static function urldecode_ur_chars_deep($value = array())
 {
     if (is_array($value)) {
         foreach ($value as &$r) {
             /* Reference. */
             $r = c_ws_plugin__optimizemember_utils_strings::urldecode_ur_chars_deep($r);
         }
         return $value;
         /* Return modified array. */
     }
     return str_replace(array("%2D", "%2E", "%5F", "%7E"), array("-", ".", "_", "~"), (string) $value);
 }
 /**
  * Get ``$_POST`` or ``$_REQUEST`` vars from ccBill.
  *
  * @package optimizeMember\ccBill
  * @since 1.5
  *
  * @return array|bool An array of verified ``$_POST`` or ``$_REQUEST`` variables, else false.
  *
  * @todo Continue optimizing this routine with ``empty()`` and ``isset()``.
  * @todo Candidate for the use of ``ifsetor()``?
  * @todo Update to use ``strcasecmp()``.
  */
 public static function ccbill_postvars()
 {
     if (isset($_REQUEST["optimizemember_pro_ccbill_return"]) && strlen($_REQUEST["optimizemember_pro_ccbill_return"]) || isset($_REQUEST["optimizemember_pro_ccbill_notify"]) && strlen($_REQUEST["optimizemember_pro_ccbill_notify"])) {
         $postvars = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_REQUEST));
         /**/
         foreach ($postvars as $var => $value) {
             if (preg_match("/^optimizemember_/", $var)) {
                 unset($postvars[$var]);
             }
         }
         /**/
         $denial_digest_vars = $postvars["denialId"] . "0";
         $approval_digest_vars = $postvars["subscription_id"] . "1";
         /**/
         if ($postvars["responseDigest"] === md5($approval_digest_vars . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_salt_key"])) {
             return $postvars;
         } else {
             if ($postvars["responseDigest"] === md5($denial_digest_vars . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_salt_key"])) {
                 return $postvars;
             } else {
                 /* Nope. */
                 return false;
             }
         }
     } else {
         /* Nope. */
         return false;
     }
 }
 /**
  * Handles processing of Pro Form registrations.
  *
  * @package optimizeMember\Stripe
  * @since 140617
  *
  * @attaches-to ``add_action('init');``
  */
 public static function stripe_registration()
 {
     if (!empty($_POST['optimizemember_pro_stripe_registration']['nonce']) && ($nonce = $_POST['optimizemember_pro_stripe_registration']['nonce']) && wp_verify_nonce($nonce, 'optimizemember-pro-stripe-registration')) {
         $GLOBALS['ws_plugin__optimizemember_pro_stripe_registration_response'] = array();
         // This holds the global response details.
         $global_response =& $GLOBALS['ws_plugin__optimizemember_pro_stripe_registration_response'];
         $post_vars = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST['optimizemember_pro_stripe_registration']));
         $post_vars['attr'] = !empty($post_vars['attr']) ? (array) unserialize(c_ws_plugin__optimizemember_utils_encryption::decrypt($post_vars['attr'])) : array();
         $post_vars['attr'] = apply_filters('ws_plugin__optimizemember_pro_stripe_registration_post_attr', $post_vars['attr'], get_defined_vars());
         $post_vars['name'] = trim($post_vars['first_name'] . ' ' . $post_vars['last_name']);
         $post_vars['email'] = apply_filters('user_registration_email', sanitize_email($post_vars['email']), get_defined_vars());
         $post_vars['username'] = is_multisite() ? strtolower($post_vars['username']) : $post_vars['username'];
         // Force lowercase.
         $post_vars['username'] = preg_replace('/\\s+/', '', sanitize_user($post_vars['_o_username'] = $post_vars['username'], is_multisite()));
         $post_vars['recaptcha_challenge_field'] = isset($_POST['recaptcha_challenge_field']) ? trim(stripslashes($_POST['recaptcha_challenge_field'])) : '';
         $post_vars['recaptcha_response_field'] = isset($_POST['recaptcha_response_field']) ? trim(stripslashes($_POST['recaptcha_response_field'])) : '';
         if (!c_ws_plugin__optimizemember_pro_stripe_responses::stripe_form_attr_validation_errors($post_vars['attr'])) {
             if (!($form_submission_validation_errors = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_form_submission_validation_errors('registration', $post_vars))) {
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_user_pass1'] = $post_vars['password1'];
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_first_name'] = $post_vars['first_name'];
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_last_name'] = $post_vars['last_name'];
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_opt_in'] = @$post_vars['custom_fields']['opt_in'];
                 if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields']) {
                     foreach (json_decode($GLOBALS['WS_PLUGIN__']['optimizemember']['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($post_vars['custom_fields'][$field_var])) {
                             $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_' . $field_var] = $post_vars['custom_fields'][$field_var];
                         }
                     }
                 }
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_optimizemember_level'] = $post_vars['attr']['level'];
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_optimizemember_ccaps'] = $post_vars['attr']['ccaps'];
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_optimizemember_custom'] = $post_vars['attr']['custom'];
                 $GLOBALS['ws_plugin__optimizemember_registration_vars']['ws_plugin__optimizemember_custom_reg_field_optimizemember_auto_eot_time'] = $post_vars['attr']['tp'] && $post_vars['attr']['tt'] ? date('Y-m-d H:i:s', c_ws_plugin__optimizemember_utils_time::auto_eot_time('', '', '', $post_vars['attr']['tp'] . ' ' . $post_vars['attr']['tt'])) : '';
                 $GLOBALS['ws_plugin__optimizemember_registration_return_url'] = $post_vars['attr']['success'];
                 $create_user['user_email'] = $post_vars['email'];
                 // Copy this into a separate array for `wp_create_user()`.
                 $create_user['user_login'] = $post_vars['username'];
                 // Copy this into a separate array for `wp_create_user()`.
                 $create_user['user_pass'] = wp_generate_password();
                 // Which may fire `c_ws_plugin__optimizemember_registrations::generate_password()`.
                 $has_custom_password = $post_vars['password1'] && $post_vars['password1'] === $create_user['user_pass'];
                 if ((is_multisite() && ($new__user_id = c_ws_plugin__optimizemember_registrations::ms_create_existing_user($create_user['user_login'], $create_user['user_email'], $create_user['user_pass'])) || ($new__user_id = wp_create_user($create_user['user_login'], $create_user['user_pass'], $create_user['user_email']))) && !is_wp_error($new__user_id)) {
                     update_user_option($new__user_id, 'default_password_nag', $has_custom_password ? FALSE : TRUE, TRUE);
                     wp_new_user_notification($new__user_id, $create_user['user_pass']);
                     if ($has_custom_password) {
                         $global_response = array('response' => sprintf(_x('<strong>Thank you.</strong> Please <a href="%s" rel="nofollow">login</a>.', 's2member-front', 'optimizemember'), esc_attr(wp_login_url())));
                     } else {
                         $global_response = array('response' => _x('<strong>Thank you.</strong> You\'ll receive an email momentarily.', 's2member-front', 's2member'));
                     }
                     if ($post_vars['attr']['success'] && substr($GLOBALS['ws_plugin__optimizemember_registration_return_url'], 0, 2) === substr($post_vars['attr']['success'], 0, 2) && ($custom_success_url = str_ireplace(array('%%s_response%%', '%%response%%'), array(urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt($global_response['response'])), urlencode($global_response['response'])), $GLOBALS['ws_plugin__optimizemember_registration_return_url'])) && ($custom_success_url = trim(preg_replace('/%%(.+?)%%/i', '', $custom_success_url)))) {
                         wp_redirect(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($custom_success_url, 's2p-v')) . exit;
                     }
                 } else {
                     $global_response = array('response' => _x('<strong>Oops.</strong> A slight problem. Please contact Support for assistance.', 's2member-front', 's2member'), 'error' => TRUE);
                 }
             } else {
                 // Input form field validation errors.
                 $global_response = $form_submission_validation_errors;
             }
         }
     }
 }