/**
  * 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()
        {
            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>PayPal Buttons</h2>' . "\n";
            /**/
            echo '<table class="ws-menu-page-table">' . "\n";
            echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
            echo '<tr class="ws-menu-page-table-tr">' . "\n";
            echo '<td class="ws-menu-page-table-l">' . "\n";
            /**/
            do_action("ws_plugin__optimizemember_during_paypal_buttons_page_before_left_sections", get_defined_vars());
            /**/
            for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) {
                $labelText = ws_plugin__optimizemember_getMembershipLabel($n);
                if (($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_level" . $n . "_buttons") && apply_filters($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_levelN_buttons, true, get_defined_vars())) {
                    if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_level" . $n . "_buttons") {
                        do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_levelN_buttons, get_defined_vars());
                    }
                    /**/
                    echo '<div class="ws-menu-page-group" title="PayPal Buttons For Level ' . $labelText . ' Access">' . "\n";
                    /**/
                    echo '<div class="ws-menu-page-section ws-plugin--optimizemember-level' . $n . '-buttons-section">' . "\n";
                    echo '<h3>Button Code 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 Button Code). These special PayPal Buttons 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>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back &amp; re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n";
                    /**/
                    if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons") {
                        do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons, get_defined_vars());
                    }
                    /**/
                    echo '<table class="form-table">' . "\n";
                    echo '<tbody>' . "\n";
                    echo '<tr>' . "\n";
                    /**/
                    echo '<th class="ws-menu-page-th-side">' . "\n";
                    echo '<label for="ws-plugin--optimizemember-level' . $n . '-shortcode">' . "\n";
                    echo 'Button Code<br />For Level ' . $labelText . ':<br /><br />' . "\n";
                    echo '<div id="ws-plugin--optimizemember-level' . $n . '-button-prev"></div>' . "\n";
                    echo '</label>' . "\n";
                    echo '</th>' . "\n";
                    /**/
                    echo '<td>' . "\n";
                    echo '<form onsubmit="return false;">' . "\n";
                    echo '<p id="ws-plugin--optimizemember-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-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-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n";
                    echo '<p><span id="ws-plugin--optimizemember-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-level' . $n . '-term" class="paypal-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-regular-terms.php"))) . '</select></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\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-page-style" value="paypal" size="18" class="paypal-buttons-checkout-page-style-input" /> <select id="ws-plugin--optimizemember-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 Button Code" onclick="ws_plugin__optimizemember_paypalButtonGenerate(\'level' . $n . '\');" class="button-primary" /></p>' . "\n";
                    echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-desc" class="paypal-buttons-description-input" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="73" /></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-level' . $n . '-ccaps" size="40" /></p>' . "\n";
                    echo 'Packages: ';
                    if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
                        foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                            echo '<input type="checkbox" onchange="showSelectedValues(\'ccpchk_' . $n . '\', \'ccaps\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchk_' . $n . '" value="' . $val . '" /> ' . $val . "\n";
                        }
                    } else {
                        echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>';
                    }
                    echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-level' . $n . '-ccaps" value="" />' . "\n";
                    ?>

										<?php 
                    echo '</form>' . "\n";
                    echo '</td>' . "\n";
                    /**/
                    echo '</tr>' . "\n";
                    echo '<tr>' . "\n";
                    /**/
                    echo '<td colspan="2">' . "\n";
                    echo '<form onsubmit="return false;">' . "\n";
                    /**/
                    if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons_before_shortcode = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons_before_shortcode") {
                        do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons_before_shortcode, get_defined_vars());
                    }
                    /**/
                    echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
                    $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.php")));
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($n)), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_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_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                    echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
                    /**/
                    echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n";
                    echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
                    echo '<textarea id="ws-plugin--optimizemember-level' . $n . '-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
                    $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-checkout-button.php")));
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($n)), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_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_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s);
                    $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s);
                    echo format_to_edit($ws_plugin__optimizemember_temp_s);
                    echo '</textarea><br />' . "\n";
                    echo '&uarr; <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
                    echo '</div>' . "\n";
                    /**/
                    echo '</form>' . "\n";
                    echo '</td>' . "\n";
                    /**/
                    echo '</tr>' . "\n";
                    echo '</tbody>' . "\n";
                    echo '</table>' . "\n";
                    echo '</div>' . "\n";
                    /**/
                    echo '</div>' . "\n";
                    /**/
                    if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_level" . $n . "_buttons") {
                        do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_levelN_buttons, get_defined_vars());
                    }
                }
            }
            ?>
							<script type="text/javascript">
							window.showSelectedValues = function(param, elemId, n) {
									var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map(
									     function () {return this.value;}).get().join(",");
									jQuery("#ws-plugin--optimizemember-level"+n+"-" + elemId).val(text);


								}
							window.showSingleSelectedValues = function(param, elemId, n) {
								var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map(
								     function () {return this.value;}).get().join(",");
								jQuery("#ws-plugin--optimizemember-" + elemId + "-ccaps").val(text);


							}
								/**/
							</script>
							<?php 
            /**/
            if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_modification_buttons", true, get_defined_vars())) {
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_modification_buttons", get_defined_vars());
                /**/
                echo '<div class="ws-menu-page-group" title="PayPal Subscr Modification Buttons">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-modification-buttons-section">' . "\n";
                echo '<h3>Button Code Generator For Subscription Modifications</h3>' . "\n";
                echo '<p>If you\'d like to give your Members <em>( and/or your Free Subscribers )</em> the ability to modify their billing plan, by switching to a more expensive option, or a less expensive option; generate a new PayPal Modification Button here. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Button available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade Button 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>*Important Note*</strong> Modification Buttons should be displayed to existing Users/Members, and they should be logged-in, BEFORE clicking this Button. Otherwise, post-processing of their transaction will fail to recognize the Customer\'s existing account within WordPress. Please display this Button only to Users/Members that are already logged into their account ( perhaps in your Login Welcome Page for optimizeMember ), or in another location where you can be absolutely sure that a User/Member is logged in. optimizeMember\'s Simple Conditionals could also be used to ensure a User/Member is logged in, by wrapping your Shortcode within a Conditional test. For further details, please see: <code>optimizeMember -> API Scripting -> Simple Conditionals</code>.</em></p>' . "\n";
                echo '<p><em><strong>*Modification Process*</strong> When you send a Member to PayPal using a Subscription Modification Button, PayPal will ask them to login. Once they\'re logged in, instead of being able to signup for a new Membership, PayPal will provide them with the ability to upgrade and/or downgrade their existing Membership with you, by allowing them to switch to the Membership Plan that was specified in the Subscription Modification Button. PayPal handles this nicely, and you\'ll be happy to know that optimizeMember has been pre-configured to deal with this scenario as well, so that everything remains automated. Their Membership Access Level will either be promoted, or demoted, based on the actions they took at PayPal during the modification process. Once an existing Member completes their Subscription Modification at PayPal, they\'ll be brought back to their Login Welcome Page, instead of to the registration screen.</em></p>' . "\n";
                echo '<p><em><strong>*Also Works For Free Subscribers*</strong> Although a Free Subscriber does not have an existing PayPal Subscription, optimizeMember is capable of adapting to this scenario gracefully. Just make sure that your existing Free Subscribers <em>( the ones who wish to upgrade )</em> pay for their Membership through a Modification Button generated by optimizeMember. That will allow them to continue using their existing account with you. In other words, they can keep their existing Username <em>( and anything already associated with that Username )</em>, rather than being forced to re-register after checkout.</em></p>' . "\n";
                echo '<p><em><strong>*Make It More User-Friendly*</strong> You can make the Subscription Modification Process, more user-friendly, by setting up a <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 tell optimizeMember to use that Page Style whenever you generate your Button Code.\'); return false;">Custom Page Style at PayPal</a>, specifically for Subscription Modification Buttons. Use a custom header image, with a brief explanation to the Customer. Something like, "Log into PayPal", "You can Modify your Subscription!".</em></p>' . "\n";
                echo '<p><em><strong>*Integrating Conditionals*</strong> Since each Modification Button is configured for a specific Level, you may want to create multiple Modification Buttons, one for each combination you intend to make available. optimizeMember\'s API Conditionals can help you display the proper Button 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 Button Generator: <code>Capability (Buy Now) Buttons</code>. Independent Capability Buttons facilitate Buy Now functionality, specifically for Custom Capabilities, without affecting the Customer\'s primary Subscription and Membership Level Access.</em></p>' . "\n" : '';
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_modification_buttons", get_defined_vars());
                /**/
                echo '<table class="form-table">' . "\n";
                echo '<tbody>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<th class="ws-menu-page-th-side">' . "\n";
                echo '<label for="ws-plugin--optimizemember-modification-shortcode">' . "\n";
                echo 'Button Code<br />For Modifications:<br /><br />' . "\n";
                echo '<div id="ws-plugin--optimizemember-modification-button-prev"></div>' . "\n";
                echo '</label>' . "\n";
                echo '</th>' . "\n";
                /**/
                echo '<td>' . "\n";
                echo '<form onsubmit="return false;">' . "\n";
                /**/
                echo '<p>Modification: <select id="ws-plugin--optimizemember-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-modification-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-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-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
                echo '<p><span id="ws-plugin--optimizemember-modification-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-modification-term" class="paypal-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-regular-terms.php"))) . '</select><span id="ws-plugin--optimizemember-modification-20p-rule"><br /><small>* Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details are <a href="http://www.optimizepress.com/paypal-20p-rule" target="_blank" rel="external">documented here</a>.<br />* <strong>Tip</strong> <a href="' . esc_attr(c_ws_plugin__optimizemember_readmes::parse_readme_value("Pro Module / Prices")) . '" target="_blank" rel="external">optimizeMember Pro Forms</a> are NOT subjected to this ridiculous 20% rule.</small></span></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\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-page-style" value="paypal" size="18" class="paypal-buttons-checkout-page-style-input" /> <select id="ws-plugin--optimizemember-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 Button Code" onclick="ws_plugin__optimizemember_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
                echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-desc" class="paypal-buttons-description-input" value="Description and pricing details here." size="73" /></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-modification-ccaps" size="40" /></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-level' . $n . '-ccaps" size="40" /></p>' . "\n";
                echo 'Packages: ';
                $n = 1;
                if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
                    foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                        echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchksub_' . $n . '\', \'modification\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchksub_' . $n . '" value="' . $val . '" /> ' . $val . "\n";
                    }
                } else {
                    echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>';
                }
                echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-modification-ccaps" value="" />' . "\n";
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<td colspan="2">' . "\n";
                echo '<form onsubmit="return false;">' . "\n";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_modification_buttons_before_shortcode", get_defined_vars());
                echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("1")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_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_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/\\/]\$/", 'modify="1" /]', $ws_plugin__optimizemember_temp_s);
                /* Adds modify="1" to the end of the Shortcode. */
                echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
                /**/
                echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n";
                echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
                echo '<textarea id="ws-plugin--optimizemember-modification-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-checkout-button.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace('/name\\="modify" value\\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("1")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_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_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s);
                echo format_to_edit($ws_plugin__optimizemember_temp_s);
                echo '</textarea><br />' . "\n";
                echo '&uarr; <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '</tbody>' . "\n";
                echo '</table>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</div>' . "\n";
                /**/
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_modification_buttons", get_defined_vars());
            }
            /**/
            if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_ccap_buttons", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_ccap_buttons", get_defined_vars());
                /**/
                echo '<div class="ws-menu-page-group" title="PayPal Capability (Buy Now) Buttons">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-ccap-buttons-section">' . "\n";
                echo '<h3>Button Code 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>Subscr. Modification Button</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 Button Code). These special PayPal Buttons 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 '<p><em><strong>*Important Note*</strong> Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button. Otherwise, post-processing of their transaction will fail to recognize the Customer\'s existing account within WordPress. Please display this Button only to Users/Members that are already logged into their account ( perhaps in your Login Welcome Page for optimizeMember ), or in another location where you can be absolutely sure that a User/Member is logged in. optimizeMember\'s Simple Conditionals could also be used to ensure a User/Member is logged in, by wrapping your Shortcode within a Conditional test. For further details, please see: <code>optimizeMember -> API Scripting -> Simple Conditionals</code>.</em></p>' . "\n";
                echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your WordPress Editor. If you lose your Button Code, you\'ll need to come back &amp; re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_ccap_buttons", get_defined_vars());
                /**/
                echo '<table class="form-table">' . "\n";
                echo '<tbody>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<th class="ws-menu-page-th-side">' . "\n";
                echo '<label for="ws-plugin--optimizemember-ccap-shortcode">' . "\n";
                echo 'Button Code<br />For Capabilities:<br /><br />' . "\n";
                echo '<div id="ws-plugin--optimizemember-ccap-button-prev"></div>' . "\n";
                echo '</label>' . "\n";
                echo '</th>' . "\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-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-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>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\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-ccap-page-style" class="paypal-buttons-checkout-page-style-input" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-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 Button Code" onclick="ws_plugin__optimizemember_paypalCcapButtonGenerate();" class="button-primary" /></p>' . "\n";
                echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-ccap-desc" class="paypal-buttons-description-input" value="Description and pricing details here." size="73" /></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-ccap-ccaps" size="40" /></p>' . "\n";
                echo 'Packages: ';
                $n = 1;
                if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
                    foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                        echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkccaps_' . $n . '\', \'ccap\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkccaps_' . $n . '" value="' . $val . '" /> ' . $val . "\n";
                    }
                } else {
                    echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>';
                }
                echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-ccap-ccaps" value="" />' . "\n";
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<td colspan="2">' . "\n";
                echo '<form onsubmit="return false;">' . "\n";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_ccap_buttons_before_shortcode", get_defined_vars());
                echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-ccaps-checkout-button-shortcode.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-ccap-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
                /**/
                echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n";
                echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
                echo '<textarea id="ws-plugin--optimizemember-ccap-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-ccaps-checkout-button.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s);
                echo format_to_edit($ws_plugin__optimizemember_temp_s);
                echo '</textarea><br />' . "\n";
                echo '&uarr; <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '</tbody>' . "\n";
                echo '</table>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</div>' . "\n";
                /**/
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_ccap_buttons", get_defined_vars());
            }
            /**/
            if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_cancellation_buttons", true, get_defined_vars())) {
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_cancellation_buttons", get_defined_vars());
                /**/
                echo '<div class="ws-menu-page-group" title="PayPal Subscr Cancellation Buttons">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-cancellation-buttons-section">' . "\n";
                echo '<h3>One Button Does It All For Cancellations ( copy/paste )</h3>' . "\n";
                echo '<p>Since all recurring charges are associated with a PayPal Subscription; and every PayPal Subscription is associated with a PayPal Account; your Members will always have a PayPal Account of their own, which is tied to their Membership with you. So... a Member can simply log into their own PayPal account and cancel their Subscription(s) with you at anytime, all on their own. However, some Customers do not realize this. So, if you would like to make it clearer ( easier ) for Members to cancel their own Subscription(s), you can provide this Cancellation Button for them on your Login Welcome Page, or somewhere in the support section of your website. Note... you don\'t have to use this Cancellation Button at all, if you don\'t want to. It\'s completely optional.</p>' . "\n";
                echo '<p><em><strong>*Cancellation Process*</strong> Very simple. A Member clicks the Cancellation Button. PayPal asks them to log into their PayPal account. Once they\'re logged in, PayPal will display a list of all active Subscriptions they have with you. They choose which ones they want to cancel, and optimizeMember is notified silently behind-the-scene, through the PayPal IPN service.</em></p>' . "\n";
                echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
                echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through PayPal... but, optimizeMember continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. optimizeMember will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by optimizeMember.</em></p>' . "\n";
                echo '<p><em>optimizeMember will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, optimizeMember will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). optimizeMember also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons", get_defined_vars());
                /**/
                echo '<table class="form-table">' . "\n";
                echo '<tbody>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<th class="ws-menu-page-th-side">' . "\n";
                echo '<label for="ws-plugin--optimizemember-cancellation-shortcode">' . "\n";
                echo 'Button Code<br />For Cancellations:<br /><br />' . "\n";
                echo '<div id="ws-plugin--optimizemember-cancellation-button-prev">' . "\n";
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s);
                echo preg_replace("/\\<a/", '<a target="_blank"', $ws_plugin__optimizemember_temp_s);
                echo '</div>' . "\n";
                echo '</label>' . "\n";
                echo '</th>' . "\n";
                /**/
                echo '<td class="align-top">' . "\n";
                echo '<form onsubmit="return false;">' . "\n";
                echo '<p>No configuration necessary.</p>' . "\n";
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<td colspan="2">' . "\n";
                echo '<form onsubmit="return false;">' . "\n";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons_before_shortcode", get_defined_vars());
                echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-cancellation-button-shortcode.php")));
                echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-cancellation-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
                /**/
                echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n";
                echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
                echo '<textarea id="ws-plugin--optimizemember-cancellation-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s);
                echo format_to_edit($ws_plugin__optimizemember_temp_s);
                echo '</textarea><br />' . "\n";
                echo '&uarr; <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '</tbody>' . "\n";
                echo '</table>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</div>' . "\n";
                /**/
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_cancellation_buttons", get_defined_vars());
            }
            /**/
            if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_reg_links", true, get_defined_vars())) {
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_reg_links", get_defined_vars());
                /**/
                echo '<div class="ws-menu-page-group" title="PayPal Member Registration Access Links">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-reg-links-section">' . "\n";
                echo '<h3>Registration Access Link Generator ( for Customer Service )</h3>' . "\n";
                echo '<p>optimizeMember automatically generates Registration Access 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 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";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_reg_links", get_defined_vars());
                /**/
                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-reg-link-level" style="min-width:200px;">' . "\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-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 under 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-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_paypalRegLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-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-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 'Packages: ';
                $n = 1;
                if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
                    foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                        echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkreg_' . $n . '\', \'reg-link\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkreg_' . $n . '" value="' . $val . '" /> ' . $val . "\n";
                    }
                } else {
                    echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>';
                }
                echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-reg-link-ccaps" value="" />' . "\n";
                echo '<p>Fixed Term Length ( for Buy Now transactions ): <input type="text" autocomplete="off" id="ws-plugin--optimizemember-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 automatically 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-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";
                /**/
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_reg_links", get_defined_vars());
            }
            /**/
            if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_sp_buttons", true, get_defined_vars())) {
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_sp_buttons", get_defined_vars());
                /**/
                echo '<div class="ws-menu-page-group" title="PayPal Specific Post/Page (Buy Now) Buttons">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-sp-buttons-section">' . "\n";
                echo '<h3>Button Code Generator For Specific Post/Page Buttons</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" Buttons, and 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 Button Code). These special PayPal Buttons are customized to work with optimizeMember seamlessly. You can even Package Additional Posts/Pages together into one transaction.</p>' . "\n";
                echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your WordPress Editor. If you lose your Button Code, you\'ll need to come back &amp; re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_sp_buttons", get_defined_vars());
                /**/
                echo '<table class="form-table">' . "\n";
                echo '<tbody>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<th class="ws-menu-page-th-side">' . "\n";
                echo '<label for="ws-plugin--optimizemember-sp-shortcode">' . "\n";
                echo 'Button Code<br />Specific Posts/Pages:<br /><br />' . "\n";
                echo '<div id="ws-plugin--optimizemember-sp-button-prev"></div>' . "\n";
                echo '</label>' . "\n";
                echo '</th>' . "\n";
                /**/
                echo '<td>' . "\n";
                echo '<form onsubmit="return false;">' . "\n";
                /**/
                echo '<p><select id="ws-plugin--optimizemember-sp-leading-id">' . "\n";
                echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
                /**/
                $ws_plugin__optimizemember_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
                /**/
                foreach ($ws_plugin__optimizemember_temp_a_singulars as $ws_plugin__optimizemember_temp_o) {
                    echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_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-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_temp_a_singulars as $ws_plugin__optimizemember_temp_o) {
                    echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_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-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-sp-hours" class="paypal-buttons-subscription-select">' . 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-sp-desc" class="paypal-buttons-description-input" 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\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-sp-page-style" class="paypal-buttons-checkout-page-style-input" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-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 Button Code" onclick="ws_plugin__optimizemember_paypalSpButtonGenerate();" class="button-primary" /></p>' . "\n";
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<td colspan="2">' . "\n";
                echo '<form onsubmit="return false;">' . "\n";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_sp_buttons_before_shortcode", get_defined_vars());
                echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual &amp; HTML Editors )<br />' . "\n";
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-button-shortcode.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-sp-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
                /**/
                echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n";
                echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
                echo '<textarea id="ws-plugin--optimizemember-sp-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
                $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.php")));
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s);
                $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s);
                echo format_to_edit($ws_plugin__optimizemember_temp_s);
                echo '</textarea><br />' . "\n";
                echo '&uarr; <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '</tbody>' . "\n";
                echo '</table>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</div>' . "\n";
                /**/
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_sp_buttons", get_defined_vars());
            }
            /**/
            if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_sp_links", true, get_defined_vars())) {
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_sp_links", get_defined_vars());
                /**/
                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-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";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_sp_links", get_defined_vars());
                /**/
                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-sp-link-leading-id">' . "\n";
                echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
                /**/
                $ws_plugin__optimizemember_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
                /**/
                foreach ($ws_plugin__optimizemember_temp_a_singulars as $ws_plugin__optimizemember_temp_o) {
                    echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_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-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_temp_a_singulars as $ws_plugin__optimizemember_temp_o) {
                    echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_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-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_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-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-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";
                /**/
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_sp_links", get_defined_vars());
            }
            /**/
            if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_shortcode_attrs", true, get_defined_vars())) {
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_shortcode_attrs", get_defined_vars());
                /**/
                echo '<div class="ws-menu-page-group" title="Shortcode Attributes ( Explained )">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-shortcode-attrs-section">' . "\n";
                echo '<h3>Shortcode Attributes ( Explained In Full Detail )</h3>' . "\n";
                echo '<p>When you generate a Button Code, 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 Button 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";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_shortcode_attrs", get_defined_vars());
                /**/
                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>cancel="0"</code> Cancellation Button. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Cancellation Button, <code>1</code> = this IS a Cancellation Button.</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>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>desc="Gold Membership"</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>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default PayPal Button, <code>http://...</code> = location of your custom Image.</li>' . "\n";
                echo '<li><code>lc=""</code> Optional 2 character Locale Code <em>( i.e. Country Code )</em>. This controls the interface language used at PayPal during checkout. If unspecified, the language is determined by PayPal 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 Buttons providing paid Membership Level Access.' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' Or, 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 only create a new Subscription, <code>1</code> = allows Customers to modify their current Subscription or sign up for a new one, <code>2</code> = allows Customers to only modify their current Subscription.</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. Not valid when <code>cancel="1"</code>.</li>' . "\n";
                echo '<li><code>output="button"</code> Output Type. Possible values: <code>button</code> = PayPal Button w/hidden inputs, <code>anchor</code> = PayPal Button (  &lt;a&gt; anchor tag ) URL w/ ?query string, <code>url</code> = raw URL w/ ?query string.</li>' . "\n";
                echo '<li><code>ps="paypal"</code> PayPal checkout Page Style. Not valid when <code>cancel="1"</code>.</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.</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="1"</code> Reattempt failed payments? Possible values: <code>0</code> = do NOT reattempt billing when/if a recurring payment fails; <code>1</code> = yes, DO reattempt billing when/if a recurring payment fails. With PayPal Standard integration, PayPal will retry a maximum of 2 times when you set <code>rra="1"</code>; after that, a Subscription would be terminated due to Max Failed Payments having been reached. PayPal Standard integration does NOT make it possible to configure Max Failed Payments, it simply defaults to a value of <code>2</code> whenever <code>rra="1"</code>, indicating that you DO want to retry failed payments.</li>' . "\n";
                echo '<li><code>sp="0"</code> Specific Post/Page Button. Possible values: <code>0</code> = this is NOT a Specific Post/Page Access Button, <code>1</code> = this IS a Specific Post/Page Access Button.</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";
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_shortcode_attrs_lis", get_defined_vars());
                echo '</ul>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '</tbody>' . "\n";
                echo '</table>' . "\n";
                echo '</div>' . "\n";
                /**/
                echo '</div>' . "\n";
                /**/
                do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_shortcode_attrs", get_defined_vars());
            }
            /**/
            do_action("ws_plugin__optimizemember_during_paypal_buttons_page_after_left_sections", get_defined_vars());
            /**/
            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";
        }
 /**
  * optimizeMember's PayPal IPN handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @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("/^(subscr_payment|recurring_payment)\$/i", $paypal["txn_type"]) && ((!empty($paypal["item_number"]) || ($paypal["item_number"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_number($paypal))) && preg_match($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["membership_item_number_w_level_regex"], $paypal["item_number"])) && (!empty($paypal["subscr_id"]) || ($paypal["subscr_id"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_subscr_id($paypal))) && (empty($paypal["payment_status"]) || empty($payment_status_issues) || !preg_match($payment_status_issues, $paypal["payment_status"])) && (!empty($paypal["item_name"]) || ($paypal["item_name"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_name($paypal))) && (!empty($paypal["payer_email"]) || ($paypal["payer_email"] = c_ws_plugin__optimizemember_utils_users::get_user_email_with($paypal["subscr_id"]))) && !empty($paypal["txn_id"]) && !empty($paypal["mc_gross"])) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_notify_before_subscr_payment", 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 " . ($identified_as = "( `subscr_payment|recurring_payment` )") . ".";
             $paypal["optimizemember_log"][] = "Sleeping for 5 seconds. Waiting for a possible ( `subscr_signup|subscr_modify|recurring_payment_profile_created` ).";
             sleep(5);
             /* Sleep here for a moment. PayPal sometimes sends a subscr_payment before the subscr_signup, subscr_modify. */
             /* It is NOT a big deal if they do. However, optimizeMember goes to sleep here, just to help keep the log files in a logical order. */
             $paypal["optimizemember_log"][] = "Awake. It's " . date("D M j, Y g:i:s a T") . ". optimizeMember `txn_type` identified as " . $identified_as . ".";
             /**/
             list($paypal["level"], $paypal["ccaps"]) = preg_split("/\\:/", $paypal["item_number"], 2);
             /**/
             $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 (($user_id = c_ws_plugin__optimizemember_utils_users::get_user_id_with($paypal["subscr_id"])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                 $processing = $during = true;
                 /* Yes, we ARE processing this. */
                 /**/
                 $pr_times = get_user_option("optimizemember_paid_registration_times", $user_id);
                 $pr_times["level"] = !$pr_times["level"] ? time() : $pr_times["level"];
                 /* Preserves existing. */
                 $pr_times["level" . $paypal["level"]] = !$pr_times["level" . $paypal["level"]] ? time() : $pr_times["level" . $paypal["level"]];
                 update_user_option($user_id, "optimizemember_paid_registration_times", $pr_times);
                 /* Update now. */
                 /**/
                 if (!get_user_option("optimizemember_first_payment_txn_id", $user_id)) {
                     /* 1st payment? */
                     update_user_option($user_id, "optimizemember_first_payment_txn_id", $paypal["txn_id"]);
                 }
                 /**/
                 update_user_option($user_id, "optimizemember_last_payment_time", time());
                 /* Also update last payment time. */
                 /**/
                 $paypal["optimizemember_log"][] = "Updated Payment Times for this Member.";
                 /* Flag this action in the log. */
                 /**/
                 $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 ($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.";
                 }
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_payment", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
             } else {
                 $paypal["optimizemember_log"][] = "Skipping this IPN response, for now. The Subscr. ID is not associated with a registered Member.";
                 /**/
                 $ipn = array("txn_type" => "subscr_payment");
                 /* Create a simulated IPN response for txn_type=subscr_payment. */
                 /**/
                 foreach ($paypal as $var => $val) {
                     if (in_array($var, array("subscr_gateway", "subscr_id", "txn_id", "custom", "invoice", "mc_gross", "mc_currency", "tax", "payer_email", "first_name", "last_name", "item_name", "item_number", "option_name1", "option_selection1", "option_name2", "option_selection2"))) {
                         $ipn[$var] = $val;
                     }
                 }
                 /**/
                 $paypal["optimizemember_log"][] = "Re-generating. This IPN will go into a Transient Queue; and be re-processed during registration.";
                 /**/
                 set_transient("s2m_" . md5("optimizemember_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $ipn, 43200);
             }
         } else {
             $paypal["optimizemember_log"][] = "Not processing. Duplicate IPN.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `subscr_payment|recurring_payment` ).";
             $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_subscr_payment", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_or_rp_payment_w_level", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_or_rp_payment_w_level", false, get_defined_vars());
     }
 }
 /**
  * Shortcode `[optimizeMember-Pro-AuthNet-Form /]`.
  *
  * @package optimizeMember\AuthNet
  * @since 1.5
  *
  * @attaches-to ``add_shortcode("optimizeMember-Pro-AuthNet-Form");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str The resulting Form Code, HTML markup.
  */
 public static function sc_authnet_form($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_pro_before_sc_authnet_form", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     c_ws_plugin__optimizemember_no_cache::no_cache_constants(true);
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /**/
     $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", "accept" => "visa,mastercard,amex,discover", "coupon" => "", "accept_coupons" => "0", "default_country_code" => "US", "captcha" => "", "template" => "", "success" => ""), $attr);
     /**/
     $attr["tt"] = strtoupper($attr["tt"]);
     $attr["rt"] = strtoupper($attr["rt"]);
     $attr["rr"] = strtoupper($attr["rr"]);
     $attr["ccaps"] = strtolower($attr["ccaps"]);
     $attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"];
     $attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"];
     $attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"];
     $attr["cc"] = "USD";
     $attr["default_country_code"] = strtoupper($attr["default_country_code"]);
     $attr["success"] = c_ws_plugin__optimizemember_utils_urls::n_amps($attr["success"]);
     /**/
     $attr["accept"] = trim($attr["accept"]) ? preg_split("/[;,]+/", preg_replace("/[\r\n\t\\s]+/", "", strtolower($attr["accept"]))) : array();
     $attr["accept"] = empty($attr["accept"]) ? array_merge($attr["accept"], array("visa")) : $attr["accept"];
     /**/
     $attr["coupon"] = $_GET["s2p-coupon"] ? trim(strip_tags(stripslashes($_GET["s2p-coupon"]))) : $attr["coupon"];
     /**/
     $attr["singular"] = get_the_ID();
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_pro_before_sc_authnet_form_after_shortcode_atts", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($attr["cancel"]) {
         $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
         /*
         Obtain a possible response and/or validation error.
         */
         $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_cancellation_response($attr);
         /*
         Empty post vars on successful response.
         */
         $_p = $response["response"] && !$response["error"] ? array() : $_p;
         /*
         Build the reCaptcha box via JavaScript.
         */
         if ($attr["captcha"]) {
             $captcha = '<div id="s2member-pro-authnet-cancellation-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-cancellation-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-cancellation-form-captcha-section">' . "\n";
             /**/
             $captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-cancellation-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-cancellation-form-captcha-section-title">' . "\n";
             $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n";
             $captcha .= '</div>' . "\n";
             /**/
             $captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-cancellation-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-cancellation-form-captcha-div">' . "\n";
             /**/
             $captcha .= '<label id="s2member-pro-authnet-cancellation-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-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";
         }
         /*
         Build the hidden input variables.
         */
         $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_cancellation[nonce]" id="s2member-pro-authnet-cancellation-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-cancellation")) . '" />';
         $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_cancellation[attr]" id="s2member-pro-authnet-cancellation-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
         /*
         Get the form template.
         */
         $custom_template = file_exists(TEMPLATEPATH . "/authnet-cancellation-form.php") ? TEMPLATEPATH . "/authnet-cancellation-form.php" : false;
         $custom_template = file_exists(TEMPLATEPATH . "/authnet-cancellation-form.html") ? TEMPLATEPATH . "/authnet-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/authnet-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);
         /*
         Fill in the action.
         */
         $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code);
         /*
         Fill in the response.
         */
         $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code);
         /*
         Fill in the description.
         */
         $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code);
         /*
         Fill the captcha section.
         */
         $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code);
         /*
         Fill hidden inputs.
         */
         $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code);
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_pro_during_sc_authnet_cancellation_form", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
     } else {
         if ($attr["register"]) {
             $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
             /*
             Obtain a possible response and/or validation error.
             */
             $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_registration_response($attr);
             /*
             Empty post vars on successful response.
             */
             $_p = $response["response"] && !$response["error"] ? array() : $_p;
             /*
             Build all of the 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="s2member-pro-authnet-registration-form-custom-fields-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-registration-form-section s2member-pro-authnet-form-custom-fields-section s2member-pro-authnet-registration-form-custom-fields-section">' . "\n";
                     /**/
                     $custom_fields .= '<div id="s2member-pro-authnet-registration-form-custom-fields-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-registration-form-section-title s2member-pro-authnet-form-custom-fields-section-title s2member-pro-authnet-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="s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-divider-section" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-custom-reg-field-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . '">' . (!empty($field["sectitle"]) ? $field["sectitle"] : '') . '</div>';
                             }
                             /**/
                             $custom_fields .= '<div id="s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-div s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-div">' . "\n";
                             /**/
                             $custom_fields .= '<label for="s2member-pro-authnet-registration-custom-reg-field-' . esc_attr($field_id_class) . '" id="s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-label" class="s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-label s2member-pro-authnet-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_authnet_registration[custom_fields][", "s2member-pro-authnet-registration-custom-reg-field-", "s2member-pro-authnet-custom-reg-field-" . $field_id_class . " s2member-pro-authnet-registration-custom-reg-field-" . $field_id_class, "", $tabindex = $tabindex + 1, "", $_p, $_p["optimizemember_pro_authnet_registration"]["custom_fields"][$field_var], "registration");
                             /**/
                             $custom_fields .= '</div>' . "\n";
                         }
                     }
                     /**/
                     $custom_fields .= '</div>' . "\n";
                 }
             }
             /*
             Build the reCaptcha box via JavaScript.
             */
             if ($attr["captcha"]) {
                 $captcha = '<div id="s2member-pro-authnet-registration-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-registration-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-registration-form-captcha-section">' . "\n";
                 /**/
                 $captcha .= '<div id="s2member-pro-authnet-registration-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-registration-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-registration-form-captcha-section-title">' . "\n";
                 $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n";
                 $captcha .= '</div>' . "\n";
                 /**/
                 $captcha .= '<div id="s2member-pro-authnet-registration-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-registration-form-captcha-div">' . "\n";
                 /**/
                 $captcha .= '<label id="s2member-pro-authnet-registration-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-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";
             }
             /*
             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="s2member-pro-authnet-registration-form-custom-reg-field-opt-in-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-custom-reg-field-opt-in-div s2member-pro-authnet-registration-form-custom-reg-field-opt-in-div">' . "\n";
                 /**/
                 $opt_in .= '<label for="s2member-pro-authnet-registration-form-custom-reg-field-opt-in" id="s2member-pro-authnet-registration-form-custom-reg-field-opt-in-label" class="s2member-pro-authnet-form-custom-reg-field-opt-in-label s2member-pro-authnet-registration-form-custom-reg-field-opt-in-label">' . "\n";
                 $opt_in .= '<input type="checkbox" name="optimizemember_pro_authnet_registration[custom_fields][opt_in]" id="s2member-pro-authnet-registration-form-custom-reg-field-opt-in" class="s2member-pro-authnet-form-custom-reg-field-opt-in s2member-pro-authnet-registration-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] == 1 || $_p["optimizemember_pro_authnet_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";
             }
             /*
             Build the hidden input variables.
             */
             $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_registration[nonce]" id="s2member-pro-authnet-registration-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-registration")) . '" />';
             $hidden_inputs .= !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_names"] ? '<input type="hidden" id="s2member-pro-authnet-registration-names-not-required-or-not-possible" value="1" />' : '';
             $hidden_inputs .= !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_password"] ? '<input type="hidden" id="s2member-pro-authnet-registration-password-not-required-or-not-possible" value="1" />' : '';
             $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_registration[attr]" id="s2member-pro-authnet-registration-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
             /*
             Get the form template.
             */
             $custom_template = file_exists(TEMPLATEPATH . "/authnet-registration-form.php") ? TEMPLATEPATH . "/authnet-registration-form.php" : false;
             $custom_template = file_exists(TEMPLATEPATH . "/authnet-registration-form.html") ? TEMPLATEPATH . "/authnet-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/authnet-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);
             /*
             Fill in the action.
             */
             $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code);
             /*
             Fill in the response.
             */
             $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code);
             /*
             Fill in the description.
             */
             $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code);
             /*
             Fill in the registration section.
             */
             $code = preg_replace("/%%first_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_registration"]["first_name"])), $code);
             $code = preg_replace("/%%last_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_registration"]["last_name"])), $code);
             $code = preg_replace("/%%email_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["email"])), $code);
             $code = preg_replace("/%%username_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["username"])), $code);
             $code = preg_replace("/%%password1_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["password1"])), $code);
             $code = preg_replace("/%%password2_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["password2"])), $code);
             /*
             Fill in the custom fields section.
             */
             $code = preg_replace("/%%custom_fields%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($custom_fields), $code);
             /*
             Fill the captcha section.
             */
             $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code);
             /*
             Fill the opt-in box.
             */
             $code = preg_replace("/%%opt_in%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($opt_in), $code);
             /*
             Fill hidden inputs.
             */
             $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code);
             /**/
             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
             do_action("ws_plugin__optimizemember_pro_during_sc_authnet_registration_form", get_defined_vars());
             unset($__refs, $__v);
             /* Unset defined __refs, __v. */
         } else {
             if ($attr["update"]) {
                 $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
                 /*
                 Obtain a possible response and/or validation error.
                 */
                 $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_update_response($attr);
                 /*
                 Empty post vars on successful response.
                 */
                 $_p = $response["response"] && !$response["error"] ? array() : $_p;
                 /*
                 Build the list of card type options.
                 */
                 foreach (array("Visa" => _x("Visa", "s2member-front", "s2member"), "MasterCard" => _x("MasterCard", "s2member-front", "s2member"), "Discover" => _x("Discover", "s2member-front", "s2member"), "Amex" => _x("American Express", "s2member-front", "s2member")) as $card_type_v => $card_type_l) {
                     $card_type_options .= '<label for="s2member-pro-authnet-update-card-type-' . esc_attr(strtolower($card_type_v)) . '" id="s2member-pro-authnet-update-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label" class="s2member-pro-authnet-form-card-type-label s2member-pro-authnet-update-form-card-type-label s2member-pro-authnet-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label s2member-pro-authnet-update-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label' . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled' : '') . '">' . "\n" . '<input type="radio" aria-required="true" name="optimizemember_pro_authnet_update[card_type]" id="s2member-pro-authnet-update-card-type-' . esc_attr(strtolower($card_type_v)) . '" class="s2member-pro-authnet-card-type-' . esc_attr(strtolower($card_type_v)) . ' s2member-pro-authnet-update-card-type-' . esc_attr(strtolower($card_type_v)) . '" value="' . esc_attr($card_type_v) . '"' . (!empty($_p["optimizemember_pro_authnet_update"]["card_type"]) && in_array(strtolower($_p["optimizemember_pro_authnet_update"]["card_type"]), $attr["accept"]) && $_p["optimizemember_pro_authnet_update"]["card_type"] === $card_type_v ? ' checked="checked"' : '') . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled="disabled"' : '') . ' tabindex="10" />' . "\n" . '</label>';
                 }
                 /*
                 Build the list of country code options.
                 $country_default_by_currency = false. Authorize.Net always processes in USD, so the country is empty by default.
                 Authorize.Net always processes in USD. International transactions are converted automatically through banking institutions.
                 */
                 $country_default_by_currency = !$_p["optimizemember_pro_authnet_update"]["country"] && $attr["cc"] === "USD" ? "US" : $country_default_by_currency;
                 $country_default_by_currency = !$_p["optimizemember_pro_authnet_update"]["country"] && $attr["cc"] === "CAD" ? "CA" : $country_default_by_currency;
                 $country_default_by_currency = !$_p["optimizemember_pro_authnet_update"]["country"] && $attr["cc"] === "GBP" ? "GB" : $country_default_by_currency;
                 $country_default_by_currency = apply_filters("ws_plugin__optimizemember_pro_authnet_default_country", false, 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_authnet_update"]["country"] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>';
                     }
                 }
                 /*
                 Build the reCaptcha box via JavaScript.
                 */
                 if ($attr["captcha"]) {
                     $captcha = '<div id="s2member-pro-authnet-update-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-update-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-update-form-captcha-section">' . "\n";
                     /**/
                     $captcha .= '<div id="s2member-pro-authnet-update-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-update-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-update-form-captcha-section-title">' . "\n";
                     $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n";
                     $captcha .= '</div>' . "\n";
                     /**/
                     $captcha .= '<div id="s2member-pro-authnet-update-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-update-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-update-form-captcha-div">' . "\n";
                     /**/
                     $captcha .= '<label id="s2member-pro-authnet-update-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-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";
                 }
                 /*
                 Build the hidden input variables.
                 */
                 $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_update[nonce]" id="s2member-pro-authnet-update-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-update")) . '" />';
                 $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_update[attr]" id="s2member-pro-authnet-update-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
                 /*
                 Get the form template.
                 */
                 $custom_template = file_exists(TEMPLATEPATH . "/authnet-update-form.php") ? TEMPLATEPATH . "/authnet-update-form.php" : false;
                 $custom_template = file_exists(TEMPLATEPATH . "/authnet-update-form.html") ? TEMPLATEPATH . "/authnet-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/authnet-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);
                 /*
                 Fill in the action.
                 */
                 $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code);
                 /*
                 Fill in the response.
                 */
                 $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code);
                 /*
                 Fill in the description.
                 */
                 $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code);
                 /*
                 Fill in the billing method section.
                 */
                 $code = preg_replace("/%%card_type_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($card_type_options), $code);
                 $code = preg_replace("/%%card_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_number"])), $code);
                 $code = preg_replace("/%%card_expiration_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_expiration"])), $code);
                 $code = preg_replace("/%%card_verification_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_verification"])), $code);
                 $code = preg_replace("/%%card_start_date_issue_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_start_date_issue_number"])), $code);
                 /*
                 Fill in the billing address section.
                 */
                 $code = preg_replace("/%%street_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["street"])), $code);
                 $code = preg_replace("/%%city_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["city"])), $code);
                 $code = preg_replace("/%%state_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["state"])), $code);
                 $code = preg_replace("/%%country_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($country_options), $code);
                 $code = preg_replace("/%%zip_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["zip"])), $code);
                 /*
                 Fill the captcha section.
                 */
                 $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code);
                 /*
                 Fill hidden inputs.
                 */
                 $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code);
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_pro_during_sc_authnet_update_form", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
             } else {
                 if ($attr["sp"]) {
                     $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
                     /*
                     Configure internal attributes.
                     */
                     $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
                     /* Combined `sp:ids:expiration hours`. */
                     $attr["coupon"] = $_p["optimizemember_pro_authnet_sp_checkout"]["coupon"] ? $_p["optimizemember_pro_authnet_sp_checkout"]["coupon"] : $attr["coupon"];
                     /*
                     Obtain a possible response and/or validation error.
                     */
                     $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_sp_checkout_response($attr);
                     /*
                     Empty post vars on successful response.
                     */
                     $_p = $response["response"] && !$response["error"] ? array() : $_p;
                     /*
                     Build the list of card type options.
                     */
                     foreach (array("Visa" => _x("Visa", "s2member-front", "s2member"), "MasterCard" => _x("MasterCard", "s2member-front", "s2member"), "Discover" => _x("Discover", "s2member-front", "s2member"), "Amex" => _x("American Express", "s2member-front", "s2member")) as $card_type_v => $card_type_l) {
                         $card_type_options .= '<label for="s2member-pro-authnet-sp-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" id="s2member-pro-authnet-sp-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label" class="s2member-pro-authnet-form-card-type-label s2member-pro-authnet-sp-checkout-form-card-type-label s2member-pro-authnet-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label s2member-pro-authnet-sp-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label' . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled' : '') . '">' . "\n" . '<input type="radio" aria-required="true" name="optimizemember_pro_authnet_sp_checkout[card_type]" id="s2member-pro-authnet-sp-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" class="s2member-pro-authnet-card-type-' . esc_attr(strtolower($card_type_v)) . ' s2member-pro-authnet-sp-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" value="' . esc_attr($card_type_v) . '"' . (!empty($_p["optimizemember_pro_authnet_sp_checkout"]["card_type"]) && in_array(strtolower($_p["optimizemember_pro_authnet_sp_checkout"]["card_type"]), $attr["accept"]) && $_p["optimizemember_pro_authnet_sp_checkout"]["card_type"] === $card_type_v ? ' checked="checked"' : '') . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled="disabled"' : '') . ' tabindex="100" />' . "\n" . '</label>';
                     }
                     /*
                     Build the list of country code options.
                     $country_default_by_currency = false. Authorize.Net always processes in USD, so the country is empty by default.
                     Authorize.Net always processes in USD. International transactions are converted automatically through banking institutions.
                     */
                     $country_default_by_currency = !$_p["optimizemember_pro_authnet_sp_checkout"]["country"] && $attr["cc"] === "USD" ? "US" : $country_default_by_currency;
                     $country_default_by_currency = !$_p["optimizemember_pro_authnet_sp_checkout"]["country"] && $attr["cc"] === "CAD" ? "CA" : $country_default_by_currency;
                     $country_default_by_currency = !$_p["optimizemember_pro_authnet_sp_checkout"]["country"] && $attr["cc"] === "GBP" ? "GB" : $country_default_by_currency;
                     $country_default_by_currency = apply_filters("ws_plugin__optimizemember_pro_authnet_default_country", false, 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_authnet_sp_checkout"]["country"] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>';
                         }
                     }
                     /*
                     Build the reCaptcha box via JavaScript.
                     */
                     if ($attr["captcha"]) {
                         $captcha = '<div id="s2member-pro-authnet-sp-checkout-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-sp-checkout-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-sp-checkout-form-captcha-section">' . "\n";
                         /**/
                         $captcha .= '<div id="s2member-pro-authnet-sp-checkout-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-sp-checkout-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-sp-checkout-form-captcha-section-title">' . "\n";
                         $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n";
                         $captcha .= '</div>' . "\n";
                         /**/
                         $captcha .= '<div id="s2member-pro-authnet-sp-checkout-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-sp-checkout-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-sp-checkout-form-captcha-div">' . "\n";
                         /**/
                         $captcha .= '<label id="s2member-pro-authnet-sp-checkout-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-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";
                     }
                     /*
                     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="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-sp-checkout-form-div s2member-pro-authnet-form-custom-reg-field-opt-in-div s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-div">' . "\n";
                         /**/
                         $opt_in .= '<label for="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in" id="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-label" class="s2member-pro-authnet-form-custom-reg-field-opt-in-label s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-label">' . "\n";
                         $opt_in .= '<input type="checkbox" name="optimizemember_pro_authnet_sp_checkout[custom_fields][opt_in]" id="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in" class="s2member-pro-authnet-form-custom-reg-field-opt-in s2member-pro-authnet-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_authnet_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";
                     }
                     /*
                     Build the hidden input variables.
                     */
                     $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_sp_checkout[nonce]" id="s2member-pro-authnet-sp-checkout-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-sp-checkout")) . '" />';
                     $hidden_inputs .= !$attr["accept_coupons"] ? '<input type="hidden" id="s2member-pro-authnet-sp-checkout-coupons-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= !c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_tax_may_apply() ? '<input type="hidden" id="s2member-pro-authnet-sp-checkout-tax-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_sp_checkout[attr]" id="s2member-pro-authnet-sp-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
                     /*
                     Get the form template.
                     */
                     $custom_template = file_exists(TEMPLATEPATH . "/authnet-sp-checkout-form.php") ? TEMPLATEPATH . "/authnet-sp-checkout-form.php" : false;
                     $custom_template = file_exists(TEMPLATEPATH . "/authnet-sp-checkout-form.html") ? TEMPLATEPATH . "/authnet-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/authnet-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);
                     /*
                     Fill in the action.
                     */
                     $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code);
                     /*
                     Fill in the response.
                     */
                     $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code);
                     /*
                     Fill in the description.
                     */
                     $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code);
                     /*
                     Fill in the coupon value.
                     */
                     $code = preg_replace("/%%coupon_response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_apply_coupon($attr, $attr["coupon"], "response", array("affiliates-1px-response"))), $code);
                     $code = preg_replace("/%%coupon_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($attr["coupon"])), $code);
                     /*
                     Fill in the registration section.
                     */
                     $code = preg_replace("/%%first_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_sp_checkout"]["first_name"])), $code);
                     $code = preg_replace("/%%last_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_sp_checkout"]["last_name"])), $code);
                     $code = preg_replace("/%%email_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["email"])), $code);
                     /*
                     Fill in the billing method section.
                     */
                     $code = preg_replace("/%%card_type_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($card_type_options), $code);
                     $code = preg_replace("/%%card_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_number"])), $code);
                     $code = preg_replace("/%%card_expiration_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_expiration"])), $code);
                     $code = preg_replace("/%%card_verification_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_verification"])), $code);
                     $code = preg_replace("/%%card_start_date_issue_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_start_date_issue_number"])), $code);
                     /*
                     Fill in the billing address section.
                     */
                     $code = preg_replace("/%%street_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["street"])), $code);
                     $code = preg_replace("/%%city_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["city"])), $code);
                     $code = preg_replace("/%%state_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["state"])), $code);
                     $code = preg_replace("/%%country_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($country_options), $code);
                     $code = preg_replace("/%%zip_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["zip"])), $code);
                     /*
                     Fill the captcha section.
                     */
                     $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code);
                     /*
                     Fill the opt-in box.
                     */
                     $code = preg_replace("/%%opt_in%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($opt_in), $code);
                     /*
                     Fill hidden inputs.
                     */
                     $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code);
                     /**/
                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                     do_action("ws_plugin__optimizemember_pro_during_sc_authnet_sp_form", get_defined_vars());
                     unset($__refs, $__v);
                     /* Unset defined __refs, __v. */
                 } else {
                     $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST));
                     /*
                     Configure internal attributes.
                     */
                     $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"] = $_p["optimizemember_pro_authnet_checkout"]["coupon"] ? $_p["optimizemember_pro_authnet_checkout"]["coupon"] : $attr["coupon"];
                     /*
                     Obtain a possible response and/or validation error.
                     */
                     $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_checkout_response($attr);
                     /*
                     Empty post vars on successful response.
                     */
                     $_p = $response["response"] && !$response["error"] ? array() : $_p;
                     /*
                     Build the list of card type options.
                     */
                     foreach (array("Visa" => _x("Visa", "s2member-front", "s2member"), "MasterCard" => _x("MasterCard", "s2member-front", "s2member"), "Discover" => _x("Discover", "s2member-front", "s2member"), "Amex" => _x("American Express", "s2member-front", "s2member")) as $card_type_v => $card_type_l) {
                         $card_type_options .= '<label for="s2member-pro-authnet-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" id="s2member-pro-authnet-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label" class="s2member-pro-authnet-form-card-type-label s2member-pro-authnet-checkout-form-card-type-label s2member-pro-authnet-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label s2member-pro-authnet-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label' . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled' : '') . '">' . "\n" . '<input type="radio" aria-required="true" name="optimizemember_pro_authnet_checkout[card_type]" id="s2member-pro-authnet-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" class="s2member-pro-authnet-card-type-' . esc_attr(strtolower($card_type_v)) . ' s2member-pro-authnet-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" value="' . esc_attr($card_type_v) . '"' . (!empty($_p["optimizemember_pro_authnet_checkout"]["card_type"]) && in_array(strtolower($_p["optimizemember_pro_authnet_checkout"]["card_type"]), $attr["accept"]) && $_p["optimizemember_pro_authnet_checkout"]["card_type"] === $card_type_v ? ' checked="checked"' : '') . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled="disabled"' : '') . ' tabindex="200" />' . "\n" . '</label>';
                     }
                     /*
                     Build the list of country code options.
                     $country_default_by_currency = false. Authorize.Net always processes in USD, so the country is empty by default.
                     Authorize.Net always processes in USD. International transactions are converted automatically through banking institutions.
                     */
                     $country_default_by_currency = !$_p["optimizemember_pro_authnet_checkout"]["country"] && $attr["cc"] === "USD" ? "US" : $country_default_by_currency;
                     $country_default_by_currency = !$_p["optimizemember_pro_authnet_checkout"]["country"] && $attr["cc"] === "CAD" ? "CA" : $country_default_by_currency;
                     $country_default_by_currency = !$_p["optimizemember_pro_authnet_checkout"]["country"] && $attr["cc"] === "GBP" ? "GB" : $country_default_by_currency;
                     $country_default_by_currency = apply_filters("ws_plugin__optimizemember_pro_authnet_default_country", false, 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_authnet_checkout"]["country"] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>';
                         }
                     }
                     /*
                     Build all of the 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="s2member-pro-authnet-checkout-form-custom-fields-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-checkout-form-section s2member-pro-authnet-form-custom-fields-section s2member-pro-authnet-checkout-form-custom-fields-section">' . "\n";
                             /**/
                             $custom_fields .= '<div id="s2member-pro-authnet-checkout-form-custom-fields-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-checkout-form-section-title s2member-pro-authnet-form-custom-fields-section-title s2member-pro-authnet-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="s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-custom-reg-field-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . '">' . (!empty($field["sectitle"]) ? $field["sectitle"] : '') . '</div>';
                                     }
                                     /**/
                                     $custom_fields .= '<div id="s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-div s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-div">' . "\n";
                                     /**/
                                     $custom_fields .= '<label for="s2member-pro-authnet-checkout-custom-reg-field-' . esc_attr($field_id_class) . '" id="s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-label" class="s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-label s2member-pro-authnet-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_authnet_checkout[custom_fields][", "s2member-pro-authnet-checkout-custom-reg-field-", "s2member-pro-authnet-custom-reg-field-" . $field_id_class . " s2member-pro-authnet-checkout-custom-reg-field-" . $field_id_class, "", $tabindex = $tabindex + 1, "", $_p, $_p["optimizemember_pro_authnet_checkout"]["custom_fields"][$field_var], "registration");
                                     /**/
                                     $custom_fields .= '</div>' . "\n";
                                 }
                             }
                             /**/
                             $custom_fields .= '</div>' . "\n";
                         }
                     }
                     /*
                     Build the reCaptcha box via JavaScript.
                     */
                     if ($attr["captcha"]) {
                         $captcha = '<div id="s2member-pro-authnet-checkout-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-checkout-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-checkout-form-captcha-section">' . "\n";
                         /**/
                         $captcha .= '<div id="s2member-pro-authnet-checkout-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-checkout-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-checkout-form-captcha-section-title">' . "\n";
                         $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n";
                         $captcha .= '</div>' . "\n";
                         /**/
                         $captcha .= '<div id="s2member-pro-authnet-checkout-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-checkout-form-captcha-div">' . "\n";
                         /**/
                         $captcha .= '<label id="s2member-pro-authnet-checkout-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-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";
                     }
                     /*
                     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="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-custom-reg-field-opt-in-div s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-div">' . "\n";
                         /**/
                         $opt_in .= '<label for="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in" id="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-label" class="s2member-pro-authnet-form-custom-reg-field-opt-in-label s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-label">' . "\n";
                         $opt_in .= '<input type="checkbox" name="optimizemember_pro_authnet_checkout[custom_fields][opt_in]" id="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in" class="s2member-pro-authnet-form-custom-reg-field-opt-in s2member-pro-authnet-checkout-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] == 1 || $_p["optimizemember_pro_authnet_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";
                     }
                     /*
                     Build the hidden input variables.
                     */
                     $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_checkout[nonce]" id="s2member-pro-authnet-checkout-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-checkout")) . '" />';
                     $hidden_inputs .= !$attr["accept_coupons"] ? '<input type="hidden" id="s2member-pro-authnet-checkout-coupons-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_password"] ? '<input type="hidden" id="s2member-pro-authnet-checkout-password-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= !c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_tax_may_apply() ? '<input type="hidden" id="s2member-pro-authnet-checkout-tax-not-required-or-not-possible" value="1" />' : '';
                     $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_checkout[attr]" id="s2member-pro-authnet-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />';
                     /*
                     Get the form template.
                     */
                     $custom_template = file_exists(TEMPLATEPATH . "/authnet-checkout-form.php") ? TEMPLATEPATH . "/authnet-checkout-form.php" : false;
                     $custom_template = file_exists(TEMPLATEPATH . "/authnet-checkout-form.html") ? TEMPLATEPATH . "/authnet-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/authnet-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);
                     /*
                     Fill in the action.
                     */
                     $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code);
                     /*
                     Fill in the response.
                     */
                     $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code);
                     /*
                     Fill in the description.
                     */
                     $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code);
                     /*
                     Fill in the coupon value.
                     */
                     $code = preg_replace("/%%coupon_response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_apply_coupon($attr, $attr["coupon"], "response", array("affiliates-1px-response"))), $code);
                     $code = preg_replace("/%%coupon_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($attr["coupon"])), $code);
                     /*
                     Fill in the registration section.
                     */
                     $code = preg_replace("/%%first_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_checkout"]["first_name"])), $code);
                     $code = preg_replace("/%%last_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_checkout"]["last_name"])), $code);
                     $code = preg_replace("/%%email_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["email"])), $code);
                     $code = preg_replace("/%%username_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["username"])), $code);
                     $code = preg_replace("/%%password1_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["password1"])), $code);
                     $code = preg_replace("/%%password2_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["password2"])), $code);
                     /*
                     Fill in the custom fields section.
                     */
                     $code = preg_replace("/%%custom_fields%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($custom_fields), $code);
                     /*
                     Fill in the billing method section.
                     */
                     $code = preg_replace("/%%card_type_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($card_type_options), $code);
                     $code = preg_replace("/%%card_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_number"])), $code);
                     $code = preg_replace("/%%card_expiration_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_expiration"])), $code);
                     $code = preg_replace("/%%card_verification_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_verification"])), $code);
                     $code = preg_replace("/%%card_start_date_issue_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_start_date_issue_number"])), $code);
                     /*
                     Fill in the billing address section.
                     */
                     $code = preg_replace("/%%street_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["street"])), $code);
                     $code = preg_replace("/%%city_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["city"])), $code);
                     $code = preg_replace("/%%state_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["state"])), $code);
                     $code = preg_replace("/%%country_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($country_options), $code);
                     $code = preg_replace("/%%zip_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["zip"])), $code);
                     /*
                     Fill the captcha section.
                     */
                     $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code);
                     /*
                     Fill the opt-in box.
                     */
                     $code = preg_replace("/%%opt_in%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($opt_in), $code);
                     /*
                     Fill hidden inputs.
                     */
                     $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code);
                     /*
                      * Custom button
                      */
                     if (!empty($content)) {
                         $code = preg_replace('/%%button_markup%%/', $content, $code);
                     } else {
                         $code = preg_replace("/%%button_markup%%/", sprintf('<input type="submit" id="s2member-pro-authnet-checkout-submit" class="s2member-pro-authnet-submit s2member-pro-authnet-checkout-submit" value="%s" tabindex="600" />', esc_attr(_x("Submit Form", "s2member-front", "s2member"))), $code);
                     }
                     /**/
                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                     $attr["modify"] ? do_action("ws_plugin__optimizemember_pro_during_sc_authnet_modification_form", get_defined_vars()) : do_action("ws_plugin__optimizemember_pro_during_sc_authnet_form", get_defined_vars());
                     unset($__refs, $__v);
                     /* Unset defined __refs, __v. */
                 }
             }
         }
     }
     /**/
     $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code);
     return apply_filters("ws_plugin__optimizemember_pro_sc_authnet_form", $code, get_defined_vars());
 }
 /**
  * Shortcode `[optimizeMember-Pro-Google-Button /]`.
  *
  * @package optimizeMember\Google
  * @since 1.5
  *
  * @attaches-to ``add_shortcode("optimizeMember-Pro-Google-Button");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str The resulting Google Button Code, HTML markup.
  */
 public static function sc_google_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     c_ws_plugin__optimizemember_no_cache::no_cache_constants(true);
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /**/
     $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"]);
     $attr["rt"] = strtoupper($attr["rt"]);
     $attr["rr"] = strtoupper($attr["rr"]);
     $attr["ccaps"] = strtolower($attr["ccaps"]);
     $attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"];
     $attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"];
     $attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"];
     /**/
     if ($attr["modify"] || $attr["cancel"]) {
         $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/google-edit-button.png";
         /**/
         $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-cancellation-button.php")));
         $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
         $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
         /**/
         $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
         /**/
         $code = $attr["output"] === "anchor" ? $code : $code;
         if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
             $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
         }
         /**/
         unset($href, $url, $m);
     } else {
         if ($attr["sp"]) {
             $default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"]) . "&amp;w=180&amp;h=46&amp;style=trans&amp;variant=text&amp;loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member"));
             /**/
             $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-sp-checkout-button.php")));
             $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
             $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
             /**/
             foreach ($attr as $key => $val) {
                 $code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($val)), $code);
             }
             /**/
             if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) {
                 $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code);
             }
             /**/
             $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
             /**/
             $code = $attr["output"] === "anchor" ? $code : $code;
             if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
                 $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
             }
             /**/
             unset($href, $url, $m);
         } else {
             if ($attr["level"] === "*") {
                 $default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"]) . "&amp;w=180&amp;h=46&amp;style=trans&amp;variant=text&amp;loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member"));
                 /**/
                 $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-ccaps-checkout-button.php")));
                 $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
                 /**/
                 foreach ($attr as $key => $val) {
                     $code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($val)), $code);
                 }
                 /**/
                 if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) {
                     $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code);
                 }
                 /**/
                 $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                 /**/
                 $code = $attr["output"] === "anchor" ? $code : $code;
                 if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
                     $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
                 }
                 /**/
                 unset($href, $url, $m);
             } else {
                 $default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"]) . "&amp;w=180&amp;h=46&amp;style=trans&amp;variant=text&amp;loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member"));
                 /**/
                 $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-checkout-button.php")));
                 /*
                  * Custom button
                  */
                 if (!empty($content)) {
                     $code = preg_replace('/%%button_markup%%/', $content, $code);
                     $code = preg_replace('/%%url%%/', '%%wpurl%%/?optimizemember_pro_google_co=1&amp;co[level]=%%level%%&amp;co[ccaps]=%%ccaps%%&amp;co[desc]=%%desc%%&amp;co[cc]=%%cc%%&amp;co[custom]=%%custom%%&amp;co[ta]=%%ta%%&amp;co[tp]=%%tp%%&amp;co[tt]=%%tt%%&amp;co[ra]=%%ra%%&amp;co[rp]=%%rp%%&amp;co[rt]=%%rt%%&amp;co[rr]=%%rr%%&amp;co[image]=%%image%%&amp;co[output]=%%output%%', $code);
                 } else {
                     $code = preg_replace("/%%button_markup%%/", '<a href="%%wpurl%%/?optimizemember_pro_google_co=1&amp;co[level]=%%level%%&amp;co[ccaps]=%%ccaps%%&amp;co[desc]=%%desc%%&amp;co[cc]=%%cc%%&amp;co[custom]=%%custom%%&amp;co[ta]=%%ta%%&amp;co[tp]=%%tp%%&amp;co[tt]=%%tt%%&amp;co[ra]=%%ra%%&amp;co[rp]=%%rp%%&amp;co[rt]=%%rt%%&amp;co[rr]=%%rr%%&amp;co[image]=%%image%%&amp;co[output]=%%output%%"><img src="https://checkout.google.com/buttons/checkout.gif?w=180&amp;h=46&amp;style=trans&amp;variant=text&amp;loc=' . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member")) . '" style="width:auto; height:auto; border:0;" alt="Google" /></a>', $code);
                 }
                 $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
                 /**/
                 foreach ($attr as $key => $val) {
                     $code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($val)), $code);
                 }
                 /**/
                 if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) {
                     $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code);
                 }
                 /*
                  * Only when there is no custom button
                  */
                 if (empty($content)) {
                     $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                 }
                 /**/
                 $code = $attr["output"] === "anchor" ? $code : $code;
                 if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
                     $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
                 }
                 /**/
                 unset($href, $url, $m);
             }
         }
     }
     /**/
     $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code);
     return $code;
 }
 /**
  * optimizeMember's PayPal Auto-Return/PDT handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link optimizeMember\PayPal\c_ws_plugin__optimizemember_paypal_return_in::paypal_return()}.
  * @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"]["sp_access_item_number_regex"], $paypal["item_number"])) && (empty($paypal["payment_status"]) || empty($payment_status_issues) || !preg_match($payment_status_issues, $paypal["payment_status"])) && !empty($paypal["txn_id"])) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_return_before_sp_access", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         if (!get_transient($transient_rtn = "s2m_rtn_" . md5("optimizemember_transient_" . $_paypal_s)) && set_transient($transient_rtn, time(), 31556926 * 10)) {
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept` ) for Specific Post/Page Access.";
             /**/
             list(, $paypal["sp_ids"], $paypal["hours"]) = preg_split("/\\:/", $paypal["item_number"], 3);
             /**/
             $paypal["ip"] = preg_match("/ip address/i", $paypal["option_name2"]) && $paypal["option_selection2"] ? $paypal["option_selection2"] : "";
             $paypal["ip"] = !$paypal["ip"] && preg_match("/^[a-z0-9]+~[0-9\\.]+\$/i", $paypal["invoice"]) ? preg_replace("/^[a-z0-9]+~/i", "", $paypal["invoice"]) : $paypal["ip"];
             $paypal["ip"] = !$paypal["ip"] && $_SERVER["REMOTE_ADDR"] ? $_SERVER["REMOTE_ADDR"] : $paypal["ip"];
             /**/
             if ($sp_access_url = c_ws_plugin__optimizemember_sp_access::sp_access_link_gen($paypal["sp_ids"], $paypal["hours"], false)) {
                 $processing = $during = true;
                 /* Yes, we ARE processing this. */
                 /**/
                 setcookie("optimizemember_sp_tracking", $optimizemember_sp_tracking = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["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);
                 /**/
                 $paypal["optimizemember_log"][] = "Transient Tracking Cookie set on ( `web_accept` ) for Specific Post/Page Access.";
                 /**/
                 if ($processing && ($code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_tracking_codes"]) && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                     if (($code = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $code)) && ($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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $code)) {
                                             /**/
                                             if ($code = trim(preg_replace("/%%(.+?)%%/i", "", $code))) {
                                                 $paypal["optimizemember_log"][] = "Storing Specific Post/Page Tracking Codes into a Transient Queue. These will be processed on-site.";
                                                 set_transient("s2m_" . md5("optimizemember_transient_sp_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_return_during_sp_access", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
                 /**/
                 if (apply_filters("ws_plugin__optimizemember_immediate_sp_access_redirection", false, get_defined_vars())) {
                     $paypal["optimizemember_log"][] = "Redirecting Customer immediately to the Specific Post/Page.";
                     /**/
                     wp_redirect($sp_access_url);
                     /* Immediate redirection to Specific Post/Page. */
                 } else {
                     if ($custom_success_redirection) {
                         $paypal["optimizemember_log"][] = "Redirecting Customer to a custom URL on success: " . $custom_success_redirection;
                         /**/
                         wp_redirect($custom_success_redirection);
                     } else {
                         $paypal["optimizemember_log"][] = "Redirecting Customer to the Specific Post/Page.";
                         /**/
                         echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank You! Your transaction has been approved.</strong>', "s2member-front", "s2member"), _x("Continue ( Click Here )", "s2member-front", "s2member"), $sp_access_url);
                     }
                 }
             } else {
                 $paypal["optimizemember_log"][] = "Unable to generate Specific Post/Page Access Link. Does your Leading Post/Page still exist?";
                 /**/
                 $paypal["optimizemember_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
                 /**/
                 echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to generate Access Link.<br />Please contact Support for assistance.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
             }
         } else {
             $paypal["optimizemember_log"][] = "Page Expired. Duplicate Return-Data.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept` ) for Specific Post/Page Access.";
             $paypal["optimizemember_log"][] = "Page Expired. Redirecting Customer to the Home Page.";
             /**/
             echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Page Expired:</strong> Duplicate Return-Data.<br />Please contact Support if you need any assistance.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
         }
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_return_after_sp_access", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_return_in_web_accept_sp", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_return_in_web_accept_sp", false, get_defined_vars());
     }
 }
 /**
  * optimizeMember's PayPal IPN handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @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("/^new_case\$/i", $paypal["txn_type"]) && !empty($paypal["case_type"]) && preg_match("/^chargeback\$/i", $paypal["case_type"]) || !empty($paypal["payment_status"]) && preg_match("/^(refunded|reversed|reversal)\$/i", $paypal["payment_status"])) && ((!empty($paypal["item_number"]) || ($paypal["item_number"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_number($paypal))) && preg_match($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["sp_access_item_number_regex"], $paypal["item_number"])) && (!empty($paypal["item_name"]) || ($paypal["item_name"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_name($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"])) && !empty($paypal["payer_email"]) && !empty($paypal["parent_txn_id"])) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_notify_before_sp_refund_reversal", 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 ( `[empty or irrelevant]` ) w/ `payment_status` ( `refunded|reversed|reversal` ) - or - `new_case` w/ `case_type` ( `chargeback` ).";
             /**/
             $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"];
             /**/
             $processing = $during = true;
             /* Yes, we ARE processing this. */
             /*
             Refunds and chargeback reversals. This is excluded from the processing check.
             In other words, optimizeMember sends `Refund/Reversal` Notifications ANYTIME a Refund/Reversal occurs; even if optimizeMember did not process it otherwise.
             Since this routine ignores the processing check, it is *possible* that Refund/Reversal Notification URLs will be contacted more than once.
             	If you're writing scripts that depend on Refund/Reversal Notifications, please keep this in mind.
             */
             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_ref_rev_notification_urls"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                 foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_ref_rev_notification_urls"]) as $url) {
                     /**/
                     if (($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace("/%%parent_txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["parent_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("/%%-amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["mc_gross"])), $url)) && ($url = preg_replace("/%%-fee%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["mc_fee"])), $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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["ip"])), $url)) {
                                                 /**/
                                                 if ($url = trim(preg_replace("/%%(.+?)%%/i", "", $url))) {
                                                     c_ws_plugin__optimizemember_utils_urls::remote($url);
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 /**/
                 $paypal["optimizemember_log"][] = "Specific Post/Page ~ Refund/Reversal Notification URLs have been processed.";
             }
             /**/
             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_ref_rev_notification_recipients"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                 $msg = $sbj = "( optimizeMember / API Notification Email ) - Specific Post/Page ~ Refund/Reversal";
                 $msg .= "\n\n";
                 /* Spacing in the message body. */
                 /**/
                 $msg .= "parent_txn_id: %%parent_txn_id%%\n";
                 $msg .= "item_number: %%item_number%%\n";
                 $msg .= "item_name: %%item_name%%\n";
                 $msg .= "-amount: %%-amount%%\n";
                 $msg .= "-fee: %%-fee%%\n";
                 $msg .= "first_name: %%first_name%%\n";
                 $msg .= "last_name: %%last_name%%\n";
                 $msg .= "full_name: %%full_name%%\n";
                 $msg .= "payer_email: %%payer_email%%\n";
                 $msg .= "user_ip: %%user_ip%%\n";
                 /**/
                 $msg .= "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("/%%parent_txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["parent_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("/%%-amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_gross"]), $msg)) && ($msg = preg_replace("/%%-fee%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_fee"]), $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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $msg)) {
                                             /**/
                                             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"]["sp_ref_rev_notification_recipients"]) as $recipient) {
                                                     wp_mail($recipient, apply_filters("ws_plugin__optimizemember_sp_ref_rev_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_sp_ref_rev_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 /**/
                 $paypal["optimizemember_log"][] = "Specific Post/Page ~ Refund/Reversal Notification Emails have been processed.";
             }
             /**/
             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
             do_action("ws_plugin__optimizemember_during_paypal_notify_during_sp_refund_reversal", get_defined_vars());
             unset($__refs, $__v);
             /* Unset defined __refs, __v. */
         } else {
             $paypal["optimizemember_log"][] = "Not processing. Duplicate IPN.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `[empty or irrelevant]` ) w/ `payment_status` ( `refunded|reversed|reversal` ) - or - `new_case` w/ `case_type` ( `chargeback` ).";
             $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_sp_refund_reversal", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_sp_refund_reversal", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_sp_refund_reversal", false, get_defined_vars());
     }
 }
Beispiel #8
0
 /**
  * Handles new User/Member notifications.
  *
  * @package optimizeMember\Email_Configs
  * @since 110707
  *
  * @param str|int $user_id A numeric WordPress User ID.
  * @param str $user_pass Optional. A plain text version of the User's password.
  * 	If omitted, only the administrative notification will be sent.
  * @param array $notify An array of directives. Must be non-empty, with at least one of these values `user,admin`.
  * @return bool True if all required parameters are supplied, else false.
  */
 public static function new_user_notification($user_id = FALSE, $user_pass = FALSE, $notify = array("user", "admin"))
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_new_user_notification", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($user_id && ($user = new WP_User($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && is_array($notify) && !empty($notify)) {
         $email_configs_were_on = c_ws_plugin__optimizemember_email_configs::email_config_status();
         c_ws_plugin__optimizemember_email_configs::email_config_release();
         /**/
         if (in_array("user", $notify) && $user_pass) {
             $fields = get_user_option("optimizemember_custom_fields", $user_id);
             $cv = preg_split("/\\|/", get_user_option("optimizemember_custom", $user_id));
             $user_full_name = trim($user->first_name . " " . $user->last_name);
             $user_ip = $_SERVER["REMOTE_ADDR"];
             /**/
             if ($sbj = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_email_subject"]) {
                 if ($sbj = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)) {
                     if ($sbj = preg_replace("/%%wp_login_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(wp_login_url()), $sbj)) {
                         if ($sbj = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->first_name), $sbj)) {
                             if ($sbj = preg_replace("/%%user_last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->last_name), $sbj)) {
                                 if ($sbj = preg_replace("/%%user_full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_full_name), $sbj)) {
                                     if ($sbj = preg_replace("/%%user_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_email), $sbj)) {
                                         if ($sbj = preg_replace("/%%user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_login), $sbj)) {
                                             if ($sbj = preg_replace("/%%user_pass%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_pass), $sbj)) {
                                                 if ($sbj = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_ip), $sbj)) {
                                                     if ($sbj = preg_replace("/%%user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_id), $sbj)) {
                                                         if (is_array($fields) && !empty($fields)) {
                                                             foreach ($fields as $var => $val) {
                                                                 /* Custom Registration/Profile Fields. */
                                                                 if (!($sbj = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(maybe_serialize($val)), $sbj))) {
                                                                     break;
                                                                 }
                                                             }
                                                         }
                                                         /**/
                                                         if ($msg = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_email_message"]) {
                                                             if ($msg = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) {
                                                                 if ($msg = preg_replace("/%%wp_login_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(wp_login_url()), $msg)) {
                                                                     if ($msg = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->first_name), $msg)) {
                                                                         if ($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($user_full_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_pass%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_pass), $msg)) {
                                                                                             if ($msg = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_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 = trim(preg_replace("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim(preg_replace("/%%(.+?)%%/i", "", $msg)))) {
                                                                                                         /* Still have a ``$sbj`` and a ``$msg``? */
                                                                                                         /**/
                                                                                                         c_ws_plugin__optimizemember_email_configs::email_config() . wp_mail($user->user_email, $sbj, $msg, "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();
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         /**/
         if (in_array("admin", $notify)) {
             /* Send Admin(s) a notification? */
             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_admin_email_recipients"]) {
                 $fields = get_user_option("optimizemember_custom_fields", $user_id);
                 $cv = preg_split("/\\|/", get_user_option("optimizemember_custom", $user_id));
                 $user_full_name = trim($user->first_name . " " . $user->last_name);
                 $user_ip = $_SERVER["REMOTE_ADDR"];
                 /**/
                 if ($rec = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_admin_email_recipients"]) {
                     if ($rec = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $rec)) {
                         if ($rec = preg_replace("/%%wp_login_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(wp_login_url()), $rec)) {
                             if ($rec = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_dq(c_ws_plugin__optimizemember_utils_strings::esc_ds($user->first_name)), $rec)) {
                                 if ($rec = preg_replace("/%%user_last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_dq(c_ws_plugin__optimizemember_utils_strings::esc_ds($user->last_name)), $rec)) {
                                     if ($rec = preg_replace("/%%user_full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_dq(c_ws_plugin__optimizemember_utils_strings::esc_ds($user_full_name)), $rec)) {
                                         if ($rec = preg_replace("/%%user_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_email), $rec)) {
                                             if ($rec = preg_replace("/%%user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_login), $rec)) {
                                                 if ($rec = preg_replace("/%%user_pass%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_pass), $rec)) {
                                                     if ($rec = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_ip), $rec)) {
                                                         if ($rec = preg_replace("/%%user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_id), $rec)) {
                                                             if (is_array($fields) && !empty($fields)) {
                                                                 foreach ($fields as $var => $val) {
                                                                     /* Custom Registration/Profile Fields. */
                                                                     if (!($rec = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(maybe_serialize($val)), $rec))) {
                                                                         break;
                                                                     }
                                                                 }
                                                             }
                                                             /**/
                                                             if ($sbj = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_admin_email_subject"]) {
                                                                 if ($sbj = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)) {
                                                                     if ($sbj = preg_replace("/%%wp_login_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(wp_login_url()), $sbj)) {
                                                                         if ($sbj = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->first_name), $sbj)) {
                                                                             if ($sbj = preg_replace("/%%user_last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->last_name), $sbj)) {
                                                                                 if ($sbj = preg_replace("/%%user_full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_full_name), $sbj)) {
                                                                                     if ($sbj = preg_replace("/%%user_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_email), $sbj)) {
                                                                                         if ($sbj = preg_replace("/%%user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->user_login), $sbj)) {
                                                                                             if ($sbj = preg_replace("/%%user_pass%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_pass), $sbj)) {
                                                                                                 if ($sbj = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_ip), $sbj)) {
                                                                                                     if ($sbj = preg_replace("/%%user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_id), $sbj)) {
                                                                                                         if (is_array($fields) && !empty($fields)) {
                                                                                                             foreach ($fields as $var => $val) {
                                                                                                                 /* Custom Registration/Profile Fields. */
                                                                                                                 if (!($sbj = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(maybe_serialize($val)), $sbj))) {
                                                                                                                     break;
                                                                                                                 }
                                                                                                             }
                                                                                                         }
                                                                                                         /**/
                                                                                                         if ($msg = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_admin_email_message"]) {
                                                                                                             if ($msg = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) {
                                                                                                                 if ($msg = preg_replace("/%%wp_login_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(wp_login_url()), $msg)) {
                                                                                                                     if ($msg = preg_replace("/%%user_first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user->first_name), $msg)) {
                                                                                                                         if ($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($user_full_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_pass%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_pass), $msg)) {
                                                                                                                                             if ($msg = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_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 (($rec = trim(preg_replace("/%%(.+?)%%/i", "", $rec))) && ($sbj = trim(preg_replace("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim(preg_replace("/%%(.+?)%%/i", "", $msg)))) {
                                                                                                                                                         foreach (c_ws_plugin__optimizemember_utils_strings::parse_emails($rec) as $recipient) {
                                                                                                                                                             /* A possible list of recipients. */
                                                                                                                                                             wp_mail($recipient, $sbj, $msg, "Content-Type: text/plain; charset=utf-8");
                                                                                                                                                         }
                                                                                                                                                     }
                                                                                                                                                 }
                                                                                                                                             }
                                                                                                                                         }
                                                                                                                                     }
                                                                                                                                 }
                                                                                                                             }
                                                                                                                         }
                                                                                                                     }
                                                                                                                 }
                                                                                                             }
                                                                                                         }
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         /**/
         if ($email_configs_were_on) {
             /* Back on? */
             c_ws_plugin__optimizemember_email_configs::email_config();
         }
         /**/
         return apply_filters("ws_plugin__optimizemember_new_user_notification", true, get_defined_vars());
     } else {
         return apply_filters("ws_plugin__optimizemember_new_user_notification", false, get_defined_vars());
     }
 }
 /**
  * Handles User removals/deletions.
  *
  * @package optimizeMember\User_Deletions
  * @since 3.5
  *
  * @attaches-to ``add_action("delete_user");``
  * @attaches-to ``add_action("wpmu_delete_user");``
  *
  * @param int|str $user_id Numeric WordPress User ID.
  * @return null
  */
 public static function handle_user_deletions($user_id = FALSE)
 {
     static $processed = array();
     /* No duplicate processing. */
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_handle_user_deletions", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if (empty($processed[$user_id]) && ($processed[$user_id] = true)) {
         $eot_del_type = !empty($GLOBALS["ws_plugin__optimizemember_eot_del_type"]) ? $GLOBALS["ws_plugin__optimizemember_eot_del_type"] : "user-removal-deletion";
         /* Else use default. */
         /**/
         $custom = get_user_option("optimizemember_custom", $user_id);
         /* An EOT Notification is triggered, EVEN if empty. */
         $subscr_id = get_user_option("optimizemember_subscr_id", $user_id);
         /* And also, EVEN if this is empty. */
         $fields = get_user_option("optimizemember_custom_fields", $user_id);
         /* Used in API Notifications. */
         $user_reg_ip = get_user_option("optimizemember_registration_ip", $user_id);
         /* In API Notifications. */
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_handle_user_before_deletions", get_defined_vars());
         do_action("ws_plugin__optimizemember_during_collective_eots", $user_id, get_defined_vars(), $eot_del_type, "removal-deletion");
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         delete_user_option($user_id, "optimizemember_custom");
         /* Remove User options ( for this Blog ). */
         delete_user_option($user_id, "optimizemember_subscr_id");
         delete_user_option($user_id, "optimizemember_subscr_gateway");
         /**/
         delete_user_option($user_id, "optimizemember_custom_fields");
         delete_user_option($user_id, "optimizemember_registration_ip");
         /**/
         delete_user_option($user_id, "optimizemember_ipn_signup_vars");
         delete_user_option($user_id, "optimizemember_paid_registration_times");
         delete_user_option($user_id, "optimizemember_capability_times");
         delete_user_option($user_id, "optimizemember_sp_references");
         /**/
         delete_user_option($user_id, "optimizemember_last_status_scan");
         delete_user_option($user_id, "optimizemember_first_payment_txn_id");
         delete_user_option($user_id, "optimizemember_last_payment_time");
         delete_user_option($user_id, "optimizemember_auto_eot_time");
         /**/
         delete_user_option($user_id, "optimizemember_file_download_access_arc");
         delete_user_option($user_id, "optimizemember_file_download_access_log");
         /**/
         delete_user_option($user_id, "optimizemember_login_counter");
         delete_user_option($user_id, "optimizemember_notes");
         /**/
         if (is_object($user = new WP_User($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_urls"] && is_array($cv = preg_split("/\\|/", $custom))) {
             foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_urls"]) as $url) {
                 /* Handle EOT Notifications on user deletion. */
                 /**/
                 if (($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace("/%%eot_del_type%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($eot_del_type)), $url)) && ($url = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($subscr_id)), $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);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         /**/
         if (is_object($user = new WP_User($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_recipients"] && is_array($cv = preg_split("/\\|/", $custom))) {
             $email_configs_were_on = c_ws_plugin__optimizemember_email_configs::email_config_status();
             c_ws_plugin__optimizemember_email_configs::email_config_release();
             /**/
             $msg = $sbj = "( optimizeMember / API Notification Email ) - EOT/Deletion";
             $msg .= "\n\n";
             /* Spacing in the message body. */
             /**/
             $msg .= "eot_del_type: %%eot_del_type%%\n";
             $msg .= "subscr_id: %%subscr_id%%\n";
             $msg .= "user_first_name: %%user_first_name%%\n";
             $msg .= "user_last_name: %%user_last_name%%\n";
             $msg .= "user_full_name: %%user_full_name%%\n";
             $msg .= "user_email: %%user_email%%\n";
             $msg .= "user_login: %%user_login%%\n";
             $msg .= "user_ip: %%user_ip%%\n";
             $msg .= "user_id: %%user_id%%\n";
             /**/
             if (is_array($fields) && !empty($fields)) {
                 foreach ($fields as $var => $val) {
                     $msg .= $var . ": %%" . $var . "%%\n";
                 }
             }
             /**/
             $msg .= "cv0: %%cv0%%\n";
             $msg .= "cv1: %%cv1%%\n";
             $msg .= "cv2: %%cv2%%\n";
             $msg .= "cv3: %%cv3%%\n";
             $msg .= "cv4: %%cv4%%\n";
             $msg .= "cv5: %%cv5%%\n";
             $msg .= "cv6: %%cv6%%\n";
             $msg .= "cv7: %%cv7%%\n";
             $msg .= "cv8: %%cv8%%\n";
             $msg .= "cv9: %%cv9%%";
             /**/
             if (($msg = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace("/%%eot_del_type%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($eot_del_type), $msg)) && ($msg = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($subscr_id), $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"]["eot_del_notification_recipients"]) as $recipient) {
                                                 wp_mail($recipient, apply_filters("ws_plugin__optimizemember_eot_del_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_eot_del_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             /**/
             if ($email_configs_were_on) {
                 /* Back on? */
                 c_ws_plugin__optimizemember_email_configs::email_config();
             }
         }
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_handle_user_deletions", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
     }
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_after_handle_user_deletions", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     return;
     /* Return for uniformity. */
 }
 /**
  * Shortcode `[optimizeMember-Pro-AliPay-Button /]`.
  *
  * @package optimizeMember\AliPay
  * @since 1.5
  *
  * @attaches-to ``add_shortcode("optimizeMember-Pro-AliPay-Button");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str The resulting AliPay Button Code, HTML markup.
  */
 public static function sc_alipay_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     c_ws_plugin__optimizemember_no_cache::no_cache_constants(true);
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /**/
     $attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "custom" => $_SERVER["HTTP_HOST"], "ra" => "0.01", "rp" => "1", "rt" => "M", "sp" => "0", "success" => "", "image" => "default", "output" => "anchor"), $attr);
     /**/
     $attr["rt"] = strtoupper($attr["rt"]);
     $attr["ccaps"] = strtolower($attr["ccaps"]);
     $attr["success"] = str_ireplace(array("&#038;", "&amp;"), "&", $attr["success"]);
     /**/
     if ($attr["sp"]) {
         $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/alipay-button.gif";
         /**/
         $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
         /**/
         $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/alipay-sp-checkout-button.php")));
         $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
         $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
         /**/
         $vars = array("service" => "create_direct_pay_by_user", "payment_type" => 1, "partner" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_partner_id"], "seller_email" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_seller_email"], "subject" => $_SERVER["HTTP_HOST"], "body" => $attr["desc"], "out_trade_no" => uniqid() . "~" . $attr["sp_ids_exp"] . (($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "~" . $referencing : "~") . "~" . $_SERVER["REMOTE_ADDR"], "extra_common_param" => $attr["custom"], "total_fee" => $attr["ra"], "paymethod" => "directPay", "show_url" => home_url("/"), "return_url" => $attr["success"] ? $attr["success"] : site_url("/?optimizemember_pro_alipay_return=1"), "notify_url" => site_url("/"));
         /**/
         $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_alipay_utilities::alipay_link_gen($vars))), $code);
         /**/
         $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
         /**/
         $code = $attr["output"] === "anchor" ? $code : $code;
         $code = $attr["output"] === "url" ? $url : $code;
         /**/
         unset($href, $url, $m);
     } else {
         if ($attr["level"] === "*") {
             $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/alipay-button.gif";
             /**/
             $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"], ":");
             /**/
             $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/alipay-ccaps-checkout-button.php")));
             $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
             $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
             /**/
             $vars = array("service" => "create_direct_pay_by_user", "payment_type" => 1, "partner" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_partner_id"], "seller_email" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_seller_email"], "subject" => $_SERVER["HTTP_HOST"], "body" => $attr["desc"], "out_trade_no" => uniqid() . "~" . $attr["level_ccaps_eotper"] . (($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "~" . $referencing : "~") . "~" . $_SERVER["REMOTE_ADDR"], "extra_common_param" => $attr["custom"], "total_fee" => $attr["ra"], "paymethod" => "directPay", "show_url" => home_url("/"), "return_url" => $attr["success"] && !$referencing ? $attr["success"] : site_url("/?optimizemember_pro_alipay_return=1"), "notify_url" => site_url("/"));
             /**/
             $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_alipay_utilities::alipay_link_gen($vars))), $code);
             /**/
             $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
             /**/
             $code = $attr["output"] === "anchor" ? $code : $code;
             $code = $attr["output"] === "url" ? $url : $code;
             /**/
             unset($href, $url, $m);
         } else {
             $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/alipay-button.gif";
             /**/
             $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"], ":");
             /**/
             $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/alipay-checkout-button.php")));
             /*
              * Custom button
              */
             if (!empty($content)) {
                 $code = preg_replace('/%%button_markup%%/', $content, $code);
             } else {
                 $code = preg_replace("/%%button_markup%%/", '<a href="%%url%%"><img src="%%images%%/alipay-button.gif" style="width:auto; height:auto; border:0;" alt="AliPay" /></a>', $code);
             }
             $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
             $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
             /**/
             $vars = array("service" => "create_direct_pay_by_user", "payment_type" => 1, "partner" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_partner_id"], "seller_email" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_seller_email"], "subject" => $_SERVER["HTTP_HOST"], "body" => $attr["desc"], "out_trade_no" => uniqid() . "~" . $attr["level_ccaps_eotper"] . (($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "~" . $referencing : "~") . "~" . $_SERVER["REMOTE_ADDR"], "extra_common_param" => $attr["custom"], "total_fee" => $attr["ra"], "paymethod" => "directPay", "show_url" => home_url("/"), "return_url" => $attr["success"] && !$referencing ? $attr["success"] : site_url("/?optimizemember_pro_alipay_return=1"), "notify_url" => site_url("/"));
             /**/
             $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_alipay_utilities::alipay_link_gen($vars))), $code);
             /*
              * Only when there is no custom button
              */
             if (empty($content)) {
                 $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
             }
             /**/
             $code = $attr["output"] === "anchor" ? $code : $code;
             $code = $attr["output"] === "url" ? $url : $code;
             /**/
             unset($href, $url, $m);
         }
     }
     /**/
     $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code);
     return $code;
 }
 /**
  * Shortcode `[optimizeMember-Pro-ccBill-Button /]`.
  *
  * @package optimizeMember\ccBill
  * @since 1.5
  *
  * @attaches-to ``add_shortcode("optimizeMember-Pro-ccBill-Button");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str The resulting ccBill Button Code, HTML markup.
  */
 public static function sc_ccbill_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     c_ws_plugin__optimizemember_no_cache::no_cache_constants(true);
     /**/
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     /**/
     $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" => "2.95", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "sub_account" => "", "form" => "", "output" => "anchor"), $attr);
     /**/
     $attr["tt"] = strtoupper($attr["tt"]);
     $attr["rt"] = strtoupper($attr["rt"]);
     $attr["ccaps"] = strtolower($attr["ccaps"]);
     $attr["rr"] = $attr["rt"] === "L" ? "0" : $attr["rr"];
     $attr["rr"] = $attr["level"] === "*" ? "0" : $attr["rr"];
     /**/
     if ($attr["rr"] && ($attr["ta"] <= 0 || $attr["tp"] <= 0 || !$attr["tt"])) {
         eval('$attr["ta"] = $attr["ra"]; $attr["tp"] = $attr["rp"]; $attr["tt"] = $attr["rt"];');
     }
     /**/
     if ($attr["modify"] || $attr["cancel"]) {
         $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-edit-button.png";
         /**/
         $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-cancellation-button.php")));
         $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
         $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
         /**/
         $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
         /**/
         $code = $attr["output"] === "anchor" ? $code : $code;
         if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
             $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
         }
         /**/
         unset($href, $url, $m);
     } else {
         if ($attr["sp"]) {
             $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-button.png";
             /**/
             $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
             /**/
             $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-sp-checkout-button.php")));
             $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
             $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
             /**/
             $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => round($attr["exp"] / 24), "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_desc" => $attr["desc"], "s2_invoice" => $attr["sp_ids_exp"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
             /**/
             if ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) {
                 $vars["s2_referencing"] = $referencing;
             }
             /**/
             $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_link_gen($vars))), $code);
             /**/
             $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
             /**/
             $code = $attr["output"] === "anchor" ? $code : $code;
             $code = $attr["output"] === "url" ? $url : $code;
             /**/
             unset($href, $url, $m);
         } else {
             if ($attr["level"] === "*") {
                 $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-button.png";
                 /**/
                 $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
                 $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
                 /**/
                 $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-ccaps-checkout-button.php")));
                 $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
                 /**/
                 $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
                 /**/
                 if ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) {
                     $vars["s2_referencing"] = $referencing;
                 }
                 /**/
                 $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_link_gen($vars))), $code);
                 /**/
                 $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                 /**/
                 $code = $attr["output"] === "anchor" ? $code : $code;
                 $code = $attr["output"] === "url" ? $url : $code;
                 /**/
                 unset($href, $url, $m);
             } else {
                 $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-button.png";
                 /**/
                 $attr["desc"] = !$attr["desc"] ? $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $attr["level"] . "_label"] : $attr["desc"];
                 /**/
                 $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
                 $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
                 /**/
                 $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-checkout-button.php")));
                 /*
                  * Custom button
                  */
                 if (!empty($content)) {
                     $code = preg_replace('/%%button_markup%%/', $content, $code);
                 } else {
                     $code = preg_replace("/%%button_markup%%/", '<a href="%%url%%"><img src="%%images%%/ccbill-button.png" style="width:auto; height:auto; border:0;" alt="ccBill" /></a>', $code);
                 }
                 $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
                 /**/
                 if (!$attr["rr"]) {
                     $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_p1" => "0 D", "s2_p3" => $attr["rp"] . " " . $attr["rt"], "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
                 } else {
                     /* Otherwise, we need to include both an Initial and Regular/Recurring period. This will ALWAYS recur. */
                     $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ta"], "formPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["tp"], $attr["tt"]), "formRecurringPrice" => $attr["ra"], "formRecurringPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "formRebills" => "99", "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_p1" => $attr["tp"] . " " . $attr["tt"], "s2_p3" => $attr["rp"] . " " . $attr["rt"], "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
                 }
                 /**/
                 if ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) {
                     $vars["s2_referencing"] = $referencing;
                 }
                 /**/
                 $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_link_gen($vars))), $code);
                 /*
                  * Only when there is no custom button
                  */
                 if (empty($content)) {
                     $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                 }
                 /**/
                 $code = $attr["output"] === "anchor" ? $code : $code;
                 $code = $attr["output"] === "url" ? $url : $code;
                 /**/
                 unset($href, $url, $m);
             }
         }
     }
     /**/
     $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code);
     return $code;
 }
Beispiel #12
0
 /**
  * Handles optimizeMember option Replacement Codes.
  *
  * @package optimizeMember\Utilities
  * @since 110815
  *
  * @param array $ops An array of optimizeMember options, or an option value array.
  * @param bool $fill Optional. If true, Replacement Codes are filled, else false.
  * @return mixed The end result, after handling Replacement Codes.
  */
 public static function op_replace($ops = FALSE, $fill = FALSE)
 {
     global $current_site, $current_blog;
     /* Multisite. */
     /**/
     if (is_array($ops) && !empty($ops)) {
         foreach ($ops as &$op) {
             if (is_array($op) && !empty($op)) {
                 /* Array? */
                 $op = c_ws_plugin__optimizemember_pro_utils_ops::op_replace($op, $fill);
             } else {
                 if (is_string($op) && !$fill) {
                     $op = is_multisite() ? preg_replace("/" . preg_quote(rtrim($current_site->domain . $current_site->path, "/") . "/", "/") . "/", "%%_op__current_site_domain_path/%%", $op) : $op;
                     $op = is_multisite() ? preg_replace("/" . preg_quote(rtrim($current_site->domain . $current_site->path, "/"), "/") . "/", "%%_op__current_site_domain_path%%", $op) : $op;
                     /**/
                     $op = is_multisite() ? preg_replace("/" . preg_quote(rtrim($current_blog->domain . $current_blog->path, "/") . "/", "/") . "/", "%%_op__current_blog_domain_path/%%", $op) : $op;
                     $op = is_multisite() ? preg_replace("/" . preg_quote(rtrim($current_blog->domain . $current_blog->path, "/"), "/") . "/", "%%_op__current_blog_domain_path%%", $op) : $op;
                     /**/
                     $op = preg_replace("/" . preg_quote(rtrim(site_url(), "/"), "/") . "/", "%%_op__site_url%%", preg_replace("/" . preg_quote(rtrim(site_url(), "/") . "/", "/") . "/", "%%_op__site_url/%%", $op));
                     $op = preg_replace("/" . preg_quote(rtrim(home_url(), "/"), "/") . "/", "%%_op__home_url%%", preg_replace("/" . preg_quote(rtrim(home_url(), "/") . "/", "/") . "/", "%%_op__home_url/%%", $op));
                     /**/
                     $op = preg_replace("/" . preg_quote($_SERVER["HTTP_HOST"], "/") . "/i", "%%_op__domain%%", preg_replace("/" . preg_quote(get_bloginfo("name"), "/") . "/", "%%_op__blog_name%%", $op));
                 } else {
                     if (is_string($op) && $fill) {
                         $op = is_multisite() ? preg_replace("/%%_op__current_site_domain_path\\/%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim($current_site->domain . $current_site->path, "/") . "/"), $op) : preg_replace("/%%_op__current_site_domain_path\\/%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(site_url(), "/") . "/"), $op);
                         $op = is_multisite() ? preg_replace("/%%_op__current_site_domain_path%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim($current_site->domain . $current_site->path, "/")), $op) : preg_replace("/%%_op__current_site_domain_path%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(site_url(), "/")), $op);
                         /**/
                         $op = is_multisite() ? preg_replace("/%%_op__current_blog_domain_path\\/%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim($current_blog->domain . $current_blog->path, "/") . "/"), $op) : preg_replace("/%%_op__current_blog_domain_path\\/%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(site_url(), "/") . "/"), $op);
                         $op = is_multisite() ? preg_replace("/%%_op__current_blog_domain_path%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim($current_blog->domain . $current_blog->path, "/")), $op) : preg_replace("/%%_op__current_blog_domain_path%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(site_url(), "/")), $op);
                         /**/
                         $op = preg_replace("/%%_op__site_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(site_url(), "/")), preg_replace("/%%_op__site_url\\/%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(site_url(), "/") . "/"), $op));
                         $op = preg_replace("/%%_op__home_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(home_url(), "/")), preg_replace("/%%_op__home_url\\/%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rtrim(home_url(), "/") . "/"), $op));
                         /**/
                         $op = preg_replace("/%%_op__domain%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($_SERVER["HTTP_HOST"]), preg_replace("/%%_op__blog_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(get_bloginfo("name")), $op));
                     }
                 }
             }
         }
     }
     /**/
     return $ops;
     /* Now return the $ops. */
 }
Beispiel #13
0
 /**
  * Fills Replacement Code variables in URIs; collectively.
  *
  * @package optimizeMember\URIs
  * @since 3.5
  *
  * @param str $uris A URI string, or a string of multiple URIs is also fine.
  * @param obj $user Optional. A `WP_User` object. Defaults to the current User, if logged-in.
  * @return str Collective string of input URIs, with Replacement Codes having been filled.
  */
 public static function fill_ruri_level_access_rc_vars($uris = FALSE, $user = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_fill_ruri_level_access_rc_vars", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $uris = (string) $uris;
     /* Force ``$uris`` to a string value. */
     $orig_uris = $uris;
     /* Record the original URIs that were passed in; collectively. */
     /**/
     $user = (is_object($user) || is_object($user = is_user_logged_in() ? wp_get_current_user() : false)) && !empty($user->ID) ? $user : false;
     /**/
     $user_id = $user ? (string) $user->ID : "";
     $user_login = $user ? (string) strtolower($user->user_login) : "";
     /**/
     $user_level = (string) c_ws_plugin__optimizemember_user_access::user_access_level($user);
     $user_role = (string) c_ws_plugin__optimizemember_user_access::user_access_role($user);
     $user_ccaps = (string) implode("-", c_ws_plugin__optimizemember_user_access::user_access_ccaps($user));
     $user_logins = $user ? (string) (int) get_user_option("optimizemember_login_counter", $user_id) : "-1";
     /**/
     $uris = strlen($user_login) ? preg_replace("/%%current_user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_login), $uris) : $uris;
     $uris = strlen($user_id) ? preg_replace("/%%current_user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_id), $uris) : $uris;
     $uris = strlen($user_level) ? preg_replace("/%%current_user_level%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_level), $uris) : $uris;
     $uris = strlen($user_role) ? preg_replace("/%%current_user_role%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_role), $uris) : $uris;
     $uris = strlen($user_ccaps) ? preg_replace("/%%current_user_ccaps%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_ccaps), $uris) : $uris;
     $uris = strlen($user_logins) ? preg_replace("/%%current_user_logins%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_logins), $uris) : $uris;
     /**/
     return apply_filters("ws_plugin__optimizemember_fill_ruri_level_access_rc_vars", $uris, get_defined_vars());
 }
 /**
  * optimizeMember's PayPal Auto-Return/PDT handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link optimizeMember\PayPal\c_ws_plugin__optimizemember_paypal_return_in::paypal_return()}.
  * @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|subscr_signup|subscr_payment)\$/i", $paypal["txn_type"]) && (!empty($paypal["item_number"]) && preg_match($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["membership_item_number_w_level_regex"], $paypal["item_number"])) && (!empty($paypal["subscr_id"]) || !empty($paypal["txn_id"]) && ($paypal["subscr_id"] = $paypal["txn_id"])) && (empty($paypal["payment_status"]) || empty($payment_status_issues) || !preg_match($payment_status_issues, $paypal["payment_status"]))) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_return_before_subscr_signup", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         if (!get_transient($transient_rtn = "s2m_rtn_" . md5("optimizemember_transient_" . $_paypal_s)) && set_transient($transient_rtn, time(), 31556926 * 10)) {
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept|subscr_signup|subscr_payment` ).";
             /**/
             list($paypal["level"], $paypal["ccaps"], $paypal["eotper"]) = preg_split("/\\:/", $paypal["item_number"], 3);
             /**/
             $paypal["ip"] = preg_match("/ip address/i", $paypal["option_name2"]) && $paypal["option_selection2"] ? $paypal["option_selection2"] : "";
             $paypal["ip"] = !$paypal["ip"] && preg_match("/^[a-z0-9]+~[0-9\\.]+\$/i", $paypal["invoice"]) ? preg_replace("/^[a-z0-9]+~/i", "", $paypal["invoice"]) : $paypal["ip"];
             $paypal["ip"] = !$paypal["ip"] && $_SERVER["REMOTE_ADDR"] ? $_SERVER["REMOTE_ADDR"] : $paypal["ip"];
             /**/
             if (preg_match("/^subscr_payment\$/i", $paypal["txn_type"]) && !empty($_GET["optimizemember_paypal_return_tra"]) && (($tra = c_ws_plugin__optimizemember_utils_encryption::decrypt(trim(stripslashes($_GET["optimizemember_paypal_return_tra"])))) && is_array($tra = maybe_unserialize($tra))) && (count($tra) === 11 && isset($tra["ta"], $tra["tp"], $tra["tt"], $tra["ra"], $tra["rp"], $tra["rt"], $tra["rr"], $tra["rrt"], $tra["rra"], $tra["invoice"], $tra["checksum"])) && $tra["invoice"] === $paypal["invoice"] && $tra["checksum"] === md5($paypal["invoice"] . $paypal["ip"] . $paypal["item_number"])) {
                 $tracking_properties = true;
                 /* Yes, these tracking properties ARE being set here. */
                 /**/
                 $paypal["period1"] = $tra["rr"] !== "BN" && $tra["tp"] ? $tra["tp"] . " " . $tra["tt"] : "0 D";
                 $paypal["mc_amount1"] = $tra["rr"] !== "BN" && $tra["tp"] ? number_format($tra["ta"], 2, ".", "") : "0.00";
                 /**/
                 $paypal["period3"] = $tra["rp"] . " " . $tra["rt"];
                 $paypal["mc_amount3"] = $tra["ra"];
                 /**/
                 $paypal["recurring"] = $tra["rr"] === "1" ? "1" : "0";
                 /**/
                 $paypal["initial_term"] = preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["period1"] : "0 D";
                 /* Defaults to "0 D" ( zero days ). */
                 $paypal["initial"] = strlen($paypal["mc_amount1"]) && preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["mc_amount1"] : $paypal["mc_amount3"];
                 $paypal["regular"] = $paypal["mc_amount3"];
                 /* This is the Regular Payment Amount that is charged to the Customer. Always required by PayPal. */
                 $paypal["regular_term"] = $paypal["period3"];
                 /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
                 $paypal["recurring"] = $paypal["recurring"] ? $paypal["mc_amount3"] : "0";
                 /* If non-recurring, this should be zero, otherwise Regular. */
                 /**/
                 eval('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["optimizemember_log"]);');
                 /* Create array of wouldbe IPN signup vars w/o optimizemember_log. */
             } else {
                 if (preg_match("/^(web_accept|subscr_signup)\$/i", $paypal["txn_type"])) {
                     $tracking_properties = true;
                     /* Yes, these tracking properties ARE being set here. */
                     /**/
                     $paypal["period1"] = preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["period1"] : "0 D";
                     /* Defaults to "0 D" ( zero days ). */
                     $paypal["mc_amount1"] = strlen($paypal["mc_amount1"]) && $paypal["mc_amount1"] > 0 ? $paypal["mc_amount1"] : "0.00";
                     /* "0.00". */
                     /**/
                     if (preg_match("/^web_accept\$/i", $paypal["txn_type"])) {
                         $paypal["period3"] = $paypal["eotper"] ? $paypal["eotper"] : "1 L";
                         /* 1 Lifetime. */
                         $paypal["mc_amount3"] = $paypal["mc_gross"];
                         /* The "Buy Now" amount is the full gross. */
                     }
                     /**/
                     $paypal["initial_term"] = preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["period1"] : "0 D";
                     /* Defaults to "0 D" ( zero days ). */
                     $paypal["initial"] = strlen($paypal["mc_amount1"]) && preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["mc_amount1"] : $paypal["mc_amount3"];
                     $paypal["regular"] = $paypal["mc_amount3"];
                     /* This is the Regular Payment Amount that is charged to the Customer. Always required by PayPal. */
                     $paypal["regular_term"] = $paypal["period3"];
                     /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
                     $paypal["recurring"] = $paypal["recurring"] ? $paypal["mc_amount3"] : "0";
                     /* If non-recurring, this should be zero, otherwise Regular. */
                     /**/
                     eval('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["optimizemember_log"]);');
                     /* Create array of wouldbe IPN signup vars w/o optimizemember_log. */
                 }
             }
             /*
             New Subscription with advanced update vars ( option_name1, option_selection1 )? Used in Subscr. Modifications.
             */
             if (preg_match("/(referenc|associat|updat|upgrad)/i", $paypal["option_name1"]) && $paypal["option_selection1"]) {
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_paypal_return_before_subscr_signup_w_update_vars", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
                 /**/
                 $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept|subscr_signup|subscr_payment` ) w/ update vars.";
                 /**/
                 /* Check for both the old & new subscr_id's, just in case the IPN routine already changed it. */
                 if (($user_id = c_ws_plugin__optimizemember_utils_users::get_user_id_with($paypal["subscr_id"], $paypal["option_selection1"])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                     if (!$user->has_cap("administrator")) {
                         $processing = $modifying = $during = true;
                         /* Yes, we ARE processing this. */
                         /**/
                         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                         do_action("ws_plugin__optimizemember_during_paypal_return_during_before_subscr_signup_w_update_vars", get_defined_vars());
                         do_action("ws_plugin__optimizemember_during_collective_mods", $user_id, get_defined_vars(), "rtn-upgrade-downgrade", "modification", "optimizemember_level" . $paypal["level"]);
                         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" => "optimizemember_level" . $paypal["level"]));
                             $user = new WP_User($user_id);
                         }
                         /**/
                         $current_role = c_ws_plugin__optimizemember_user_access::user_access_role($user);
                         /**/
                         if ($current_role !== "optimizemember_level" . $paypal["level"]) {
                             /* Only if we need to. */
                             $user->set_role("optimizemember_level" . $paypal["level"]);
                         }
                         /* (upgrade/downgrade) */
                         /**/
                         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);
                                 }
                             }
                         }
                         /**/
                         update_user_option($user_id, "optimizemember_subscr_gateway", $paypal["subscr_gateway"]);
                         update_user_option($user_id, "optimizemember_subscr_id", $paypal["subscr_id"]);
                         update_user_option($user_id, "optimizemember_custom", $paypal["custom"]);
                         /**/
                         if (!get_user_option("optimizemember_registration_ip", $user_id)) {
                             update_user_option($user_id, "optimizemember_registration_ip", $paypal["ip"]);
                         }
                         /**/
                         if (!empty($ipn_signup_vars)) {
                             update_user_option($user_id, "optimizemember_ipn_signup_vars", $ipn_signup_vars);
                         }
                         /**/
                         delete_user_option($user_id, "optimizemember_file_download_access_log");
                         /**/
                         if (preg_match("/^web_accept\$/i", $paypal["txn_type"]) && $paypal["eotper"]) {
                             /* Don't update this in the return routine. Leave this for the IPN routine. */
                             /* EOT Times might be extended, and we don't want the IPN routine to extend an already-extended EOT Time. */
                             $eot_time = c_ws_plugin__optimizemember_utils_time::auto_eot_time("", "", "", $paypal["eotper"], "", get_user_option("optimizemember_auto_eot_time", $user_id));
                             $paypal["optimizemember_log"][] = "Automatic EOT ( End Of Term ) Time will be set to: " . date("D M j, Y g:i:s a T", $eot_time) . ".";
                         } else {
                             /* Otherwise, we need to clear the Auto-EOT Time. */
                             delete_user_option($user_id, "optimizemember_auto_eot_time");
                         }
                         /**/
                         $pr_times = get_user_option("optimizemember_paid_registration_times", $user_id);
                         $pr_times["level"] = !$pr_times["level"] ? time() : $pr_times["level"];
                         /* Preserves existing. */
                         $pr_times["level" . $paypal["level"]] = !$pr_times["level" . $paypal["level"]] ? time() : $pr_times["level" . $paypal["level"]];
                         update_user_option($user_id, "optimizemember_paid_registration_times", $pr_times);
                         /* Update now. */
                         /**/
                         c_ws_plugin__optimizemember_user_notes::clear_user_note_lines($user_id, "/^Demoted by optimizeMember\\:/");
                         /**/
                         $paypal["optimizemember_log"][] = "optimizeMember Level/Capabilities updated w/ advanced update routines.";
                         /**/
                         setcookie("optimizemember_tracking", $optimizemember_tracking = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["subscr_id"]), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_tracking", $optimizemember_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_tracking"] = $optimizemember_tracking);
                         /**/
                         $paypal["optimizemember_log"][] = "Transient Tracking Cookie set on ( `web_accept|subscr_signup|subscr_payment` ) w/ update vars.";
                         /**/
                         if ($processing && $tracking_properties && ($code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["modification_tracking_codes"]) && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                             if (($code = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $code)) && ($code = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["subscr_id"]), $code))) {
                                 if (($code = preg_replace("/%%initial%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial"]), $code)) && ($code = preg_replace("/%%regular%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular"]), $code)) && ($code = preg_replace("/%%recurring%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["recurring"]), $code))) {
                                     if (($code = preg_replace("/%%initial_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial_term"]), $code)) && ($code = preg_replace("/%%regular_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular_term"]), $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 Modification Tracking Codes into a Transient Queue. These will be processed on-site.";
                                                                                     set_transient("s2m_" . md5("optimizemember_transient_modification_tracking_codes_" . $paypal["subscr_id"]), $code, 43200);
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         /**/
                         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                         do_action("ws_plugin__optimizemember_during_paypal_return_during_subscr_signup_w_update_vars", get_defined_vars());
                         unset($__refs, $__v);
                         /* Unset defined __refs, __v. */
                         /**/
                         if ($redirection_url_after_modification = apply_filters("ws_plugin__optimizemember_redirection_url_after_modification", false, get_defined_vars())) {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to a custom URL after modification: " . $redirection_url_after_modification;
                             /**/
                             wp_redirect($redirection_url_after_modification);
                         } else {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to the Login Page. They need to log back in.";
                             /**/
                             echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], '<strong>' . _x("Thank you! You've been updated to:", "s2member-front", "s2member") . '<br /><em>' . esc_html($paypal["item_name"]) . '</em></strong>', _x("Please Log Back In ( Click Here )", "s2member-front", "s2member"), wp_login_url());
                         }
                     } else {
                         $paypal["optimizemember_log"][] = "Unable to modify Subscription. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access. Please make sure that you are NOT logged in as an Administrator while testing.";
                         /**/
                         $paypal["optimizemember_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
                         /**/
                         echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to modify Subscription.<br />Please contact Support for assistance.<br /><br />The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access. Please make sure that you are NOT logged in as an Administrator while testing.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                     }
                 } else {
                     $paypal["optimizemember_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
                     /**/
                     $paypal["optimizemember_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
                     /**/
                     echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to modify Subscription.<br />Please contact Support for assistance.<br /><br />Could not get the existing User ID from the DB.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                 }
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_paypal_return_after_subscr_signup_w_update_vars", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
             } else {
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_paypal_return_before_subscr_signup_wo_update_vars", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
                 /**/
                 $processing = $during = true;
                 /* Yes, we ARE processing this new Subscription request. */
                 /**/
                 $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept|subscr_signup|subscr_payment` ) w/o update vars.";
                 /**/
                 setcookie("optimizemember_subscr_gateway", $optimizemember_subscr_gateway = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["subscr_gateway"]), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_subscr_gateway", $optimizemember_subscr_gateway, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_subscr_gateway"] = $optimizemember_subscr_gateway);
                 setcookie("optimizemember_subscr_id", $optimizemember_subscr_id = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["subscr_id"]), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_subscr_id", $optimizemember_subscr_id, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_subscr_id"] = $optimizemember_subscr_id);
                 setcookie("optimizemember_custom", $optimizemember_custom = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["custom"]), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_custom", $optimizemember_custom, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_custom"] = $optimizemember_custom);
                 setcookie("optimizemember_item_number", $optimizemember_item_number = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["item_number"]), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_item_number", $optimizemember_item_number, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_item_number"] = $optimizemember_item_number);
                 /**/
                 $paypal["optimizemember_log"][] = "Registration Cookies set on ( `web_accept|subscr_signup|subscr_payment` ) w/o update vars.";
                 /**/
                 setcookie("optimizemember_tracking", $optimizemember_tracking = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["subscr_id"]), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_tracking", $optimizemember_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_tracking"] = $optimizemember_tracking);
                 /**/
                 $paypal["optimizemember_log"][] = "Transient Tracking Cookie set on ( `web_accept|subscr_signup|subscr_payment` ) w/o update vars.";
                 /**/
                 if ($processing && $tracking_properties && ($code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["signup_tracking_codes"]) && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                     if (($code = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $code)) && ($code = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["subscr_id"]), $code))) {
                         if (($code = preg_replace("/%%initial%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial"]), $code)) && ($code = preg_replace("/%%regular%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular"]), $code)) && ($code = preg_replace("/%%recurring%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["recurring"]), $code))) {
                             if (($code = preg_replace("/%%initial_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial_term"]), $code)) && ($code = preg_replace("/%%regular_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular_term"]), $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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $code)) {
                                                     /**/
                                                     if ($code = trim(preg_replace("/%%(.+?)%%/i", "", $code))) {
                                                         $paypal["optimizemember_log"][] = "Storing Signup Tracking Codes into a Transient Queue. These will be processed on-site.";
                                                         set_transient("s2m_" . md5("optimizemember_transient_signup_tracking_codes_" . $paypal["subscr_id"]), $code, 43200);
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
                 /**/
                 if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && is_main_site()) {
                     if ($redirection_url_after_mms_farm_signup = apply_filters("ws_plugin__optimizemember_redirection_url_after_mms_farm_signup", false, get_defined_vars())) {
                         $paypal["optimizemember_log"][] = "Redirecting Customer to a custom URL after signup: " . $redirection_url_after_mms_farm_signup;
                         /**/
                         wp_redirect($redirection_url_after_mms_farm_signup);
                     } else {
                         if ($custom_success_redirection) {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to a custom URL on success: " . $custom_success_redirection;
                             /**/
                             wp_redirect($custom_success_redirection);
                         } else {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to Signup Page. They need to Signup/Register now.";
                             /**/
                             echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! Your account has been approved.<br />The next step is to Register a Username for immediate access.</strong>', "s2member-front", "s2member"), _x("Please Register Now ( Click Here )", "s2member-front", "s2member"), c_ws_plugin__optimizemember_utils_urls::wp_signup_url());
                         }
                     }
                 } else {
                     if ($redirection_url_after_signup = apply_filters("ws_plugin__optimizemember_redirection_url_after_signup", false, get_defined_vars())) {
                         $paypal["optimizemember_log"][] = "Redirecting Customer to a custom URL after signup: " . $redirection_url_after_signup;
                         /**/
                         wp_redirect($redirection_url_after_signup);
                     } else {
                         if ($custom_success_redirection) {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to a custom URL on success: " . $custom_success_redirection;
                             /**/
                             wp_redirect($custom_success_redirection);
                         } else {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to Registration Page. They need to Register now.";
                             /**/
                             echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! Your account has been approved.<br />The next step is to Register a Username for immediate access.</strong>', "s2member-front", "s2member"), _x("Please Register Now ( Click Here )", "s2member-front", "s2member"), c_ws_plugin__optimizemember_utils_urls::wp_register_url());
                         }
                     }
                 }
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_paypal_return_after_subscr_signup_wo_update_vars", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
             }
         } else {
             $paypal["optimizemember_log"][] = "Page Expired. Duplicate Return-Data.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept|subscr_signup|subscr_payment` ).";
             $paypal["optimizemember_log"][] = "Page Expired. Redirecting Customer to the Home Page.";
             /**/
             echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Page Expired:</strong> Duplicate Return-Data.<br />Please contact Support if you need any assistance.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
         }
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_return_after_subscr_signup", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_return_in_subscr_or_wa_w_level", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_return_in_subscr_or_wa_w_level", false, get_defined_vars());
     }
 }
 /**
  * optimizeMember's PayPal IPN handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @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"]["sp_access_item_number_regex"], $paypal["item_number"])) && (empty($paypal["payment_status"]) || empty($payment_status_issues) || !preg_match($payment_status_issues, $paypal["payment_status"])) && !empty($paypal["payer_email"]) && !empty($paypal["txn_id"])) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_notify_before_sp_access", 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` ) for Specific Post/Page Access.";
             /**/
             list(, $paypal["sp_ids"], $paypal["hours"]) = preg_split("/\\:/", $paypal["item_number"], 3);
             /**/
             $paypal["ip"] = preg_match("/ip address/i", $paypal["option_name2"]) && $paypal["option_selection2"] ? $paypal["option_selection2"] : "";
             $paypal["ip"] = !$paypal["ip"] && preg_match("/^[a-z0-9]+~[0-9\\.]+\$/i", $paypal["invoice"]) ? preg_replace("/^[a-z0-9]+~/i", "", $paypal["invoice"]) : $paypal["ip"];
             /**/
             if (($sp_access_url = c_ws_plugin__optimizemember_sp_access::sp_access_link_gen($paypal["sp_ids"], $paypal["hours"])) && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                 $processing = $during = true;
                 /* Yes, we ARE processing this. */
                 /**/
                 if (preg_match("/(referenc|associat)/i", $paypal["option_name1"]) && $paypal["option_selection1"]) {
                     /* Associating this purchase with a Member? */
                     if (($user_id = c_ws_plugin__optimizemember_utils_users::get_user_id_with($paypal["option_selection1"], $paypal["option_selection1"])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                         $sp_references = (array) get_user_option("optimizemember_sp_references", $user_id);
                         $_sp_reference = array("time" => time(), "ids" => $paypal["sp_ids"], "hours" => $paypal["hours"], "url" => $sp_access_url);
                         $sp_references = c_ws_plugin__optimizemember_utils_arrays::array_unique(array_merge($sp_references, $_sp_reference));
                         update_user_option($user_id, "optimizemember_sp_references", $sp_references);
                         /**/
                         $paypal["optimizemember_log"][] = "Specific Post/Page ~ Sale associated with User ID: " . $user_id . ".";
                     }
                 }
                 /**/
                 $sbj = preg_replace("/%%sp_access_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($sp_access_url), $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"][($_GET["optimizemember_paypal_proxy"] && preg_match("/pro-emails/", $_GET["optimizemember_paypal_proxy_use"]) ? "pro_" : "") . "sp_email_subject"]);
                 $sbj = preg_replace("/%%sp_access_exp%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_utils_time::approx_time_difference(time(), strtotime("+" . $paypal["hours"] . " hours"))), $sbj);
                 /**/
                 $msg = preg_replace("/%%sp_access_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($sp_access_url), $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"][($_GET["optimizemember_paypal_proxy"] && preg_match("/pro-emails/", $_GET["optimizemember_paypal_proxy_use"]) ? "pro_" : "") . "sp_email_message"]);
                 $msg = preg_replace("/%%sp_access_exp%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_utils_time::approx_time_difference(time(), strtotime("+" . $paypal["hours"] . " hours"))), $msg);
                 /**/
                 $rec = preg_replace("/%%sp_access_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($sp_access_url), $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"][($_GET["optimizemember_paypal_proxy"] && preg_match("/pro-emails/", $_GET["optimizemember_paypal_proxy_use"]) ? "pro_" : "") . "sp_email_recipients"]);
                 $rec = preg_replace("/%%sp_access_exp%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_utils_time::approx_time_difference(time(), strtotime("+" . $paypal["hours"] . " hours"))), $rec);
                 /**/
                 if (($rec = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $rec)) && ($rec = preg_replace("/%%txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["txn_id"]), $rec))) {
                     if ($rec = preg_replace("/%%amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_gross"]), $rec)) {
                         /* Full amount of the payment, before fee is subtracted. */
                         if (($rec = preg_replace("/%%item_number%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_number"]), $rec)) && ($rec = preg_replace("/%%item_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_name"]), $rec))) {
                             if (($rec = preg_replace("/%%first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_dq(c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["first_name"])), $rec)) && ($rec = preg_replace("/%%last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_dq(c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["last_name"])), $rec))) {
                                 if ($rec = preg_replace("/%%full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_dq(c_ws_plugin__optimizemember_utils_strings::esc_ds(trim($paypal["first_name"] . " " . $paypal["last_name"]))), $rec)) {
                                     /* **NOTE** c_ws_plugin__optimizemember_utils_strings::esc_dq() is applied here. ( ex. "N\"ame" <email> ). */
                                     if ($rec = preg_replace("/%%payer_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["payer_email"]), $rec)) {
                                         if ($rec = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $rec)) {
                                             /**/
                                             if (($sbj = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)) && ($sbj = preg_replace("/%%txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["txn_id"]), $sbj))) {
                                                 if ($sbj = preg_replace("/%%amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_gross"]), $sbj)) {
                                                     /* Full amount of the payment, before fee is subtracted. */
                                                     if (($sbj = preg_replace("/%%item_number%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_number"]), $sbj)) && ($sbj = preg_replace("/%%item_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["item_name"]), $sbj))) {
                                                         if (($sbj = preg_replace("/%%first_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["first_name"]), $sbj)) && ($sbj = preg_replace("/%%last_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["last_name"]), $sbj))) {
                                                             if ($sbj = preg_replace("/%%full_name%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(trim($paypal["first_name"] . " " . $paypal["last_name"])), $sbj)) {
                                                                 if ($sbj = preg_replace("/%%payer_email%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["payer_email"]), $sbj)) {
                                                                     if ($sbj = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $sbj)) {
                                                                         /**/
                                                                         if (($msg = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace("/%%txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["txn_id"]), $msg))) {
                                                                             if ($msg = preg_replace("/%%amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_gross"]), $msg)) {
                                                                                 /* Full amount of the payment, before fee is subtracted. */
                                                                                 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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $msg)) {
                                                                                                     /**/
                                                                                                     if (($rec = trim(preg_replace("/%%(.+?)%%/i", "", $rec))) && ($sbj = trim(preg_replace("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim(preg_replace("/%%(.+?)%%/i", "", $msg)))) {
                                                                                                         foreach (c_ws_plugin__optimizemember_utils_strings::parse_emails($rec) as $recipient) {
                                                                                                             /* Go through a possible list of recipients. */
                                                                                                             c_ws_plugin__optimizemember_email_configs::email_config() . wp_mail($recipient, apply_filters("ws_plugin__optimizemember_sp_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_sp_email_msg", $msg, 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"][] = "Specific Post/Page Confirmation Email sent to: " . $rec . ".";
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 /**/
                 if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_sale_notification_urls"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                     foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_sale_notification_urls"]) as $url) {
                         /**/
                         if (($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace("/%%sp_access_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rawurlencode($sp_access_url)), $url))) {
                             if ($url = preg_replace("/%%sp_access_exp%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(c_ws_plugin__optimizemember_utils_time::approx_time_difference(time(), strtotime("+" . $paypal["hours"] . " hours")))), $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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["ip"])), $url)) {
                                                         /**/
                                                         if ($url = trim(preg_replace("/%%(.+?)%%/i", "", $url))) {
                                                             c_ws_plugin__optimizemember_utils_urls::remote($url);
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     /**/
                     $paypal["optimizemember_log"][] = "Specific Post/Page ~ Sale Notification URLs have been processed.";
                 }
                 /**/
                 if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_sale_notification_recipients"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                     $msg = $sbj = "( optimizeMember / API Notification Email ) - Specific Post/Page ~ Sale";
                     $msg .= "\n\n";
                     /* Spacing in the message body. */
                     /**/
                     $msg .= "sp_access_url: %%sp_access_url%%\n";
                     $msg .= "sp_access_exp: %%sp_access_exp%%\n";
                     $msg .= "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_ip: %%user_ip%%\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("/%%sp_access_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($sp_access_url), $msg))) {
                         if ($msg = preg_replace("/%%sp_access_exp%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_utils_time::approx_time_difference(time(), strtotime("+" . $paypal["hours"] . " hours"))), $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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $msg)) {
                                                     /**/
                                                     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"]["sp_sale_notification_recipients"]) as $recipient) {
                                                             wp_mail($recipient, apply_filters("ws_plugin__optimizemember_sp_sale_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_sp_sale_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     /**/
                     $paypal["optimizemember_log"][] = "Specific Post/Page ~ Sale Notification Emails have been processed.";
                 }
                 /**/
                 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("/%%sp_access_url%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(rawurlencode($sp_access_url)), $url))) {
                         if ($url = preg_replace("/%%sp_access_exp%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(c_ws_plugin__optimizemember_utils_time::approx_time_difference(time(), strtotime("+" . $paypal["hours"] . " hours")))), $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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["ip"])), $url)) {
                                                     /**/
                                                     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"][] = "Specific Post/Page Return, a Proxy Return URL is ready.";
                 }
                 /**/
                 if ($processing && ($code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sp_tracking_codes"]) && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                     if (($code = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $code)) && ($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_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["ip"]), $code)) {
                                             /**/
                                             if ($code = trim(preg_replace("/%%(.+?)%%/i", "", $code))) {
                                                 $paypal["optimizemember_log"][] = "Storing Specific Post/Page Tracking Codes into a Transient Queue. These will be processed on-site.";
                                                 set_transient("s2m_" . md5("optimizemember_transient_sp_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_sp_access", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
             } else {
                 $paypal["optimizemember_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
             }
         } else {
             $paypal["optimizemember_log"][] = "Not processing. Duplicate IPN.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept` ) for Specific Post/Page Access.";
             $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_sp_access", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_web_accept_sp", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_web_accept_sp", false, get_defined_vars());
     }
 }
 /**
  * optimizeMember's PayPal IPN handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @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("/^(subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment)\$/i", $paypal["txn_type"]) && ($recurring = true) || !empty($paypal["txn_type"]) && preg_match("/^recurring_payment_profile_cancel\$/i", $paypal["txn_type"]) && !empty($paypal["initial_payment_status"]) && preg_match("/^failed\$/i", $paypal["initial_payment_status"]) && ($recurring = true) || !empty($paypal["txn_type"]) && preg_match("/^new_case\$/i", $paypal["txn_type"]) && !empty($paypal["case_type"]) && preg_match("/^chargeback\$/i", $paypal["case_type"]) && !($recurring = false) || !empty($paypal["payment_status"]) && preg_match("/^(refunded|reversed|reversal)\$/i", $paypal["payment_status"]) && !($recurring = false)) && (!empty($paypal["subscr_id"]) || ($paypal["subscr_id"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_subscr_id($paypal)) || !empty($paypal["parent_txn_id"]) && ($paypal["subscr_id"] = $paypal["parent_txn_id"])) && (!empty($paypal["period1"]) || ($paypal["period1"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period1($paypal, false)) || empty($recurring) || ($paypal["period1"] = c_ws_plugin__optimizemember_utils_users::get_user_ipn_signup_var("period1", false, $paypal["subscr_id"])) || ($paypal["period1"] = "0 D")) && (!empty($paypal["period3"]) || ($paypal["period3"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period3($paypal, false)) || empty($recurring) || ($paypal["period3"] = c_ws_plugin__optimizemember_utils_users::get_user_ipn_signup_var("period3", false, $paypal["subscr_id"])) || ($paypal["period3"] = "1 D")) && ((!empty($paypal["item_number"]) || ($paypal["item_number"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_number($paypal)) || ($paypal["item_number"] = c_ws_plugin__optimizemember_utils_users::get_user_ipn_signup_var("item_number", false, $paypal["subscr_id"])) || ($paypal["item_number"] = "1")) && preg_match($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["membership_item_number_w_level_regex"], $paypal["item_number"])) && (!empty($paypal["item_name"]) || ($paypal["item_name"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_name($paypal)) || ($paypal["item_name"] = c_ws_plugin__optimizemember_utils_users::get_user_ipn_signup_var("item_name", false, $paypal["subscr_id"])) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"])) && (!empty($paypal["payer_email"]) || ($paypal["payer_email"] = c_ws_plugin__optimizemember_utils_users::get_user_ipn_signup_var("payer_email", false, $paypal["subscr_id"])) || ($paypal["payer_email"] = c_ws_plugin__optimizemember_utils_users::get_user_email_with($paypal["subscr_id"])))) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_notify_before_subscr_eot", 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)) {
             $is_refund = preg_match("/^refunded\$/i", $paypal["payment_status"]) && $paypal["parent_txn_id"];
             $is_reversal = preg_match("/^(reversed|reversal)\$/i", $paypal["payment_status"]) && $paypal["parent_txn_id"];
             $is_reversal = !$is_reversal ? preg_match("/^new_case\$/i", $paypal["txn_type"]) && preg_match("/^chargeback\$/i", $paypal["case_type"]) : $is_reversal;
             $is_refund_or_reversal = $is_refund || $is_reversal;
             /* If either of the previous tests above evaluated to true; then it's obviously a Refund and/or a Reversal. */
             $is_delayed_eot = !$is_refund_or_reversal && preg_match("/^(subscr_eot|recurring_payment_expired)\$/i", $paypal["txn_type"]) && preg_match("/^I-/i", $paypal["subscr_id"]);
             /**/
             if ($is_refund_or_reversal) {
                 $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as " . ($identified_as = "( `[empty or irrelevant]` ) w/ `payment_status` ( `refunded|reversed|reversal` ) - or - `new_case` w/ `case_type` ( `chargeback` )") . ".";
             } else {
                 $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as " . ($identified_as = "( `subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment` ) - or - `recurring_payment_profile_cancel` w/ `initial_payment_status` ( `failed` )") . ".";
             }
             /**/
             $paypal["optimizemember_log"][] = "Sleeping for 5 seconds. Waiting for a possible ( `subscr_signup|subscr_modify|recurring_payment_profile_created` ).";
             sleep(5);
             /* Sleep here for a moment. PayPal sometimes sends a subscr_eot before the subscr_signup, subscr_modify. */
             /* It is NOT a big deal if they do. However, optimizeMember goes to sleep here, just to help keep the log files in a logical order. */
             $paypal["optimizemember_log"][] = "Awake. It's " . date("D M j, Y g:i:s a T") . ". optimizeMember `txn_type` identified as " . $identified_as . ".";
             /**/
             $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 (($user_id = c_ws_plugin__optimizemember_utils_users::get_user_id_with($paypal["subscr_id"])) && is_object($user = new WP_User($user_id)) && !empty($user->ID)) {
                 $fields = get_user_option("optimizemember_custom_fields", $user_id);
                 /* These will be needed below. */
                 $user_reg_ip = get_user_option("optimizemember_registration_ip", $user_id);
                 /* Needed below. */
                 $user_reg_ip = $paypal["ip"] = $user_reg_ip ? $user_reg_ip : $paypal["ip"];
                 /**/
                 if (!$is_refund_or_reversal && !$is_delayed_eot && !get_user_option("optimizemember_auto_eot_time", $user_id) || $is_refund_or_reversal && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["triggers_immediate_eot"] === "refunds,reversals" || $is_reversal && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["triggers_immediate_eot"] === "reversals" || $is_refund && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["triggers_immediate_eot"] === "refunds") {
                     if (!$user->has_cap("administrator")) {
                         if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["auto_eot_system_enabled"]) {
                             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_eot_behavior"] === "demote") {
                                 $processing = $during = true;
                                 /* Yes, we ARE processing this. */
                                 /**/
                                 $eot_del_type = $is_refund_or_reversal ? "ipn-refund-reversal-demotion" : "ipn-cancellation-expiration-demotion";
                                 /**/
                                 $demotion_role = c_ws_plugin__optimizemember_option_forces::force_demotion_role("subscriber");
                                 $existing_role = c_ws_plugin__optimizemember_user_access::user_access_role($user);
                                 /**/
                                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                                 do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_eot_before_demote", get_defined_vars());
                                 do_action("ws_plugin__optimizemember_during_collective_mods", $user_id, get_defined_vars(), $eot_del_type, "modification", $demotion_role);
                                 do_action("ws_plugin__optimizemember_during_collective_eots", $user_id, get_defined_vars(), $eot_del_type, "modification");
                                 unset($__refs, $__v);
                                 /* Unset defined __refs, __v. */
                                 /**/
                                 if ($existing_role !== $demotion_role) {
                                     /* Only if NOT the existing Role. */
                                     $user->set_role($demotion_role);
                                 }
                                 /* Give User the demotion Role. */
                                 /**/
                                 foreach ($user->allcaps as $cap => $cap_enabled) {
                                     if (preg_match("/^access_optimizemember_ccap_/", $cap)) {
                                         $user->remove_cap($ccap = $cap);
                                     }
                                 }
                                 /**/
                                 delete_user_option($user_id, "optimizemember_custom");
                                 delete_user_option($user_id, "optimizemember_subscr_id");
                                 delete_user_option($user_id, "optimizemember_subscr_gateway");
                                 /**/
                                 delete_user_option($user_id, "optimizemember_ipn_signup_vars");
                                 if (!apply_filters("ws_plugin__optimizemember_preserve_paid_registration_times", true, get_defined_vars())) {
                                     delete_user_option($user_id, "optimizemember_paid_registration_times");
                                 }
                                 /**/
                                 delete_user_option($user_id, "optimizemember_last_status_scan");
                                 delete_user_option($user_id, "optimizemember_first_payment_txn_id");
                                 delete_user_option($user_id, "optimizemember_last_payment_time");
                                 delete_user_option($user_id, "optimizemember_auto_eot_time");
                                 /**/
                                 delete_user_option($user_id, "optimizemember_file_download_access_log");
                                 /**/
                                 c_ws_plugin__optimizemember_user_notes::append_user_notes($user_id, "Demoted by optimizeMember: " . date("D M j, Y g:i a T"));
                                 /**/
                                 $paypal["optimizemember_log"][] = "Member Level/Capabilities demoted to: " . ucwords(preg_replace("/_/", " ", $demotion_role)) . ".";
                                 /**/
                                 if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_urls"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                                     foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_urls"]) as $url) {
                                         /* Handle EOT Notifications. */
                                         /**/
                                         if (($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace("/%%eot_del_type%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($eot_del_type)), $url)) && ($url = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["subscr_id"])), $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"][] = "EOT/Deletion Notification URLs have been processed.";
                                 }
                                 /**/
                                 if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_recipients"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                                     $msg = $sbj = "( optimizeMember / API Notification Email ) - EOT/Deletion";
                                     $msg .= "\n\n";
                                     /* Spacing in the message body. */
                                     /**/
                                     $msg .= "eot_del_type: %%eot_del_type%%\n";
                                     $msg .= "subscr_id: %%subscr_id%%\n";
                                     $msg .= "user_first_name: %%user_first_name%%\n";
                                     $msg .= "user_last_name: %%user_last_name%%\n";
                                     $msg .= "user_full_name: %%user_full_name%%\n";
                                     $msg .= "user_email: %%user_email%%\n";
                                     $msg .= "user_login: %%user_login%%\n";
                                     $msg .= "user_ip: %%user_ip%%\n";
                                     $msg .= "user_id: %%user_id%%\n";
                                     /**/
                                     if (is_array($fields) && !empty($fields)) {
                                         foreach ($fields as $var => $val) {
                                             $msg .= $var . ": %%" . $var . "%%\n";
                                         }
                                     }
                                     /**/
                                     $msg .= "cv0: %%cv0%%\n";
                                     $msg .= "cv1: %%cv1%%\n";
                                     $msg .= "cv2: %%cv2%%\n";
                                     $msg .= "cv3: %%cv3%%\n";
                                     $msg .= "cv4: %%cv4%%\n";
                                     $msg .= "cv5: %%cv5%%\n";
                                     $msg .= "cv6: %%cv6%%\n";
                                     $msg .= "cv7: %%cv7%%\n";
                                     $msg .= "cv8: %%cv8%%\n";
                                     $msg .= "cv9: %%cv9%%";
                                     /**/
                                     if (($msg = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace("/%%eot_del_type%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($eot_del_type), $msg)) && ($msg = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["subscr_id"]), $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"]["eot_del_notification_recipients"]) as $recipient) {
                                                                         wp_mail($recipient, apply_filters("ws_plugin__optimizemember_eot_del_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_eot_del_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     /**/
                                     $paypal["optimizemember_log"][] = "EOT/Deletion Notification Emails have been processed.";
                                 }
                                 /**/
                                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                                 do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_eot_demote", get_defined_vars());
                                 unset($__refs, $__v);
                                 /* Unset defined __refs, __v. */
                             } else {
                                 if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_eot_behavior"] === "delete") {
                                     $processing = $during = true;
                                     /* Yes, we ARE processing this. */
                                     /**/
                                     $eot_del_type = $GLOBALS["ws_plugin__optimizemember_eot_del_type"] = $is_refund_or_reversal ? "ipn-refund-reversal-deletion" : "ipn-cancellation-expiration-deletion";
                                     /**/
                                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                                     do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_eot_before_delete", get_defined_vars());
                                     do_action("ws_plugin__optimizemember_during_collective_eots", $user_id, get_defined_vars(), $eot_del_type, "removal-deletion");
                                     unset($__refs, $__v);
                                     /* Unset defined __refs, __v. */
                                     /**/
                                     if (is_multisite()) {
                                         remove_user_from_blog($user_id, $current_blog->blog_id);
                                         /* This will automatically trigger `eot_del_notification_urls` as well. */
                                         c_ws_plugin__optimizemember_user_deletions::handle_ms_user_deletions($user_id, $current_blog->blog_id, "s2says");
                                     } else {
                                         /* Otherwise, we can actually delete them. */
                                         /* This will automatically trigger `eot_del_notification_urls` as well. */
                                         wp_delete_user($user_id);
                                     }
                                     /* `c_ws_plugin__optimizemember_user_deletions::handle_user_deletions()` */
                                     /**/
                                     $paypal["optimizemember_log"][] = "This Member's account has been " . (is_multisite() ? "removed" : "deleted") . ".";
                                     /**/
                                     $paypal["optimizemember_log"][] = "EOT/Deletion Notification URLs have been processed.";
                                     /**/
                                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                                     do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_eot_delete", get_defined_vars());
                                     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_paypal_notify_during_subscr_eot", get_defined_vars());
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                         } else {
                             $processing = $during = true;
                             /* Yes, we ARE processing this. */
                             /**/
                             update_user_option($user_id, "optimizemember_auto_eot_time", $auto_eot_time = strtotime("now"));
                             /**/
                             $paypal["optimizemember_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT ( demote|delete ), for now.";
                             $paypal["optimizemember_log"][] = "Recording the Auto-EOT Time for this Member's account: " . date("D M j, Y g:i a T", $auto_eot_time);
                             /**/
                             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                             do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars());
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                         }
                     } else {
                         $paypal["optimizemember_log"][] = "Unable to ( demote|delete ) Member. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
                     }
                 } else {
                     if ($is_delayed_eot && !get_user_option("optimizemember_auto_eot_time", $user_id)) {
                         if (!$user->has_cap("administrator")) {
                             $processing = $during = true;
                             /* Yes, we ARE processing this. */
                             /**/
                             $auto_eot_time = c_ws_plugin__optimizemember_utils_time::auto_eot_time($user_id, $paypal["period1"], $paypal["period3"], "", time());
                             /* We assume the last payment was today, because this is how newer PayPal accounts function with respect to EOT handling.
                             			Newer PayPal accounts ( i.e. Subscription IDs starting with `I-`, will have their EOT triggered upon the last payment. */
                             update_user_option($user_id, "optimizemember_auto_eot_time", $auto_eot_time);
                             /* optimizeMember will follow-up on this later. */
                             /**/
                             $paypal["optimizemember_log"][] = "Auto-EOT Time for this account ( delayed ), set to: " . date("D M j, Y g:i a T", $auto_eot_time);
                             /**/
                             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                             do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_eot_delayed", get_defined_vars());
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                         } else {
                             $paypal["optimizemember_log"][] = "Ignoring Delayed EOT. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
                         }
                     } else {
                         if (!$is_refund_or_reversal || $is_delayed_eot) {
                             $paypal["optimizemember_log"][] = "Skipping ( demote|delete ) Member, for now. An Auto-EOT Time is already set for this account. When an Auto-EOT Time has been recorded, optimizeMember will handle EOT ( demote|delete ) events using it's own Auto-EOT System - internally.";
                         } else {
                             if ($is_reversal) {
                                 $paypal["optimizemember_log"][] = "Skipping ( demote|delete ) Member. Your configuration dictates that optimizeMember should NOT take any immediate action on an EOT associated with a Chargeback Reversal. An optimizeMember API Notification will still be processed however.";
                             } else {
                                 if ($is_refund) {
                                     $paypal["optimizemember_log"][] = "Skipping ( demote|delete ) Member. Your configuration dictates that optimizeMember should NOT take any immediate action on an EOT associated with a Refund. An optimizeMember API Notification will still be processed however.";
                                 }
                             }
                         }
                     }
                 }
             } else {
                 if ($is_delayed_eot) {
                     $paypal["optimizemember_log"][] = "Skipping this IPN response, for now. The Subscr. ID is not associated with a registered Member.";
                     /**/
                     $ipn = array("txn_type" => "subscr_eot");
                     /* Create a simulated IPN response for txn_type=subscr_eot. */
                     /**/
                     foreach ($paypal as $var => $val) {
                         if (in_array($var, array("subscr_gateway", "subscr_id", "custom", "invoice", "payer_email", "first_name", "last_name", "item_name", "item_number", "option_name1", "option_selection1", "option_name2", "option_selection2"))) {
                             $ipn[$var] = $val;
                         }
                     }
                     /**/
                     $paypal["optimizemember_log"][] = "Re-generating. This IPN will go into a Transient Queue; and be re-processed during registration.";
                     /**/
                     set_transient("s2m_" . md5("optimizemember_transient_ipn_subscr_eot_" . $paypal["subscr_id"]), $ipn, 43200);
                 } else {
                     $paypal["optimizemember_log"][] = "Unable to ( demote|delete ) Member. Could not get the existing User ID from the DB. It's possible that it was ALREADY processed through another IPN, removed manually by a Site Administrator, or by optimizeMember's Auto-EOT Sys.";
                 }
             }
             /*
             Refunds and chargeback reversals. This is excluded from the processing check, because a Member *could* have already been (demoted|deleted).
             In other words, optimizeMember sends `Refund/Reversal` Notifications ANYTIME a Refund/Reversal occurs; even if optimizeMember did not process it otherwise.
             Since this routine ignores the processing check, it is *possible* that Refund/Reversal Notification URLs will be contacted more than once.
             	If you're writing scripts that depend on Refund/Reversal Notifications, please keep this in mind.
             */
             if ($is_refund_or_reversal) {
                 $fields = $user_id ? get_user_option("optimizemember_custom_fields", $user_id) : array();
                 /* These will be needed below. */
                 $user_reg_ip = $user_id ? get_user_option("optimizemember_registration_ip", $user_id) : "";
                 /* Needed below. */
                 $user_reg_ip = $paypal["ip"] = $user_reg_ip ? $user_reg_ip : $paypal["ip"];
                 /* Now merge conditionally. */
                 /**/
                 if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ref_rev_notification_urls"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                     foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ref_rev_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)) && ($url = preg_replace("/%%parent_txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["parent_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("/%%-amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["mc_gross"])), $url)) && ($url = preg_replace("/%%-fee%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["mc_fee"])), $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_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"][] = "Refund/Reversal Notification URLs have been processed.";
                 }
                 /**/
                 if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ref_rev_notification_recipients"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                     $msg = $sbj = "( optimizeMember / API Notification Email ) - Refund/Reversal";
                     $msg .= "\n\n";
                     /* Spacing in the message body. */
                     /**/
                     $msg .= "subscr_id: %%subscr_id%%\n";
                     $msg .= "parent_txn_id: %%parent_txn_id%%\n";
                     $msg .= "item_number: %%item_number%%\n";
                     $msg .= "item_name: %%item_name%%\n";
                     $msg .= "-amount: %%-amount%%\n";
                     $msg .= "-fee: %%-fee%%\n";
                     $msg .= "first_name: %%first_name%%\n";
                     $msg .= "last_name: %%last_name%%\n";
                     $msg .= "full_name: %%full_name%%\n";
                     $msg .= "payer_email: %%payer_email%%\n";
                     $msg .= "user_ip: %%user_ip%%\n";
                     $msg .= "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)) && ($msg = preg_replace("/%%parent_txn_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["parent_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("/%%-amount%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_gross"]), $msg)) && ($msg = preg_replace("/%%-fee%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["mc_fee"]), $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_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"]["ref_rev_notification_recipients"]) as $recipient) {
                                                             wp_mail($recipient, apply_filters("ws_plugin__optimizemember_ref_rev_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_ref_rev_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     /**/
                     $paypal["optimizemember_log"][] = "Refund/Reversal Notification Emails have been processed.";
                 }
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars());
                 unset($__refs, $__v);
                 /* Unset defined __refs, __v. */
             }
         } else {
             $paypal["optimizemember_log"][] = "Not processing. Duplicate IPN.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as a type of EOT.";
             $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_subscr_eot", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_or_rp_eots_w_level", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_or_rp_eots_w_level", false, get_defined_vars());
     }
 }
 /**
  * optimizeMember's PayPal IPN handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @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("/^subscr_modify\$/i", $paypal["txn_type"]) && (!empty($paypal["item_number"]) && preg_match($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["membership_item_number_w_level_regex"], $paypal["item_number"])) && !empty($paypal["subscr_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_subscr_modify", 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 ( `subscr_modify` ).";
             /**/
             list($paypal["level"], $paypal["ccaps"]) = preg_split("/\\:/", $paypal["item_number"], 2);
             /**/
             $paypal["ip"] = preg_match("/ip address/i", $paypal["option_name2"]) && $paypal["option_selection2"] ? $paypal["option_selection2"] : "";
             $paypal["ip"] = !$paypal["ip"] && preg_match("/^[a-z0-9]+~[0-9\\.]+\$/i", $paypal["invoice"]) ? preg_replace("/^[a-z0-9]+~/i", "", $paypal["invoice"]) : $paypal["ip"];
             /**/
             $paypal["period1"] = preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["period1"] : "0 D";
             /* Defaults to "0 D" ( zero days ). */
             $paypal["mc_amount1"] = strlen($paypal["mc_amount1"]) && $paypal["mc_amount1"] > 0 ? $paypal["mc_amount1"] : "0.00";
             /* "0.00". */
             /**/
             $paypal["initial_term"] = preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["period1"] : "0 D";
             /* Defaults to "0 D" ( zero days ). */
             $paypal["initial"] = strlen($paypal["mc_amount1"]) && preg_match("/^[1-9]/", $paypal["period1"]) ? $paypal["mc_amount1"] : $paypal["mc_amount3"];
             $paypal["regular"] = $paypal["mc_amount3"];
             /* This is the Regular Payment Amount that is charged to the Customer. Always required by PayPal. */
             $paypal["regular_term"] = $paypal["period3"];
             /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
             $paypal["recurring"] = $paypal["recurring"] ? $paypal["mc_amount3"] : "0";
             /* If non-recurring, this should be zero, otherwise Regular. */
             /**/
             eval('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["optimizemember_log"]);');
             /* Create array of IPN signup vars w/o optimizemember_log. */
             /**/
             if (($user_id = c_ws_plugin__optimizemember_utils_users::get_user_id_with($paypal["subscr_id"])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                 if (!$user->has_cap("administrator")) {
                     $processing = $modifying = $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_subscr_modify", get_defined_vars());
                     do_action("ws_plugin__optimizemember_during_collective_mods", $user_id, get_defined_vars(), "ipn-upgrade-downgrade", "modification", "optimizemember_level" . $paypal["level"]);
                     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" => "optimizemember_level" . $paypal["level"]));
                         $user = new WP_User($user_id);
                     }
                     /**/
                     $current_role = c_ws_plugin__optimizemember_user_access::user_access_role($user);
                     /**/
                     if ($current_role !== "optimizemember_level" . $paypal["level"]) {
                         /* Only if we need to. */
                         $user->set_role("optimizemember_level" . $paypal["level"]);
                     }
                     /* (upgrade/downgrade) */
                     /**/
                     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);
                             }
                         }
                     }
                     /**/
                     update_user_option($user_id, "optimizemember_subscr_gateway", $paypal["subscr_gateway"]);
                     update_user_option($user_id, "optimizemember_subscr_id", $paypal["subscr_id"]);
                     update_user_option($user_id, "optimizemember_custom", $paypal["custom"]);
                     /**/
                     if (!get_user_option("optimizemember_registration_ip", $user_id)) {
                         update_user_option($user_id, "optimizemember_registration_ip", $paypal["ip"]);
                     }
                     /**/
                     update_user_option($user_id, "optimizemember_ipn_signup_vars", $ipn_signup_vars);
                     /**/
                     delete_user_option($user_id, "optimizemember_file_download_access_log");
                     /**/
                     delete_user_option($user_id, "optimizemember_auto_eot_time");
                     /**/
                     $pr_times = get_user_option("optimizemember_paid_registration_times", $user_id);
                     $pr_times["level"] = !$pr_times["level"] ? time() : $pr_times["level"];
                     /* Preserves existing. */
                     $pr_times["level" . $paypal["level"]] = !$pr_times["level" . $paypal["level"]] ? time() : $pr_times["level" . $paypal["level"]];
                     update_user_option($user_id, "optimizemember_paid_registration_times", $pr_times);
                     /* Update now. */
                     /**/
                     c_ws_plugin__optimizemember_user_notes::clear_user_note_lines($user_id, "/^Demoted by optimizeMember\\:/");
                     /**/
                     $paypal["optimizemember_log"][] = "optimizeMember Level/Capabilities updated on Subscription modification.";
                     /**/
                     c_ws_plugin__optimizemember_email_configs::email_config() . wp_mail($paypal["payer_email"], apply_filters("ws_plugin__optimizemember_modification_email_sbj", _x("Thank you! Your account has been updated.", "s2member-front", "s2member"), get_defined_vars()), apply_filters("ws_plugin__optimizemember_modification_email_msg", _x("Thank you! You've been updated 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"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
                     /**/
                     if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["modification_notification_urls"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                         foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["modification_notification_urls"]) as $url) {
                             /**/
                             if (($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["subscr_id"])), $url))) {
                                 if (($url = preg_replace("/%%initial%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["initial"])), $url)) && ($url = preg_replace("/%%regular%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["regular"])), $url)) && ($url = preg_replace("/%%recurring%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["recurring"])), $url))) {
                                     if (($url = preg_replace("/%%initial_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["initial_term"])), $url)) && ($url = preg_replace("/%%regular_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($paypal["regular_term"])), $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"][] = "Modification Notification URLs have been processed.";
                     }
                     /**/
                     if ($processing && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["modification_notification_recipients"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                         $msg = $sbj = "( optimizeMember / API Notification Email ) - Modification";
                         $msg .= "\n\n";
                         /* Spacing in the message body. */
                         /**/
                         $msg .= "subscr_id: %%subscr_id%%\n";
                         $msg .= "initial: %%initial%%\n";
                         $msg .= "regular: %%regular%%\n";
                         $msg .= "recurring: %%recurring%%\n";
                         $msg .= "initial_term: %%initial_term%%\n";
                         $msg .= "regular_term: %%regular_term%%\n";
                         $msg .= "item_number: %%item_number%%\n";
                         $msg .= "item_name: %%item_name%%\n";
                         $msg .= "first_name: %%first_name%%\n";
                         $msg .= "last_name: %%last_name%%\n";
                         $msg .= "full_name: %%full_name%%\n";
                         $msg .= "payer_email: %%payer_email%%\n";
                         /**/
                         $msg .= "user_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("/%%initial%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial"]), $msg)) && ($msg = preg_replace("/%%regular%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular"]), $msg)) && ($msg = preg_replace("/%%recurring%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["recurring"]), $msg))) {
                                 if (($msg = preg_replace("/%%initial_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial_term"]), $msg)) && ($msg = preg_replace("/%%regular_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular_term"]), $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"]["modification_notification_recipients"]) as $recipient) {
                                                                                     wp_mail($recipient, apply_filters("ws_plugin__optimizemember_modification_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_modification_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         /**/
                         $paypal["optimizemember_log"][] = "Modification Notification Emails have been processed.";
                     }
                     /**/
                     if ($processing && ($code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["modification_tracking_codes"]) && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                         if (($code = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $code)) && ($code = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["subscr_id"]), $code))) {
                             if (($code = preg_replace("/%%initial%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial"]), $code)) && ($code = preg_replace("/%%regular%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular"]), $code)) && ($code = preg_replace("/%%recurring%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["recurring"]), $code))) {
                                 if (($code = preg_replace("/%%initial_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["initial_term"]), $code)) && ($code = preg_replace("/%%regular_term%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($paypal["regular_term"]), $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 Modification Tracking Codes into a Transient Queue. These will be processed on-site.";
                                                                                 set_transient("s2m_" . md5("optimizemember_transient_modification_tracking_codes_" . $paypal["subscr_id"]), $code, 43200);
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     /**/
                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                     do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_modify", get_defined_vars());
                     unset($__refs, $__v);
                     /* Unset defined __refs, __v. */
                 } else {
                     $paypal["optimizemember_log"][] = "Unable to modify Subscription. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
                 }
             } else {
                 $paypal["optimizemember_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
             }
         } else {
             $paypal["optimizemember_log"][] = "Not processing. Duplicate IPN.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `subscr_modify` ).";
             $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_subscr_modify", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_modify_w_level", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_modify_w_level", false, get_defined_vars());
     }
 }
 /**
  * Handles PayPal Button encryption.
  *
  * This uses the PayPal API. optimizeMember will NOT attempt to encrypt Buttons until there is at least a Business Email Address and API Username configured.
  * optimizeMember also maintains a log of communication with the PayPal API. If logging is enabled, check: `/wp-content/plugins/optimizemember-logs/paypal-api.log`.
  *
  * @package optimizeMember\PayPal
  * @since 3.5
  *
  * @param str $code The PayPal Button Code before encryption.
  * @param array $vars An array of defined variables in the scope of the calling Filter.
  * @return str The Resulting PayPal Button Code *( possibly encrypted, depending on configuration )*.
  */
 public static function sc_paypal_button_encryption($code = FALSE, $vars = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_sc_paypal_button_encryption", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_btn_encryption"] && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"] && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_api_username"]) {
         $cache = apply_filters("ws_plugin__optimizemember_sc_paypal_button_encryption_cache", true, get_defined_vars());
         /**/
         eval('$_code = $vars["_code"]; $attr = $vars["attr"];');
         /* Let's unpack ( i.e. use shorter references ) to these two important vars. */
         /**/
         if ($cache && ($transient = "s2m_btn_" . md5($code . c_ws_plugin__optimizemember_utilities::ver_checksum())) && ($cache = get_transient($transient))) {
             $code = $cache;
         } else {
             if (is_array($inputs = c_ws_plugin__optimizemember_utils_forms::form_whips_2_array($_code)) && !empty($inputs)) {
                 $paypal = array("METHOD" => "BMCreateButton", "BUTTONCODE" => "ENCRYPTED", "BUTTONTYPE" => $attr["sp"] || $attr["rr"] === "BN" ? "BUYNOW" : "SUBSCRIBE");
                 /**/
                 $i = 0;
                 /* Initialize incremental variable counter. PayPal wants these numbered using L_BUTTONVAR{n}; where {n} starts at zero. */
                 foreach ($inputs as $input => $value) {
                     /* Now run through each of the input variables that we parsed from the Full Button Code */
                     if (!preg_match("/^cmd\$/i", $input)) {
                         /* The PayPal API method `BMCreateButton` expects (amount|a1|a3) to include 2 decimal places. */
                         if (preg_match("/^(amount|a1|a3)\$/i", $input)) {
                             $value = number_format($value, 2, ".", "");
                         }
                         /**/
                         $paypal["L_BUTTONVAR" . $i] = $input . "=" . $value;
                         $i++;
                         /* Increment variable counter. */
                     }
                 }
                 /**/
                 if (($paypal = c_ws_plugin__optimizemember_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"]) && !empty($paypal["WEBSITECODE"]) && ($code = $paypal["WEBSITECODE"])) {
                     $default_image = "https://www.paypal.com/" . _x("en_US", "s2member-front paypal-button-lang-code", "s2member") . "/i/btn/btn_xpressCheckout.gif";
                     /**/
                     $code = preg_replace("/\\<img[^\\>]+\\>/i", "", $code);
                     /* Remove the 1x1 pixel tracking image that PayPal sticks in there. */
                     $code = preg_replace("/(\\<input)([^\\>]+)(\\>)/ie", "'\\1'.rtrim(stripslashes('\\2'),'/').' /\\3'", $code);
                     /* Use XHTML! */
                     /**/
                     $code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                     /**/
                     $code = $attr["output"] === "anchor" ? '<a href="' . esc_attr(c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code)) . '"><img src="' . esc_attr($attr["image"] && $attr["image"] !== "default" ? $attr["image"] : $default_image) . '" style="width:auto; height:auto; border:0;" alt="PayPal" /></a>' : $code;
                     $code = $attr["output"] === "url" ? c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code) : $code;
                     /**/
                     $cache && $transient ? set_transient($transient, $code, apply_filters("ws_plugin__optimizemember_sc_paypal_button_encryption_cache_exp_time", 3600, get_defined_vars())) : null;
                     /* Caching? */
                 }
             }
         }
     }
     /* No WordPress Filters apply here. */
     /* Instead, use: `ws_plugin__optimizemember_sc_paypal_button`. */
     return $code;
     /* Button Code. Possibly w/ API encryption now. */
 }
 /**
  * optimizeMember's PayPal Auto-Return/PDT handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link optimizeMember\PayPal\c_ws_plugin__optimizemember_paypal_return_in::paypal_return()}.
  * @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_return_before_new_ccaps", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         if (!get_transient($transient_rtn = "s2m_rtn_" . md5("optimizemember_transient_" . $_paypal_s)) && set_transient($transient_rtn, 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"];
             $paypal["ip"] = !$paypal["ip"] && $_SERVER["REMOTE_ADDR"] ? $_SERVER["REMOTE_ADDR"] : $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. */
                         /**/
                         $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.";
                         /**/
                         setcookie("optimizemember_tracking", $optimizemember_tracking = c_ws_plugin__optimizemember_utils_encryption::encrypt($paypal["subscr_id"]), time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("optimizemember_tracking", $optimizemember_tracking, time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE["optimizemember_tracking"] = $optimizemember_tracking);
                         /**/
                         $paypal["optimizemember_log"][] = "Transient Tracking Cookie set on ( `web_accept` ) w/ update vars for Capabilities w/o Level.";
                         /**/
                         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_return_during_new_ccaps", get_defined_vars());
                         unset($__refs, $__v);
                         /* Unset defined __refs, __v. */
                         /**/
                         if ($redirection_url_after_capabilities = apply_filters("ws_plugin__optimizemember_redirection_url_after_capabilities", false, get_defined_vars())) {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to a custom URL after Capabilities: " . $redirection_url_after_capabilities;
                             /**/
                             wp_redirect($redirection_url_after_capabilities);
                         } else {
                             $paypal["optimizemember_log"][] = "Redirecting Customer to the Login Page. They need to log back in.";
                             /**/
                             echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], '<strong>' . _x("Thank you! You now have access to:", "s2member-front", "s2member") . '<br /><em>' . esc_html($paypal["item_name"]) . '</em></strong>', _x("Please Log Back In ( Click Here )", "s2member-front", "s2member"), wp_login_url());
                         }
                     } 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. Please make sure that you are NOT logged in as an Administrator while testing.";
                         /**/
                         $paypal["optimizemember_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
                         /**/
                         echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to add new Capabilities.<br />Please contact Support for assistance.<br /><br />The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access. Please make sure that you are NOT logged in as an Administrator while testing.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                     }
                 } else {
                     $paypal["optimizemember_log"][] = "Unable to add new Capabilities. Could not get the existing User ID from the DB.";
                     /**/
                     $paypal["optimizemember_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
                     /**/
                     echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to add new Capabilities.<br />Please contact Support for assistance.<br /><br />Could not get the existing User ID from the DB.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                 }
             } else {
                 $paypal["optimizemember_log"][] = "Unable to add new Capabilities. Missing User/Member details. Please check the `on0` and `os0` variables in your Button Code.";
                 /**/
                 $paypal["optimizemember_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
                 /**/
                 echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to add new Capabilities.<br />Please contact Support for assistance.<br /><br />Missing User/Member details.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
             }
         } else {
             $paypal["optimizemember_log"][] = "Page Expired. Duplicate Return-Data.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `web_accept` ) w/ update vars for Capabilities w/o Level.";
             $paypal["optimizemember_log"][] = "Page Expired. Redirecting Customer to the Home Page.";
             /**/
             echo c_ws_plugin__optimizemember_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Page Expired:</strong> Duplicate Return-Data.<br />Please contact Support if you need any assistance.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
         }
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_return_after_new_ccaps", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_return_in_wa_ccaps_wo_level", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_return_in_wa_ccaps_wo_level", false, get_defined_vars());
     }
 }
 /**
  * optimizeMember's PayPal IPN handler ( inner processing routine ).
  *
  * @package optimizeMember\PayPal
  * @since 110720
  *
  * @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("/^(subscr_cancel|recurring_payment_profile_cancel)\$/i", $paypal["txn_type"]) && !(preg_match("/^recurring_payment_profile_cancel\$/i", $paypal["txn_type"]) && !empty($paypal["initial_payment_status"]) && preg_match("/^failed\$/i", $paypal["initial_payment_status"])) && ((!empty($paypal["item_number"]) || ($paypal["item_number"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_number($paypal))) && preg_match($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["membership_item_number_w_level_regex"], $paypal["item_number"])) && (!empty($paypal["period1"]) || ($paypal["period1"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period1($paypal)) || ($paypal["period1"] = "0 D")) && (!empty($paypal["period3"]) || ($paypal["period3"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_period3($paypal))) && (!empty($paypal["subscr_id"]) || ($paypal["subscr_id"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_subscr_id($paypal))) && (!empty($paypal["item_name"]) || ($paypal["item_name"] = c_ws_plugin__optimizemember_paypal_utilities::paypal_pro_item_name($paypal))) && (!empty($paypal["payer_email"]) || ($paypal["payer_email"] = c_ws_plugin__optimizemember_utils_users::get_user_email_with($paypal["subscr_id"])))) {
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_paypal_notify_before_subscr_cancel", 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 ( `subscr_cancel|recurring_payment_profile_cancel` ).";
             /**/
             list($paypal["level"], $paypal["ccaps"]) = preg_split("/\\:/", $paypal["item_number"], 2);
             /**/
             $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 (($user_id = c_ws_plugin__optimizemember_utils_users::get_user_id_with($paypal["subscr_id"])) && is_object($user = new WP_User($user_id)) && $user->ID) {
                 if (!$user->has_cap("administrator")) {
                     $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 (!get_user_option("optimizemember_auto_eot_time", $user_id)) {
                         $processing = $during = true;
                         /* Yes, we ARE processing this. */
                         /**/
                         $auto_eot_time = c_ws_plugin__optimizemember_utils_time::auto_eot_time($user_id, $paypal["period1"], $paypal["period3"]);
                         /**/
                         update_user_option($user_id, "optimizemember_auto_eot_time", $auto_eot_time);
                         /* optimizeMember follows-up later. */
                         /**/
                         $paypal["optimizemember_log"][] = "Auto-EOT Time for this account: " . date("D M j, Y g:i a T", $auto_eot_time);
                         /**/
                         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                         do_action("ws_plugin__optimizemember_during_paypal_notify_during_subscr_cancel", get_defined_vars());
                         unset($__refs, $__v);
                         /* Unset defined __refs, __v. */
                     } else {
                         $paypal["optimizemember_log"][] = "Ignoring Cancellation. An Auto-EOT Time is already set for this Member. An optimizeMember API Notification will still be processed however.";
                     }
                     /**/
                     if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["cancellation_notification_urls"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                         foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["cancellation_notification_urls"]) as $url) {
                             /* Handle Cancellation Notifications. */
                             /**/
                             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("/%%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("/%%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"][] = "Cancellation Notification URLs have been processed.";
                     }
                     /**/
                     if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["cancellation_notification_recipients"] && is_array($cv = preg_split("/\\|/", $paypal["custom"]))) {
                         $msg = $sbj = "( optimizeMember / API Notification Email ) - Cancellation";
                         $msg .= "\n\n";
                         /* Spacing in the message body. */
                         /**/
                         $msg .= "subscr_id: %%subscr_id%%\n";
                         $msg .= "item_number: %%item_number%%\n";
                         $msg .= "item_name: %%item_name%%\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("/%%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("/%%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"]["cancellation_notification_recipients"]) as $recipient) {
                                                                 wp_mail($recipient, apply_filters("ws_plugin__optimizemember_cancellation_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_cancellation_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         /**/
                         $paypal["optimizemember_log"][] = "Cancellation Notification Emails have been processed.";
                     }
                 } else {
                     $paypal["optimizemember_log"][] = "Ignoring Cancellation. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
                 }
             } else {
                 $paypal["optimizemember_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
             }
         } else {
             $paypal["optimizemember_log"][] = "Not processing. Duplicate IPN.";
             $paypal["optimizemember_log"][] = "optimizeMember `txn_type` identified as ( `subscr_cancel|recurring_payment_profile_cancel` ).";
             $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_subscr_cancel", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_or_rp_cancellation_w_level", $paypal, get_defined_vars());
     } else {
         return apply_filters("c_ws_plugin__optimizemember_paypal_notify_in_subscr_or_rp_cancellation_w_level", false, get_defined_vars());
     }
 }
 /**
  * Fills Replacement Codes in Special Redirection URLs.
  *
  * @package optimizeMember\Login_Redirects
  * @since 3.5
  *
  * @param str $url A URL with possible Replacement Codes in it.
  * @param obj $user Optional. A `WP_User` object. Defaults to the current User, if logged-in.
  * @param bool $root_returns_false Defaults to false. True if the function should return false when a URL is reduced to the site root.
  * @return str|bool A Special Login Redirection URL with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URL is the site root.
  */
 public static function fill_login_redirect_rc_vars($url = FALSE, $user = FALSE, $root_returns_false = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_fill_login_redirect_rc_vars", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $url = (string) $url;
     /* Force ``$url`` to a string value. */
     $orig_url = $url;
     /* Record the original URL that was passed in. */
     /**/
     $user = (is_object($user) || is_object($user = is_user_logged_in() ? wp_get_current_user() : false)) && !empty($user->ID) ? $user : false;
     /**/
     $user_id = $user ? (string) $user->ID : "";
     $user_login = $user ? (string) strtolower($user->user_login) : "";
     /**/
     $user_level = (string) c_ws_plugin__optimizemember_user_access::user_access_level($user);
     $user_role = (string) c_ws_plugin__optimizemember_user_access::user_access_role($user);
     $user_ccaps = (string) implode("-", c_ws_plugin__optimizemember_user_access::user_access_ccaps($user));
     $user_logins = $user ? (string) (int) get_user_option("optimizemember_login_counter", $user_id) : "-1";
     /**/
     $url = preg_replace("/%%current_user_login%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_login), $url);
     $url = preg_replace("/%%current_user_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_id), $url);
     $url = preg_replace("/%%current_user_level%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_level), $url);
     $url = preg_replace("/%%current_user_role%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_role), $url);
     $url = preg_replace("/%%current_user_ccaps%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_ccaps), $url);
     $url = preg_replace("/%%current_user_logins%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($user_logins), $url);
     /**/
     if ($url !== $orig_url && (!($parse = c_ws_plugin__optimizemember_utils_urls::parse_url($url, -1, false)) || !empty($parse["path"]) && strpos($parse["path"], "//") !== false)) {
         $url = site_url("/");
     }
     /* Defaults to Home Page. We don't return invalid URLs produced by empty Replacement Codes ( i.e. with `//` ). */
     /**/
     if ($root_returns_false && c_ws_plugin__optimizemember_utils_conds::is_site_root($url)) {
         $url = false;
     }
     /* In case we need to return false on root URLs ( i.e. don't protect the Home Page inadvertently ). */
     /**/
     return apply_filters("ws_plugin__optimizemember_fill_login_redirect_rc_vars", $url, get_defined_vars());
 }
 /**
  * Checks to see if a Coupon Code was supplied, and if so; what does it provide?
  *
  * @package optimizeMember\PayPal
  * @since 1.5
  *
  * @param array $attr An array of Pro Form Attributes.
  * @param str $coupon_code Optional. A possible Coupon Code supplied by the Customer.
  * @param str $return Optional. Return type. One of `response|attr`. Defaults to `attr`.
  * @param array $process Optional. An array of additional processing routines to run here.
  * 	One or more of these values: `affiliates-1px-response|affiliates-silent-post|notifications`.
  * @return array|str Original array, with prices and description modified when/if a Coupon Code is accepted.
  * 	Or, if ``$return === "response"``, return a string response, indicating status.
  *
  * @todo See if it's possible to simplify this routine.
  * @todo Add support for tracking Coupon Code usage.
  * @todo Add support for a fixed number of uses.
  */
 public static function paypal_apply_coupon($attr = FALSE, $coupon_code = FALSE, $return = FALSE, $process = FALSE)
 {
     if (($coupon_code = trim(strtolower($coupon_code))) || ($coupon_code = trim(strtolower($attr["coupon"])))) {
         if ($attr["accept_coupons"] && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_coupon_codes"]) {
             $cs = c_ws_plugin__optimizemember_utils_cur::symbol($attr["cc"]);
             $tx = c_ws_plugin__optimizemember_pro_paypal_utilities::paypal_tax_may_apply() ? _x(" + tax", "s2member-front", "s2member") : "";
             $ps = _x("%", "s2member-front percentage-symbol", "s2member");
             /**/
             if (strlen($affiliate_suffix_chars = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_affiliate_coupon_code_suffix_chars"])) {
                 if (preg_match("/^(.+?)" . preg_quote($affiliate_suffix_chars, "/") . "([0-9]+)\$/i", $coupon_code, $m)) {
                     ($full_coupon_code = $m[0]) . ($coupon_code = $m[1]) . ($affiliate_id = $m[2]);
                 }
             }
             unset($affiliate_suffix_chars, $m);
             /**/
             foreach (c_ws_plugin__optimizemember_utils_strings::trim_deep(preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_coupon_codes"])) as $_line) {
                 if (($_line = trim($_line, " \r\n\t\v|")) && is_array($_coupon = preg_split("/\\|/", $_line))) {
                     $coupon["code"] = !empty($_coupon[0]) ? trim(strtolower($_coupon[0])) : "";
                     /**/
                     $coupon["percentage"] = !empty($_coupon[1]) && preg_match("/%/", $_coupon[1]) ? (double) $_coupon[1] : 0;
                     $coupon["flat-rate"] = !empty($_coupon[1]) && !preg_match("/%/", $_coupon[1]) ? (double) $_coupon[1] : 0;
                     /**/
                     $coupon["expired"] = !empty($_coupon[2]) && strtotime($_coupon[2]) < time() ? $_coupon[2] : false;
                     /**/
                     $coupon["directive"] = !empty($_coupon[3]) && ($_coupon[3] = strtolower($_coupon[3])) ? preg_replace("/_/", "-", $_coupon[3]) : "all";
                     $coupon["directive"] = preg_match("/^(ta-only|ra-only|all)\$/", $coupon["directive"]) ? $coupon["directive"] : "all";
                     /**/
                     $coupon["singulars"] = !empty($_coupon[4]) && ($_coupon[4] = strtolower($_coupon[4])) && $_coupon[4] !== "all" ? $_coupon[4] : "all";
                     $coupon["singulars"] = $coupon["singulars"] !== "all" ? preg_split("/[\r\n\t\\s;,]+/", trim(preg_replace("/[^0-9,]/", "", $coupon["singulars"]), ",")) : array("all");
                     /**/
                     unset($_line, $_coupon);
                     /**/
                     if ($coupon_code === $coupon["code"] && !$coupon["expired"]) {
                         if ($coupon["singulars"] === array("all") || in_array($attr["singular"], $coupon["singulars"])) {
                             $coupon_accepted = true;
                             /**/
                             if ($coupon["flat-rate"]) {
                                 if (($coupon["directive"] === "ra-only" || $coupon["directive"] === "all") && $attr["sp"]) {
                                     $coupon_applies = true;
                                     /**/
                                     $ta = number_format($attr["ta"], 2, ".", "");
                                     $ta = $ta >= 0.0 ? $ta : "0.00";
                                     /**/
                                     $ra = number_format($attr["ra"] - $coupon["flat-rate"], 2, ".", "");
                                     $ra = $ra >= 0.01 ? $ra : "0.01";
                                     /**/
                                     $desc = sprintf(_x("COUPON %s off. ( Now: %s )", "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . $ra . $tx);
                                     $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>', "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . $ra . $tx);
                                 } else {
                                     if ($coupon["directive"] === "ta-only" && $attr["tp"] && !$attr["sp"]) {
                                         $coupon_applies = true;
                                         /**/
                                         $ta = number_format($attr["ta"] - $coupon["flat-rate"], 2, ".", "");
                                         $ta = $ta >= 0.0 ? $ta : "0.00";
                                         /**/
                                         $ra = number_format($attr["ra"], 2, ".", "");
                                         $ra = $ra >= 0.01 ? $ra : "0.01";
                                         /**/
                                         $desc = sprintf(_x("COUPON %s off. ( Now: %s, then %s )", "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                         $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>', "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                     } else {
                                         if ($coupon["directive"] === "ra-only" && $attr["tp"] && !$attr["sp"]) {
                                             $coupon_applies = true;
                                             /**/
                                             $ta = number_format($attr["ta"], 2, ".", "");
                                             $ta = $ta >= 0.0 ? $ta : "0.00";
                                             /**/
                                             $ra = number_format($attr["ra"] - $coupon["flat-rate"], 2, ".", "");
                                             $ra = $ra >= 0.01 ? $ra : "0.01";
                                             /**/
                                             $desc = sprintf(_x("COUPON %s off. ( Now: %s, then %s )", "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                             $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>', "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                         } else {
                                             if ($coupon["directive"] === "all" && $attr["tp"] && !$attr["sp"]) {
                                                 $coupon_applies = true;
                                                 /**/
                                                 $ta = number_format($attr["ta"] - $coupon["flat-rate"], 2, ".", "");
                                                 $ta = $ta >= 0.0 ? $ta : "0.00";
                                                 /**/
                                                 $ra = number_format($attr["ra"] - $coupon["flat-rate"], 2, ".", "");
                                                 $ra = $ra >= 0.01 ? $ra : "0.01";
                                                 /**/
                                                 $desc = sprintf(_x("COUPON %s off. ( Now: %s, then %s )", "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                                 $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>', "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                             } else {
                                                 if ($coupon["directive"] === "ra-only" && !$attr["tp"] && !$attr["sp"]) {
                                                     $coupon_applies = true;
                                                     /**/
                                                     $ta = number_format($attr["ta"], 2, ".", "");
                                                     $ta = $ta >= 0.0 ? $ta : "0.00";
                                                     /**/
                                                     $ra = number_format($attr["ra"] - $coupon["flat-rate"], 2, ".", "");
                                                     $ra = $ra >= 0.01 ? $ra : "0.01";
                                                     /**/
                                                     $desc = sprintf(_x("COUPON %s off. ( Now: %s )", "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                     $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>', "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                 } else {
                                                     if ($coupon["directive"] === "all" && !$attr["tp"] && !$attr["sp"]) {
                                                         $coupon_applies = true;
                                                         /**/
                                                         $ta = number_format($attr["ta"] - $coupon["flat-rate"], 2, ".", "");
                                                         $ta = $ta >= 0.0 ? $ta : "0.00";
                                                         /**/
                                                         $ra = number_format($attr["ra"] - $coupon["flat-rate"], 2, ".", "");
                                                         $ra = $ra >= 0.01 ? $ra : "0.01";
                                                         /**/
                                                         $desc = sprintf(_x("COUPON %s off. ( Now: %s )", "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                         $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>', "s2member-front", "s2member"), $cs . number_format($coupon["flat-rate"], 2, ".", ""), $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                     } else {
                                                         /* Otherwise, we need a default response to display. */
                                                         $response = _x('<div>Sorry, your Coupon is not applicable.</div>', "s2member-front", "s2member");
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             } else {
                                 if ($coupon["percentage"]) {
                                     if (($coupon["directive"] === "ra-only" || $coupon["directive"] === "all") && $attr["sp"]) {
                                         $coupon_applies = true;
                                         /**/
                                         $p = $attr["ta"] / 100 * $coupon["percentage"];
                                         $ta = number_format($attr["ta"], 2, ".", "");
                                         $ta = $ta >= 0.0 ? $ta : "0.00";
                                         /**/
                                         $p = $attr["ra"] / 100 * $coupon["percentage"];
                                         $ra = number_format($attr["ra"] - $p, 2, ".", "");
                                         $ra = $ra >= 0.01 ? $ra : "0.01";
                                         /**/
                                         $desc = sprintf(_x("COUPON %s off. ( Now: %s )", "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . $ra . $tx);
                                         $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>', "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . $ra . $tx);
                                     } else {
                                         if ($coupon["directive"] === "ta-only" && $attr["tp"] && !$attr["sp"]) {
                                             $coupon_applies = true;
                                             /**/
                                             $p = $attr["ta"] / 100 * $coupon["percentage"];
                                             $ta = number_format($attr["ta"] - $p, 2, ".", "");
                                             $ta = $ta >= 0.0 ? $ta : "0.00";
                                             /**/
                                             $p = $attr["ra"] / 100 * $coupon["percentage"];
                                             $ra = number_format($attr["ra"], 2, ".", "");
                                             $ra = $ra >= 0.01 ? $ra : "0.01";
                                             /**/
                                             $desc = sprintf(_x("COUPON %s off. ( Now: %s, then %s )", "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                             $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>', "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                         } else {
                                             if ($coupon["directive"] === "ra-only" && $attr["tp"] && !$attr["sp"]) {
                                                 $coupon_applies = true;
                                                 /**/
                                                 $p = $attr["ta"] / 100 * $coupon["percentage"];
                                                 $ta = number_format($attr["ta"], 2, ".", "");
                                                 $ta = $ta >= 0.0 ? $ta : "0.00";
                                                 /**/
                                                 $p = $attr["ra"] / 100 * $coupon["percentage"];
                                                 $ra = number_format($attr["ra"] - $p, 2, ".", "");
                                                 $ra = $ra >= 0.01 ? $ra : "0.01";
                                                 /**/
                                                 $desc = sprintf(_x("COUPON %s off. ( Now: %s, then %s )", "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                                 $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>', "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                             } else {
                                                 if ($coupon["directive"] === "all" && $attr["tp"] && !$attr["sp"]) {
                                                     $coupon_applies = true;
                                                     /**/
                                                     $p = $attr["ta"] / 100 * $coupon["percentage"];
                                                     $ta = number_format($attr["ta"] - $p, 2, ".", "");
                                                     $ta = $ta >= 0.0 ? $ta : "0.00";
                                                     /**/
                                                     $p = $attr["ra"] / 100 * $coupon["percentage"];
                                                     $ra = number_format($attr["ra"] - $p, 2, ".", "");
                                                     $ra = $ra >= 0.01 ? $ra : "0.01";
                                                     /**/
                                                     $desc = sprintf(_x("COUPON %s off. ( Now: %s, then %s )", "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                                     $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>', "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ta, $attr["tp"] . " " . $attr["tt"]) . $tx, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]));
                                                 } else {
                                                     if ($coupon["directive"] === "ra-only" && !$attr["tp"] && !$attr["sp"]) {
                                                         $coupon_applies = true;
                                                         /**/
                                                         $p = $attr["ta"] / 100 * $coupon["percentage"];
                                                         $ta = number_format($attr["ta"], 2, ".", "");
                                                         $ta = $ta >= 0.0 ? $ta : "0.00";
                                                         /**/
                                                         $p = $attr["ra"] / 100 * $coupon["percentage"];
                                                         $ra = number_format($attr["ra"] - $p, 2, ".", "");
                                                         $ra = $ra >= 0.01 ? $ra : "0.01";
                                                         /**/
                                                         $desc = sprintf(_x("COUPON %s off. ( Now: %s )", "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                         $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>', "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                     } else {
                                                         if ($coupon["directive"] === "all" && !$attr["tp"] && !$attr["sp"]) {
                                                             $coupon_applies = true;
                                                             /**/
                                                             $p = $attr["ta"] / 100 * $coupon["percentage"];
                                                             $ta = number_format($attr["ta"] - $p, 2, ".", "");
                                                             $ta = $ta >= 0.0 ? $ta : "0.00";
                                                             /**/
                                                             $p = $attr["ra"] / 100 * $coupon["percentage"];
                                                             $ra = number_format($attr["ra"] - $p, 2, ".", "");
                                                             $ra = $ra >= 0.01 ? $ra : "0.01";
                                                             /**/
                                                             $desc = sprintf(_x("COUPON %s off. ( Now: %s )", "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                             $response = sprintf(_x('<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>', "s2member-front", "s2member"), number_format($coupon["percentage"], 0) . $ps, $cs . c_ws_plugin__optimizemember_utils_time::amount_period_term($ra, $attr["rp"] . " " . $attr["rt"], $attr["rr"]) . $tx);
                                                         } else {
                                                             /* Otherwise, we need a default response to display. */
                                                             $response = _x('<div>Sorry, your Coupon is not applicable.</div>', "s2member-front", "s2member");
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 } else {
                                     /* Else there was no discount applied at all. */
                                     $response = sprintf(_x('<div>Coupon: <strong>%s0.00 off</strong>.</div>', "s2member-front", "s2member"), $cs);
                                 }
                             }
                         } else {
                             /* Otherwise, we need a response that indicates not applicable for this purchase. */
                             $response = _x('<div>Sorry, your Coupon cannot be applied to this particular purchase.</div>', "s2member-front", "s2member");
                         }
                     } else {
                         if ($coupon_code === $coupon["code"] && $coupon["expired"]) {
                             $response = sprintf(_x('<div>Sorry, your Coupon <strong>expired</strong>: <em>%s</em>.</div>', "s2member-front", "s2member"), $coupon["expired"]);
                         }
                     }
                 }
             }
             /**/
             if (isset($coupon_applies, $desc) && $coupon_applies) {
                 /* translators: `%1$s` is new price/description, after coupon applied. `%2$s` is original description. */
                 $attr["desc"] = sprintf(_x('%1$s ~ ORIGINALLY: %2$s', "s2member-front", "s2member"), $desc, $attr["desc"]);
             }
             /**/
             $attr["ta"] = isset($coupon_applies, $ta) && $coupon_applies ? $ta : $attr["ta"];
             $attr["ra"] = isset($coupon_applies, $ra) && $coupon_applies ? $ra : $attr["ra"];
             /**/
             if (is_array($process) && (in_array("affiliates-silent-post", $process) || in_array("affiliates-1px-response", $process))) {
                 if (isset($coupon_applies) && $coupon_applies && !empty($affiliate_id)) {
                     if (empty($_COOKIE["idev"])) {
                         if ($_urls = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_affiliate_coupon_code_tracking_urls"]) {
                             /**/
                             foreach (preg_split("/[\r\n\t]+/", $_urls) as $_url) {
                                 /**/
                                 if ($_url = preg_replace("/%%full_coupon_code%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($full_coupon_code)), $_url)) {
                                     if ($_url = preg_replace("/%%coupon_code%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($coupon_code)), $_url)) {
                                         if ($_url = preg_replace("/%%affiliate_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($affiliate_id)), $_url)) {
                                             if ($_url = preg_replace("/%%user_ip%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $_url)) {
                                                 if ($_url = trim(preg_replace("/%%(.+?)%%/i", "", $_url))) {
                                                     /**/
                                                     if (!($_r = 0) && ($_url = preg_replace("/^silent-php\\|/i", "", $_url, 1, $_r)) && $_r && in_array("affiliates-silent-post", $process)) {
                                                         c_ws_plugin__optimizemember_utils_urls::remote($_url, false, array("blocking" => false));
                                                     } else {
                                                         if (!($_r = 0) && ($_url = preg_replace("/^img-1px\\|/i", "", $_url, 1, $_r)) && $_r && in_array("affiliates-1px-response", $process)) {
                                                             if (!empty($response) && $return === "response") {
                                                                 $response .= "\n" . '<img src="' . esc_attr($_url) . '" style="width:0; height:0; border:0;" alt="" />';
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             unset($_urls, $_url, $_r);
             /**/
             if (empty($response)) {
                 /* Is ``$response`` NOT set by now? If it's not, we need a default ``$response``. */
                 $response = _x('<div>Sorry, your Coupon is N/A, invalid or expired.</div>', "s2member-front", "s2member");
             }
         } else {
             /* Otherwise, we need a default response to display. */
             $response = _x('<div>Sorry, your Coupon is N/A, invalid or expired.</div>', "s2member-front", "s2member");
         }
     }
     /**/
     return $return === "response" ? $response : $attr;
 }
Beispiel #23
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>Google Checkout Buttons</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";
            /**/
            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="Google Checkout For Level ' . $labelText . ' Access">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-level' . $n . '-buttons-section">' . "\n";
                echo '<h3>Button Code 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 Button Code). These Google Checkout Buttons 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 Google API Callback service. optimizeMember receives updates from Google behind-the-scene. <em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back &amp; re-generate a new one.</em></p>' . "\n";
                /**/
                echo '<table class="form-table">' . "\n";
                echo '<tbody>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<th class="ws-menu-page-th-side">' . "\n";
                echo '<label for="ws-plugin--optimizemember-pro-level' . $n . '-shortcode">' . "\n";
                echo 'Button Code<br />For Level ' . $labelText . ':<br /><br />' . "\n";
                echo '<div id="ws-plugin--optimizemember-pro-level' . $n . '-button-prev"></div>' . "\n";
                echo '</label>' . "\n";
                echo '</th>' . "\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/google-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" class="google-checkout-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-membership-regular-terms.php"))) . '</select></p>' . "\n";
                echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-desc" class="google-checkout-buttons-description-input" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="73" /></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 'Packages: ';
                if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
                    foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                        echo '<input type="checkbox" onchange="showSelectedValues(\'ccpchk_' . $n . '\', \'ccaps\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchk_' . $n . '" value="' . $val . '" /> ' . $val . "\n";
                    }
                } else {
                    echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>';
                }
                echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-pro-level' . $n . '-ccaps" value="" />' . "\n";
                echo '<p>Currency: <select id="ws-plugin--optimizemember-pro-level' . $n . '-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_pro_googleButtonGenerate(\'level' . $n . '\');" class="button-primary" /></p>' . "\n";
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<td colspan="2">' . "\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/google-checkout-button-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";
            }
            /**/
            ?>
							<script type="text/javascript">
							window.showSelectedValues = function(param, elemId, n) {
									var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map(
									     function () {return this.value;}).get().join(",");
									jQuery("#ws-plugin--optimizemember-pro-level"+n+"-" + elemId).val(text);


								}
							window.showSingleSelectedValues = function(param, elemId, n) {
								var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map(
								     function () {return this.value;}).get().join(",");
								jQuery("#ws-plugin--optimizemember-pro-" + elemId + "-ccaps").val(text);


							}
								/**/
							</script>
							<?php 
            echo '<div class="ws-menu-page-group" title="Google Modification/Cancellation Buttons">' . "\n";
            /**/
            echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-cancellation-buttons-section">' . "\n";
            echo '<h3>One Button Does It All For Modifications/Cancellations ( copy/paste )</h3>' . "\n";
            echo '<p>Every Google Recurring Subscription can be modified by the Customer, or even cancelled by the Customer through Google Checkout. It\'s very simple. A Member clicks a Modification/Cancellation Button. This brings the Customer to a "Purchase History" screen inside their Google Checkout account. Here they\'ll have easy access to make any changes they like. When important changes occur ( such as a cancellation ), information regarding this event will be relayed back to optimizeMember through Google\'s API Callback service. optimizeMember will react appropriately at that time.</p>' . "\n";
            echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
            echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through Google Checkout... but, optimizeMember continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. optimizeMember will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by optimizeMember.</em></p>' . "\n";
            echo '<p><em>optimizeMember will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, optimizeMember will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). optimizeMember also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
            /**/
            echo '<table class="form-table">' . "\n";
            echo '<tbody>' . "\n";
            echo '<tr>' . "\n";
            /**/
            echo '<th class="ws-menu-page-th-side">' . "\n";
            echo '<label for="ws-plugin--optimizemember-pro-cancellation-shortcode">' . "\n";
            echo 'Button Code<br />For Cancellations:<br /><br />' . "\n";
            echo '<div id="ws-plugin--optimizemember-pro-cancellation-button-prev">' . "\n";
            $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/google-cancellation-button.php")));
            $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_pro_temp_s);
            $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_pro_temp_s);
            $ws_plugin__optimizemember_pro_temp_s = preg_replace("/&amp;/", "&", $ws_plugin__optimizemember_pro_temp_s);
            /* Match this with the JavaScript generator. */
            echo preg_replace("/\\<a/", '<a target="_blank"', $ws_plugin__optimizemember_pro_temp_s);
            echo '</div>' . "\n";
            echo '</label>' . "\n";
            echo '</th>' . "\n";
            /**/
            echo '<td class="align-top">' . "\n";
            echo '<form onsubmit="return false;">' . "\n";
            echo '<p>No configuration necessary.</p>' . "\n";
            echo '</form>' . "\n";
            echo '</td>' . "\n";
            /**/
            echo '</tr>' . "\n";
            echo '<tr>' . "\n";
            /**/
            echo '<td colspan="2">' . "\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/google-cancellation-button-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";
            /**/
            if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) {
                echo '<div class="ws-menu-page-group" title="Google Capability (Buy Now) Buttons">' . "\n";
                /**/
                echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-ccap-buttons-section">' . "\n";
                echo '<h3>Button Code 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>Membership Level# Button</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 Button Code). These Google Checkout Buttons 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 '<p><em><strong>*Important Note*</strong> Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button. Otherwise, post-processing of their transaction will fail to recognize the Customer\'s existing account within WordPress. Please display this Button only to Users/Members that are already logged into their account ( perhaps in your Login Welcome Page for optimizeMember ), or in another location where you can be absolutely sure that a User/Member is logged in. optimizeMember\'s Simple Conditionals could also be used to ensure a User/Member is logged in, by wrapping your Shortcode within a Conditional test. For further details, please see: <code>optimizeMember -> API Scripting -> Simple Conditionals</code>.</em></p>' . "\n";
                echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. If you lose your Button Code, you\'ll need to come back &amp; re-generate a new one.</em></p>' . "\n";
                /**/
                echo '<table class="form-table">' . "\n";
                echo '<tbody>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<th class="ws-menu-page-th-side">' . "\n";
                echo '<label for="ws-plugin--optimizemember-pro-ccap-shortcode">' . "\n";
                echo 'Button Code<br />For Capabilities:<br /><br />' . "\n";
                echo '<div id="ws-plugin--optimizemember-pro-ccap-button-prev"></div>' . "\n";
                echo '</label>' . "\n";
                echo '</th>' . "\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/google-membership-ccap-terms.php"))) . '</select></p>' . "\n";
                echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-desc" class="google-checkout-buttons-description-input" value="Description and pricing details here." size="73" /></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\\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-ccap-ccaps" size="40" /></p>' . "\n";
                echo 'Packages: ';
                $n = 1;
                if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
                    foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                        echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkccaps_' . $n . '\', \'ccap\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkccaps_' . $n . '" value="' . $val . '" /> ' . $val . "\n";
                    }
                } else {
                    echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>';
                }
                echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-pro-ccap-ccaps" value="" />' . "\n";
                echo '<p>Currency: <select id="ws-plugin--optimizemember-pro-ccap-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_pro_googleCcapButtonGenerate();" class="button-primary" /></p>' . "\n";
                echo '</form>' . "\n";
                echo '</td>' . "\n";
                /**/
                echo '</tr>' . "\n";
                echo '<tr>' . "\n";
                /**/
                echo '<td colspan="2">' . "\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/google-ccaps-checkout-button-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="Google 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 automatically generates Registration Access 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 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: Google TID/SID with an `s2-` prefix ) must be unique. This value can be obtained from inside your Google Checkout account in the transaction Description field. 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 Google IPN ( i.e. Notification/Callback ) service if this value does not reflect a real Paid Subscr. ID that exists in your Google Checkout transaction 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_googleRegLinkGenerate();" 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 'Packages: ';
            $n = 1;
            if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
                foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                    echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkreg_' . $n . '\', \'reg-link\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkreg_' . $n . '" value="' . $val . '" /> ' . $val . "\n";
                }
            } else {
                echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>';
            }
            echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-pro-reg-link-ccaps" value="" />' . "\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="Google Specific Post/Page (Buy Now) Buttons">' . "\n";
            /**/
            echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-sp-buttons-section">' . "\n";
            echo '<h3>Button Code Generator For Specific Post/Page Buttons</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" Buttons, and 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 -> Google 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 Button Code). These Google Checkout Buttons are customized to work with optimizeMember seamlessly. You can even Package Additional Posts/Pages together into one transaction. <em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your WordPress Editor, wherever you feel it would be most appropriate. If you lose your Button Code, you\'ll need to come back &amp; re-generate a new one.</em></p>' . "\n";
            /**/
            echo '<table class="form-table">' . "\n";
            echo '<tbody>' . "\n";
            echo '<tr>' . "\n";
            /**/
            echo '<th class="ws-menu-page-th-side">' . "\n";
            echo '<label for="ws-plugin--optimizemember-pro-sp-shortcode">' . "\n";
            echo 'Button Code<br />Specific Posts/Pages:<br /><br />' . "\n";
            echo '<div id="ws-plugin--optimizemember-pro-sp-button-prev"></div>' . "\n";
            echo '</label>' . "\n";
            echo '</th>' . "\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" class="google-checkout-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-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>Currency: <select id="ws-plugin--optimizemember-pro-sp-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_pro_googleSpButtonGenerate();" class="button-primary" /></p>' . "\n";
            echo '</form>' . "\n";
            echo '</td>' . "\n";
            /**/
            echo '</tr>' . "\n";
            echo '<tr>' . "\n";
            /**/
            echo '<td colspan="2">' . "\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/google-sp-checkout-button-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="Google 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/google-sp-hours.php"))) . '</select> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_pro_googleSpLinkGenerate();" 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";
            /**/
            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 Button Code, 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 Button 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>cancel="0"</code> Cancellation Button. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Cancellation Button, <code>1</code> = this IS a Cancellation Button.</li>' . "\n";
            echo '<li><code>cc="USD"</code> 3 character Currency Code. Not valid when <code>modify|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>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>modify|cancel="1"</code>.</li>' . "\n";
            echo '<li><code>desc="Gold Membership"</code> A brief purchase Description. Not valid when <code>modify|cancel="1"</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>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default Google Checkout Button, <code>http://...</code> = location of your custom Image.</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 Buttons providing paid Membership Level Access.' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' Or, 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 Button. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Modification Button, <code>1</code> = this IS a Modification Button.</li>' . "\n";
            echo '<li><code>output="anchor"</code> Output Type. Possible values: <code>anchor</code> = Google Checkout Button (  &lt;a&gt; anchor tag ) URL w/ ?query string, <code>url</code> = raw URL w/ ?query string.</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>modify|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.</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>sp="0"</code> Specific Post/Page Button. Possible values: <code>0</code> = this is NOT a Specific Post/Page Access Button, <code>1</code> = this IS a Specific Post/Page Access Button.</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 '</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 #24
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">';
     echo '<h2>General Options</h2>' . "\n";
     /**/
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     /**/
     echo '<form method="post" name="ws_plugin__optimizemember_options_form" id="ws-plugin--optimizemember-options-form">' . "\n";
     echo '<input type="hidden" name="ws_plugin__optimizemember_options_save" id="ws-plugin--optimizemember-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--optimizemember-options-save")) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__optimizemember_configured" id="ws-plugin--optimizemember-configured" value="1" />' . "\n";
     /**/
     do_action("ws_plugin__optimizemember_during_gen_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_membership_levels", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_membership_levels", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Define Membership Levels And Packages">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-membership-levels-section">' . "\n";
         echo '<h3>Membership Levels and Packages ( required, please customize these )</h3>' . "\n";
         echo '<p>The default Membership Levels are labeled generically; feel free to modify them as needed. optimizeMember supports Free Subscribers <em>( at Level #0 )</em>, along with several Primary Roles for paid Membership <em>( i.e. Levels 1-10 )</em>, created by the OptimizeMember plugin. OptimizeMember also supports unlimited Custom Capability Packages <em>( see <code>optimizeMember -> API Scripting -> Custom Capabilities</code> )</em>. That being said, you don\'t have to use all of the Membership Levels if you don\'t want to. To use only 1 or 2 of these Levels, just design your Membership Options / Redirect Page, so it only includes Payment Buttons for the Levels being used.</p>' . "\n";
         /**do_action ("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_membership_levels", get_defined_vars ());**/
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         /**/
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) {
             $labelText = ws_plugin__optimizemember_getMembershipLabel($n);
             echo '<tr>' . "\n";
             /**/
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--optimizemember-level' . $n . '-label">' . "\n";
             echo $n === 0 ? 'Level #' . $n . ' <em>( Free Subscribers )</em>:' . "\n" : 'Level #' . $n . ' Members:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             /**/
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             /**/
             echo '<td>' . "\n";
             echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_level' . $n . '_label" id="ws-plugin--optimizemember-level' . $n . '-label" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"]) . '" /><br />' . "\n";
             echo 'This is the Label for Level #' . $n . ($n === 0 ? ' ( Free Subscribers )' : ' Members') . '.<br />' . "\n";
             echo '</td>' . "\n";
             /**/
             echo '</tr>' . "\n";
         }
         /**/
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-membership-levels-section">' . "\n";
         echo '<h3>Packages</h3>' . "\n";
         echo '<p>Packages are a great way to protect individual products or content.  You can protect any content to a particular package by using the admin options on the page and this will ensure only users with that package added to their account will be given access</p>' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--optimizemember-ccp">' . "\n";
         echo 'Add new package:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<input type="hidden" name="ws_plugin__optimizemember_ccp[]" value="update-signal" />' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" 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 ());" name="ws_plugin__optimizemember_ccp[]" id="ws-plugin--optimizemember-ccp" value="" />';
         if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) {
             echo '<h3>Available packages</h3>' . "\n";
             foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) {
                 if (!empty($val)) {
                     echo '<input type="hidden" name="ws_plugin__optimizemember_ccp[]" value="' . $val . '" />' . "\n";
                     echo $val . '<br />' . "\n";
                 }
             }
         }
         //echo 'This affects your administrative Dashboard only <em>( i.e. your list of Users )</em>.<br />optimizeMember can force WordPress to use your Labels instead of referencing Roles by `optimizeMember Level #`. If this is your first installation of optimizeMember, we suggest leaving this set to <code>no</code> until you\'ve had a chance to get acclimated with optimizeMember\'s functionality. In fact, many site owners choose to leave this off, because they find it less confusing when Roles are referred to by their optimizeMember Level #.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '<table class="form-table" style="margin-top:0;display:none;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--optimizemember-apply-label-translations">' . "\n";
         echo 'Force WordPress to use your Labels?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="radio" name="ws_plugin__optimizemember_apply_label_translations" id="ws-plugin--optimizemember-apply-label-translations-" value="1" checked="checked" />';
         //echo '<input type="radio" name="ws_plugin__optimizemember_apply_label_translations" id="ws-plugin--optimizemember-apply-label-translations-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["apply_label_translations"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--optimizemember-apply-label-translations-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__optimizemember_apply_label_translations" id="ws-plugin--optimizemember-apply-label-translations-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["apply_label_translations"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--optimizemember-apply-label-translations-1">Yes, force WordPress to use my Labels.</label><br />' . "\n";
         echo 'This affects your administrative Dashboard only <em>( i.e. your list of Users )</em>.<br />optimizeMember can force WordPress to use your Labels instead of referencing Roles by `optimizeMember Level #`. If this is your first installation of optimizeMember, we suggest leaving this set to <code>no</code> until you\'ve had a chance to get acclimated with optimizeMember\'s functionality. In fact, many site owners choose to leave this off, because they find it less confusing when Roles are referred to by their optimizeMember Level #.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-filter-wp-query">' . "\n";
         echo 'Hide links?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         //echo '<div class="ws-menu-page-scrollbox" style="height:105px;">' . "\n";
         echo '<input type="hidden" name="ws_plugin__optimizemember_filter_wp_query[]" value="update-signal" />' . "\n";
         foreach (array("all" => "<strong>Hide links to protected content for non-members</strong>") as $ws_plugin__optimizemember_temp_s_value => $ws_plugin__optimizemember_temp_s_label) {
             echo '<input type="checkbox" name="ws_plugin__optimizemember_filter_wp_query[]" id="ws-plugin--optimizemember-filter-wp-query-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__optimizemember_temp_s_value)) . '" value="' . esc_attr($ws_plugin__optimizemember_temp_s_value) . '"' . (in_array($ws_plugin__optimizemember_temp_s_value, $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["filter_wp_query"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--optimizemember-filter-wp-query-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__optimizemember_temp_s_value)) . '">' . $ws_plugin__optimizemember_temp_s_label . '</label><br />' . "\n";
             break;
         }
         echo 'This option will hide links to any protected content for members who do not have access to that content<br />' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<input type="button" value="Reset Roles/Capabilities" class="ws-menu-page-right ws-plugin--optimizemember-reset-roles-button button" style="min-width:175px;" />' . "\n";
         echo '<p>The button to the right, is a nifty tool, which allows you to reset optimizeMember\'s internal Roles and Capabilities that integrate with WordPress. If you, or a developer working with you, has made attempts to alter the default <em>internal</em> Role/Capability sets that come with optimizeMember, and you need to reset them back to the way optimizeMember expects them to be, please use this tool. <em>Attn Developers: it is also possible lock-in your modified Roles/Capabilities with an optimizeMember Filter. Please see <a href="http://www.optimizepress.com/forums/viewtopic.php?f=36&t=15420&p=45162#p45162" target="_blank" rel="external">this thread for details</a>.</em></p>' . "\n";
         /**/
         // echo '<p class="submit"><input id="opmNewSave" type="submit" class="op-pb-button green" value="Save Changes" /></p>' . "\n";
         // echo '<p id="msg"><p>';
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_membership_levels", get_defined_vars());
     }
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_list_server_integration", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_list_server_integration", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Define Mailing List/Autoresponder Configurations">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-list-server-integration-section">' . "\n";
         echo '<h3>Mailing List/Autoresponder Configurations</h3>' . "\n";
         echo '<p>To enable and configure email marketing service go to <a href="' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services">OP theme/plugin Dashboard settings</a></p>' . "\n";
         echo '<p>Note: Lists/follow upsequences can take up to 1 minute to be retrieved from your provider.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_list_server_integration", get_defined_vars());
         /**/
         $providers = op_assets_provider_list();
         $providersDetails = array();
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         /**/
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) {
             $labelText = ws_plugin__optimizemember_getMembershipLabel($n);
             $provider = format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_provider"]);
             echo '<tr>' . "\n";
             /**/
             echo '<th>' . "\n";
             echo '<h4>' . ($n === 0 ? 'Level #' . $n . ' <em>(Free Subscribers)</em>' . "\n" : 'Level #' . $n . ' Members') . '</h4>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             /**/
             echo '<tr>' . "\n";
             /**/
             echo '<th>' . "\n";
             echo '<label for="ws_plugin__optimizemember_level' . $n . '_provider" id="ws_plugin__optimizemember_level' . $n . '_provider_label">' . "\n";
             echo 'List Provider:' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '<th>' . "\n";
             echo '<label for="ws_plugin__optimizemember_level' . $n . '_list" id="ws_plugin__optimizemember_level' . $n . '_list_label">' . "\n";
             if ($provider === 'infusionsoft') {
                 echo 'Follow up sequence:' . "\n";
             } else {
                 echo 'List:' . "\n";
             }
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             /**/
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             /**/
             echo '<td>' . "\n";
             echo '<select data-level="' . $n . '" name="ws_plugin__optimizemember_level' . $n . '_provider" id="ws_plugin__optimizemember_level' . $n . '_provider" class="ws_plugin__optimizemember_level_provider">' . "\n";
             echo '<option value="0">Select provider</option>' . "\n";
             if (count($providers) > 0) {
                 foreach ($providers as $providerId => $providerName) {
                     /*
                      * Subscribing is happening on their URL and can't be done in background
                      */
                     if ($providerId === 'oneshoppingcart') {
                         continue;
                     }
                     echo '<option value="' . $providerId . '"' . selected($providerId, $provider, false) . '>' . $providerName . '</option>' . "\n";
                 }
             }
             echo '</select><br />' . "\n";
             echo '</td>' . "\n";
             /**/
             echo '<td>' . "\n";
             echo '<select data-level="' . $n . '" name="ws_plugin__optimizemember_level' . $n . '_list" id="ws_plugin__optimizemember_level' . $n . '_list" class="ws_plugin__optimizemember_level_list">' . "\n";
             $provider = format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_provider"]);
             if (!empty($provider)) {
                 $list = format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_list"]);
                 if (isset($providersDetails[$provider])) {
                     $details = $providersDetails[$provider];
                 } else {
                     $details = op_assets_provider_items($provider, true);
                     if (count($details) > 0) {
                         $details = $details['lists'];
                         $providersDetails[$provider] = $details;
                     }
                 }
                 foreach ($details as $listId => $item) {
                     echo '<option value="' . $listId . '"' . selected($list, $listId, false) . '>' . $item['name'] . '</option>' . "\n";
                 }
             } else {
                 echo '<option value="0">Select provider first</option>' . "\n";
             }
             echo '</select><br />' . "\n";
             echo '</td>' . "\n";
             /**/
             echo '</tr>' . "\n";
         }
         /**/
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         // echo '<p class="submit"><input id="opmNewSave" type="submit" class="op-pb-button green" value="Save Changes" /></p>' . "\n";
         // echo '<p class="save_info"><p>';
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_list_server_integration", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_membership_options_page", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_membership_options_page", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Membership Options / Redirect Page">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-membership-options-page-section">' . "\n";
         echo '<h3>Membership Options / Redirect Page ( required, please customize this )</h3>' . "\n";
         echo '<p>This is where visitors who do not have access to your restricted membership content will be redirected to.  We recommend using this page either as a login page, or as a page where you offer promote your membership or product.</p>' . "\n";
         echo '<p>If you want to add a login form on your page, use the "Membership Login Form" element in the Liveeditor to add a login form for your visitors to login</p>' . "\n";
         //echo '<p><em><strong>*Tip*</strong> If you allow Open Registration ( i.e. Free Subscribers ), you might want to place a link on your Membership Options / Redirect Page, which points directly to your Registration Form, instead of routing a Customer through your Payment Gateway first. For further details, please check the section above: <code>optimizeMember -> General Options -> Open Registration</code>.</em></p>' . "\n";
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> Even with BuddyPress, optimizeMember still needs a Membership Options / Redirect Page. This is where your Payment Button(s) will go, giving people the ability to pay you. And again, this is also the Page that anyone could be redirected to <em>( by optimizeMember )</em>, should they attempt to access an area of your site, which may require access to something they are currenty NOT allowed to view.' . (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? ' For more on this advanced topic, please check your Dashboard here: <code>optimizeMember -> API Scripting -> Membership Options / Redirect Page / Variables</code>.' : '') . '</em></p>' . "\n" : '';
         echo '<p><em><strong>*Tip*</strong> optimizeMember will NEVER allow this Page to be protected from public access.</em></p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_membership_options_page", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-membership-options-page">' . "\n";
         echo 'Membership Options / Redirect Page:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_membership_options_page" id="ws-plugin--optimizemember-membership-options-page">' . "\n";
         echo '<option value="">&mdash; Select &mdash;</option>' . "\n";
         foreach ($ws_plugin__optimizemember_temp_a = array_merge((array) get_pages()) as $ws_plugin__optimizemember_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '"' . ($ws_plugin__optimizemember_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"] ? ' selected="selected"' : '') . '>' . esc_html($ws_plugin__optimizemember_temp_o->post_title) . '</option>' . "\n";
         }
         echo '</select><br />' . "\n";
         echo 'Select a page which your users will be redirected to when they try to access content they\'re not currently allowed to view.  We recommend having a login form on this page or details of your membership or product' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_membership_options_page", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_login_welcome_page", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_login_welcome_page", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Members Home Page / Login Welcome Page">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-login-welcome-page-section">' . "\n";
         echo '<h3>Members Home Page / Login Welcome Page ( required, please customize this )</h3>' . "\n";
         echo '<p>Please create and/or choose an existing Page to use as the first page Members will see after logging in.</p>' . "\n";
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> optimizeMember integrates with BuddyPress. Your Login Welcome Page affects BuddyPress too.</em></p>' . "\n" : '';
         echo '<p><em><strong>*Tip*</strong> This special Page will be protected from public access ( automatically ) by optimizeMember.</em></p>' . "\n";
         //echo '<p><strong>See also:</strong> This KB article: <a href="http://help.optimizepress.com/customer/portal/articles/1281577-customizing-your-login-welcome-page" target="_blank" rel="external">Customizing Your Login Welcome Page</a>.</p>'."\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_login_welcome_page", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-welcome-page">' . "\n";
         echo 'Members Home Page / Login Welcome Page:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_login_welcome_page" id="ws-plugin--optimizemember-login-welcome-page">' . "\n";
         echo '<option value="">&mdash; Select &mdash;</option>' . "\n";
         foreach ($ws_plugin__optimizemember_temp_a = array_merge((array) get_pages()) as $ws_plugin__optimizemember_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_redirection_override"] && $ws_plugin__optimizemember_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"] ? ' selected="selected"' : '') . '>' . esc_html($ws_plugin__optimizemember_temp_o->post_title) . '</option>' . "\n";
         }
         echo '</select><br />' . "\n";
         echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.<br /><br />' . "\n";
         echo '&darr; Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>. <em>A few <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s Username, lowercase.\\n%%current_user_id%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s optimizeMember Level.\\n%%current_user_role%% = The current User\\\'s WordPress Role.' . (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '\\n%%current_user_ccaps%% = The current User\\\'s Custom Capabilities.' : '') . '\\n%%current_user_logins%% = Number of times the current User has logged in.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: ' . site_url("/members/%%current_user_login%%/profile/") . '\\n\\nOr ... using %%current_user_level%%, you could have a separate Login Welcome Page for each Membership Level that you plan to offer. BuddyPress not required.\'); return false;">Replacement Codes</a> are also supported here.</em>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_redirection_override" id="ws-plugin--optimizemember-login-redirection-override" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_login_welcome_page", get_defined_vars());
     }
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_email_config", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_email_config", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Email Configuration">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-email-section">' . "\n";
         echo '<h3 style="margin:0;">Email From: ' . esc_html('"Name" <address>') . '</h3>' . "\n";
         echo '<p style="margin:0;">This is the name/address that will appear in outgoing email notifications sent by the optimizeMember plugin.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_email_from_name_config", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-reg-email-from-name">' . "\n";
         echo 'Email From Name:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_reg_email_from_name" id="ws-plugin--optimizemember-reg-email-from-name" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["reg_email_from_name"]) . '" /><br />' . "\n";
         echo 'We recommend that you use the name of your site here.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-reg-email-from-email">' . "\n";
         echo 'Email From Address:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_reg_email_from_email" id="ws-plugin--optimizemember-reg-email-from-email" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["reg_email_from_email"]) . '" /><br />' . "\n";
         echo 'Example: support@your-domain.com. <em class="ws-menu-page-hilite">Please read <a href="#" onclick="alert(\'Running WordPress with an SMTP mail plugin?\\n\\nPlease be advised. If you run an SMTP mail plugin with WordPress, be sure to configure optimizeMember with a valid `From:` address ( i.e. one matching your SMTP configuration perhaps ). Most free SMTP servers, such as Gmail and Yahoo, require that your `From:` header match the email address associated with your account. Please check with your SMTP service provider before attempting to configure plugins like optimizeMember to use a different `From:` address when sending email messages.\'); return false;">this IMPORTANT note</a></em>.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-reg-email-support-link">' . "\n";
         echo 'Email Support/Contact Link:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_reg_email_support_link" id="ws-plugin--optimizemember-reg-email-support-link" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["reg_email_support_link"]) . '" /><br />' . "\n";
         echo 'Ex: <code>mailto:support@your-domain.com</code> ( <em>mailto link</em> ).<br />' . "\n";
         echo 'Or: <code>' . esc_html(site_url("/contact-us/")) . '</code>.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3 style="margin:0;">New User Email Configuration</h3>' . "\n";
         echo '<input type="hidden" id="ws-plugin--optimizemember-pluggables-wp-new-user-notification" value="' . esc_attr(empty($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["pluggables"]["wp_new_user_notification"]) ? '0' : '1') . '" />' . "\n";
         echo empty($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["pluggables"]["wp_new_user_notification"]) ? '<p class="ws-menu-page-error" style="margin:0;"><em><strong>Conflict warning:</strong> You have another theme or plugin installed that is preventing optimizeMember from controlling this aspect of your installation. When the pluggable function <code><a href="http://codex.wordpress.org/Function_Reference/wp_new_user_notification" target="_blank" rel="external">wp_new_user_notification()</a></code> is handled by another plugin, it\'s not possible for optimizeMember to allow customization of New User Emails. This is NOT a major issue. In fact, in some cases, it might be desirable. That being said, if you DO want to use optimizeMember\'s customization of New User Emails, you will need to deactivate one plugin at a time until this conflict warning goes away.</em></p>' . "\n" : '';
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_new_user_emails", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_new_user_emails_enabled" id="ws-plugin--optimizemember-new-user-emails-enabled">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_emails_enabled"] ? ' selected="selected"' : '') . '>No ( default, use WordPress defaults )</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_emails_enabled"] ? ' selected="selected"' : '') . '>Yes ( customize New User Emails with optimizeMember )</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div id="ws-plugin--optimizemember-new-user-emails">' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3 style="margin:0;">New User Email Message ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-new-user-email-details\').toggle(); return false;" class="ws-dotted-link">click to customize</a> )</h3>' . "\n";
         echo '<p style="margin:0;">This email is sent to all new Users/Members. It should always contain their Username/Password. In addition to this email, optimizeMember will also send new paying Customers a Signup Confirmation Email, which you can customize from your Dashboard, under: <code>optimizeMember -> PayPal Options</code>. You may wish to customize these emails further, by providing details that are specifically geared to your site.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_new_user_email", get_defined_vars());
         /**/
         echo '<div id="ws-plugin--optimizemember-new-user-email-details" style="display:none;">' . "\n";
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> please note that BuddyPress does NOT send this email to Users that register through the BuddyPress registration system. This is because BuddyPress sends each User an activation link; eliminating the need for this email all together. However, you CAN still customize optimizeMember\'s separate email to paying Members. See: <code>optimizeMember -> PayPal Options -> Signup Confirmation Email</code>.</em></p>' . "\n" : '';
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-new-user-email-subject">' . "\n";
         echo 'New User Email Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_new_user_email_subject" id="ws-plugin--optimizemember-new-user-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email sent to new Users/Members.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-new-user-email-message">' . "\n";
         echo 'New User Email Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__optimizemember_new_user_email_message" id="ws-plugin--optimizemember-new-user-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email sent to new Users/Members.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name ( First &amp; Last ) of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n";
         echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>' . "\n";
         echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>' . "\n";
         echo '</ul>' . "\n";
         /**/
         echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> 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>' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         /**/
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3 style="margin:0;">Administrative: New User Notification ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-new-user-admin-email-details\').toggle(); return false;" class="ws-dotted-link">click to customize</a> )</h3>' . "\n";
         echo '<p style="margin:0;">This email notification is sent to you, each time a new User/Member registers.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_new_user_admin_email", get_defined_vars());
         /**/
         echo '<div id="ws-plugin--optimizemember-new-user-admin-email-details" style="display:none;">' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-new-user-admin-email-recipients">' . "\n";
         echo 'New User Notification Recipients:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_new_user_admin_email_recipients" id="ws-plugin--optimizemember-new-user-admin-email-recipients" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_admin_email_recipients"]) . '" /><br />' . "\n";
         echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
         echo '<code>"Name" &lt;user@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-new-user-admin-email-subject">' . "\n";
         echo 'New User Notification Subject:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_new_user_admin_email_subject" id="ws-plugin--optimizemember-new-user-admin-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_admin_email_subject"]) . '" /><br />' . "\n";
         echo 'Subject Line used in the email notification sent to Administrator.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-new-user-admin-email-message">' . "\n";
         echo 'New User Notification Message:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__optimizemember_new_user_admin_email_message" id="ws-plugin--optimizemember-new-user-admin-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["new_user_admin_email_message"]) . '</textarea><br />' . "\n";
         echo 'Message Body used in the email notification sent to Administrator.<br /><br />' . "\n";
         echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name ( First &amp; Last ) of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n";
         echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
         echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>' . "\n";
         echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>' . "\n";
         echo '</ul>' . "\n";
         /**/
         echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>' . "\n";
         echo '<ul>' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> 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>' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         /**/
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_email_config", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_open_registration", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_open_registration", get_defined_vars());
         /**/
         if (is_multisite() && is_main_site()) {
             echo '<div class="ws-menu-page-group" title="Open Registration">' . "\n";
             /**/
             echo '<div class="ws-menu-page-section ws-plugin--optimizemember-open-registration-section">' . "\n";
             echo '<h3>Open Registration / Free Subscribers ( optional )</h3>' . "\n";
             echo '<p>On the Main Site of a Multisite Network, the settings for Open Registration are consolidated into the <code>optimizeMember -> Multisite (Config)</code> panel.</p>' . "\n";
             do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_open_registration", get_defined_vars());
             echo '</div>' . "\n";
             /**/
             echo '</div>' . "\n";
         } else {
             echo '<div class="ws-menu-page-group" title="Open Registration">' . "\n";
             /**/
             echo '<div class="ws-menu-page-section ws-plugin--optimizemember-open-registration-section">' . "\n";
             echo '<h3>Open Registration / Free Subscribers ( optional )</h3>' . "\n";
             echo '<p>optimizeMember supports Free Subscribers ( at Level #0 ), along with four Primary Levels [1-10] of paid Membership. If you want your visitors to be capable of registering absolutely free, you will want to "allow" Open Registration. Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0.</p>' . "\n";
             do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_open_registration", get_defined_vars());
             /**/
             echo '<table class="form-table">' . "\n";
             echo '<tbody>' . "\n";
             echo '<tr>' . "\n";
             /**/
             echo '<th>' . "\n";
             echo '<label for="ws-plugin--optimizemember-allow-subscribers-in">' . "\n";
             echo 'Allow Open Registration? ( Free Subscribers )' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             /**/
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             /**/
             echo '<td>' . "\n";
             echo '<select name="ws_plugin__optimizemember_allow_subscribers_in" id="ws-plugin--optimizemember-allow-subscribers-in">' . "\n";
             echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["allow_subscribers_in"] ? ' selected="selected"' : '') . '>No ( do NOT allow Open Registration )</option>' . "\n";
             echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["allow_subscribers_in"] ? ' selected="selected"' : '') . '>Yes ( allow Open Registration; Free Subscribers at Level #0 )</option>' . "\n";
             echo '</select><br />' . "\n";
             echo 'If you set this to <code>Yes</code>, you\'re unlocking <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::wp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your Standard Registration Form.\\n* optimizeMember makes this form available to logged-in Administrators, at all times ( for testing purposes ), regardless of configuration.' . (c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">/wp-login.php?action=register</a>. When a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0. The optimizeMember software reserves Level #0; to be used ONLY for Free Subscribers. All other Membership Levels [1-4] require payment.' . "\n";
             echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<br /><br /><em><strong>BuddyPress:</strong> BuddyPress will use its own Registration Form <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your BuddyPress Registration Form.\\n* However, you will probably be redirected away from this BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.\');">here</a>.<br />optimizeMember integrates with BuddyPress, and the above setting will control Open Regisration for BuddyPress too.</em>' . "\n" : '';
             echo '</td>' . "\n";
             /**/
             echo '</tr>' . "\n";
             echo '</tbody>' . "\n";
             echo '</table>' . "\n";
             echo '</div>' . "\n";
             /**/
             echo '</div>' . "\n";
         }
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_open_registration", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_login_registration", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_login_registration", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Login Page & Registration Form Design">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-login-registration-section">' . "\n";
         echo '<h3>Login/Registration Page Customization ( required )</h3>' . "\n";
         echo '<p>These settings customize your Standard Login/Registration Pages:<br />( <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::wp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your Standard Registration Form.\\n* optimizeMember makes this form available to logged-in Administrators, at all times ( for testing purposes ), regardless of configuration.' . (c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__optimizemember_utils_urls::wp_register_url()) . '</a> )</p>' . "\n";
         echo is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && is_main_site() ? '<p><em>The Main Site of a Multisite Blog Farm uses this Form instead, powered by your theme.<br />( <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::wp_signup_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your Multisite Registration Form.\\n* optimizeMember makes this form available to logged-in Super Administrators, at all times ( for testing purposes ), regardless of configuration.' . (c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__optimizemember_utils_urls::wp_signup_url()) . '</a> )</em></p>' . "\n" : '';
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> BuddyPress will use its own Registration Form, powered by your theme.<br />( <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your BuddyPress Registration Form.\\n* However, you will probably be redirected away from this BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.\');">' . esc_html(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . '</a> )</em></p>' . "\n" : '';
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_login_registration", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Overall Font/Size Configuration</h3>' . "\n";
         echo '<p style="margin:0;">These settings are all focused on your Login/Registration Fonts.</p>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-font-size">' . "\n";
         echo 'Overall Font Size:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_font_size" id="ws-plugin--optimizemember-login-reg-font-size" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_font_size"]) . '" /><br />' . "\n";
         echo 'Set this to a numeric value, calculated in pixels.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-font-family">' . "\n";
         echo 'Overall Font Family:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_font_family" id="ws-plugin--optimizemember-login-reg-font-family" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_font_family"]) . '" /><br />' . "\n";
         echo 'Set this to a web-safe font family.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-font-field-size">' . "\n";
         echo 'Form Field Font Size:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_font_field_size" id="ws-plugin--optimizemember-login-reg-font-field-size" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_font_field_size"]) . '" /><br />' . "\n";
         echo 'Set this to a numeric value, calculated in pixels.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Background Configuration</h3>' . "\n";
         echo '<p style="margin:0;">These settings are all focused on your Login/Registration Background.</p>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-background-color">' . "\n";
         echo 'Background Color:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_background_color" id="ws-plugin--optimizemember-login-reg-background-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-background-image">' . "\n";
         echo 'Background Image:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_background_image" id="ws-plugin--optimizemember-login-reg-background-image" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_image"]) . '" /><br />' . "\n";
         echo '<input type="button" id="ws-plugin--optimizemember-login-reg-background-image-media-btn" value="Open Media Library" class="ws-menu-page-media-btn button" rel="ws-plugin--optimizemember-login-reg-background-image" />' . "\n";
         echo 'Set this to the URL of your Background Image. ( this is optional )<br />';
         echo 'If supplied, your Background Image will be tiled.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-background-image-repeat">' . "\n";
         echo 'Background Image Tile:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_login_reg_background_image_repeat" id="ws-plugin--optimizemember-login-reg-background-image-repeat">' . "\n";
         echo '<option value="repeat"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_image_repeat"] === "repeat" ? ' selected="selected"' : '') . '>Seamless Tile ( background-repeat: repeat; )</option>' . "\n";
         echo '<option value="repeat-x"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_image_repeat"] === "repeat-x" ? ' selected="selected"' : '') . '>Tile Horizontally ( background-repeat: repeat-x; )</option>' . "\n";
         echo '<option value="repeat-y"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_image_repeat"] === "repeat-y" ? ' selected="selected"' : '') . '>Tile Vertically ( background-repeat: repeat-y; )</option>' . "\n";
         echo '<option value="no-repeat"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_image_repeat"] === "no-repeat" ? ' selected="selected"' : '') . '>No Tiles ( background-repeat: no-repeat; )</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'This controls the way your Background Image is styled with CSS. [ <a href="http://www.w3schools.com/css/pr_background-repeat.asp" target="_blank" rel="external">learn more</a> ]' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-background-text-color">' . "\n";
         echo 'Color of Text on top of your Background:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_background_text_color" id="ws-plugin--optimizemember-login-reg-background-text-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_text_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-background-text-shadow-color">' . "\n";
         echo 'Shadow Color for Text on top of your Background:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_background_text_shadow_color" id="ws-plugin--optimizemember-login-reg-background-text-shadow-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_text_shadow_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-background-box-shadow-color">' . "\n";
         echo 'Shadow Color for Boxes on top of your Background:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_background_box_shadow_color" id="ws-plugin--optimizemember-login-reg-background-box-shadow-color" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_background_box_shadow_color"]) . '" /><br />' . "\n";
         echo 'Set this to a 6-digit hex color code.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Logo Image Configuration</h3>' . "\n";
         echo '<p style="margin:0;">These settings are all focused on your Login/Registration Logo.</p>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-logo-src">' . "\n";
         echo 'Logo Image Location:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_logo_src" id="ws-plugin--optimizemember-login-reg-logo-src" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_logo_src"]) . '" /><br />' . "\n";
         echo '<input type="button" id="ws-plugin--optimizemember-login-reg-logo-src-media-btn" value="Open Media Library" class="ws-menu-page-media-btn button" rel="ws-plugin--optimizemember-login-reg-logo-src" />' . "\n";
         echo 'Set this to the URL of your Logo Image.<br />' . "\n";
         echo 'Suggested size is around 500 x 100.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-logo-src-width">' . "\n";
         echo 'Logo Image Width:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_logo_src_width" id="ws-plugin--optimizemember-login-reg-logo-src-width" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_logo_src_width"]) . '" /><br />' . "\n";
         echo 'The pixel Width of your Logo Image. <em>* This ALSO affects the overall width of your Login/Registration forms. If you want wider form fields, use a wider Logo.</em>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-logo-src-height">' . "\n";
         echo 'Logo Image Height:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_logo_src_height" id="ws-plugin--optimizemember-login-reg-logo-src-height" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_logo_src_height"]) . '" /><br />' . "\n";
         echo 'The pixel Height of your Logo Image.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-logo-url">' . "\n";
         echo 'Logo Image Click URL:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_logo_url" id="ws-plugin--optimizemember-login-reg-logo-url" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_logo_url"]) . '" /><br />' . "\n";
         echo 'Set this to the Click URL for your Logo Image.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-logo-title">' . "\n";
         echo 'Logo Image Title Attribute:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_login_reg_logo_title" id="ws-plugin--optimizemember-login-reg-logo-title" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_logo_title"]) . '" /><br />' . "\n";
         echo 'Used as the <code>title=""</code> attribute for your Logo Image.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<h3 style="margin:0;">Footer Design ( i.e. Bottom )</h3>' . "\n";
         echo '<p style="margin:0;">This field accepts raw HTML' . (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? ' ( and/or PHP )' : '') . ' code.</p>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-login-reg-footer-design">' . "\n";
         echo 'Login/Registration Footer Design ( optional ):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<textarea name="ws_plugin__optimizemember_login_reg_footer_design" id="ws-plugin--optimizemember-login-reg-footer-design" rows="3" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_reg_footer_design"]) . '</textarea><br />' . "\n";
         echo 'This optional HTML' . (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? ' ( and/or PHP )' : '') . ' code will appear at the very bottom of your Login/Registration Forms.' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_login_registration", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_custom_reg_fields", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_custom_reg_fields", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Registration/Profile Fields &amp; Options">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-custom-reg-fields-section">' . "\n";
         echo '<h3>Custom Registration/Profile Fields ( optional, for further customization )</h3>' . "\n";
         echo '<p>Some fields are already built-in by default. The defaults are: <code>*Username*, *Email*, *First Name*, *Last Name*</code>.</p>' . "\n";
         /**/
         echo '<p>Custom Fields will appear in your Standard Registration Form, and in User/Member Profiles:<br />( <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::wp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your Standard Registration Form.\\n* optimizeMember makes this form available to logged-in Administrators, at all times ( for testing purposes ), regardless of configuration.' . (c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__optimizemember_utils_urls::wp_register_url()) . '</a> )</p>' . "\n";
         echo is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && is_main_site() ? '<p><em>The Main Site of a Multisite Blog Farm uses this Form. optimizeMember supports Custom Fields here too.<br />( <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::wp_signup_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your Multisite Registration Form.\\n* optimizeMember makes this form available to logged-in Super Administrators, at all times ( for testing purposes ), regardless of configuration.' . (c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '\\n\\nBuddyPress: * BuddyPress will use its own Registration Form. Please note, you will probably be redirected away from the BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.' : '') . '\');">' . esc_html(c_ws_plugin__optimizemember_utils_urls::wp_signup_url()) . '</a> )</em></p>' . "\n" : '';
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> BuddyPress will use its own Registration Form <a href="' . esc_attr(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . '" target="_blank" rel="external" onclick="alert(\'optimizeMember will now open your BuddyPress Registration Form.\\n* However, you will probably be redirected away from this BuddyPress Registration Form ( ' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(c_ws_plugin__optimizemember_utils_urls::bp_register_url()) . ' ), because you\\\'re ALREADY logged-in. Please log out before testing BuddyPress registration.\');">here</a>.<br />optimizeMember can integrate your Custom Fields with BuddyPress too, please see options below.</em></p>' . "\n" : '';
         echo '<p><strong>Regarding registration...</strong> Custom Fields do NOT appear during repeat registration and/or checkout attempts (e.g. they do NOT appear for any user that is currently logged into the site). Please make sure that you test registration and/or checkout forms while NOT logged in (e.g. please test as a first-time customer). Existing users/members/customers may update Custom Fields by editing their Profile.</p>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_custom_reg_fields", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label>' . "\n";
         echo 'Custom Registration/Profile Fields:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="hidden" name="ws_plugin__optimizemember_custom_reg_fields" id="ws-plugin--optimizemember-custom-reg-fields" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) . '" />' . "\n";
         echo '<div id="ws-plugin--optimizemember-custom-reg-field-configuration"></div>' . "\n";
         /* This is filled by JavaScript routines. */
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-custom-reg-names">' . "\n";
         echo 'Collect First/Last Names during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_custom_reg_names" id="ws-plugin--optimizemember-custom-reg-names">' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_password"] ? ' selected="selected"' : '') . '>Yes ( always collect First/Last Names during registration )</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_names"] ? ' selected="selected"' : '') . '>No ( do NOT collect First/Last Names during registration )</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting ( <code>Yes</code> ). It\'s usually a good idea to leave this on.' . "\n";
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<br /><em>* Has NO affect on BuddyPress registration form (BuddyPress always collects a full <code>Name</code> field).</em>' . "\n" : '';
         echo c_ws_plugin__optimizemember_utils_conds::pro_is_installed() ? '<br /><em>* optimizeMember Pro (Checkout) Forms always require a First/Last Name for billing.</em>' . "\n" : '';
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-custom-reg-display-name">' . "\n";
         echo 'Set "Display Name" during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_custom_reg_display_name" id="ws-plugin--optimizemember-custom-reg-display-name">' . "\n";
         echo '<option value="full"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_display_name"] === "full" ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s Full Name )</option>' . "\n";
         echo '<option value="first"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_display_name"] === "first" ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s First Name )</option>' . "\n";
         echo '<option value="last"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_display_name"] === "last" ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s Last Name )</option>' . "\n";
         echo '<option value="login"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_display_name"] === "login" ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s Username )</option>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_display_name"] ? ' selected="selected"' : '') . '>No ( leave Display Name at default WordPress value )</option>' . "\n";
         echo '</select>' . "\n";
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<br /><em>* Has NO affect on BuddyPress registration form (BuddyPress always uses its full <code>Name</code> field).</em>' . "\n" : '';
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-custom-reg-password">' . "\n";
         echo 'Allow Custom Passwords during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_custom_reg_password" id="ws-plugin--optimizemember-custom-reg-password"' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && is_main_site() && !c_ws_plugin__optimizemember_utils_conds::pro_is_installed() ? ' disabled="disabled"' : '') . '>' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_password"] ? ' selected="selected"' : '') . '>No ( send auto-generated passwords via email; after registration )</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_password"] ? ' selected="selected"' : '') . '>Yes ( allow members to create their own password during registration )</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Auto-generated Passwords are recommended for best security; because, this also serves as a form of email confirmation.' . "\n";
         echo is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && is_main_site() ? '<br /><em>* For security purposes, Custom Passwords are NOT possible on the Main Site of a Blog Farm. <a href="#" onclick="alert(\'For security purposes, Custom Passwords are NOT possible on the Main Site of a Blog Farm. A User MUST wait for the activation/confirmation email; where a randomly generated Password will be assigned. Please note, this limitation only affects your Main Site, via `/wp-signup.php`. In other words, your Customers ( i.e. other Blog Owners ) will still have the ability to allow Custom Passwords with optimizeMember. YOU are affected by this limitation, NOT them.\\n\\n* NOTE: optimizeMember (Pro) removes this limitation.\\nIf you install the optimizeMember Pro Module, you WILL be able to allow Custom Passwords through optimizeMember Pro Forms; even on a Multisite Blog Farm.\'); return false;" tabindex="-1">[?]</a></em>' . "\n" : '';
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<br /><em>* Does NOT affect BuddyPress registration form (always <code>yes</code> with BuddyPress registration).</em>' . "\n" : '';
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-custom-reg-force-personal-emails">' . "\n";
         echo 'Force Personal Emails during Registration?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_custom_reg_force_personal_emails" id="ws-plugin--optimizemember-custom-reg-force-personal-emails" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_force_personal_emails"]) . '" /><br />' . "\n";
         echo 'To force personal email addresses, provide a comma-delimited list of email users to reject. <a href="#" onclick="alert(\'optimizeMember will reject [user]@ ( based on your configuration here ). A JavaScript alert message will be issued, asking the User to, `please use a personal email address`.\'); return false;" tabindex="-1">[?]</a><br />' . "\n";
         echo 'Ex: <code>info,help,admin,webmaster,hostmaster,sales,support,spam</code><br />' . "\n";
         echo 'See: <a href="http://kb.mailchimp.com/article/what-role-addresses-does-mailchimp-specifically-block-from-bulk-importing/" target="_blank" rel="external">this article</a> for a more complete list.' . "\n";
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<br /><em>* Affects BuddyPress registration form too.</em>' . "\n" : '';
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-custom-reg-fields-4bp">' . "\n";
         echo 'Integrate Custom Registration/Profile Fields with BuddyPress?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<div class="ws-menu-page-scrollbox" style="height:65px;">' . "\n";
         echo '<input type="hidden" name="ws_plugin__optimizemember_custom_reg_fields_4bp[]" value="update-signal"' . (!c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? ' disabled="disabled"' : '') . ' />' . "\n";
         foreach (array("profile-view" => "Yes, integrate with BuddyPress Public Profiles.", "registration" => "Yes, integrate with BuddyPress Registration Form.", "profile" => "Yes, integrate with BuddyPress Profile Editing Panel.") as $ws_plugin__optimizemember_temp_s_value => $ws_plugin__optimizemember_temp_s_label) {
             echo '<input type="checkbox" name="ws_plugin__optimizemember_custom_reg_fields_4bp[]" id="ws-plugin--optimizemember-custom-reg-fields-4bp-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__optimizemember_temp_s_value)) . '" value="' . esc_attr($ws_plugin__optimizemember_temp_s_value) . '"' . (in_array($ws_plugin__optimizemember_temp_s_value, $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields_4bp"]) ? ' checked="checked"' : '') . (!c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? ' disabled="disabled"' : '') . ' /> <label for="ws-plugin--optimizemember-custom-reg-fields-4bp-' . esc_attr(preg_replace("/[^a-z0-9_\\-]/", "-", $ws_plugin__optimizemember_temp_s_value)) . '">' . $ws_plugin__optimizemember_temp_s_label . '</label><br />' . "\n";
         }
         echo '</div>' . "\n";
         echo !c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<em>* BuddyPress is NOT installed; which is perfectly OK. BuddyPress is NOT a requirement.</em>' . "\n" : '<em>* The options above, make it possible to integrate Custom Registration/Profile Fields ( i.e. those configured with optimizeMember ) into BuddyPress as well. However, if you configure Profile Fields with BuddyPress, those will NOT be integrated with optimizeMember. Therefore, if you need Custom Registration/Profile Fields to work with both optimizeMember and with BuddyPress, please configure them with optimizeMember.</em>';
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_custom_reg_fields", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_profile_modifications", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_profile_modifications", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Member Profile Modifications">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-profile-modifications-section">' . "\n";
         echo '<h3>Giving Members The Ability To Modify Their Profile</h3>' . "\n";
         echo '<p>optimizeMember can be configured to redirect Members away from the <a href="' . esc_attr(admin_url("/profile.php")) . '" target="_blank" rel="external">default Profile Editing Panel</a> that is built into WordPress. When/if a Member attempts to access the default Profile Editing Panel, they\'ll instead, be redirected to the Login Welcome Page that you\'ve configured through optimizeMember. <strong>Why would I redirect?</strong> Unless you\'ve made some drastic modifications to your WordPress installation, the default Profile Editing Panel that ships with WordPress, is NOT really suited for public access, even by a Member.</p>' . "\n";
         echo '<p>So instead of using this default Profile Editing Panel; optimizeMember creates an added layer of functionality, on top of WordPress. It does this by providing you <em>( as the site owner )</em>, with a special Shortcode: <code>[optimizeMember-Profile /]</code> that you can place into your Login Welcome Page, or any Post/Page for that matter <em>( even into a Text Widget )</em>. This Shortcode produces an Inline Profile Editing Form that supports all aspects of optimizeMember, including Password changes; and any Custom Registration/Profile Fields that you\'ve configured with optimizeMember.</p>' . "\n";
         echo '<p>Alternatively, optimizeMember also gives you the ability to send your Members to a <a href="' . esc_attr(site_url("/?optimizemember_profile=1")) . '" target="_blank" rel="external">special Stand-Alone version</a>. This Stand-Alone version has been designed <em>( with a bare-bones format )</em>, intentionally. This makes it possible for you to <a href="#" onclick="if(!window.open(\'' . site_url("/?optimizemember_profile=1") . '\', \'_popup\', \'width=600,height=400,left=100,screenX=100,top=100,screenY=100,location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1\')) alert(\'Please disable popup blockers and try again!\'); return false;" rel="external">open it up in a popup window</a>, or embed it into your Login Welcome Page using an IFRAME. Code samples are provided below.</p>' . "\n";
         echo c_ws_plugin__optimizemember_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> BuddyPress already provides Users/Members with a Profile Editing Panel, powered by your theme. If you\'ve configured Custom Registration/Profile Fields with optimizeMember, you can also enable optimizeMember\'s Profile Field integration with BuddyPress ( recommended ). For further details, see: <code>optimizeMember -> General Options -> Registration/Profile Fields</code>.</em></p>' . "\n" : '';
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_profile_modifications", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-force-admin-lockouts">' . "\n";
         echo 'Redirect Members away from the Default Profile Panel?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_force_admin_lockouts" id="ws-plugin--optimizemember-force-admin-lockouts">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["force_admin_lockouts"] ? ' selected="selected"' : '') . '>No ( I want to use the WordPress default methodologies )</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["force_admin_lockouts"] ? ' selected="selected"' : '') . '>Yes ( redirect to Login Welcome Page; locking all /wp-admin/ areas )</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting ( <code>Yes</code> ). <em><strong>*Note*</strong> When this is set to ( <code>Yes</code> ), optimizeMember will take an initiative to further safeguard ALL <code>/wp-admin/</code> areas of your installation; not just the Default Profile Panel.</em>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Shortcode ( copy/paste )</strong>, for an Inline Profile Modification Form:<br />' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit('[optimizeMember-Profile /]') . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
         /**/
         echo '<p style="margin-top:20px;"><strong>Stand-Alone ( copy/paste )</strong>, for popup window:</p>' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit(preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(site_url("/?optimizemember_profile=1")), file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.x-php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_profile_modifications", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_trk_ops_page_during_left_sections_display_other_membership_options_header", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_trk_ops_page_during_left_sections_before_other_membership_options_header", get_defined_vars());
         /**/
         echo '<div style="border-bottom:1px solid #DFDFDF; margin:-20px 0 9px 0; padding:0;">&nbsp;</div>' . "\n";
         // echo '<div id="icon-tools" class="icon32" style="margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0;"><br /></div>' . "\n";
         echo '<h2 style="margin-top:30px;">Other Membership Options</h2>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_trk_ops_page_during_left_sections_after_other_membership_options_header", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_url_shortening", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_url_shortening", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="URL Shortening Service Preference">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-url-shortening-section">' . "\n";
         echo '<h3>URL Shortening Service API ( Preference )</h3>' . "\n";
         echo '<p>In a few special cases, long URLs generated by optimizeMember, containing encrypted authentication details, will be shortened; using one of the URL Shortening APIs <em>( listed below )</em>. A shortened URL prevents issues with VERY long links becoming corrupted by a Customer\'s email application. For instance, the Signup Confirmation Email that optimizeMember sends out to a new paying Customer, may contain a link which is shortened to prevent corruption by email applications. By default, optimizeMember uses the tinyURL API, which has proven itself to be the most reliable. However, in cases where an API service call fails, optimizeMember will automatically use one or more of its other APIs as a backup. The option below, allows you to configure which URL Shortening API optimizeMember should try first <em>( i.e. the one you prefer )</em>.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_url_shortening", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-default-url-shortener">' . "\n";
         echo 'URL Shortening Service API ( Preference ):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_default_url_shortener" id="ws-plugin--optimizemember-default-url-shortener">' . "\n";
         echo '<option value="tiny_url"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["default_url_shortener"] === "tiny_url" ? ' selected="selected"' : '') . '>tinyurl.com ( free tinyURL™ API service )</option>' . "\n";
         echo '<option value="goo_gl"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["default_url_shortener"] === "goo_gl" ? ' selected="selected"' : '') . '>goo.gl ( free Google URL Shortening API service )</option>' . "\n";
         echo '</select>' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-default-custom-str-url-shortener">' . "\n";
         echo 'Custom URL Shortening Service API ( Optional/Advanced ):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__optimizemember_default_custom_str_url_shortener" id="ws-plugin--optimizemember-default-custom-str-url-shortener" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["default_custom_str_url_shortener"]) . '" /><br />' . "\n";
         echo 'Your own custom URL <code>( i.e. GET request )</code>, with <code>%%s2_long_url%%</code> Replacement Code. [ <a href="#" onclick="alert(\'optimizeMember makes it possible for advanced site owners to use a custom URL shortening service they prefer, over the ones currently pre-integrated with optimizeMember. In order for this to work, your URL shortening service MUST support basic GET requests through its API ( sometimes referred to as a REST or NVP API ). In addition, your URL shortening service MUST be capable of returning a simple URL in the response that optimizeMember receives, as a result of optimizeMember processing the GET request you formulate. See example below.\\n\\nBitly example GET request with format=txt:\\nhttp://api.bitly.com/v3/shorten?login=demo&apiKey=2d71bf07&format=txt&longUrl=%%s2_long_url%%\\n( optimizeMember expects a shortened URL in the response from Bitly )\\n\\n* If you configure optimizeMember to use your own custom URL shortening service, optimizeMember will try your configuration first, and if anything fails, it will fall back on its own pre-integrated backups. When configuring your URL for the GET request, optimizeMember makes two Replacement Codes available:\\n\\n%%s2_long_url%% = The full URL that needs to be shortened ( raw URL-encoded ).\\n%%s2_long_url_md5%% = An MD5 hash of the full URL ( might be useful in some APIs ).\\n\\n* If you have any trouble getting your URL shortening service integrated with optimizeMember in this way, you might take a look at this WordPress Filter ( `ws_plugin__optimizemember_url_shorten` ), which optimizeMember makes available for advanced circumstances. Search optimizeMember\\\'s source code for `ws_plugin__optimizemember_url_shorten`.\'); return false;" tabindex="-1">click for details</a> ]<br />' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_url_shortening", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_deactivation", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() || is_super_admin(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_deactivation", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Deactivation Safeguards"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["run_deactivation_routines"] ? ' default-state="open"' : '') . '>' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-deactivation-section">' . "\n";
         echo '<h3>Deactivation Safeguards ( highly recommended )</h3>' . "\n";
         echo is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() && is_super_admin() ? '<p><em class="ws-menu-page-hilite">On a Multisite Blog Farm, this panel is ONLY visible to YOU, as a Super Administrator. optimizeMember automatically Safeguards everything on a Multisite Blog Farm. However, as the Super Administrator, you may turn this off; on a per-Blog basis. For example, if you\'re going to de-activate optimizeMember on this particular Blog, you can turn OFF the Safeguards below, so that optimizeMember will completely erase itself.</em></p>' . "\n" : '<p>By default, optimizeMember will retain all of it\'s Roles, Capabilities, and your Configuration Options when/if you deactivate optimizeMember from the Plugins Menu in WordPress. However, if you would like for optimizeMember to erase itself completely, please choose: <code>No ( upon deactivation, erase all data/options )</code>.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_deactivation", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-run-deactivation-routines">' . "\n";
         echo 'Safeguard optimizeMember Data/Options?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__optimizemember_run_deactivation_routines" id="ws-plugin--optimizemember-run-deactivation-routines">' . "\n";
         echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["run_deactivation_routines"] ? ' selected="selected"' : '') . '>Yes ( safeguard all data/options )</option>' . "\n";
         echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["run_deactivation_routines"] ? ' selected="selected"' : '') . '>No ( upon deactivation, erase all data/options )</option>' . "\n";
         echo '</select><br />' . "\n";
         echo 'Recommended setting: ( <code>Yes, safeguard all data/options</code> )' . "\n";
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_deactivation", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_display_security", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_before_security", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Security Encryption Key">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-security-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>Security Encryption Key ( optional, for tighter security )</h3>' . "\n";
         echo '<p>Just like WordPress, optimizeMember is open-source software. Which is wonderful. However, this also makes it possible for anyone to grab a copy of the software, and try to learn their way around its security measures. In order to keep your installation of optimizeMember unique/secure, you should configure a Security Encryption Key. optimizeMember will use your Security Encryption Key to protect itself against hackers. It does this by encrypting all sensitive information with your Key. A Security Encryption Key is unique to your installation.</p>' . "\n";
         echo '<p>Once you configure this, you do NOT want to change it; not ever. In fact, it is a VERY good idea to keep this backed up in a safe place, just in case you need to move your site, or re-install optimizeMember in the future. Some of the sensitive data that optimizeMember stores, will be encrypted with this Key. If you change it, that data can no longer be read, even by optimizeMember itself. In other words, don\'t use optimizeMember for six months, then decide to change your Key. That would break your installation.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_during_security", get_defined_vars());
         /**/
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--optimizemember-sec-encryption-key">' . "\n";
         echo 'Security Encryption Key ( at least 60 chars )' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sec_encryption_key"] ? ' <a href="#" onclick="ws_plugin__optimizemember_enableSecurityKey(); return false;" title="( not recommended )">edit key</a>' : ' <a href="#" onclick="ws_plugin__optimizemember_generateSecurityKey(); return false;" title="Insert an auto-generated Key. ( recommended )">auto-generate</a>') . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         /**/
         echo '<td>' . "\n";
         echo '<input type="text" maxlength="256" autocomplete="off" name="ws_plugin__optimizemember_sec_encryption_key" id="ws-plugin--optimizemember-sec-encryption-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sec_encryption_key"]) . '"' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sec_encryption_key"] ? ' disabled="disabled"' : '') . ' />' . "\n";
         echo !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sec_encryption_key"] ? '<br />This may contain letters, numbers, spaces; even punctuation. Up to 256 characters.<br /><em>Ex: <code>' . esc_html(strtoupper(c_ws_plugin__optimizemember_utils_strings::random_str_gen(64))) . '</code></em>' . "\n" : '';
         echo count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sec_encryption_key_history"]) > 1 ? '<br /><a href="#" onclick="ws_plugin__optimizemember_securityKeyHistory(); return false;">Click here</a> for a history of your last 10 Encryption Keys.<div id="ws-plugin--optimizemember-sec-encryption-key-history" style="display:none;"><code>' . implode('</code><br /><code>', $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["sec_encryption_key_history"]) . '</code></div>' . "\n" : '';
         echo '</td>' . "\n";
         /**/
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3>Additional Details Regarding this Key:</h3>' . "\n";
         echo '<p>Your Security Encryption Key is used throughout OptimizeMember\'s source code for many different things. However, MOST (not all, but most) uses of this Key are related to transactional processing within a particular session; so changing the Key won\'t really impact these scenarios in any significant way. Your Security Encryption Key is simply there to enhance security of data that is being transmitted in these cases.</p>' . "\n";
         echo '<p>That said, there are a few scenarios where use of your Security Encryption Key is more long-term. These include: Specific Post/Page Access Links, Registration Access Links, and it can also have a long-term impact on IPN communication because some data analyzed by OptimizeMember includes a checksum that depends on your Key. If the Key changes, it could cause future IPN data (i.e. data from your payment gateway) to fail validation.</p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_gen_ops_page_during_left_sections_after_security", get_defined_vars());
     }
     /**/
     do_action("ws_plugin__optimizemember_during_gen_ops_page_after_left_sections", get_defined_vars());
     /**/
     //echo '<div class="ws-menu-page-hr"></div>' . "\n";
     /**/
     echo '<p class="submit"><input type="submit" class="op-pb-button green" value="Save All Changes" /></p>' . "\n";
     /**/
     echo '</form>' . "\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 #25
0
 /**
  * Processed by WP_Cron; this handles Auto-EOTs *( EOT = End Of Term )*.
  *
  * If you have a HUGE userbase, increase the max EOTs per process.
  * But NOTE, this runs ``$per_process`` *( per Blog )* on a Multisite Network.
  * To increase, use: ``add_filter ("ws_plugin__optimizemember_auto_eot_system_per_process");``.
  *
  * This function makes an important Hook available: `ws_plugin__optimizemember_after_auto_eot_system`.
  * This Hook is used by some of optimizeMember Pro's Gateway integrations; allowing CRON processing
  * to run for important communications; which poll Payment Gateway APIs for possible EOTs.
  *
  * @package optimizeMember\Auto_EOT_System
  * @since 3.5
  *
  * @param int $per_process Number of database records to process each time.
  * 	Can also be Filtered with `ws_plugin__optimizemember_auto_eot_system_per_process`.
  * @return null
  */
 public static function auto_eot_system($per_process = 3)
 {
     global $wpdb;
     /* Need global DB obj. */
     global $current_site, $current_blog;
     /* Multisite. */
     /**/
     include_once ABSPATH . "wp-admin/includes/admin.php";
     /**/
     @set_time_limit(0);
     /* Make time for processing a larger userbase. */
     @ini_set("memory_limit", apply_filters("admin_memory_limit", WP_MAX_MEMORY_LIMIT));
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_auto_eot_system", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["auto_eot_system_enabled"]) {
         $per_process = apply_filters("ws_plugin__optimizemember_auto_eot_system_per_process", $per_process, get_defined_vars());
         /**/
         if (is_array($eots = $wpdb->get_results("SELECT `user_id` AS `ID` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "optimizemember_auto_eot_time' AND `meta_value` != '' AND `meta_value` <= '" . $wpdb->escape(strtotime("now")) . "' LIMIT " . $per_process))) {
             foreach ($eots as $eot) {
                 if (($user_id = $eot->ID) && is_object($user = new WP_User($user_id)) && $user->ID) {
                     delete_user_option($user_id, "optimizemember_auto_eot_time");
                     /* Always delete. */
                     /**/
                     if (!$user->has_cap("administrator")) {
                         if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_eot_behavior"] === "demote") {
                             $eot_del_type = "auto-eot-cancellation-expiration-demotion";
                             /**/
                             $custom = get_user_option("optimizemember_custom", $user_id);
                             $subscr_id = get_user_option("optimizemember_subscr_id", $user_id);
                             $fields = get_user_option("optimizemember_custom_fields", $user_id);
                             $user_reg_ip = get_user_option("optimizemember_registration_ip", $user_id);
                             /**/
                             $demotion_role = c_ws_plugin__optimizemember_option_forces::force_demotion_role("subscriber");
                             $existing_role = c_ws_plugin__optimizemember_user_access::user_access_role($user);
                             /**/
                             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                             do_action("ws_plugin__optimizemember_during_auto_eot_system_during_before_demote", get_defined_vars());
                             do_action("ws_plugin__optimizemember_during_collective_mods", $user_id, get_defined_vars(), $eot_del_type, "modification", $demotion_role);
                             do_action("ws_plugin__optimizemember_during_collective_eots", $user_id, get_defined_vars(), $eot_del_type, "modification");
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                             /**/
                             if ($existing_role !== $demotion_role) {
                                 /* Only if NOT the existing Role. */
                                 $user->set_role($demotion_role);
                             }
                             /* Give User the demotion Role. */
                             /**/
                             foreach ($user->allcaps as $cap => $cap_enabled) {
                                 if (preg_match("/^access_optimizemember_ccap_/", $cap)) {
                                     $user->remove_cap($ccap = $cap);
                                 }
                             }
                             /**/
                             delete_user_option($user_id, "optimizemember_custom");
                             delete_user_option($user_id, "optimizemember_subscr_id");
                             delete_user_option($user_id, "optimizemember_subscr_gateway");
                             /**/
                             delete_user_option($user_id, "optimizemember_ipn_signup_vars");
                             if (!apply_filters("ws_plugin__optimizemember_preserve_paid_registration_times", true, get_defined_vars())) {
                                 delete_user_option($user_id, "optimizemember_paid_registration_times");
                             }
                             /**/
                             delete_user_option($user_id, "optimizemember_last_status_scan");
                             delete_user_option($user_id, "optimizemember_first_payment_txn_id");
                             delete_user_option($user_id, "optimizemember_last_payment_time");
                             delete_user_option($user_id, "optimizemember_auto_eot_time");
                             /**/
                             delete_user_option($user_id, "optimizemember_file_download_access_log");
                             /**/
                             c_ws_plugin__optimizemember_user_notes::append_user_notes($user_id, "Demoted by optimizeMember: " . date("D M j, Y g:i a T"));
                             /**/
                             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_urls"] && is_array($cv = preg_split("/\\|/", $custom))) {
                                 foreach (preg_split("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_urls"]) as $url) {
                                     /* Handle EOT Notifications. */
                                     /**/
                                     if (($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace("/%%eot_del_type%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode("auto-eot-cancellation-expiration-demotion")), $url)) && ($url = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($subscr_id)), $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);
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             /**/
                             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["eot_del_notification_recipients"] && is_array($cv = preg_split("/\\|/", $custom))) {
                                 $email_configs_were_on = c_ws_plugin__optimizemember_email_configs::email_config_status();
                                 c_ws_plugin__optimizemember_email_configs::email_config_release();
                                 /**/
                                 $msg = $sbj = "( optimizeMember / API Notification Email ) - EOT/Deletion";
                                 $msg .= "\n\n";
                                 /* Spacing in the message body. */
                                 /**/
                                 $msg .= "eot_del_type: %%eot_del_type%%\n";
                                 $msg .= "subscr_id: %%subscr_id%%\n";
                                 $msg .= "user_first_name: %%user_first_name%%\n";
                                 $msg .= "user_last_name: %%user_last_name%%\n";
                                 $msg .= "user_full_name: %%user_full_name%%\n";
                                 $msg .= "user_email: %%user_email%%\n";
                                 $msg .= "user_login: %%user_login%%\n";
                                 $msg .= "user_ip: %%user_ip%%\n";
                                 $msg .= "user_id: %%user_id%%\n";
                                 /**/
                                 if (is_array($fields) && !empty($fields)) {
                                     foreach ($fields as $var => $val) {
                                         $msg .= $var . ": %%" . $var . "%%\n";
                                     }
                                 }
                                 /**/
                                 $msg .= "cv0: %%cv0%%\n";
                                 $msg .= "cv1: %%cv1%%\n";
                                 $msg .= "cv2: %%cv2%%\n";
                                 $msg .= "cv3: %%cv3%%\n";
                                 $msg .= "cv4: %%cv4%%\n";
                                 $msg .= "cv5: %%cv5%%\n";
                                 $msg .= "cv6: %%cv6%%\n";
                                 $msg .= "cv7: %%cv7%%\n";
                                 $msg .= "cv8: %%cv8%%\n";
                                 $msg .= "cv9: %%cv9%%";
                                 /**/
                                 if (($msg = preg_replace("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace("/%%eot_del_type%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds("auto-eot-cancellation-expiration-demotion"), $msg)) && ($msg = preg_replace("/%%subscr_id%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds($subscr_id), $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"]["eot_del_notification_recipients"]) as $recipient) {
                                                                     wp_mail($recipient, apply_filters("ws_plugin__optimizemember_eot_del_notification_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__optimizemember_eot_del_notification_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=utf-8");
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                                 /**/
                                 if ($email_configs_were_on) {
                                     /* Back on? */
                                     c_ws_plugin__optimizemember_email_configs::email_config();
                                 }
                             }
                             /**/
                             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                             do_action("ws_plugin__optimizemember_during_auto_eot_system_during_demote", get_defined_vars());
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                         } else {
                             if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_eot_behavior"] === "delete") {
                                 $eot_del_type = $GLOBALS["ws_plugin__optimizemember_eot_del_type"] = "auto-eot-cancellation-expiration-deletion";
                                 /**/
                                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                                 do_action("ws_plugin__optimizemember_during_auto_eot_system_during_before_delete", get_defined_vars());
                                 do_action("ws_plugin__optimizemember_during_collective_eots", $user_id, get_defined_vars(), $eot_del_type, "removal-deletion");
                                 unset($__refs, $__v);
                                 /* Unset defined __refs, __v. */
                                 /**/
                                 if (is_multisite()) {
                                     remove_user_from_blog($user_id, $current_blog->blog_id);
                                     /* This will automatically trigger `eot_del_notification_urls` as well. */
                                     c_ws_plugin__optimizemember_user_deletions::handle_ms_user_deletions($user_id, $current_blog->blog_id, "s2says");
                                 } else {
                                     /* Otherwise, we can actually delete them. */
                                     /* This will automatically trigger `eot_del_notification_urls` as well. */
                                     wp_delete_user($user_id);
                                 }
                                 /* `c_ws_plugin__optimizemember_user_deletions::handle_user_deletions()` */
                                 /**/
                                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                                 do_action("ws_plugin__optimizemember_during_auto_eot_system_during_delete", get_defined_vars());
                                 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_auto_eot_system", get_defined_vars());
                         unset($__refs, $__v);
                         /* Unset defined __refs, __v. */
                     }
                 }
             }
         }
     }
     /**/
     c_ws_plugin__optimizemember_utils_logs::cleanup_expired_s2m_transients();
     /* Cleanup. */
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_after_auto_eot_system", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     return;
     /* Return for uniformity. */
 }
 /**
  * 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());
     }
 }
 /**
  * Shortcode `[optimizeMember-Pro-ClickBank-Button /]`.
  *
  * @package optimizeMember\ClickBank
  * @since 1.5
  *
  * @attaches-to ``add_shortcode("optimizeMember-Pro-ClickBank-Button");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str The resulting ClickBank® Button Code, HTML markup.
  */
 public static function sc_clickbank_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     c_ws_plugin__optimizemember_no_cache::no_cache_constants(true);
     $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr);
     $attr = shortcode_atts(array("cbp" => "0", "cbskin" => "", "cbfid" => "", "cbur" => "", "cbf" => "auto", "ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "custom" => $_SERVER["HTTP_HOST"], "tp" => "0", "tt" => "D", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor"), $attr);
     $attr["tt"] = strtoupper($attr["tt"]);
     $attr["rt"] = strtoupper($attr["rt"]);
     $attr["ccaps"] = strtolower($attr["ccaps"]);
     $attr["rr"] = $attr["rt"] === "L" ? "0" : $attr["rr"];
     $attr["rr"] = $attr["level"] === "*" ? "0" : $attr["rr"];
     $attr["desc"] = str_replace("+", "plus", $attr["desc"]);
     // Workaround for a known bug @ ClickBank®.
     // ClickBank® will NOT properly parse `+` signs in URLs leading to (and returning from) ClickBank® checkout forms.
     if ($attr["cbur"] && $attr["cbf"] === "auto" && !empty($_REQUEST["cbf"])) {
         $attr["cbf"] = esc_html((string) $_REQUEST["cbf"]);
     } else {
         if (!$attr["cbur"] || $attr["cbf"] === "auto") {
             $attr["cbf"] = "";
         }
     }
     if ($attr["modify"] || $attr["cancel"]) {
         $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-edit-button.png";
         $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-cancellation-button.php")));
         $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
         $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
         $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
         $code = $attr["output"] === "anchor" ? $code : $code;
         if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
             $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
         }
         unset($href, $url, $m);
     } else {
         if ($attr["sp"]) {
             $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-button.png";
             $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
             $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-sp-checkout-button.php")));
             $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
             $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
             $code = preg_replace("/%%item%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code);
             $code = preg_replace("/%%vendor%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_username"])), $code);
             $code = preg_replace("/%%invoice%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["sp_ids_exp"])), $code);
             $code = preg_replace("/%%desc%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["desc"])), $code);
             $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["custom"])), $code);
             $code = preg_replace("/%%cbskin%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code);
             $code = preg_replace("/%%cbfid%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code);
             $code = preg_replace("/%%cbur%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbur"])), $code);
             $code = preg_replace("/%%cbf%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbf"])), $code);
             $code = str_replace(array("&amp;cbskin=&amp;", "&amp;cbfid=&amp;", "&amp;cbur=&amp;", "&amp;cbf=&amp;"), "&amp;", $code);
             $code = preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code);
             $code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__optimizemember_utils_strings::esc_ds("&amp;s2_referencing=" . urlencode($referencing)) : "", $code);
             if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) {
                 $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code);
             }
             $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
             $code = $attr["output"] === "anchor" ? $code : $code;
             if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
                 $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
             }
             unset($href, $url, $m);
         } else {
             if ($attr["level"] === "*") {
                 $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-button.png";
                 $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
                 $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
                 $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-ccaps-checkout-button.php")));
                 $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
                 $code = preg_replace("/%%item%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code);
                 $code = preg_replace("/%%vendor%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_username"])), $code);
                 $code = preg_replace("/%%invoice%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["level_ccaps_eotper"])), $code);
                 $code = preg_replace("/%%desc%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["desc"])), $code);
                 $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["custom"])), $code);
                 $code = preg_replace("/%%cbskin%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code);
                 $code = preg_replace("/%%cbfid%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code);
                 $code = preg_replace("/%%cbur%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbur"])), $code);
                 $code = preg_replace("/%%cbf%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbf"])), $code);
                 $code = str_replace(array("&amp;cbskin=&amp;", "&amp;cbfid=&amp;", "&amp;cbur=&amp;", "&amp;cbf=&amp;"), "&amp;", $code);
                 $code = !$attr["rr"] ? preg_replace("/&amp;s2_subscr_id\\=s2-\\<\\?php echo uniqid\\(\\); \\?\\>/", "", $code) : preg_replace("/\\<\\?php echo uniqid\\(\\); \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(uniqid())), $code);
                 $code = preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code);
                 $code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__optimizemember_utils_strings::esc_ds("&amp;s2_referencing=" . urlencode($referencing)) : "", $code);
                 if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) {
                     $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code);
                 }
                 $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                 $code = $attr["output"] === "anchor" ? $code : $code;
                 if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
                     $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
                 }
                 unset($href, $url, $m);
             } else {
                 $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-button.png";
                 $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
                 $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
                 $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-checkout-button.php")));
                 /*
                  * Custom button
                  */
                 if (!empty($content)) {
                     $code = preg_replace('/%%button_markup%%/', $content, $code);
                     $code = preg_replace('/%%url%%/', 'http://%%item%%.%%vendor%%.pay.clickbank.net/?cbskin=%%cbskin%%&amp;cbfid=%%cbfid%%&amp;cbur=%%cbur%%&amp;cbf=%%cbf%%&amp;s2_invoice=%%invoice%%&amp;s2_p1=%%p1%%&amp;s2_p3=%%p3%%&amp;s2_desc=%%desc%%&amp;s2_custom=%%custom%%&amp;s2_customer_ip=<?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; ?>&amp;s2_subscr_id=s2-<?php echo uniqid(); ?>%%referencing%%', $code);
                 } else {
                     $code = preg_replace("/%%button_markup%%/", '<a href="http://%%item%%.%%vendor%%.pay.clickbank.net/?cbskin=%%cbskin%%&amp;cbfid=%%cbfid%%&amp;cbur=%%cbur%%&amp;cbf=%%cbf%%&amp;s2_invoice=%%invoice%%&amp;s2_p1=%%p1%%&amp;s2_p3=%%p3%%&amp;s2_desc=%%desc%%&amp;s2_custom=%%custom%%&amp;s2_customer_ip=<?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; ?>&amp;s2_subscr_id=s2-<?php echo uniqid(); ?>%%referencing%%"><img src="%%images%%/clickbank-button.png" style="width:auto; height:auto; border:0;" alt="ClickBank®" /></a>', $code);
                 }
                 $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code);
                 $code = preg_replace("/%%item%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code);
                 $code = preg_replace("/%%vendor%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_username"])), $code);
                 $code = preg_replace("/%%invoice%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["level_ccaps_eotper"])), $code);
                 $code = preg_replace("/%%desc%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["desc"])), $code);
                 $code = preg_replace("/%%p1%%/", $attr["rr"] ? c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["tp"] . " " . $attr["tt"])) : "", $code);
                 $code = preg_replace("/%%p3%%/", $attr["rr"] ? c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["rp"] . " " . $attr["rt"])) : "", $code);
                 $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["custom"])), $code);
                 $code = preg_replace("/%%cbskin%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code);
                 $code = preg_replace("/%%cbfid%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code);
                 $code = preg_replace("/%%cbur%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbur"])), $code);
                 $code = preg_replace("/%%cbf%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbf"])), $code);
                 $code = str_replace(array("&amp;cbskin=&amp;", "&amp;cbfid=&amp;", "&amp;cbur=&amp;", "&amp;cbf=&amp;"), "&amp;", $code);
                 $code = !$attr["rr"] ? preg_replace("/&amp;s2_subscr_id\\=s2-\\<\\?php echo uniqid\\(\\); \\?\\>/", "", $code) : preg_replace("/\\<\\?php echo uniqid\\(\\); \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(uniqid())), $code);
                 $code = preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code);
                 $code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__optimizemember_utils_strings::esc_ds("&amp;s2_referencing=" . urlencode($referencing)) : "", $code);
                 if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) {
                     $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code);
                 }
                 /*
                  * Only when there is no custom button
                  */
                 if (empty($content)) {
                     $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                 }
                 /**/
                 $code = $attr["output"] === "anchor" ? $code : $code;
                 if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
                     $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href);
                 }
                 unset($href, $url, $m);
             }
         }
     }
     return $code;
 }
Beispiel #28
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 #29
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">';
     echo '<h2>API / Scripting</h2>' . "\n";
     /**/
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     /**/
     do_action("ws_plugin__optimizemember_during_scripting_page_before_left_sections", get_defined_vars());
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_easy_way", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_easy_way", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="The Extremely Easy Way">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-easy-way-section">' . "\n";
         echo '<h3>The Extremely Easy Way ( no scripting required )</h3>' . "\n";
         echo '<p>From your optimizeMember Restriction Options panel, you may restrict access to certain Posts, Pages, Tags, Categories, and/or URIs based on a Member\'s Level. The optimizeMember Restriction Options panel makes it easy for you. All you do is type in the basics of what you want to restrict access to, and those sections of your site will be off limits to non-Members. That being said, there are times when you might need to have greater control over which portions of your site can be viewed by non-Members, or Members at different Levels; with different Capabilities. This is where API Scripting with Conditionals comes in.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_easy_way", get_defined_vars());
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_easy_way", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_simple_way", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_simple_way", get_defined_vars());
         /**/
         if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site()) {
             echo '<div class="ws-menu-page-group" title="Simple/Shortcode Conditionals">' . "\n";
             /**/
             echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-simple-way-section">' . "\n";
             echo '<h3>Simple Conditionals ( via WordPress Shortcodes )</h3>' . "\n";
             echo '<p>In an effort to give you even more control over access restrictions, optimizeMember makes Simple Conditionals available to you from within WordPress, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Member\'s Level, or even based on Custom Capabilities. optimizeMember\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
             echo '<p><em>There are <strong>two different Shortcodes</strong> being demonstrated here:<br /><strong>1. <code>opmIf</code></strong> ( for testing simple conditional expressions ).<br /><strong>2. <code>opmGet</code></strong> ( to get an API Constant value, a Custom Field, or meta key ).</em></p>' . "\n";
             do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_simple_way_farm", get_defined_vars());
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-is-user-logged-in-farm.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-can-full-access-farm.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-is-specific-content-farm.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #4:</strong> Simple Conditionals w/ integrated use of [opmGet /].</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-1-farm.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #5:</strong> Using multiple Conditionals together, and even nesting other Shortcodes.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-2-farm.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-3-farm.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to optimizeMember. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><em><strong>optimizeMember supports many <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank" rel="external">Conditional Tags</a> in WordPress.</strong> Including: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>is_admin()</code></strong>, <strong><code>is_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_admin()</code></strong>, <strong><code>is_404()</code></strong>, <strong><code>is_home()</code></strong>, <strong><code>is_front_page()</code></strong>, <strong><code>is_singular(ID|slug|{slug,ID})"</code></strong>, <strong><code>is_single(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page_template(file.php)</code></strong>, <strong><code>is_attachment()</code></strong>, <strong><code>is_feed()</code></strong>, <strong><code>is_archive()</code></strong>, <strong><code>is_search()</code></strong>, <strong><code>is_category(ID|slug|{slug,ID})</code></strong>, <strong><code>is_tax(taxonomy,term)</code></strong>, <strong><code>is_tag(slug|{slug,slug})"</code></strong>, <strong><code>has_tag(slug|{slug,slug})"</code></strong>, <strong><code>is_author(ID|slug|{slug,ID})</code></strong>, <strong><code>is_date()</code></strong>, <strong><code>is_day()</code></strong>, <strong><code>is_month()</code></strong>, <strong><code>is_time()</code></strong>, <strong><code>is_year()</code></strong>, <strong><code>is_sticky(ID)</code></strong>, <strong><code>is_paged()</code></strong>, <strong><code>is_preview()</code></strong>, <strong><code>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>.</em></p>' . "\n";
             /**/
             echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
             echo '<p><em>1. True/false -> ex: <code>current_user_can()</code> / <code>!current_user_can()</code><br />2. False explicitly -> ex: <code>current_user_cannot()</code><br />3. Passing an ID -> ex: <code>is_page(24)</code><br />4. Passing a Slug -> ex: <code>is_page(my-cool-page)</code><br />5. Passing an Array -> ex: <code>is_page({my-cool-page,24,about,contact-form})</code></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT use spaces inside Conditionals.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_page(My Membership Options Page)</code><br />- use slugs or IDs instead, no spaces.</em></p>' . "\n";
             /**/
             echo '<p><em><strong>Implementing AND/OR Conditional expressions:</strong></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT mix AND/OR expressions.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_user_logged_in() AND is_page(1) OR is_page(2)</code><br />- use one or the other; do NOT mix AND/OR together.</em></p>' . "\n";
             echo '<p><em><strong class="ws-menu-page-hilite">If you need to have both types of logic, use nesting:</strong></em></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-nesting.x-php")) . '</p>' . "\n";
             echo '</div>' . "\n";
             /**/
             echo '</div>' . "\n";
         } else {
             echo '<div class="ws-menu-page-group" title="Simple/Shortcode Conditionals">' . "\n";
             /**/
             echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-simple-way-section">' . "\n";
             echo '<h3>Simple Conditionals ( via WordPress Shortcodes )</h3>' . "\n";
             echo '<p>In an effort to give you even more control over access restrictions, optimizeMember makes Simple Conditionals available to you from within WordPress, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>current_user_is_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_is_not_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_can_for_blog(blog_id,capability)</code></strong>, <strong><code>current_user_cannot_for_blog(blog_id,capability)</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Member\'s Level, or even based on Custom Capabilities. optimizeMember\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
             echo '<p><em>There are <strong>two different Shortcodes</strong> being demonstrated here:<br /><strong>1. <code>opmIf</code></strong> ( for testing simple conditional expressions ).<br /><strong>2. <code>opmGet</code></strong> ( to get an API Constant value, a Custom Field, or meta key ).</em></p>' . "\n";
             do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars());
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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 class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-is-user-logged-in.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-can-full-access.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-current-user-is-specific-content.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #4:</strong> Simple Conditionals w/ integrated use of [opmGet /].</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-1.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #5:</strong> Using multiple Conditionals together, and even nesting other Shortcodes.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-2.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-supplements-3.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to optimizeMember. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><em><strong>optimizeMember supports ALL <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank" rel="external">Conditional Tags</a> in WordPress.</strong> Including, but not limited to: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>current_user_is_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_is_not_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_can_for_blog(blog_id,capability)</code></strong>, <strong><code>current_user_cannot_for_blog(blog_id,capability)</code></strong>, <strong><code>is_multisite()</code></strong>, <strong><code>is_main_site()</code></strong>, <strong><code>is_super_admin()</code></strong>, <strong><code>is_admin()</code></strong>, <strong><code>is_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_admin()</code></strong>, <strong><code>is_404()</code></strong>, <strong><code>is_home()</code></strong>, <strong><code>is_front_page()</code></strong>, <strong><code>is_comments_popup()</code></strong>, <strong><code>is_singular(ID|slug|{slug,ID})"</code></strong>, <strong><code>is_single(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page_template(file.php)</code></strong>, <strong><code>is_attachment()</code></strong>, <strong><code>is_feed()</code></strong>, <strong><code>is_trackback()</code></strong>, <strong><code>is_archive()</code></strong>, <strong><code>is_search()</code></strong>, <strong><code>is_category(ID|slug|{slug,ID})</code></strong>, <strong><code>is_tax(taxonomy,term)</code></strong>, <strong><code>is_tag(slug|{slug,slug})"</code></strong>, <strong><code>has_tag(slug|{slug,slug})"</code></strong>, <strong><code>is_author(ID|slug|{slug,ID})</code></strong>, <strong><code>is_date()</code></strong>, <strong><code>is_day()</code></strong>, <strong><code>is_month()</code></strong>, <strong><code>is_time()</code></strong>, <strong><code>is_year()</code></strong>, <strong><code>is_sticky(ID)</code></strong>, <strong><code>is_paged()</code></strong>, <strong><code>is_preview()</code></strong>, <strong><code>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>, <strong><code>is_active_sidebar(ID|number)</code></strong>.</em></p>' . "\n";
             /**/
             echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
             echo '<p><em>1. True/false -> ex: <code>current_user_can()</code> / <code>!current_user_can()</code><br />2. False explicitly -> ex: <code>current_user_cannot()</code><br />3. Passing an ID -> ex: <code>is_page(24)</code><br />4. Passing a Slug -> ex: <code>is_page(my-cool-page)</code><br />5. Passing an Array -> ex: <code>is_page({my-cool-page,24,about,contact-form})</code></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT use spaces inside Conditionals.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_page(My Membership Options Page)</code><br />- use slugs or IDs instead, no spaces.</em></p>' . "\n";
             /**/
             echo '<p><em><strong>Implementing AND/OR Conditional expressions:</strong></em></p>' . "\n";
             echo '<p><em>*Tip: do NOT mix AND/OR expressions.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_user_logged_in() AND is_page(1) OR is_page(2)</code><br />- use one or the other; do NOT mix AND/OR together.</em></p>' . "\n";
             echo '<p><em><strong class="ws-menu-page-hilite">If you need to have both types of logic, use nesting:</strong></em></p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/sc-s2-conditional-nesting.x-php")) . '</p>' . "\n";
             echo '</div>' . "\n";
             /**/
             echo '</div>' . "\n";
         }
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_simple_way", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_advanced_way", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_advanced_way", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Advanced/PHP Conditionals">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-advanced-way-section">' . "\n";
         echo '<h3>The Advanced Way ( some PHP scripting required )</h3>' . "\n";
         echo '<p>In an effort to give you even more control over access restrictions, optimizeMember makes some PHP functions, and also some PHP Constants, available to you from within WordPress. In this section, we\'ll demonstrate several functions: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</code></strong>, <strong><code>current_user_is("role")</code></strong>, <strong><code>current_user_is_not("role")</code></strong>, <strong><code>current_user_can("capability")</code></strong>, <strong><code>current_user_cannot("capability")</code></strong>, <strong><code>current_user_is_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_is_not_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_can_for_blog($blog_id,"capability")</code></strong>, &amp; <strong><code>current_user_cannot_for_blog($blog_id,"capability")</code></strong>. To make use of these functions, please follow our PHP code samples below. Using PHP, is a very powerful way to build Advanced Conditionals within your content; based on a Member\'s Level, Custom Capabilities, and/or other factors. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ).</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_advanced_way", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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 class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/is-user-logged-in.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-full-access.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-is-specific-content.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #4:</strong> Using optimizeMember API Conditionals, supplementing WordPress core functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2-conditional-supplements-1.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #5:</strong> Using optimizeMember API Conditionals, supplementing WordPress core functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2-conditional-supplements-2.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2-conditional-supplements-3.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #7:</strong> Using optimizeMember API Constants, instead of conditional functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-constants-1.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #8:</strong> Using optimizeMember API Constants, instead of conditional functions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-constants-2.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
         echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
         echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to optimizeMember. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_advanced_way", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_queries", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_queries", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Advanced/PHP Query Conditionals">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-advanced-way-section">' . "\n";
         echo '<h3>Advanced Query Conditionals ( some PHP scripting required )</h3>' . "\n";
         echo '<p>optimizeMember provides several built-in API Functions that are tailored to meet the needs of developers integrating optimizeMember into their themes. Such as: <strong><code>is_protected_by_s2member($id, "[category,tag,post,page,singular,uri]")</code></strong>, <strong><code>is_permitted_by_s2member($id, "[category,tag,post,page,singular,uri]")</code></strong>, <strong><code>is_category_protected_by_s2member($cat_id)</code></strong>, <strong><code>is_category_permitted_by_s2member($cat_id)</code></strong>, <strong><code>is_tag_protected_by_s2member($tag_id [slug or tag name])</code></strong>, <strong><code>is_tag_permitted_by_s2member($tag_id [slug or tag name])</code></strong>, <strong><code>is_post_protected_by_s2member($post_id)</code></strong>, <strong><code>is_post_permitted_by_s2member($post_id)</code></strong>, <strong><code>is_page_protected_by_s2member($page_id)</code></strong>, <strong><code>is_page_permitted_by_s2member($page_id)</code></strong>, <strong><code>is_uri_protected_by_s2member($uri [or full url])</code></strong>, <strong><code>is_uri_permitted_by_s2member($uri [ or full url])</code></strong>.</p>' . "\n";
         echo '<p>In addition, there are two special functions that can be applied by theme authors before making custom queries: <strong><code>attach_optimizemember_query_filters()</code></strong>, <strong><code>detach_optimizemember_query_filters()</code></strong>. These can be used before and after a call to <strong><code>query_posts()</code></strong> for example. optimizeMember will automatically filter all protected content ( not available to the current User/Member ).</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_queries", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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 class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #1:</strong> Pre-filtering custom queries in WordPress.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/custom-queries.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #2:</strong> OR, instead of pre-filtering; check Access Restrictions in The Loop.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/custom-queries-loop.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #3:</strong> Checking Tag Restrictions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-tag-restrictions.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #4:</strong> Checking Category Restrictions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-category-restrictions.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #5:</strong> Checking Page Restrictions.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-page-restrictions.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Example #6:</strong> Checking Post Restrictions, including Custom Post Types.</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/specific-post-restrictions.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_queries", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_custom_capabilities", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_custom_capabilities", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Custom Capabilities ( Packages )">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-custom-capabilities-section">' . "\n";
         echo '<h3>Packaging Together Custom Capabilities w/ Membership</h3>' . "\n";
         echo '<p>Using one of optimizeMember\'s Payment Button and/or Form Generators, you can add Custom Capabilities in comma-delimited format. optimizeMember builds upon existing functionality offered by <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank" rel="external">WordPress Roles/Capabilities</a>. optimizeMember supports Free Subscribers <em>( at Level #0 )</em>, and several Primary Roles created by the optimizeMember plugin <em>( i.e. optimizeMember Levels 1-4, or up to the number of configured Levels )</em>. Each optimizeMember Level <em>( aka: optimizeMember Role )</em> provides the Capability <code>current_user_can("access_optimizemember_level0"), 1, 2, 3, 4</code>, where <code>access_optimizemember_level[0-4]</code> is the Capability associated with each Role; and Membership Levels provide incremental access <em>( i.e. Level #4 Members can also access content at Levels 0, 1, 2, and 3 beneath them )</em>. In short, these Level-based permissions are the default Capabilities that come with each Membership Level being sold on your site.</p>' . "\n";
         echo '<p>Now, if you\'d like to package together some variations of each Membership Level that you\'re selling, you can! All you do is add <strong>Custom Capabilities</strong> whenever you create your Payment Button and/or Form Shortcode ( <em>there is a field in the Button &amp; Form Generators where you can enter Custom Capabilities</em> ). You can sell Membership Packages that come with Custom Capabilities, and even with custom prices.</p>' . "\n";
         echo '<p>Custom Capabilities are an extension to a feature that already exists in WordPress. The <code>current_user_can()</code> function, can be used to test for these additional Capabilities that you allow. Whenever a Member completes the checkout process, after having purchased a Membership from you ( one that included Custom Capabilities ), optimizeMember will add those Custom Capabilities to the account for that specific Member.</p>' . "\n";
         echo '<p>Custom Capabilities are always prepended with <code>access_optimizemember_ccap_</code>. You fill in the last part, with ONLY lowercase alpha-numerics and/or underscores. For example, let\'s say you want to sell Membership Level #1, as is. But, you also want to sell a slight variation of Membership Level #1, that includes the ability to access the Music &amp; Video sections of your site. So, instead of selling this additional access under a whole new Membership Level, you could just sell a modified version of Membership Level #1. Add the the Custom Capabilities: <code>music,videos</code>. Once a Member has these Capabilities, you can test for these Capabilities using <code>current_user_can("access_optimizemember_ccap_music")</code> and <code>current_user_can("access_optimizemember_ccap_videos")</code>.</p>' . "\n";
         echo '<p>The important thing to realize, is that Custom Capabilities, are just that. They\'re custom. optimizeMember only deals with the default Capabilities that it uses. If you start using Custom Capabilities, you MUST use Simple or Advanced Conditionals ( <em>i.e. <code>current_user_can()</code> logic</em> ) to test for them. Either in your theme files with PHP, or in Posts/Pages using Simple Conditionals <em>( powered by Shortcodes )</em>.</p>' . "\n";
         echo '<p><strong>*New*</strong> In the latest versions of optimizeMember, you can automatically require certain Custom Capabilities on a per Post/Page basis. So now, optimizeMember <em>( if you prefer )</em> CAN handle Custom Capabilities for you automatically! Whenever you edit a Post/Page <em>( i.e. there is a Meta Box for optimizeMember in your Post/Page editing station )</em>... you can tell optimizeMember to require certain Custom Capabilities that you type in, using comma-delimited format. In other words, you will need to type in some of the trigger words that you used whenever you created your Payment Buttons/Forms. This way paying Members will have the Custom Capabilities to view different kinds of content that you offer.</p>' . "\n";
         echo '<p><strong>*New*</strong> By default, a Checkout Button or Form generated by optimizeMember is designed to (Add) Custom Capabilities to any that may or may not already exist for a particular User/Member. However, starting with optimizeMember v110815+, you can tell optimizeMember to (Remove All) Custom Capabilities, and then (Add) only the new ones that you specify. This is accomplished on a per Form/Button basis by preceding your comma-delimited list of Custom Capabilities with `-all`. For further details on this topic, click the <a href="#" onclick="alert(\'*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell 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> icon next to the Custom Capabilities field in any Button/Form Generator supplied by optimizeMember.</p>' . "\n";
         echo '<p><strong>*New*</strong> Independent Custom Capabilities. You can now sell one or more Custom Capabilities using Buy Now functionality, to "existing" Users/Members, regardless of which Membership Level they have on your site <em>( i.e. you could even sell Independent Custom Capabilities to Users at Membership Level #0, normally referred to as Free Subscribers, if you like )</em>. So this is quite flexible. For further details, please check your Dashboard, under: <code>optimizeMember -> PayPal Buttons -> Capability (Buy Now) Buttons</code>.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_custom_capabilities", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://wordpress.org/extend/plugins/user-role-editor/" target="_blank" rel="external">Plugins -> User Role Editor</a> <em>( may come in handy for some )</em>.</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Custom Capabilities:</strong> ( music,videos ):</p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-ccaps-1.x-php")) . '</p>' . "\n";
         /**/
         echo '<p><strong>Custom Capabilities:</strong> ( ebooks,reports,tips ):</p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-can-ccaps-2.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_custom_capabilities", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_custom_capability_files", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_custom_capability_files", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Custom Capability &amp; Member Level Files">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-custom-capability-files-section">' . "\n";
         echo '<h3>Restricting Files, Based On Custom Capabilities</h3>' . "\n";
         echo '<p>If you\'re NOT familiar with Custom Capabilities yet, please read the section above, titled: `Custom Capability Packages`, and also see: `optimizeMember -> Download Options`, both as primers; BEFORE you read this section. Once you understand the basic concept of Custom Capabilities &amp; Protected File Downloads, you\'ll see that ( by default ) optimizeMember does NOT handle File Download Protection with respect to Custom Capabilities. That\'s where Custom Capability Sub-directories come in.</p>' . "\n";
         echo '<p>You can create Custom Capability Sub-directories under: <code>' . esc_html(c_ws_plugin__optimizemember_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '</code>. For instance, if you have a Custom Capability <code>music</code>, you can place protected files that should ONLY be accessible to Members with <code>access_optimizemember_ccap_music</code>, inside: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-ccap-music/</code>. Some examples are provided below.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_custom_capability_files", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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 class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Custom Capabilities:</strong> ( music,videos )</p>' . "\n";
         echo '<p>Sub-Directory: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-ccap-music</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-ccap-videos</code></p>' . "\n";
         echo '<p>Protected File: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-ccap-music/file.mp3</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-ccap-videos/file.avi</code></p>' . "\n";
         echo '<p>Now, here are some link examples, using Custom Capability Sub-directories:</p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/ccap-file-downloads.x-php")) . '</p>' . "\n";
         echo '<p><em>These links will ONLY work for Members who are logged-in, with the proper Capabilities.</em></p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Membership Levels:</strong> ( this also works fine )</p>' . "\n";
         echo '<p>Sub-Directory: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level0</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level1</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level2</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level3</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level4</code></p>' . "\n";
         echo '<p>Protected File: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level0/tiger.doc</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level1/zebra.pdf</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level2/elephant.doc</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level3/rhino.pdf</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/access-optimizemember-level4/lion.doc</code></p>' . "\n";
         echo '<p>Now, here are some link examples, using Member Level Sub-directories:</p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/level-file-downloads.x-php")) . '</p>' . "\n";
         echo '<p><em>These links will ONLY work for Members who are logged-in, with an adequate Membership Level.</em></p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_custom_capability_files", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_advanced_dripping", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_advanced_dripping", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="optimizeMember Content Dripping">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-advanced-dripping-section">' . "\n";
         echo '<h3>Dripping Content ( some PHP scripting required )</h3>' . "\n";
         echo '<p>Content Dripping is the gradual, pre-scheduled release of premium website content to paying Members. This has become increasingly popular, because it allows older Members; those who have paid you more, due to recurring charges; to acquire access to more content progressively; based on their original paid registration time. It also gives you ( as the site owner ), the ability to launch multiple membership site portals, operating on autopilot, without any direct day-to-day involvement in a content release process. This requires some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ).</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_advanced_dripping", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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 class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>To drip content using <code>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>:</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-paid-registration-days-dripping.x-php")) . '</p>' . "\n";
         /**/
         echo '<p><em>There are more examples on this page, under the sub-section "optimizeMember PHP/API Constants". You\'ll see that optimizeMember provides you with access to several PHP/API Constants, which will assist you in dripping content. Some of the most relevant API Constants include: <code>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</code>, <code>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>, <code>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_TIME</code>, <code>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_DAYS</code>; and there are many others.</em></p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<h3>Very Advanced Content Dripping ( some PHP required )</h3>' . "\n";
         echo '<p>If you plan on dripping content in VERY advanced ways, you can tap into optimizeMember\'s recorded history of all Paid Registration Times. ( i.e. <code>' . esc_html('<?php $time = optimizemember_paid_registration_time("level1"); ?>') . '</code> ) will give you a timestamp at which a Member first paid for Level#1 access. If they\'ve never paid for Level#1 access, the function will return 0. optimizeMember keeps a recorded history of timestamps associated with each Level that a Member gains access to, throughout the lifetime of their account. * NOTE: This requires optimizeMember v3.3+. Previous versions of optimizeMember did NOT record this information. If you implement this functionality on an upgraded installation of optimizeMember, please remember that optimizeMember will have NO Paid Registration Time for any Member you acquired prior to installing optimizeMember v3.3+. <em>Check the forums for work-arounds.</em></p>' . "\n";
         echo '<p><strong>Here is the function documentation for PHP/WordPress developers:</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2member-paid-registration-time.x-php")) . '</p>' . "\n";
         echo '<p><strong>Here are some actual examples that should give you some ideas:</strong></p>' . "\n";
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/s2member-paid-registration-time-examples.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_advanced_dripping", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_profile_modifications", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_profile_modifications", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Member Profile Modifications">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-profile-modifications-section">' . "\n";
         echo '<h3>Giving Members The Ability To Modify Their Profile</h3>' . "\n";
         echo '<p>optimizeMember can be configured to redirect Members away from the <a href="' . esc_attr(admin_url("/profile.php")) . '" target="_blank" rel="external">default Profile Editing Panel</a> that is built into WordPress. When/if a Member attempts to access the default Profile Editing Panel, they\'ll instead, be redirected to the Login Welcome Page that you\'ve configured through optimizeMember. <strong>Why would I redirect?</strong> Unless you\'ve made some drastic modifications to your WordPress installation, the default Profile Editing Panel that ships with WordPress, is NOT really suited for public access, even by a Member. See: <code>optimizeMember -> General Options -> Profile Modifications</code>.</p>' . "\n";
         echo '<p>So instead of using this default Profile Editing Panel; optimizeMember creates an added layer of functionality, on top of WordPress. It does this by providing you ( as the site owner ), with a special Shortcode: <code>[optimizeMember-Profile /]</code> that you can place into your Login Welcome Page, or any Post/Page for that matter ( even into a Text Widget ). This Shortcode produces an Inline Profile Editing Form that supports all aspects of optimizeMember, including Password changes; and any Custom Registration/Profile Fields that you\'ve configured with optimizeMember.</p>' . "\n";
         echo '<p>Alternatively, optimizeMember also gives you the ability to send your Members to a <a href="' . esc_attr(site_url("/?optimizemember_profile=1")) . '" target="_blank" rel="external">special Stand-Alone version</a>. This Stand-Alone version has been designed ( with a bare-bones format ), intentionally. This makes it possible for you to <a href="#" onclick="if(!window.open(\'' . site_url("/?optimizemember_profile=1") . '\', \'_popup\', \'width=600,height=400,left=100,screenX=100,top=100,screenY=100,location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1\')) alert(\'Please disable popup blockers and try again!\'); return false;" rel="external">open it up in a popup window</a>, or embed it into your Login Welcome Page using an IFRAME. Code samples are provided below.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_profile_modifications", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Shortcode:</strong> for an Inline Profile Modification Form:<br />' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit('[optimizeMember-Profile /]') . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
         /**/
         echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( standard link tag ):</p>' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit(preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(site_url("/?optimizemember_profile=1")), file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-1-ops.x-php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
         /**/
         echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( open the link in a popup window ):</p>' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit(preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(site_url("/?optimizemember_profile=1")), file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.x-php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
         /**/
         echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( embed the Form with an IFRAME tag ):</p>' . "\n";
         echo '<p><input type="text" autocomplete="off" value="' . format_to_edit(preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(site_url("/?optimizemember_profile=1")), file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-3-ops.x-php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_profile_modifications", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_constants", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_constants", get_defined_vars());
         /**/
         if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site()) {
             echo '<div class="ws-menu-page-group" title="opmGet / optimizeMember API Constants">' . "\n";
             /**/
             echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-constants-section">' . "\n";
             echo '<h3>Using opmGet w/ optimizeMember API Constants</h3>' . "\n";
             echo '<p>A Constant, is an identifier ( a name ) for a simple value. Below is a comprehensive list that includes all of the defined Constants available to you. We recommend using some of these Constants in the creation of your Login Welcome Page; which is described in the optimizeMember General Options Panel. These are NOT required, but you can get pretty creative with your Login Welcome Page if you know how to use the <code>[opmGet constant="" /]</code> Shortcode for WordPress.</p>' . "\n";
             echo '<p>For example, you might use <code>[opmGet constant="OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LABEL" /]</code> to display the type of Membership a Customer has.</em></p>' . "\n";
             do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_constants_farm", get_defined_vars());
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_VERSION</strong><br />This will always be a (string) with the current optimizeMember version. Available since optimizeMember 3.0. Dated versions began with optimizeMember v110604.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_LOGIN_COUNTER</strong><br />This will always be (int) <code>-1</code> or higher <em>( representing the number of times a User/Member has logged into your site )</em>. <code>-1</code> if no User is logged in. <code>0</code> if the current User has NEVER logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN</strong><br />This will always be (bool) true or false. True if a User/Member is currently logged in with an Access Level >= 0.</p>' . "\n";
             echo '<p><em>See: <code>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER</strong><br />This will always be (bool) true or false. True if a Member is currently logged in with an Access Level >= 1.</p>' . "\n";
             echo '<p><em>See: <code>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) <code>-1</code> thru <code>4</code> <em>( or, up to the total number Membership Levels you\'ve configured )</em>. <code>-1</code> if not logged in. <code>0</code> if logged in as a Free Subscriber.</p>' . "\n";
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to optimizeMember. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LABEL</strong><br />This will always be a (string) containing the Membership Label associated with the current User\'s account. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be an empty string. Also empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be their WordPress User ID#. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_GATEWAY</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. Gateway. If they\'ve NOT paid yet, this will be empty. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_CUSTOM</strong><br />This will always be a (string) containing the current User\'s Custom String; associated with their optimizeMember Profile. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. 0 if not logged in. This holds the recorded time at which the User originally registered their Username for access to your site; for free or otherwise. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>( i.e. if they\'re still a Free Subscriber )</em>. This holds the recorded time at which the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. This value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once this value is recorded, it never changes under any circumstance. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>( i.e. if they\'re still a Free Subscriber )</em>. This is the number of days that have passed since the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. The underlying timestamp behind this value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once the underlying timestamp behind this value is recorded, it never changes under any circumstance. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_DAYS</strong><br />This will always be an (int). 0 if not logged in. This is the number of days that have passed since the User originally registered their Username for access to your site; for free or otherwise. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DISPLAY_NAME</strong><br />This will always be a (string) containing the current User\'s Display Name. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME</strong><br />This will always be a (string) containing the current User\'s First Name. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME</strong><br />This will always be a (string) containing the current User\'s Last Name. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_LOGIN</strong><br />This will always be a (string) containing the current User\'s Username. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_EMAIL</strong><br />This will always be a (string) containing the current User\'s Email Address. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address, even when/if NOT logged-in. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if browsing anonymously.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_IP</strong><br />This is a (string) containing the IP Address the current User had at the time they registered. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_ID</strong><br />This will always be an (int) containing the current User\'s ID# in WordPress. However, it will be 0 if not logged in.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             #echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_FIELDS</strong><br />This will always be a JSON encoded array, in (string) format. An empty JSON encoded array, in (string) format, if not logged in. This JSON encoded array will contain the following fields: <code>id, ip, reg_ip, email, login, first_name, last_name, display_name, subscr_id, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. You can do <code>print_r(json_decode(OPTIMIZEMEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
             /**/
             #echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'re allowed to download. 0 means no access.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED</strong><br />This will always be (bool) true or false. A value of true means their allowed downloads are >= 999999999, and false means it is not. This is useful if you are allowing unlimited ( 999999999 ) downloads on some Membership Levels. You can display `Unlimited` instead of a number.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'ve downloaded in the current period.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS</strong><br />This will always be an (int) value >= 0. This indicates how many total days make up the current period. 0 means no access.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile. In addition to this Stand-Alone version, optimizeMember also makes a Shortcode available which produces an Inline Profile Editing Form. Use <code>[optimizeMember-Profile /]</code> in any Post/Page, or even in a Text Widget if you like.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL</strong><br />This is the full URL to the Limit Exceeded Page ( informational ).</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_MEMBERSHIP_OPTIONS_PAGE_URL</strong><br />This is the full URL to the Membership Options Page ( the signup page ).</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_MEMBERSHIP_OPTIONS_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LOGIN_WELCOME_PAGE_URL</strong><br />This is the full URL to the Login Welcome Page ( the User\'s account page ). * This could also be the full URL to a Special Redirection URL ( if you configured one ). See <code>optimizeMember -> General Options -> Login Welcome Page</code>.</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_LOGIN_WELCOME_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL. * In the case of a Special Redirection URL, this ID is not really applicable.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LOGIN_PAGE_URL</strong><br />This is the full URL to the Membership Login Page ( the WordPress login page ).</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LOGOUT_PAGE_URL</strong><br />This is the full URL to the Membership Logout Page ( the WordPress logout page ).</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LEVELn_LABEL</strong><br />This is the (string) Label that you configured for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_REG_EMAIL_FROM_EMAIL</strong><br />This is the Email Address that outgoing messages are sent by.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_NOTIFY_URL</strong><br />This is the URL on your system that receives PayPal IPN responses.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_RETURN_URL</strong><br />This is the URL on your system that receives PayPal return variables.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_BUSINESS</strong><br />This is the Email Address that identifies your PayPal Business.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_ENDPOINT</strong><br />PayPal Endpoint Domain <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_ENDPOINT</strong><br />PayPal API Endpoint Domain <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_USERNAME</strong><br />This is the API Username associated with your PayPal Business.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_PASSWORD</strong><br />This is the API Password associated with your PayPal Business.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_SIGNATURE</strong><br />This is the API Signature associated with your PayPal Business.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_PDT_IDENTITY_TOKEN</strong><br />This is the PDT Identity Token associated with your PayPal Business.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_list_of_api_constants_farm", get_defined_vars());
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>on0</code> input variable, with the string: <code>"Referencing Customer ID"</code>. Otherwise, it will be set to a default value of: <code>"Originating Domain"</code>.</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>os0</code> input variable, with the value of <code>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</code>. Otherwise, it will be set to a default value of <code>$_SERVER["HTTP_HOST"]</code> <em>( the originating domain name )</em>.</p>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_ON1</strong> ... This auto-fills the <code>on1</code> value in PayPal Button Codes. This always contains the string: <code>"Customer IP Address"</code>.</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_OS1</strong> ... This auto-fills the <code>os1</code> value in PayPal Button Codes. This always contains the value of <code>$_SERVER["REMOTE_ADDR"]</code> <em>( the Customer\'s IP address )</em>.</p>' . "\n";
             /**/
             echo '<p><em>These four Constants above are special. They\'re used by the PayPal Button Generator for optimizeMember. This is how optimizeMember identifies an existing Member ( and/or a Free Subscriber ), who is already logged in when they click a PayPal Modification Button that was generated for you by optimizeMember. Instead of forcing a Member ( and/or a Free Subscriber ) to re-register for a new account, optimizeMember can identify their existing account, and update it, according to the modified terms in your Button Code. Specifically, these three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal Buttons, you won\'t even see these, because they\'re added internally by the Shortcode processor. Anyway, they\'re just documented here for clarity; you probably won\'t use these directly; the Button Generator pops them in.</em></p>' . "\n";
             /**/
             echo '</div>' . "\n";
             /**/
             echo '</div>' . "\n";
         } else {
             echo '<div class="ws-menu-page-group" title="optimizeMember PHP/API Constants">' . "\n";
             /**/
             echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-constants-section">' . "\n";
             echo '<h3>You Have Access To PHP Constants ( some PHP scripting required )</h3>' . "\n";
             echo '<p>A Constant, is an identifier <em>( i.e. a name )</em> for a simple value in PHP scripting. Below is a comprehensive list that includes all of the PHP defined Constants available to you. All of these Constants are also available through JavaScript as Global Variables. Example code has been provided in the documentation below. If you\'re a web developer, we suggest using some of these Constants in the creation of your Login Welcome Page; which is described in the optimizeMember General Options Panel. These are NOT required, but you can get pretty creative with the Login Welcome Page, if you know a little PHP.</p>' . "\n";
             echo '<p>If you don\'t know any PHP, you can use the <code>[opmGet constant="NAME_OF_CONSTANT" /]</code> Shortcode for WordPress. For example, you might use <code>[opmGet constant="OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LABEL" /]</code> to display the type of Membership a Customer has. The <code>[opmGet constant="" /]</code> Shortcode will work for any of the API Constants documented below.</p>' . "\n";
             do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_constants", get_defined_vars());
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p>Before you read any further, you should install this handy plugin: <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a>.<br />' . "\n";
             echo 'You\'ll need to have this plugin installed to use PHP code in Posts/Pages.</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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 class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_VERSION</strong><br />This will always be a (string) with the current optimizeMember version. Available since optimizeMember 3.0. Dated versions began with optimizeMember v110604.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/version.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_LOGIN_COUNTER</strong><br />This will always be (int) <code>-1</code> or higher <em>( representing the number of times a User/Member has logged into your site )</em>. <code>-1</code> if no User is logged in. <code>0</code> if the current User has NEVER logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-login-counter.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN</strong><br />This will always be (bool) true or false. True if a User/Member is currently logged in with an Access Level >= 0.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-is-logged-in.x-php")) . '</p>' . "\n";
             echo '<p><em>See: <code>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER</strong><br />This will always be (bool) true or false. True if a Member is currently logged in with an Access Level >= 1.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-is-logged-in-as-member.x-php")) . '</p>' . "\n";
             echo '<p><em>See: <code>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) <code>-1</code> thru <code>4</code> <em>( or, up to the total number Membership Levels you\'ve configured )</em>. <code>-1</code> if not logged in. <code>0</code> if logged in as a Free Subscriber.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-access-level.x-php")) . '</p>' . "\n";
             echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
             echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
             echo '<p><em>* WordPress Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to optimizeMember. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_ACCESS_LABEL</strong><br />This will always be a (string) containing the Membership Label associated with the current User\'s account. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-access-label.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be an empty string. Also empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-subscr-id.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. ID. If they\'ve NOT paid yet, this will be their WordPress User ID#. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-subscr-or-wp-id.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_GATEWAY</strong><br />This will always be a (string) containing the current User\'s Paid Subscr. Gateway. If they\'ve NOT paid yet, this will be empty. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-subscr-gateway.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_CUSTOM</strong><br />This will always be a (string) containing the current User\'s Custom String; associated with their optimizeMember Profile. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-custom.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. 0 if not logged in. This holds the recorded time at which the User originally registered their Username for access to your site; for free or otherwise. This is useful if you want to drip content over an extended period of time, based on how long someone has been registered (period); regardless of whether they are/were paying you. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-registration-time.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_DAYS</strong><br />This will always be an (int). 0 if not logged in. This is the number of days that have passed since the User originally registered their Username for access to your site; for free or otherwise. This is useful if you want to drip content over an extended period of time, based on how long someone has been registered (period); regardless of whether they are/were paying you. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-registration-days.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>( i.e. if they\'re still a Free Subscriber )</em>. This holds the recorded time at which the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. This value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once this value is recorded, it never changes under any circumstance. This is useful if you want to drip content over an extended period of time, based on how long someone has been a "paying" Member (period); regardless of their original or existing Membership Level. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-paid-registration-time.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>( i.e. if they\'re still a Free Subscriber )</em>. This is the number of days that have passed since the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. The underlying timestamp behind this value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once the underlying timestamp behind this value is recorded, it never changes under any circumstance. This is useful if you want to drip content over an extended period of time, based on how long someone has been a "paying" Member (period); regardless of their original or existing Membership Level. <strong>* Note:</strong> this is NOT the same as <code>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-paid-registration-days.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DISPLAY_NAME</strong><br />This will always be a (string) containing the current User\'s Display Name. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-display-name.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_FIRST_NAME</strong><br />This will always be a (string) containing the current User\'s First Name. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-first-name.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_LAST_NAME</strong><br />This will always be a (string) containing the current User\'s Last Name. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-last-name.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_LOGIN</strong><br />This will always be a (string) containing the current User\'s Username. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-login.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_EMAIL</strong><br />This will always be a (string) containing the current User\'s Email Address. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-email.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address, even when/if NOT logged in. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if browsing anonymously.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-ip.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_REGISTRATION_IP</strong><br />This will always be a (string) containing the current User\'s original IP Address during registration. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-registration-ip.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_ID</strong><br />This will always be an (int) containing the current User\'s ID# in WordPress. However, it will be 0 if not logged in.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-id.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_FIELDS</strong><br />This will always be a JSON encoded array, in (string) format. An empty JSON encoded array, in (string) format, if not logged in. This JSON encoded array will contain the following fields: <code>id, ip, reg_ip, email, login, first_name, last_name, display_name, subscr_id, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. You can do <code>print_r(json_decode(OPTIMIZEMEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-fields.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'re allowed to download. 0 means no access.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-allowed.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED</strong><br />This will always be (bool) true or false. A value of true means their allowed downloads are >= 999999999, and false means it is not. This is useful if you are allowing unlimited ( 999999999 ) downloads on some Membership Levels. You can display `Unlimited` instead of a number.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-allowed-is-unlimited.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'ve downloaded in the current period.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-currently.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS</strong><br />This will always be an (int) value >= 0. This indicates how many total days make up the current period. 0 means no access.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-downloads-allowed-days.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile. In addition to this Stand-Alone version, optimizeMember also makes a Shortcode available which produces an Inline Profile Editing Form. Use <code>[optimizeMember-Profile /]</code> in any Post/Page, or even in a Text Widget if you like.</p>' . "\n";
             echo '<p><strong>Code Sample #1</strong> ( standard link ):</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.x-php")) . '</p>' . "\n";
             echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.x-php")) . '</p>' . "\n";
             echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL</strong><br />This is the full URL to the Limit Exceeded Page ( informational ).</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/file-download-limit-exceeded-page-url.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_MEMBERSHIP_OPTIONS_PAGE_URL</strong><br />This is the full URL to the Membership Options Page ( the signup page ).</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_MEMBERSHIP_OPTIONS_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/membership-options-page-url.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LOGIN_WELCOME_PAGE_URL</strong><br />This is the full URL to the Login Welcome Page ( the User\'s account page ). * This could also be the full URL to a Special Redirection URL ( if you configured one ). See <code>optimizeMember -> General Options -> Login Welcome Page</code>.</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_LOGIN_WELCOME_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL. * In the case of a Special Redirection URL, this ID is not really applicable.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/login-welcome-page-url.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LOGIN_PAGE_URL</strong><br />This is the full URL to the Membership Login Page ( the WordPress login page ).</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/login-page-url.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LOGOUT_PAGE_URL</strong><br />This is the full URL to the Membership Logout Page ( the WordPress logout page ).</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/logout-page-url.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LEVELn_LABEL</strong><br />This is the (string) Label that you created for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #..</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/leveln-label.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/leveln-file-downloads-allowed.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/leveln-file-downloads-allowed-days.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/file-download-inline-extensions.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/reg-email-from-name.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_REG_EMAIL_FROM_EMAIL</strong><br />This is the Email Address that outgoing messages are sent by.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/reg-email-from-email.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_NOTIFY_URL</strong><br />This is the URL on your system that receives PayPal IPN responses.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-notify-url.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_RETURN_URL</strong><br />This is the URL on your system that receives PayPal return variables.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-return-url.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal server <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-endpoint.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal API server <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-endpoint.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_BUSINESS</strong><br />This is the Email Address that identifies your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-business.x-php")) . '</p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_USERNAME</strong><br />This is the API Username associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-username.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_PASSWORD</strong><br />This is the API Password associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-password.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_API_SIGNATURE</strong><br />This is the API Signature associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-api-signature.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_PAYPAL_PDT_IDENTITY_TOKEN</strong><br />This is the PDT Identity Token associated with your PayPal Business.</p>' . "\n";
             echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-pdt-identity-token.x-php")) . '</p>' . "\n";
             echo '<p><em>* For security purposes, this is NOT included in the JS/API (JavaSript API).</em></p>' . "\n";
             /**/
             echo '<div class="ws-menu-page-hr"></div>' . "\n";
             /**/
             do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_list_of_api_constants", get_defined_vars());
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>on0</code> input variable, with the string: <code>"Referencing Customer ID"</code>. Otherwise, it will be set to a default value of: <code>"Originating Domain"</code>.</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>os0</code> input variable, with the value of <code>OPTIMIZEMEMBER_CURRENT_USER_SUBSCR_OR_WP_ID</code>. Otherwise, it will be set to a default value of <code>$_SERVER["HTTP_HOST"]</code> <em>( the originating domain name )</em>.</p>' . "\n";
             /**/
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_ON1</strong> ... This auto-fills the <code>on1</code> value in PayPal Button Codes. This always contains the string: <code>"Customer IP Address"</code>.</p>' . "\n";
             echo '<p><strong>OPTIMIZEMEMBER_CURRENT_USER_VALUE_FOR_PP_OS1</strong> ... This auto-fills the <code>os1</code> value in PayPal Button Codes. This always contains the value of <code>$_SERVER["REMOTE_ADDR"]</code> <em>( the Customer\'s IP address )</em>.</p>' . "\n";
             /**/
             echo '<p><em>These four Constants are special. They are used by the PayPal Button Generator for optimizeMember. This is how optimizeMember identifies an existing Member ( and/or a Free Subscriber ), who is already logged in when they click a PayPal Modification Button that was generated for you by optimizeMember. Instead of forcing a Member ( and/or a Free Subscriber ) to re-register for a new account, optimizeMember can identify their existing account, and update it, according to the modified terms in your Button Code. Specifically, these three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal Buttons, you won\'t even see these, because they\'re added internally by the Shortcode processor. Anyway, they\'re just documented here for clarity; you probably won\'t use these directly; the Button Generator pops them in.</em></p>' . "\n";
             /**/
             echo '<p><em>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/current-user-value-for-pp-on0-os0-on1-os1.x-php")) . '</em></p>' . "\n";
             /**/
             echo '</div>' . "\n";
             /**/
             echo '</div>' . "\n";
         }
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_constants", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_js_globals", true, get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_js_globals", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="optimizeMember JS/API Globals">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-js-globals-section">' . "\n";
         echo '<h3>You Also Have Access To JS Globals ( some JavaScript knowledge required )</h3>' . "\n";
         echo '<p>Unless noted otherwise, all of the PHP Constants, are also available through JavaScript, as Global Variables <em>( with the exact same names/types as their PHP counterparts )</em>. optimizeMember automatically loads it\'s compressed JavaScript API into your theme for WordPress. optimizeMember is very intelligent about the way it loads <em>( and maintains )</em> it\'s JavaScript API. You can rely on the JavaScript Globals, the same way you rely on PHP Constants. The only exceptions are related to security. Variables that include private server-side details, like Identity Tokens and other API service credentials, will be excluded automatically.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_js_globals", get_defined_vars());
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_js_globals", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_mop_vars", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_mop_vars", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Membership Options Page / Variables">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-mop-vars-section">' . "\n";
         echo '<h3>Membership Options Page Variables ( some scripting required )</h3>' . "\n";
         echo '<p>At the core of optimizeMember, is it\'s ability to protect content <em>( i.e. Posts, Pages, Tags, Categories, URI word fragments, etc )</em>. Whenever a public User, or even an existing Member attempts to access an area of your site that is unavailable to them; either because they are not logged-in, not a paying Member at all; or maybe they are logged-in, but they don\'t have access to content you\'ve protected at a higher Membership Level; optimizeMember will always redirect these unauthenticated requests to your Membership Options Page.</p>' . "\n";
         echo '<p>So your Membership Options Page is a key element of your site. It serves as the focal point of your optimizeMember installation. Understanding this, you can see it becomes important for optimizeMember to provide information about what the User/Member was attempting to access <em>( e.g. before they were redirected to the Membership Options Page )</em>. This is where optimizeMember\'s MOP Vars come in <em>( i.e. Membership Options Page Variables )</em>. Whenever optimizeMember redirects a User/Member to your Membership Options Page, it will include these important MOP Variables in the query string of the URL. These Variables can be used to provide more informative messages; or even to provide a different set of Membership Options <em>( i.e. Payment Buttons )</em>, based on what a User/Member was attempting to access.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_mop_vars", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         //echo '<p><strong>TIP:</strong> 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 class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/api-mop-vars.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Code Samples:</strong> This may give you some ideas [ <a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-api-mop-vars-code-samples\').toggle(); return false;" class="ws-dotted-link">click here</a> ].</p>' . "\n";
         echo '<p id="ws-plugin--optimizemember-api-mop-vars-code-samples" style="display:none;">' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/api-mop-vars-e.x-php")) . '</p>' . "\n";
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         echo '<p><strong>Backward compatibility:</strong> The structure of optimizeMember\'s MOP Vars changed a bit in Nov, 2011. However, optimizeMember still provides the same MOP Vars that it used in previous versions, for backward compatibility. These <a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-old-api-mop-vars-details\').toggle(); return false;" class="ws-dotted-link">old MOP Variables</a> were more difficult to use; they are now deprecated <em>( i.e. they WILL eventually be removed )</em>. Going foward, please go by the new documentation above.</p>' . "\n";
         echo '<p id="ws-plugin--optimizemember-old-api-mop-vars-details" style="display:none;">' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/api-mop-vars-o.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         /**/
         echo '</div>' . "\n";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_mop_vars", get_defined_vars());
     }
     /**/
     if (apply_filters("ws_plugin__optimizemember_during_scripting_page_during_left_sections_display_api_hooks", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_before_api_hooks", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-group" title="Hooks/Filters ( For Developers )">' . "\n";
         /**/
         echo '<div class="ws-menu-page-section ws-plugin--optimizemember-api-hooks-section">' . "\n";
         echo '<h3>WP Hooks For Theme/Plugin Developers ( scripting required )</h3>' . "\n";
         echo '<p>In addition to its API Constants, optimizeMember also makes several Hooks/Filters available throughout its framework. This makes it possible to build onto <em>( or even modify )</em> optimizeMember in lots of different ways. If you need to add custom processing routines, modify the behavior of existing processing routines, or tinker with things otherwise; you should use API Hooks/Filters. API Hooks &amp; Filters, give you the ability to "hook into", and/or "filter" processing routines, with files/functions of your own; instead of editing the optimizeMember plugin files directly. If you don\'t use a Hook/Filter, and instead, you edit the plugin files for optimizeMember, you\'ll have to merge all of your changes every time a new version of optimizeMember is released. If you create custom processing routines, you could place those routines into a PHP file here: <code>/wp-content/mu-plugins/s2-hacks.php</code>. If you don\'t have an <code>/mu-plugins/</code> directory, please create one. These are <em>(mu)</em> <a href="http://codex.wordpress.org/Must_Use_Plugins" target="_blank" rel="external">MUST USE plugins</a>, which are loaded into WordPress automatically; that\'s what you want!</p>' . "\n";
         echo '<p><strong>Attn Developers:</strong> There are simply too many Hooks/Filters spread throughout optimizeMember\'s framework <em>( over 1000 total )</em>. Rather than documenting each Hook/Filter, it is easier to browse through the files inside: <code>/s2member/includes/classes/</code>. Inspecting Hooks/Filters in this way, also leads you to a better understanding of how they work. One way to save time, is to run a search for <code>do_action</code> and/or <code>apply_filters</code>. If you\'re new to the concept of Hooks/Filters for WordPress/optimizeMember, we suggest <a href="http://www.optimizepress.com/codex/#src_doc_overview_description" target="_blank" rel="external">this article</a> as a primer.</p>' . "\n";
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_during_api_hooks", get_defined_vars());
         /**/
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         /**/
         //echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.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";
         /**/
         do_action("ws_plugin__optimizemember_during_scripting_page_during_left_sections_after_api_hooks", get_defined_vars());
     }
     /**/
     do_action("ws_plugin__optimizemember_during_scripting_page_after_left_sections", get_defined_vars());
     /**/
     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";
 }