Esempio n. 1
0
 /**
  * Handles Return templates w/ response message.
  *
  * @package s2Member\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)
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_return_template", get_defined_vars());
     unset($__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__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code);
     $doctype_html_head = c_ws_plugin__s2member_utils_html::doctype_html_head(get_bloginfo("name"), "ws_plugin__s2member_during_return_template_head_" . ($specific_template ? basename($specific_template) : "default-return.php"));
     $code = preg_replace("/%%doctype_html_head%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_doctype_html_head", $doctype_html_head, get_defined_vars())), $code);
     $code = preg_replace("/%%header%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_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__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_response", $response, get_defined_vars())), $code);
     $code = preg_replace("/%%continue%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_continue", '<a href="' . esc_attr($continue_link) . '">' . $continue_html . '</a>', get_defined_vars())), $code);
     $code = preg_replace("/%%support%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_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__"]["s2member"]["o"]["reg_email_support_link"])), get_defined_vars())), $code);
     $code = preg_replace("/%%tracking%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_tracking", c_ws_plugin__s2member_tracking_codes::generate_all_tracking_codes(), get_defined_vars())), $code);
     return apply_filters("ws_plugin__s2member_return_template", $code, get_defined_vars());
 }
 /**
  * Handles Google Return URL processing.
  *
  * @package s2Member\Google
  * @since 131123
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection.
  */
 public static function google_return()
 {
     global $current_site, $current_blog;
     if (!empty($_GET["s2member_pro_google_return"]) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_google_merchant_id"]) {
         $google["s2member_log"][] = "Return URL processed on: " . date("D M j, Y g:i:s a T");
         $google["s2member_log"][] = "Piping through s2Member's core/standard PayPal processor with `proxy_use` ( `ty-email` ).";
         $google["s2member_log"][] = "Please check PayPal RTN logs for further processing details.";
         $rtn_q = "&s2member_paypal_proxy=google&s2member_paypal_proxy_use=standard-emails,ty-email";
         if (!empty($_GET["s2member_pro_google_return_success"])) {
             $rtn_q .= "&s2member_paypal_return_success=" . rawurlencode(trim(stripslashes($_GET["s2member_pro_google_return_success"])));
         }
         $rtn_r = home_url("/?s2member_pro_google_return&s2member_paypal_return=1" . $rtn_q);
         $rtn_r = c_ws_plugin__s2member_utils_urls::add_s2member_sig($rtn_r, "s2member_paypal_proxy_verification");
         $google["s2member_log"][] = $rtn_r;
         wp_redirect($rtn_r);
         $logt = c_ws_plugin__s2member_utilities::time_details();
         $logv = c_ws_plugin__s2member_utilities::ver_details();
         $logm = c_ws_plugin__s2member_utilities::mem_details();
         $log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . @$_SERVER["HTTP_USER_AGENT"];
         $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
         $log2 = is_multisite() && !is_main_site() ? "google-rtn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "google-rtn.log";
         if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
             if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
                 if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
                     file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($google, true)) . "\n\n", FILE_APPEND);
                 }
             }
         }
         exit;
         // Exit now.
     }
 }
 /**
  * Logs HTTP communication (if enabled).
  *
  * @package s2Member\Utilities
  * @since 120212
  */
 public static function http_api_debug($response = NULL, $state = NULL, $class = NULL, $args = NULL, $url = NULL)
 {
     if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
         return;
     }
     // Logging is NOT enabled in this case.
     $is_s2member = !empty($args['s2member']) || strpos($url, 's2member') !== FALSE ? TRUE : FALSE;
     if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs_extensive'] && !$is_s2member) {
         return;
     }
     // Extensive logging is NOT enabled in this case.
     global $current_site, $current_blog;
     // For Multisite support.
     $http_api_debug = array('state' => $state, 'transport_class' => $class, 'args' => $args, 'url' => $url, 'response' => $response);
     $logt = c_ws_plugin__s2member_utilities::time_details();
     $logv = c_ws_plugin__s2member_utilities::ver_details();
     $logm = c_ws_plugin__s2member_utilities::mem_details();
     $log4 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\n" . 'User-Agent: ' . $_SERVER['HTTP_USER_AGENT'];
     $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
     $log2 = is_multisite() && !is_main_site() ? 'http-api-debug-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'http-api-debug.log';
     $http_api_debug_conceal_private_info = c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($http_api_debug, TRUE));
     if (is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
         if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
             if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs_extensive']) {
                 file_put_contents($logs_dir . '/wp-' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
             }
             if ($is_s2member) {
                 // Log s2Member HTTP connections separately.
                 file_put_contents($logs_dir . '/s2-' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
             }
         }
     }
 }
 /**
  * Handles Return templates w/ response message.
  *
  * @package s2Member\Return_Templates
  * @since 110720
  *
  * @param string $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 string $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 string $continue_html Optional. The HTML value of the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: `Continue`.
  * @param string $continue_link Optional. The HREF value for the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: ``home_url ('/', 'http')``.
  *
  * @return string 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 = '', $response = '', $continue_html = '', $continue_link = '')
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_return_template', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
     $template = $template ? $template : 'default';
     $continue_link = $continue_link ? $continue_link : home_url('/', 'http');
     $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 = is_file(TEMPLATEPATH . '/' . $template . '-return.php') ? TEMPLATEPATH . '/' . $template . '-return.php' : '';
     $custom_template = is_file(get_stylesheet_directory() . '/' . $template . '-return.php') ? get_stylesheet_directory() . '/' . $template . '-return.php' : $custom_template;
     $custom_template = is_file(WP_CONTENT_DIR . '/' . $template . '-return.php') ? WP_CONTENT_DIR . '/' . $template . '-return.php' : $custom_template;
     $custom_template = !$custom_template && is_file(TEMPLATEPATH . '/default-return.php') ? TEMPLATEPATH . '/default-return.php' : $custom_template;
     $custom_template = !$custom_template && is_file(get_stylesheet_directory() . '/default-return.php') ? get_stylesheet_directory() . '/default-return.php' : $custom_template;
     $custom_template = !$custom_template && is_file(WP_CONTENT_DIR . '/default-return.php') ? WP_CONTENT_DIR . '/default-return.php' : $custom_template;
     $specific_template = $custom_template ? $custom_template : (is_file($_default_specific_template = dirname(dirname(__FILE__)) . '/templates/returns/' . $template . '-return.php') ? $_default_specific_template : '');
     $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__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code);
     $doctype_html_head = c_ws_plugin__s2member_utils_html::doctype_html_head(get_bloginfo('name'), 'ws_plugin__s2member_during_return_template_head_' . ($specific_template ? basename($specific_template) : 'default-return.php'));
     $code = preg_replace('/%%doctype_html_head%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_doctype_html_head', $doctype_html_head, get_defined_vars())), $code);
     $code = preg_replace('/%%header%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_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__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_response', $response, get_defined_vars())), $code);
     $code = preg_replace('/%%continue%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_continue', '<a href="' . esc_attr($continue_link) . '">' . $continue_html . '</a>', get_defined_vars())), $code);
     $code = preg_replace('/%%support%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_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__']['s2member']['o']['reg_email_support_link'])), get_defined_vars())), $code);
     $code = preg_replace('/%%tracking%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_tracking', c_ws_plugin__s2member_tracking_codes::generate_all_tracking_codes(), get_defined_vars())), $code);
     return apply_filters('ws_plugin__s2member_return_template', $code, get_defined_vars());
 }
 /**
  * Logs HTTP communication (if enabled).
  *
  * @package s2Member\Utilities
  * @since 120212
  *
  * @return null Nothing.
  */
 public static function http_api_debug($response = NULL, $state = NULL, $class = NULL, $args = NULL, $url = NULL)
 {
     if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
         return;
     }
     // Logging is NOT enabled in this case.
     $is_s2member = !empty($args["s2member"]) || strpos($url, "s2member") !== false ? true : false;
     if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs_extensive"] && !$is_s2member) {
         return;
     }
     // Extensive logging is NOT enabled in this case.
     global $current_site, $current_blog;
     $http_api_debug = array("state" => $state, "transport_class" => $class, "args" => $args, "url" => $url, "response" => $response);
     $logt = c_ws_plugin__s2member_utilities::time_details();
     $logv = c_ws_plugin__s2member_utilities::ver_details();
     $logm = c_ws_plugin__s2member_utilities::mem_details();
     $log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . $_SERVER["HTTP_USER_AGENT"];
     $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
     $log2 = is_multisite() && !is_main_site() ? "http-api-debug-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "http-api-debug.log";
     $http_api_debug_conceal_private_info = c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($http_api_debug, true));
     if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
         if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
             if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs_extensive"]) {
                 file_put_contents($logs_dir . "/wp-" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
             }
             if ($is_s2member) {
                 // Log s2Member HTTP connections separately.
                 file_put_contents($logs_dir . "/s2-" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
             }
         }
     }
 }
 /**
  * Handles PayPal® Button encryption.
  *
  * This uses the PayPal® API. s2Member will NOT attempt to encrypt Buttons until there is at least a Business Email Address and API Username configured.
  * s2Member also maintains a log of communication with the PayPal® API. If logging is enabled, check: `/wp-content/plugins/s2member-logs/paypal-api.log`.
  *
  * @package s2Member\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__s2member_before_sc_paypal_button_encryption", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_btn_encryption"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"]) {
         $cache = apply_filters("ws_plugin__s2member_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__s2member_utilities::ver_checksum())) && ($cache = get_transient($transient))) {
             $code = $cache;
         } else {
             if (is_array($inputs = c_ws_plugin__s2member_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__s2member_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__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
                     /**/
                     $code = $attr["output"] === "anchor" ? '<a href="' . esc_attr(c_ws_plugin__s2member_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__s2member_utils_forms::form_whips_2_url($code) : $code;
                     /**/
                     $cache && $transient ? set_transient($transient, $code, apply_filters("ws_plugin__s2member_sc_paypal_button_encryption_cache_exp_time", 3600, get_defined_vars())) : null;
                     /* Caching? */
                 }
             }
         }
     }
     /* No WordPress® Filters apply here. */
     /* Instead, use: `ws_plugin__s2member_sc_paypal_button`. */
     return $code;
     /* Button Code. Possibly w/ API encryption now. */
 }
 /**
  * Applies custom Return Template Headers.
  *
  * @package s2Member\Return_Templates
  * @since 110720
  *
  * @attaches-to ``add_filter('ws_plugin__s2member_return_template_header');``
  *
  * @param string $default_header The default header *(i.e., HTML code)*, passed through by the Filter.
  * @param array  $vars An array of defined variables, passed through by the Filter.
  *
  * @return string A custom Return Template Header, if configured, else the ``$default_header``.
  */
 public static function return_template_header($default_header = '', $vars = array())
 {
     if (!empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_' . $vars['template'] . '_return_template_header'])) {
         $code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_' . $vars['template'] . '_return_template_header'];
         $code = !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code;
         return $custom_header = $code;
     }
     return $default_header;
 }
Esempio n. 8
0
 /**
  * Applies custom Return Template Headers.
  *
  * @package s2Member\Return_Templates
  * @since 110720
  *
  * @attaches-to ``add_filter("ws_plugin__s2member_return_template_header");``
  *
  * @param str $default_header The default header *(i.e. HTML code)*, passed through by the Filter.
  * @param array $vars An array of defined variables, passed through by the Filter.
  * @return str A custom Return Template Header, if configured, else the ``$default_header``.
  */
 public static function return_template_header($default_header = FALSE, $vars = FALSE)
 {
     if (!empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $vars["template"] . "_return_template_header"])) {
         $code = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $vars["template"] . "_return_template_header"];
         $code = !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code;
         return $custom_header = $code;
     }
     return $default_header;
 }
Esempio n. 9
0
 /**
  * Generates footer code, when/if configured.
  *
  * @package s2Member\WP_Footer
  * @since 110524RC
  *
  * @return null
  */
 public static function wp_footer_code()
 {
     do_action('ws_plugin__s2member_before_wp_footer_code', get_defined_vars());
     if ($code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['wp_footer_code']) {
         if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
             echo do_shortcode($code) . "\n";
         } else {
             echo do_shortcode(c_ws_plugin__s2member_utilities::evl($code));
         }
     }
     do_action('ws_plugin__s2member_after_wp_footer_code', get_defined_vars());
 }
Esempio n. 10
0
 /**
  * Generates footer code, when/if configured.
  *
  * @package s2Member\WP_Footer
  * @since 110524RC
  *
  * @return null
  */
 public static function wp_footer_code()
 {
     do_action("ws_plugin__s2member_before_wp_footer_code", get_defined_vars());
     if ($code = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["wp_footer_code"]) {
         if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
             echo do_shortcode($code) . "\n";
         } else {
             echo do_shortcode(c_ws_plugin__s2member_utilities::evl($code));
         }
     }
     do_action("ws_plugin__s2member_after_wp_footer_code", get_defined_vars());
     return;
 }
 /**
  * Handles the Shortcode for: `[s2Member-Security-Badge /]`.
  *
  * @package s2Member\Security_Badges
  * @since 110524RC
  *
  * @attaches-to ``add_shortcode("s2Member-Security-Badge");``
  *
  * @param array $attr An array of Attributes.
  * @param string $content Content inside the Shortcode.
  * @param string $shortcode The actual Shortcode name itself.
  * @return string Resulting Security Badge code; HTML markup.
  */
 public static function sc_s_badge($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_sc_s_badge", get_defined_vars());
     unset($__refs, $__v);
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $attr = shortcode_atts(array("v" => "1"), $attr);
     // One attribute.
     $code = c_ws_plugin__s2member_utilities::s_badge_gen($attr["v"], false, false);
     return apply_filters("ws_plugin__s2member_sc_s_badge", $code, get_defined_vars());
 }
Esempio n. 12
0
 /**
  * Handles the Shortcode for: `[s2Member-Security-Badge /]`.
  *
  * @package s2Member\Security_Badges
  * @since 110524RC
  *
  * @attaches-to ``add_shortcode('s2Member-Security-Badge');``
  *
  * @param array  $attr An array of Attributes.
  * @param string $content Content inside the Shortcode.
  * @param string $shortcode The actual Shortcode name itself.
  *
  * @return string Resulting Security Badge code; HTML markup.
  */
 public static function sc_s_badge($attr = array(), $content = '', $shortcode = '')
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_sc_s_badge', get_defined_vars());
     unset($__refs, $__v);
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $attr = shortcode_atts(array('v' => '1'), $attr);
     // One attribute.
     $code = c_ws_plugin__s2member_utilities::s_badge_gen($attr['v'], FALSE, FALSE);
     return apply_filters('ws_plugin__s2member_sc_s_badge', $code, get_defined_vars());
 }
Esempio n. 13
0
 /**
  * Logs an entry.
  *
  * @since 130315
  * @package s2Member\Utilities
  *
  * @param string $slug The file name; i.e., a slug.
  *    e.g., `mailchimp-api`, `s2-http-api-debug`.
  *
  * @param mixed  $data The data to log.
  */
 public static function log_entry($slug, $data)
 {
     if (!($slug = trim((string) $slug))) {
         return;
     }
     // Not possible.
     if (!$data) {
         return;
     }
     // Nothing to log.
     if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
         return;
     }
     // Nothing to do; logging not enabled right now.
     if (!is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
         return;
     }
     // Log directory does not exist at this time.
     if (!is_writable($logs_dir)) {
         return;
     }
     // Not writable.
     $logt = c_ws_plugin__s2member_utilities::time_details();
     $logv = c_ws_plugin__s2member_utilities::ver_details();
     $logm = c_ws_plugin__s2member_utilities::mem_details();
     $log4 = '';
     // Initialize.
     if (is_multisite() && !is_main_site()) {
         // Child blog in a multisite network?
         $log4 .= $GLOBALS['current_blog']->domain . $GLOBALS['current_blog']->path . "\n";
     }
     $log4 .= @$_SERVER['HTTP_HOST'] . @$_SERVER['REQUEST_URI'] . "\n";
     $log4 .= 'User-Agent: ' . @$_SERVER['HTTP_USER_AGENT'];
     $log2 = $slug . '-api.log';
     // Initialize.
     if (is_multisite() && !is_main_site()) {
         // Child blog in a multisite network?
         $log2 = $slug . '-api-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', $GLOBALS['current_blog']->domain . $GLOBALS['current_blog']->path), '-') . '.log';
     }
     c_ws_plugin__s2member_utils_logs::archive_oversize_log_files();
     file_put_contents($logs_dir . '/' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(print_r($data, TRUE)) . "\n\n", FILE_APPEND);
     // Append to an existing log file; if exists.
 }
 /**
  * Returns a DOCTYPE tag along with the HEAD section and title tag.
  *
  * This method should NOT be called upon until
  * {@link s2Member\API_Constants\c_ws_plugin__s2member_constants::constants()}
  * has been processed. We need access to: ``WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5``.
  *
  * @package s2Member\Utilities
  * @since 110720
  *
  * @param str $doctype_html_head_title Optional. The title of the HTML document being generated.
  * @param str $doctype_html_head_action Optional. An action Hook to process during HEAD generation.
  * @return str A DOCTYPE tag along with the HEAD section and title tag, configured by parameters.
  */
 public static function doctype_html_head($doctype_html_head_title = FALSE, $doctype_html_head_action = FALSE)
 {
     $s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
     /* Loads s2Member only. */
     /**/
     ob_start();
     /* Start output buffering here so we can "return" the output from this utility. */
     /**/
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
     /**/
     echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
     echo '<head>' . "\n";
     /**/
     echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
     /**/
     echo '<script type="text/javascript" src="' . esc_attr(site_url("/wp-includes/js/jquery/jquery.js?ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum()))) . '"></script>' . "\n";
     echo '<script type="text/javascript" src="' . esc_attr(site_url("/wp-includes/js/l10n.js?ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum()))) . '"></script>' . "\n";
     /**/
     echo '<script type="text/javascript">' . "var pwsL10n = {empty: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("Strength indicator", "s2member-front", "s2member")) . "', short: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("Very weak", "s2member-front", "s2member")) . "', bad: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("Weak", "s2member-front", "s2member")) . "', good: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("Medium", "s2member-front", "s2member")) . "', strong: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("Strong", "s2member-front", "s2member")) . "', mismatch: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("Mismatch", "s2member-front", "s2member")) . "'}; try{convertEntities(pwsL10n);}catch(e){};</script>" . "\n";
     echo '<script type="text/javascript" src="' . esc_attr(site_url("/wp-admin/js/password-strength-meter.js?ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum()))) . '"></script>' . "\n";
     /**/
     echo '<script type="text/javascript" src="' . esc_attr($s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode(WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5) . "&amp;qcABC=1&amp;ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum())) . '"></script>' . "\n";
     /**/
     echo '<link href="' . esc_attr($s2o . "?ws_plugin__s2member_css=1&amp;qcABC=1&amp;ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum())) . '" type="text/css" rel="stylesheet" media="all" />' . "\n";
     /**/
     if ($doctype_html_head_title) {
         /* Add <title></title> tag? */
         echo '<title>' . $doctype_html_head_title . '</title>' . "\n";
     }
     /**/
     if ($doctype_html_head_action) {
         /* Add content from Hook? */
         do_action($doctype_html_head_action, get_defined_vars());
     }
     /**/
     echo '</head>' . "\n";
     /**/
     return ob_get_clean();
 }
function S2FilePicker_init()
{
    if (is_plugin_active('s2member/s2member.php')) {
        /**/
        if (!is_dir($files_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['files_dir'])) {
            if (is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir)))) {
                mkdir($files_dir, 0777, true);
            }
        }
        /**/
        if (is_dir($files_dir) && is_writable($files_dir)) {
            if (!file_exists($htaccess = $files_dir . '/.htaccess') || !apply_filters('ws_plugin__s2member_preserve_files_dir_htaccess', false, get_defined_vars())) {
                file_put_contents($htaccess, trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']["s2member"]["c"]['files_dir_htaccess']))));
            }
        }
        add_action('media_buttons', 'S2FilePicker_btn', 20);
        add_action('media_upload_s2fpicker', 'S2FilePicker_media_upload_handler');
        add_action('media_upload_type_S2FilePicker_frame', 'S2FilePicker_media_upload_content');
    } else {
        add_action('admin_notices', 'S2FilePicker_warning');
    }
}
function s2sfu_initialization()
{
    $active_plugins = get_option('active_plugins');
    $required_plugin = 's2member/s2member.php';
    if (in_array($required_plugin, $active_plugins)) {
        /**/
        if (!is_dir($files_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['files_dir'])) {
            if (is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir)))) {
                mkdir($files_dir, 0777, true);
            }
        }
        /**/
        if (is_dir($files_dir) && is_writable($files_dir)) {
            if (!file_exists($htaccess = $files_dir . '/.htaccess') || !apply_filters('ws_plugin__s2member_preserve_files_dir_htaccess', false, get_defined_vars())) {
                file_put_contents($htaccess, trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']["s2member"]["c"]['files_dir_htaccess']))));
            }
        }
        add_action('media_buttons', 's2sfu_media_button', 20);
        add_action('media_upload_s2sfu', 's2sfu_media_upload_handler');
    } else {
        add_action('admin_notices', 's2sfu_warning');
    }
}
Esempio n. 17
0
 /**
  * Returns a DOCTYPE tag along with the HEAD section and title tag.
  *
  * This method should NOT be called upon until
  * {@link s2Member\API_Constants\c_ws_plugin__s2member_constants::constants()}
  * has been processed. We need access to: ``WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5``.
  *
  * @package s2Member\Utilities
  * @since 110720
  *
  * @param string $doctype_html_head_title Optional. The title of the HTML document being generated.
  * @param string $doctype_html_head_action Optional. An action Hook to process during HEAD generation.
  * @return string A DOCTYPE tag along with the HEAD section and title tag, configured by parameters.
  */
 public static function doctype_html_head($doctype_html_head_title = FALSE, $doctype_html_head_action = FALSE)
 {
     $s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
     // Loads s2Member only.
     ob_start();
     // Start output buffering here so we can "return" the output from this utility.
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
     echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
     echo '<head>' . "\n";
     echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' . "\n";
     echo '<link href="' . esc_attr($s2o . "?ws_plugin__s2member_css=1&amp;qcABC=1&amp;ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum())) . '" type="text/css" rel="stylesheet" media="all" />' . "\n";
     echo '<script type="text/javascript" src="' . esc_attr(site_url("/wp-includes/js/jquery/jquery.js?ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum()))) . '"></script>' . "\n";
     echo '<script type="text/javascript" src="' . esc_attr($s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode(WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5) . "&amp;qcABC=1&amp;ver=" . urlencode(c_ws_plugin__s2member_utilities::ver_checksum())) . '"></script>' . "\n";
     if ($doctype_html_head_title) {
         // Add <title></title> tag?
         echo '<title>' . $doctype_html_head_title . '</title>' . "\n";
     }
     if ($doctype_html_head_action) {
         // Add content from Hook?
         do_action($doctype_html_head_action, get_defined_vars());
     }
     echo '</head>' . "\n";
     return ob_get_clean();
 }
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>PayPal 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__s2member_during_paypal_buttons_page_before_left_sections", get_defined_vars());
     for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
         if (($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_level" . $n . "_buttons") && apply_filters($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_levelN_buttons, true, get_defined_vars())) {
             if ($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_before_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_before_level" . $n . "_buttons") {
                 do_action($ws_plugin__s2member_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 #' . $n . ' Access">' . "\n";
             echo '<div class="ws-menu-page-section ws-plugin--s2member-level' . $n . '-buttons-section">' . "\n";
             echo '<h3>Button Code Generator For Level #' . $n . ' 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 s2Member 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, s2Member will automatically terminate their Membership privileges. s2Member makes extensive use of the PayPal IPN service. s2Member receives updates from PayPal behind-the-scene.</p>' . "\n";
             echo '<p><em><strong>Please note:</strong> 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__s2member_during_paypal_buttons_page_during_left_sections_during_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons") {
                 do_action($ws_plugin__s2member_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--s2member-level' . $n . '-shortcode">' . "\n";
             echo 'Button Code<br />For Level #' . $n . ':<br /><br />' . "\n";
             echo '<div id="ws-plugin--s2member-level' . $n . '-button-prev"></div>' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '<td>' . "\n";
             echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
             echo '<p id="ws-plugin--s2member-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--s2member-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level' . $n . '-trial-term">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--s2member-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n";
             echo '<p><span id="ws-plugin--s2member-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level' . $n . '-term">' . trim(c_ws_plugin__s2member_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 s2Member; 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--s2member-level' . $n . '-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level' . $n . '-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level' . $n . '\');" /></p>' . "\n";
             echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--s2member-level' . $n . '-desc" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n";
             echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member ⥱ 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-level' . $n . '-ccaps" size="40" /></p>' . "\n";
             echo '</form>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td colspan="2">' . "\n";
             echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
             if ($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_levelN_buttons_before_shortcode = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons_before_shortcode") {
                 do_action($ws_plugin__s2member_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__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.php")));
             $ws_plugin__s2member_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($n)), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
             echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" />' . "\n";
             echo '<div' . (is_multisite() && c_ws_plugin__s2member_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--s2member-level' . $n . '-button" rows="8" wrap="off" onclick="this.select ();">';
             $ws_plugin__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-checkout-button.php")));
             $ws_plugin__s2member_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_merchant_id%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_merchant_id"])), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($n)), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/"))), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
             $ws_plugin__s2member_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $ws_plugin__s2member_temp_s);
             echo format_to_edit($ws_plugin__s2member_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__s2member_during_paypal_buttons_page_during_left_sections_after_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_level" . $n . "_buttons") {
                 do_action($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_levelN_buttons, get_defined_vars());
             }
         }
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_modification_buttons", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_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--s2member-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 s2Member), or in another location where you can be absolutely sure that a User/Member is logged in. s2Member\'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: <strong>s2Member ⥱ API Scripting ⥱ Simple Conditionals</strong>.</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 s2Member 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, s2Member 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 s2Member. 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 s2Member 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. s2Member\'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: <strong>s2Member ⥱ API Scripting</strong>.</em></p>' . "\n";
         echo !is_multisite() || !c_ws_plugin__s2member_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__s2member_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--s2member-modification-shortcode">' . "\n";
         echo 'Button Code<br />For Modifications:<br /><br />' . "\n";
         echo '<div id="ws-plugin--s2member-modification-button-prev"></div>' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         echo '<p>Modification: <select id="ws-plugin--s2member-modification-level">' . "\n";
         for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<optgroup label="Level #' . $n . '">' . "\n";
             echo '<option value="upgrade:' . $n . '">&uarr; Upgrade To Level #' . $n . '</option>' . "\n";
             echo $n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? '<option value="downgrade:' . $n . '">&darr; Downgrade To Level #' . $n . '</option>' . "\n" : '';
             echo '</optgroup>' . "\n";
             echo $n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? '<option disabled="disabled"></option>' . "\n" : '';
         }
         echo '</select></p>' . "\n";
         echo '<p id="ws-plugin--s2member-modification-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--s2member-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-modification-trial-term">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--s2member-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
         echo '<p><span id="ws-plugin--s2member-modification-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-modification-term">' . trim(c_ws_plugin__s2member_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 s2Member; 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--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" /></p>' . "\n";
         echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--s2member-modification-desc" value="Description and pricing details here." size="73" /></p>' . "\n";
         echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member ⥱ 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-modification-ccaps" size="40" /></p>' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td colspan="2">' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         do_action("ws_plugin__s2member_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__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.php")));
         $ws_plugin__s2member_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr("1")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%level_label%% /", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/\\/]\$/", 'modify="1" /]', $ws_plugin__s2member_temp_s);
         // Adds modify="1" to the end of the Shortcode.
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-modification-shortcode" value="' . format_to_edit($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" />' . "\n";
         echo '<div' . (is_multisite() && c_ws_plugin__s2member_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--s2member-modification-button" rows="8" wrap="off" onclick="this.select ();">';
         $ws_plugin__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-checkout-button.php")));
         $ws_plugin__s2member_temp_s = preg_replace('/name\\="modify" value\\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_merchant_id%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_merchant_id"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr("1")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%level_label%% /", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $ws_plugin__s2member_temp_s);
         echo format_to_edit($ws_plugin__s2member_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__s2member_during_paypal_buttons_page_during_left_sections_after_modification_buttons", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_ccap_buttons", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_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--s2member-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: <strong>s2Member ⥱ API Scripting ⥱ Custom Capabiities</strong>.</p>' . "\n";
         echo '<p>With s2Member, 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 s2Member 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 s2Member 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 s2Member 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 s2Member), or in another location where you can be absolutely sure that a User/Member is logged in. s2Member\'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: <strong>s2Member ⥱ API Scripting ⥱ Simple Conditionals</strong>.</em></p>' . "\n";
         echo '<p><em><strong>Please note:</strong> 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__s2member_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--s2member-ccap-shortcode">' . "\n";
         echo 'Button Code<br />For Capabilities:<br /><br />' . "\n";
         echo '<div id="ws-plugin--s2member-ccap-button-prev"></div>' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-ccap-term">' . trim(c_ws_plugin__s2member_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 s2Member; 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--s2member-ccap-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-ccap-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalCcapButtonGenerate();" /></p>' . "\n";
         echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--s2member-ccap-desc" 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: s2Member ⥱ 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-ccap-ccaps" size="40" /></p>' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td colspan="2">' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         do_action("ws_plugin__s2member_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__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-ccaps-checkout-button-shortcode.php")));
         $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-ccap-shortcode" value="' . format_to_edit($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" />' . "\n";
         echo '<div' . (is_multisite() && c_ws_plugin__s2member_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--s2member-ccap-button" rows="8" wrap="off" onclick="this.select ();">';
         $ws_plugin__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-ccaps-checkout-button.php")));
         $ws_plugin__s2member_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_merchant_id%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_merchant_id"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $ws_plugin__s2member_temp_s);
         echo format_to_edit($ws_plugin__s2member_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__s2member_during_paypal_buttons_page_during_left_sections_after_ccap_buttons", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_cancellation_buttons", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_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--s2member-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 s2Member is notified silently behind-the-scenes, 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, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT (End Of Term) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member.</em></p>' . "\n";
         echo '<p><em>s2Member will not process an EOT (End Of Term) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system (based on your configuration). s2Member also calculates one extra day (24 hours) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
         do_action("ws_plugin__s2member_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--s2member-cancellation-shortcode">' . "\n";
         echo 'Button Code<br />For Cancellations:<br /><br />' . "\n";
         echo '<div id="ws-plugin--s2member-cancellation-button-prev">' . "\n";
         $ws_plugin__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php")));
         $ws_plugin__s2member_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_merchant_id%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_merchant_id"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $ws_plugin__s2member_temp_s);
         echo preg_replace("/\\<a/", '<a target="_blank"', $ws_plugin__s2member_temp_s);
         echo '</div>' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\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;" autocomplete="off">' . "\n";
         do_action("ws_plugin__s2member_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__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-cancellation-button-shortcode.php")));
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-cancellation-shortcode" value="' . format_to_edit($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" />' . "\n";
         echo '<div' . (is_multisite() && c_ws_plugin__s2member_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--s2member-cancellation-button" rows="8" wrap="off" onclick="this.select ();">';
         $ws_plugin__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php")));
         $ws_plugin__s2member_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_merchant_id%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_merchant_id"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $ws_plugin__s2member_temp_s);
         echo format_to_edit($ws_plugin__s2member_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__s2member_during_paypal_buttons_page_during_left_sections_after_cancellation_buttons", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_reg_links", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_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--s2member-reg-links-section">' . "\n";
         echo '<h3>Registration Access Link Generator (for Customer Service)</h3>' . "\n";
         echo '<p>s2Member 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 <strong>Users ⥱ Add New</strong>. Either of these methods will work fine.</p>' . "\n";
         do_action("ws_plugin__s2member_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;" autocomplete="off">' . "\n";
         echo '<p>Paid Membership Level#: <select id="ws-plugin--s2member-reg-link-level" style="min-width:200px;">' . "\n";
         for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<option value="' . $n . '">s2Member Level #' . $n . '</option>' . "\n";
         }
         echo '</select></p>' . "\n";
         echo '<p>Paid Subscr. ID: <input type="text" autocomplete="off" id="ws-plugin--s2member-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, s2Member 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--s2member-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__s2member_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__s2member_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__s2member_paypalRegLinkGenerate();" /> <img id="ws-plugin--s2member-reg-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
         echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member ⥱ API Scripting ⥱ Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-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--s2member-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 s2Member 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--s2member-reg-link" style="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__s2member_during_paypal_buttons_page_during_left_sections_after_reg_links", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_sp_buttons", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_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--s2member-sp-buttons-section">' . "\n";
         echo '<h3>Button Code Generator For Specific Post/Page Buttons</h3>' . "\n";
         echo '<p>s2Member 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. s2Member will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link (see: <strong>s2Member ⥱ PayPal Options ⥱ Specific Post/Page Email</strong>). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
         echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file &amp; music downloads, access to additional support services, and the list goes on 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: <strong>s2Member ⥱ Restriction Options ⥱ Specific Post/Page Access</strong>. 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 s2Member seamlessly. You can even Package Additional Posts/Pages together into one transaction.</p>' . "\n";
         echo '<p><em><strong>Please note:</strong> 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__s2member_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--s2member-sp-shortcode">' . "\n";
         echo 'Button Code<br />Specific Posts/Pages:<br /><br />' . "\n";
         echo '<div id="ws-plugin--s2member-sp-button-prev"></div>' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         echo '<p><select id="ws-plugin--s2member-sp-leading-id">' . "\n";
         echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
         $ws_plugin__s2member_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
         foreach ($ws_plugin__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__s2member_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 s2Member for Specific Post/Page Access yet. See: s2Member ⥱ Restriction Options ⥱ Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
         echo '<p><select id="ws-plugin--s2member-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__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__s2member_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 (i.e., only one Access Link is needed, and s2Member 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* s2Member 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 s2Member for Specific Post/Page Access yet. See: s2Member ⥱ 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--s2member-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-sp-hours">' . trim(c_ws_plugin__s2member_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--s2member-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\\nIn addition. The Shortcode below, provided by s2Member; 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--s2member-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-sp-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalSpButtonGenerate();" /></p>' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td colspan="2">' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         do_action("ws_plugin__s2member_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__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-button-shortcode.php")));
         $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-sp-shortcode" value="' . format_to_edit($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" />' . "\n";
         echo '<div' . (is_multisite() && c_ws_plugin__s2member_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--s2member-sp-button" rows="8" wrap="off" onclick="this.select ();">';
         $ws_plugin__s2member_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.php")));
         $ws_plugin__s2member_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%paypal_merchant_id%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_merchant_id"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
         $ws_plugin__s2member_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $ws_plugin__s2member_temp_s);
         echo format_to_edit($ws_plugin__s2member_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__s2member_during_paypal_buttons_page_during_left_sections_after_sp_buttons", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_sp_links", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_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--s2member-sp-links-section">' . "\n";
         echo '<h3>Specific Post/Page Access Link Generator (for Customer Service)</h3>' . "\n";
         echo '<p>s2Member automatically generates Specific Post/Page 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 Specific Post/Page Access Link to be created manually, you can use this tool for that.</p>' . "\n";
         do_action("ws_plugin__s2member_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;" autocomplete="off">' . "\n";
         echo '<p><select id="ws-plugin--s2member-sp-link-leading-id">' . "\n";
         echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
         $ws_plugin__s2member_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
         foreach ($ws_plugin__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__s2member_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 s2Member for Specific Post/Page Access yet. See: s2Member ⥱ Restriction Options ⥱ Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
         echo '<p><select id="ws-plugin--s2member-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__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__s2member_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 (i.e., only one Access Link is needed, and s2Member 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* s2Member 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 s2Member for Specific Post/Page Access yet. See: s2Member ⥱ Restriction Options ⥱ Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
         echo '<p><select id="ws-plugin--s2member-sp-link-hours">' . trim(c_ws_plugin__s2member_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__s2member_paypalSpLinkGenerate();" /> <img id="ws-plugin--s2member-sp-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
         echo '<p id="ws-plugin--s2member-sp-link" style="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__s2member_during_paypal_buttons_page_during_left_sections_after_sp_links", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_shortcode_attrs", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_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--s2member-shortcode-attrs-section">' . "\n";
         echo '<h3>Shortcode Attributes (Explained In Full Detail)</h3>' . "\n";
         echo '<p>When you generate a Button Code, s2Member 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, s2Member reads Attributes in your Shortcode. These Attributes will be pre-configured by one of s2Member\'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__s2member_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 class="ws-menu-page-li-margins">' . "\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__s2member_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. s2Member will eventually be integrated with <a href="http://www.s2member.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>lang=""</code> Optional 5 character Button Language Code <em>(ake: Locale Code—ex: <code>en_US</code>)</em>. This controls the interface language of the PayPal Button itself. If unspecified, the language defaults to English (i.e., <code>en_US</code>; or to the value set by an optional MO translation file; which translates s2Member overall). See <a href="https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECButtonIntegration#id089QD0O0TX4__id08AH904I0YK" target="_blank" rel="external">this list of possible Locale Codes</a>.</li>' . "\n";
         echo '<li><code>lc=""</code> Optional 2 character Country/Locale Code <em>(i.e., Country Code—ex: <code>US</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. See <a href="https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECButtonIntegration#id089QD0O0TX4__id08AH904I0YK" target="_blank" rel="external">this list of possible Country Codes</a>. 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__s2member_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__s2member_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__s2member_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__s2member_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: s2Member ⥱ 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__s2member_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__s2member_during_paypal_buttons_page_during_left_sections_after_shortcode_attrs", get_defined_vars());
     }
     do_action("ws_plugin__s2member_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__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Esempio n. 19
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>Google Wallet 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__"]["s2member"]["c"]["levels"]; $n++) {
         echo '<div class="ws-menu-page-group" title="Buttons For Level #' . $n . ' Access">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-level' . $n . '-buttons-section">' . "\n";
         echo '<h3>Button Code Generator For Level #' . $n . ' 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 Wallet Buttons are customized to work with s2Member 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, s2Member will automatically terminate their Membership privileges. s2Member makes extensive use of the Google Postback/IPN service. s2Member receives updates from Google behind-the-scene. <em><strong>Please note:</strong> 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--s2member-pro-level' . $n . '-shortcode">' . "\n";
         echo 'Button Code<br />For Level #' . $n . ':<br /><br />' . "\n";
         echo '<div id="ws-plugin--s2member-pro-level' . $n . '-button-prev"></div>' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         echo '<p id="ws-plugin--s2member-pro-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-pro-level' . $n . '-trial-term">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n";
         echo '<p><span id="ws-plugin--s2member-pro-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-pro-level' . $n . '-term">' . trim(c_ws_plugin__s2member_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--s2member-pro-level' . $n . '-desc" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n";
         echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member → 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-ccaps" size="40" /></p>' . "\n";
         echo '<p>Currency: <select id="ws-plugin--s2member-pro-level' . $n . '-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_pro_googleButtonGenerate(\'level' . $n . '\');" /></p>' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td colspan="2">' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
         $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-checkout-button-shortcode.php")));
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($n)), $ws_plugin__s2member_pro_temp_s);
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])), $ws_plugin__s2member_pro_temp_s);
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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="Modification/Cancellation Buttons">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-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 Wallet. It\'s very simple. A Member clicks a Modification/Cancellation Button. This brings the Customer to a "Purchase History" screen inside their Google Wallet 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 s2Member through Google\'s Postback/IPN service. s2Member 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 Wallet... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT (End Of Term) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member.</em></p>' . "\n";
     echo '<p><em>s2Member will not process an EOT (End Of Term) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system (based on your configuration). s2Member also calculates one extra day (24 hours) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
     echo '<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--s2member-pro-cancellation-shortcode">' . "\n";
     echo 'Button Code<br />For Cancellations:<br /><br />' . "\n";
     echo '<div id="ws-plugin--s2member-pro-cancellation-button-prev">' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/google-cancellation-button.php")));
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_pro_temp_s);
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $ws_plugin__s2member_pro_temp_s);
     $ws_plugin__s2member_pro_temp_s = preg_replace("/&amp;/", "&", $ws_plugin__s2member_pro_temp_s);
     // Match this with the JavaScript generator.
     echo preg_replace("/\\<a/", '<a target="_blank"', $ws_plugin__s2member_pro_temp_s);
     echo '</div>' . "\n";
     echo '</label>' . "\n";
     echo '</th>' . "\n";
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;" autocomplete="off">' . "\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;" autocomplete="off">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-cancellation-button-shortcode.php")));
     echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-cancellation-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="Capability (Buy Now) Buttons">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-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: <strong>s2Member → API Scripting → Custom Capabiities</strong>.</p>' . "\n";
         echo '<p>With s2Member, 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 s2Member 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 s2Member 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 Wallet Buttons are customized to work with s2Member 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 s2Member), or in another location where you can be absolutely sure that a User/Member is logged in. s2Member\'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: <strong>s2Member → API Scripting → Simple Conditionals</strong>.</em></p>' . "\n";
         echo '<p><em><strong>Please note:</strong> 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--s2member-pro-ccap-shortcode">' . "\n";
         echo 'Button Code<br />For Capabilities:<br /><br />' . "\n";
         echo '<div id="ws-plugin--s2member-pro-ccap-button-prev"></div>' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '<td>' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-pro-ccap-term">' . trim(c_ws_plugin__s2member_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--s2member-pro-ccap-desc" 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: s2Member → 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-pro-ccap-ccaps" size="40" /></p>' . "\n";
         echo '<p>Currency: <select id="ws-plugin--s2member-pro-ccap-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_pro_googleCcapButtonGenerate();" /></p>' . "\n";
         echo '</form>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td colspan="2">' . "\n";
         echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
         echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
         $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-ccaps-checkout-button-shortcode.php")));
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-ccap-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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--s2member-pro-reg-links-section">' . "\n";
     echo '<h3>Registration Access Link Generator (for Customer Service)</h3>' . "\n";
     echo '<p>s2Member 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 <strong>Users → Add New</strong>. 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;" autocomplete="off">' . "\n";
     echo '<p>Paid Membership Level#: <select id="ws-plugin--s2member-pro-reg-link-level">' . "\n";
     for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
         echo '<option value="' . $n . '">s2Member Level #' . $n . '</option>' . "\n";
     }
     echo '</select></p>' . "\n";
     echo '<p>Paid Subscr. ID: <input type="text" autocomplete="off" id="ws-plugin--s2member-pro-reg-link-subscr-id" value="" size="50" /> <a href="#" onclick="alert(\'The Customer\\\'s Paid Subscr. ID (aka: a Google Wallet Order ID. This value can be obtained from inside your Google Wallet account. 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, s2Member will be unable to maintain future communication with the Google IPN (i.e., Notification/Postback) service if this value does not reflect a real Paid Subscr. ID that exists in your Google Wallet transaction log.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p>Custom String Value: <input type="text" autocomplete="off" id="ws-plugin--s2member-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__s2member_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__s2member_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__s2member_pro_googleRegLinkGenerate();" /> <img id="ws-plugin--s2member-pro-reg-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
     echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member → API Scripting → Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-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--s2member-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 s2Member 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--s2member-pro-reg-link" class="monospace" style="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="Specific Post/Page (Buy Now) Buttons">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-sp-buttons-section">' . "\n";
     echo '<h3>Button Code Generator For Specific Post/Page Buttons</h3>' . "\n";
     echo '<p>s2Member 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. s2Member can simply send an email to the Customer with a link (see: <strong>s2Member → Google Options → Specific Post/Page Email</strong>). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
     echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file &amp; music downloads, access to additional support services, and the list goes on 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: <strong>s2Member → Restriction Options → Specific Post/Page Access</strong>. 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 Wallet Buttons are customized to work with s2Member seamlessly. You can even Package Additional Posts/Pages together into one transaction. <em><strong>Please note:</strong> 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--s2member-pro-sp-shortcode">' . "\n";
     echo 'Button Code<br />Specific Posts/Pages:<br /><br />' . "\n";
     echo '<div id="ws-plugin--s2member-pro-sp-button-prev"></div>' . "\n";
     echo '</label>' . "\n";
     echo '</th>' . "\n";
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
     echo '<p><select id="ws-plugin--s2member-pro-sp-leading-id">' . "\n";
     echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
     $ws_plugin__s2member_pro_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
     foreach ($ws_plugin__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 s2Member for Specific Post/Page Access yet. See: s2Member → Restriction Options → Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p><select id="ws-plugin--s2member-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__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 (i.e., only one Access Link is needed, and s2Member 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* s2Member 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 s2Member for Specific Post/Page Access yet. See: s2Member → 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--s2member-pro-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-pro-sp-hours">' . trim(c_ws_plugin__s2member_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--s2member-pro-sp-desc" value="Description and pricing details here." size="68" /></p>' . "\n";
     echo '<p>Currency: <select id="ws-plugin--s2member-pro-sp-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_pro_googleSpButtonGenerate();" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '<tr>' . "\n";
     echo '<td colspan="2">' . "\n";
     echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-sp-checkout-button-shortcode.php")));
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
     echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-sp-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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="Specific Post/Page Access Links">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-sp-links-section">' . "\n";
     echo '<h3>Specific Post/Page Access Link Generator (for Customer Service)</h3>' . "\n";
     echo '<p>s2Member automatically generates a Specific Post/Page Access Link for your Customer after checkout; and it sends this link in a Confirmation Email to the customer. However, if you ever need to deal with a Customer Service issue that requires a new Specific Post/Page Access 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;" autocomplete="off">' . "\n";
     echo '<p><select id="ws-plugin--s2member-pro-sp-link-leading-id">' . "\n";
     echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
     $ws_plugin__s2member_pro_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
     foreach ($ws_plugin__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 s2Member for Specific Post/Page Access yet. See: s2Member → Restriction Options → Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p><select id="ws-plugin--s2member-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__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 (i.e., only one Access Link is needed, and s2Member 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* s2Member 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 s2Member for Specific Post/Page Access yet. See: s2Member → Restriction Options → Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p><select id="ws-plugin--s2member-pro-sp-link-hours">' . trim(c_ws_plugin__s2member_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__s2member_pro_googleSpLinkGenerate();" /> <img id="ws-plugin--s2member-pro-sp-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
     echo '<p id="ws-plugin--s2member-pro-sp-link" class="monospace" style="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--s2member-pro-shortcode-attrs-section">' . "\n";
     echo '<h3>Shortcode Attributes (Explained In Full Detail)</h3>' . "\n";
     echo '<p>When you generate a Button Code, s2Member will make a <a href="http://s2member.com/r/shortcode-reference/" target="_blank" rel="external">Shortcode</a> available to you. Like most Shortcodes for WordPress, s2Member reads Attributes in your Shortcode. These Attributes will be pre-configured by one of s2Member\'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 class="ws-menu-page-li-margins">' . "\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>. Google currently supports: <code>USD</code>, <code>EUR</code>, <code>CAD</code>, <code>GBP</code>, <code>AUD</code>, <code>HKD</code>, <code>JPY</code>, <code>DKK</code>, <code>NOK</code>, <code>SEK</code>. Note: Google automatically converts the billing currency you specify, to the currency that\'s been defined by your Google Wallet merchant account.</li>' . "\n";
     echo !is_multisite() || !c_ws_plugin__s2member_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 Wallet 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__s2member_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 Wallet Button (&lt;a&gt; anchor tag) URL w/ onclick handler, <code>url</code> = raw URL w/ possible ?query string (valid only for Modification/Cancellation Buttons). Note that <code>output="url"</code> is NOT valid for most Google Wallet Buttons because of their dependency on JavaScript. Using <code>output="url"</code> is valid only for Modification/Cancellation Buttons where a raw URL is possible.</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__s2member_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). Please note—Google Wallet supports only the following recurring interval: <code>monthly</code>. Thus, this MUST be set to a value of <code>1</code> with a term of <code>M</code> if you intend for charges to recur. If you don\'t intend for charges to recur, you can set this to whatever you prefer.</li>' . "\n";
     echo '<li><code>rt="M"</code> Regular Term. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__s2member_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. Please note—Google Wallet supports only the following recurring interval: <code>monthly</code>. Thus, this MUST be set to a value of <code>M</code> with a period of <code>1</code> if you intend for charges to recur. If you don\'t intend for charges to recur, you can set this to whatever you prefer.</li>' . "\n";
     echo '<li><code>rr="1"</code> Recurring directive. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__s2member_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: s2Member → Google Wallet Options)</em>.</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 '<hr />' . "\n";
     echo '<ul class="ws-menu-page-li-margins">' . "\n";
     echo '<li><code>success=""</code> Success Return URL <em>(optional)</em>. s2Member handles this automatically for you. However, if you would prefer to take control over the landing page after checkout <em>(i.e., your own custom Thank-You Page)</em>, you can. If supplied, this must be a full URL, starting with <code>http://</code>.</li>' . "\n";
     echo '<li><code>failure=""</code> Failure Return URL <em>(optional)</em>. s2Member handles this automatically for you. However, if you would prefer to take control over the landing page after a checkout failure <em>(i.e., your own custom Failure Page)</em>, you can. If supplied, this must be a full URL, starting with <code>http://</code>. <strong>Note:</strong> most site owners prefer to leave this empty; doing nothing in this scenario is often exactly what\'s expected by a customer.</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__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Esempio n. 20
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>Download Options</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form">' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-options-save")) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_amazon_cf_files_distros_auto_config_status" id="ws-plugin--s2member-amazon-cf-files-distros-auto-config-status" value="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"]) . '" />' . "\n";
     echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n";
     do_action("ws_plugin__s2member_during_down_ops_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_restrictions", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_restrictions", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Basic Download Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n";
         echo '<h3>File Download Restrictions (required, if providing access to protected files)</h3>' . "\n";
         echo '<p>If your Membership offering allows access to restricted files, you\'ll want to configure these options.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_restrictions", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Upload restricted files to this security-enabled directory:</strong><br /><code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '</code></p>' . "\n";
         echo '<p>- Now, you can link to any protected file, using this special format:<br />&nbsp;&nbsp;<code>' . esc_html(site_url("/?s2member_file_download=example-file.zip")) . '</code><br />&nbsp;&nbsp;<small><em><strong>s2member_file_download</strong> = file, relative to the /' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/ directory. In other words, just the file name.</em></small></p>' . "\n";
         echo '<p>- Or, use: <code>[s2File download="example-file.zip" /]</code> <em>(easier Shortcode if you prefer)</em><br />&nbsp;&nbsp;<small><em><strong>Shortcode equivalent:</strong> <code>[s2File /]</code> produces the entire URL for you, easier.</em></small></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p>s2Member will allow access to these protected files, based on the configuration you specify below. Repeated downloads of the same exact file are NOT tabulated against the totals below. Once a file has been downloaded, future downloads of the same exact file, by the same exact Member will not be counted against them. In other words, if a Member downloads the same file three times, the system only counts that as one unique download. In addition, multiple variations of popular media formats are only counted once. This is because many site owners provide multiple download options to their Users/Members, for compatibility purposes. Files that have the same exact name, with one of these extensions, will only be counted ONE time: <code>' . esc_html(implode(",", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["streaming_file_extns"])) . '</code>.</p>' . "\n";
         echo '<p>s2Member will automatically detect links, anywhere in your content, and/or anywhere in your theme files, that contain <code>s2member_file_download</code> or <code>s2member-files</code>. Whenever a logged-in Member clicks a link that contains <code>s2member_file_download</code> or <code>s2member-files</code>, the system will politely ask the user to confirm the download using a very intuitive JavaScript confirmation prompt, which contains specific details about your configured download limitations. This way your Members will be aware of how many files they\'ve downloaded in the current period; and they\'ll be able to make a conscious decision about whether to proceed with a specific download or not. If you want to suppress this JavaScript confirmation prompt, you can add this to the end of your links: <code>&amp;s2member_skip_confirmation</code>. Shortcode alternative: <code>[s2File skip_confirmation="yes" /]</code>.</p>' . "\n";
         echo '<p><em>* The above only applies to Users who are logged in as Members. For all other visitors in the general public, the <code>?s2member_file_download</code> links will redirect them your Membership Options Page, so that new visitors can signup, in order to gain access, by becoming a Member. You may also want to have a look down below at s2Member\'s "Advanced Download Restrictions", which provides a greater degree of flexibility.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
             echo '<tr>' . "\n";
             echo '<th style="padding-top:0;">' . "\n";
             echo '<label for="ws-plugin--s2member-level' . $n . '-file-downloads-allowed">' . "\n";
             echo $n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? 'File Downloads ( Highest Level #' . $n . ' ):' . "\n" : 'File Downloads (Level #' . $n . ' Or Higher):' . "\n";
             echo '</label>' . "\n";
             echo '</th>' . "\n";
             echo '</tr>' . "\n";
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             echo '<input type="text" maxlength="9" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_file_downloads_allowed" id="ws-plugin--s2member-level' . $n . '-file-downloads-allowed" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed"]) . '" style="width:200px;" /> every <input type="text" maxlength="3" autocomplete="off" name="ws_plugin__s2member_level' . $n . '_file_downloads_allowed_days" id="ws-plugin--s2member-level' . $n . '-file-downloads-allowed-days" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed_days"]) . '" style="width:200px;" onkeyup="if(this.value > 365){ alert(\'(365 days is the maximum).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> day(s).<br />' . "\n";
             echo 'Only this many unique downloads will be permitted every X day(s), at ' . ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? 'highest Level #' . $n : 'Level #' . $n . ' or higher') . '.<br />' . "\n";
             echo '<em>* To allow UNLIMITED downloads, use: <code>999999999</code> (i.e. <code>999999999</code> = unlimited).</em>' . "\n";
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
             echo $n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? '<tr><td><div class="ws-menu-page-hr" style="margin:10px 0 10px 0;"></div></td></tr>' : '';
         }
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_restrictions", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_limit_exceeded_page", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_limit_exceeded_page", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Download Limit Exceeded Page">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-limit-exceeded-page-section">' . "\n";
         echo '<h3>Download Limit Exceeded Page (required, if providing access to protected files)</h3>' . "\n";
         echo '<p>This Page will be shown when/if a Member reaches their download limit, based on your configuration of <strong>Basic Download Restrictions</strong> above. This Page should be created by you, in WordPress. This Page should provide an informative message to the Member, describing your file access restrictions. Just tell them a little bit about your policy on file downloads, and why they might have reached this Page.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_limit_exceeded_page", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-file-download-limit-exceeded-page">' . "\n";
         echo 'Download Limit Exceeded Page:' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<select name="ws_plugin__s2member_file_download_limit_exceeded_page" id="ws-plugin--s2member-file-download-limit-exceeded-page">' . "\n";
         echo '<option value="">&mdash; Select &mdash;</option>' . "\n";
         foreach ($ws_plugin__s2member_temp_a = array_merge((array) get_pages()) as $ws_plugin__s2member_temp_o) {
             echo '<option value="' . esc_attr($ws_plugin__s2member_temp_o->ID) . '"' . ($ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] ? ' selected="selected"' : '') . '>' . esc_html($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
         }
         echo '</select><br />' . "\n";
         echo 'We recommend the following title: <code>Download Limit Exceeded</code>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_limit_exceeded_page", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_advanced_restrictions", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_advanced_restrictions", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Advanced Download Restrictions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n";
         echo '<h3>Advanced Download Restrictions (optional, for greater flexibility)</h3>' . "\n";
         echo '<p>By default, s2Member uses your Basic Download Restrictions, as configured above. However, you can force s2Member to allow File Downloads, using an extra query string parameter: <code>&amp;s2member_file_download_key=[Key]</code>. A File Download `Key` is passed through this parameter; it tells s2Member to allow the download of this particular file, regardless of Membership Level; and WITHOUT checking any Basic Restrictions, that you may or may not have configured above. The creation of a File Download `Key`, requires a small PHP code snippet. 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/ezphp/" target="_blank" rel="external">ezPHP</a>). There is also a Shortcode equivalent, which does NOT require PHP at all, as seen below.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_advanced_restrictions", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p>' . esc_html(site_url("/?s2member_file_download=example-file.zip")) . '<code>&amp;s2member_file_download_key=&lt;?php echo s2member_file_download_key("example-file.zip"); ?&gt;</code><br />&nbsp;&nbsp;<small><em><strong>s2member_file_download_key</strong> = &lt;?php echo s2member_file_download_key("file, relative to the /' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/ directory"); ?&gt;</em></small></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p>' . esc_html(site_url("/?s2member_file_download=example-file.zip")) . '<code>&amp;s2member_file_download_key=[s2Key file_download="example-file.zip" /]</code><br />&nbsp;&nbsp;<small><em><strong>Shortcode equivalent:</strong> <code>[s2Key file_download="example-file.zip" /]</code></em></small></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><code>[s2File download="example-file.zip" download_key="true" /]</code> <em>(Key is auto-generated in this case)</em><br />&nbsp;&nbsp;<small><em><strong>Shortcode equivalent:</strong> <code>[s2File /]</code> produces the entire URL, no need to generate a Key yourself.</em></small></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p>The function <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_file_download_key()" target="_blank" rel="external">s2member_file_download_key()</a>, is part of the s2Member API. It produces a time-sensitive File Download Key that is unique to each and every visitor. Each Key it produces <em>(at the time it is produced)</em>, will be valid for the current day, and only for a specific IP address and User-Agent string; as detected by s2Member. This makes it possible for you to create links on your site, which provide access to protected file downloads; and without having to worry about one visitor sharing their link with another. So let\'s take a quick look at what <code>s2member_file_download_key()</code> actually produces.</p>' . "\n";
         echo '<p><code>s2member_file_download_key("example-file.zip")</code> = a site-specific hash of: <code>date("Y-m-d").$_SERVER["REMOTE_ADDR"].$_SERVER["HTTP_USER_AGENT"].$file</code></p>' . "\n";
         echo '<p>When <code>s2member_file_download_key = <em>a valid Key</em></code>, it works independently from Member Level Access. That is, a visitor does NOT have to be logged in to receive access; they just need a valid Key. Using this advanced technique, you could extend s2Member\'s file protection routines, or even combine them with Specific Post/Page Access, and more. The possibilities are limitless really.</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_advanced_restrictions", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_inline_extensions", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_inline_extensions", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Inline File Extensions">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-inline-extensions-section">' . "\n";
         echo '<h3>Inline File Extensions (optional, for content-disposition)</h3>' . "\n";
         echo '<p>There are two ways to serve files. Inline, or as an Attachment. By default, s2Member will serve all of your protected files, as downloadable attachments. Meaning, visitors will be given a file download prompt. Otherwise known as <code>Content-Disposition: attachment</code>. In some cases though, you may wish to serve files inline. For example, PDF files and images should usually be served inline. When you serve a file inline, it is displayed in your browser immediately, rather than your browser prompting you to download the file as an attachment.</p>' . "\n";
         echo '<p>Using the field below, you can list all of the extensions that you want s2Member to serve inline (ex: <code>htm,html,pdf,jpg,jpeg,jpe,gif,png,mp3,mp4,flv,ogg,webm</code>). Please understand, some files just cannot be displayed inline. For instance, there is no way to display an <code>exe</code> file inline. So only specify extensions that can, and should be displayed inline by a web browser. Alternatively, if you would rather handle this on a case-by-case basis, you can simply add the following to the end of your download links: <code>&amp;s2member_file_inline=yes</code>. Shortcode alternative: <code>[s2File download="example-file.zip" inline="yes" /]</code>.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_inline_extensions", get_defined_vars());
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-file-download-inline-extensions">' . "\n";
         echo 'Default Inline File Extensions (comma-delimited):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_file_download_inline_extensions" id="ws-plugin--s2member-file-download-inline-extensions" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]) . '" /><br />' . "\n";
         echo 'Inline extensions, comma-delimited. Ex: <code>htm,html,pdf,jpg,jpeg,jpe,gif,png,mp3,mp4,flv,ogg,webm</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_inline_extensions", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_remote_authorization", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_remote_authorization", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Remote Auth / Podcasting">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-remote-authorization-section">' . "\n";
         echo '<h3>Remote Header Authorization (optional)</h3>' . "\n";
         echo '<p>This can be enabled on a case-by-case basis. Just add this to the end of your download links: <code>&amp;s2member_file_remote=yes</code>. Shortcode alternative: <code>[s2File download="example-file.zip" remote="yes" /]</code>.</p>' . "\n";
         echo '<p>Remote Header Authorization allows access to file downloads through an entirely different approach. Instead of asking the Member to log into your site through a browser, a Member will be prompted automatically, to log in through HTTP Header Authorization prompts; which is the same technique used in more traditional security systems via .htaccess files. In other words, Remote Header Authorization makes it possible for your Members to access files through remote applications that may NOT use a browser. This is often the case when a Member needs to access protected files through a software client like iTunes; typical with podcasts. See <a href="http://www.s2member.com/videos/71F49478D6983A9C/" target="_blank" rel="external">tutorial video here</a> for details about how to setup a Podcast for iTunes.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_remote_authorization", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_remote_authorization", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_amazon_s3", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_s3", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Amazon S3/CDN Storage Option"' . (!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' default-state="open"' : '') . '>' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-s3-section">' . "\n";
         echo '<h3>Amazon S3/CDN Storage &amp; Delivery (optional)</h3>' . "\n";
         echo '<a href="http://aws.amazon.com/s3/" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/amazon-logo.png" class="ws-menu-page-right" style="width:250px; height:100px; border:0;" alt="." /></a>' . "\n";
         echo '<p>Please note, all of this is optional. s2Member can be configured here to ONLY use Amazon S3 <em>(i.e. without Amazon CloudFront)</em>. Or, s2Member can be configured to use BOTH Amazon S3 and Amazon CloudFront together. If you want to use Amazon S3 Storage, but you don\'t care about Amazon CloudFront, feel free to leave the entire Amazon CloudFront section empty. The configuration options in the Amazon CloudFront section are ONLY required if you are planning to use both Amazon S3 and Amazon CloudFront together.</p>' . "\n";
         echo '<p>Amazon Simple Storage Service (<a href="http://aws.amazon.com/s3/" target="_blank" rel="external">Amazon S3</a>). Amazon S3 is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives developers access to the same highly scalable, reliable, secure, fast, inexpensive infrastructure that Amazon uses to run its own global network of web sites. s2Member has been integrated with Amazon S3, so that <em>(if you wish)</em>, instead of using the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory, you can store all of your protected files inside an Amazon S3 Bucket.</p>' . "\n";
         echo '<p>If you configure the options below, s2Member will assume all protected files are inside your Amazon S3 Bucket; and the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory is no longer used at all. That being said, all other aspects of s2Member\'s File Download protection remain the same. The only thing that changes, is the location of your protected files. In other words, Basic Download Restrictions, Download Keys, Inline Extensions, Custom Capability and/or Membership Level Files will all continue to work just as before. The only difference is that s2Member will use your Amazon S3 Bucket as a CDN <em>(i.e. Content Delivery Network)</em> instead of the local <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory.</p>' . "\n";
         echo '<p>s2Member assumes that you\'re creating a new Amazon S3 Bucket, specifically for this installation; and that your Bucket is NOT available publicly. In other words, if you type this URL into your browser <em>(i.e. <code>http://your-bucket-name.s3.amazonaws.com/</code>)</em>, you should get an error that says: <code>Access Denied</code>. That\'s good, that\'s exactly what you want. You can create your Amazon S3 Bucket using the <a href="https://console.aws.amazon.com/s3/home" target="_blank" rel="external">Amazon interface</a>. Or, some people prefer to use this popular Firefox extension (<a href="http://www.s3fox.net/" target="_blank" rel="external">S3 Fox Organizer</a>).</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_amazon_s3", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Dev Note w/Technical Details:</strong> s2Member uses "Digitally Signed URLs", authenticated by the Amazon S3 API. Documented for developers <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html" target="_blank" rel="external">here</a>. To put it simply, s2Member will generate Amazon S3 URLs (internally); which allow Customers temporary access to specific files inside your S3 Bucket. s2Member\'s Digitally Signed URLs leading to Amazon S3, give a Customer 24 hours to connect to the file inside your S3 Bucket. This connection period of 24 hours is largely irrelevant when used in combination with s2Member, because access is renewed for another 24 hours each time you make a file available to a User/Member, and they are authenticated by your configuration of s2Member. This connection period of 24 hours is just a secondary line of defense to further prevent the possibility of link sharing. If you need to change this connection timeout of <code>24 hours</code> for some reason (not likely), you can use this WordPress Filter: <code>ws_plugin__s2member_amazon_s3_file_expires_time</code>.</em></p>' . "\n";
         echo '<p><em><strong>Linking To Protected Files:</strong> Nothing changes. s2Member\'s integration with Amazon S3 serves protected files through the same links that all s2Member site owners use. For example, you might use: <code>' . esc_html(site_url("/?s2member_file_download=example-file.zip")) . '</code>, where <strong>s2member_file_download</strong> = the file, relative to the root of your Amazon S3 Bucket. In other words, just the file name in most cases. s2Member will redirect Users/Members to a digitally signed Amazon S3 URL, which allows them access to a particular file via Amazon S3. For further details, please review this section of your Dashboard: <code>s2Member -› Download Options -› Basic Download Restrictions</code>. Also see: <code>s2Member -› Download Options -› Advanced Mod-Rewrite Linkage</code>.</em></p>' . "\n";
         echo '<p><em><strong>Content Type, Disposition &amp; Inline Files:</strong> The query string parameter <code>&amp;s2member_file_inline=yes</code> DOES work for files served directly through Amazon S3. s2Member DOES have control over the <code>Content-Type</code> and <code>Content-Disposition</code> headers for files being served through Amazon S3. However, Amazon CloudFront servers do NOT automatically determine the MIME type for the objects they serve. If you integrate both Amazon S3 and CloudFront, s2Member will NOT have control over headers. Therefore, when you upload a file to your Amazon S3 Bucket, you should set its Content-Type header. Again, with the Amazon S3/CloudFront combination, you MUST configure headers yourself (such as <code>Content-Type: video/webm</code>, or <code>Content-Disposition: inline|attachment</code>) that you want Amazon CloudFront to send for a particular file. It\'s quite easy. You do this by setting <code>Properties -› Metadata (i.e. headers)</code> on a per-file basis, from inside your Amazon S3 Management Console. In short, when you upload a file to your Amazon S3 Bucket, if you want that file to be served a certain way, be sure to configure its <code>Properties -› Metadata</code> accordingly.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-s3-files-bucket">' . "\n";
         echo 'Amazon S3 File Bucket Name (where protected files are):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_amazon_s3_files_bucket" id="ws-plugin--s2member-amazon-s3-files-bucket" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"]) . '" /><br />' . "\n";
         echo 'Your Amazon S3 Bucket will be used, instead of the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory.<br />' . "\n";
         echo 'Please type the name of your Bucket. Ex: <code>mys3bucket</code>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-s3-files-access-key">' . "\n";
         echo 'Amazon Access Key (Access Key ID):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_amazon_s3_files_access_key" id="ws-plugin--s2member-amazon-s3-files-access-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_access_key"]) . '" /><br />' . "\n";
         echo 'See: <code>Amazon Web Services Account -› Security Credentials -› Access Keys</code>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-s3-files-secret-key">' . "\n";
         echo 'Amazon Secret Key (Secret Access Key):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_amazon_s3_files_secret_key" id="ws-plugin--s2member-amazon-s3-files-secret-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_secret_key"]) . '" /><br />' . "\n";
         echo 'See: <code>Amazon Web Services Account -› Security Credentials -› Access Keys (leading to: Legacy Security Credentials)</code>.<br />' . "\n";
         echo 'Amazon is deprecating Secret Access Keys, but they ARE still required for digitally signed URLs.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_amazon_s3", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_amazon_cf", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_cf", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Amazon S3/CloudFront CDN Storage Option"' . (!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' default-state="open"' : '') . '>' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-cf-section">' . "\n";
         echo '<h3>Amazon S3/CloudFront CDN Storage &amp; Delivery (optional)</h3>' . "\n";
         echo '<a href="http://aws.amazon.com/cloudfront/" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/amazon-logo.png" class="ws-menu-page-right" style="width:250px; height:100px; border:0;" alt="." /></a>' . "\n";
         echo '<p>Please note, all of this is optional. s2Member can be configured to ONLY use Amazon S3 <em>(i.e. without Amazon CloudFront)</em>. Or, s2Member can be configured to use BOTH Amazon S3 and Amazon CloudFront together. If you don\'t want to use Amazon CloudFront, please leave this entire section empty. The configuration options in this section are ONLY required if you are planning to use both Amazon S3 and Amazon CloudFront together.</p>' . "\n";
         echo '<p>Amazon Simple Storage Service (<a href="http://aws.amazon.com/s3/" target="_blank" rel="external">Amazon S3</a>) combined with <a href="http://aws.amazon.com/cloudfront/" target="_blank" rel="external">Amazon CloudFront</a>. Amazon CloudFront is a web service for content delivery. It integrates with other Amazon Web Services <em>(i.e. Amazon S3 Storage)</em> to give developers and businesses an easy way to distribute content to end users with low latency, and with high data transfer speeds. Amazon CloudFront delivers your static and streaming content using a global network of edge locations. Requests for your Amazon S3 Bucket Objects <em>(i.e. your protected files)</em> are automatically routed to the nearest edge location, so content is delivered with the best possible performance. s2Member has been integrated with both Amazon S3 and with Amazon CloudFront. So <em>(if you wish)</em>, instead of using the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory, you can store all of your protected files inside an Amazon S3 Bucket and serve them via Amazon CloudFront. But again, please understand, the configuration options in this section are ONLY required if you\'re going to use both Amazon S3 &amp; CloudFront together.</p>' . "\n";
         echo '<p><strong>One of the great things about Amazon CloudFront</strong>, is its ability to <strong>stream/seek media files</strong> in the truest sense of the word. For sites delivering protected <em>FLV/MP4/OGG/WEBM</em> and other streaming audio/video file types over the <em>RTMP</em> protocol, Amazon CloudFront is our recommendation. Once you\'ve successfully configured s2Member to use both Amazon S3 and Amazon CloudFront together, please review the section below regarding <code>JW Player &amp; RTMP Protocol Examples</code>. s2Member will automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon CloudFront Streaming Distribution.</p>' . "\n";
         echo '<p>If you configure the options below, s2Member will assume all protected files are inside your Amazon S3 Bucket; and the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory is no longer used at all. That being said, all other aspects of s2Member\'s File Download protection remain the same. The only thing that changes, is the location of your protected files. In other words, Basic Download Restrictions, Download Keys, Custom Capability and/or Membership Level Files will all continue to work just as before. The only difference is that s2Member will use your Amazon S3 Bucket, automatically connecting it to both of the Amazon CloudFront Distributions, which s2Member auto-configures for you <em>(see below)</em>. In this way, s2Member uses Amazon CloudFront as a CDN <em>(i.e. Content Delivery Network)</em> for your protected files.</p>' . "\n";
         echo '<p>s2Member assumes that you\'re creating a new Amazon S3 Bucket, specifically for this installation; and that your Bucket is NOT available publicly. In other words, if you type this URL into your browser <em>(i.e. <code>http://your-bucket-name.s3.amazonaws.com/</code>)</em>, you should get an error that says: <code>Access Denied</code>. That\'s good, that\'s exactly what you want. You can create your Amazon S3 Bucket using the <a href="https://console.aws.amazon.com/s3/home" target="_blank" rel="external">Amazon interface</a>. Or, some people prefer to use this popular Firefox extension (<a href="http://www.s3fox.net/" target="_blank" rel="external">S3 Fox Organizer</a>). You will also need to enable CloudFront inside your Web Services account at Amazon. Don\'t worry about creating or configuring any CloudFront Distributions, s2Member will auto-create and auto-configure those for you, allowing you to serve protected files.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_amazon_cf", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><em><strong>Dev Note w/Technical Details:</strong> s2Member\'s auto-configuration routines for Amazon CloudFront (below), are designed to create &amp; configure various components on your Amazon Web Services account, which are all requirements for you to <a href="http://docs.amazonwebservices.com/AmazonCloudFront/2010-11-01/DeveloperGuide/index.html?HowToPrivateContent.html" target="_blank" rel="external">serve protected files through the Amazon S3/CloudFront combination</a>. These components include: an Origin Access Identity, read permissions for the Origin Access Identity, and two private content Distributions. One private content Distribution for file downloads, and another private content Distribution for streaming media files; both connected to and sourced by your Amazon S3 Bucket. In addition, s2Member will automatically configure an ACL &amp; Policy (i.e. permissions) on your Amazon S3 Bucket to make sure your protected object/files are NOT available to the public.</em></p>' . "\n";
         echo '<p><em><strong>Dev Note w/Technical Details:</strong> s2Member uses "Digitally Signed URLs", authenticated by the Amazon CloudFront API. Documented for developers <a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html" target="_blank" rel="external">here</a>. To put it simply, s2Member will generate Amazon CloudFront URLs (internally); which allow Customers temporary access to specific files inside your S3 Bucket — via CloudFront Distributions. s2Member\'s Digitally Signed URLs leading to Amazon S3/CloudFront, give a Customer 24 hours to connect to the file inside your S3 Bucket. This connection period of 24 hours is largely irrelevant when used in combination with s2Member, because access is renewed for another 24 hours each time you make a file available to a User/Member, and they are authenticated by your configuration of s2Member. This connection period of 24 hours is just a secondary line of defense to further prevent the possibility of link sharing. If you need to change this connection timeout of <code>24 hours</code> for some reason (not likely), you can use this WordPress Filter: <code>ws_plugin__s2member_amazon_cf_file_expires_time</code>.</em></p>' . "\n";
         echo '<p><em><strong>Linking To Protected Files:</strong> RTMP streams are special, but nothing else changes. s2Member\'s integration with Amazon S3/CloudFront serves protected files through the same links that all s2Member site owners use. For example, you might use: <code>' . esc_html(site_url("/?s2member_file_download=example-file.zip")) . '</code>, where <strong>s2member_file_download</strong> = the file, relative to the root of your Amazon S3 Bucket. In other words, just the file name in most cases. s2Member will redirect Users/Members to a digitally signed Amazon CloudFront URL, which allows them access to a particular file via Amazon CloudFront. For further details, please review this section of your Dashboard: <code>s2Member -› Download Options -› Basic Download Restrictions</code>. Also see: <code>s2Member -› Download Options -› Advanced Mod-Rewrite Linkage</code>. If you\'re streaming audio/video files over the RTMP protocol, please review the section below: <code>JW Player &amp; RTMP Protocol Examples</code>.</em></p>' . "\n";
         echo '<p><em><strong>Content Type, Disposition &amp; Inline Files:</strong> An IMPORTANT issue. The query string parameter <code>&amp;s2member_file_inline=yes</code> does NOTHING for files served via Amazon CloudFront. s2Member has NO control over the <code>Content-Type</code> and/or <code>Content-Disposition</code> headers for a file being served through Amazon CloudFront, and CloudFront servers do NOT automatically determine the MIME type for the objects they serve. Therefore, when you upload a file to your Amazon S3 Bucket, you should set its Content-Type header. That is, you MUST configure headers yourself (such as <code>Content-Type: video/webm</code>, or <code>Content-Disposition: inline|attachment</code>) that you want Amazon CloudFront to send for a particular file. It\'s quite easy. You do this by setting <code>Properties -› Metadata (i.e. headers)</code> on a per-file basis, from inside your Amazon S3 Management Console. In short, when you upload a file to your Amazon S3 Bucket, if you want that file to be served a certain way, be sure to configure its <code>Properties -› Metadata</code> accordingly.</em></p>' . "\n";
         echo stripos(PHP_OS, "win") === 0 && c_ws_plugin__s2member_utils_conds::is_localhost() ? '<p><em><strong>Localhost Developers:</strong> s2Member\'s Amazon CloudFront integration requires the <a href="http://php.net/manual/en/function.openssl-sign.php" target="_blank" rel="external">openssl_sign()</a> function in PHP so it can digitially sign CloudFront URLs. This function is sometimes problematic on localhost servers such as WAMP &amp; EasyPHP. We recommend installing <a href="http://www.slproweb.com/products/Win32OpenSSL.html" target="_blank" rel="external">this lightweight alternative for Windows</a> while you\'re developing. s2Member will automatically find it here: <code>C:\\OpenSSL-Win[32/64]\\bin\\openssl.exe</code>.' . (file_exists("c:\\openssl-win32\\bin\\openssl.exe") || file_exists("c:\\openssl-win64\\bin\\openssl.exe") ? ' <strong class="ws-menu-page-hilite">( s2Member has detected that OpenSSL-Win[32/64] IS installed in the correct location, thank you! )</strong>' : ' <strong class="ws-menu-page-hilite">(s2Member has detected that OpenSSL-Win[32/64] is NOT currently available)</strong>') . '</em></p>' . "\n" : '';
         if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"] === "configured") {
             echo '<p><em class="ws-menu-page-hilite"><strong>Your Amazon CloudFront Distributions are: ( ALREADY configured! )</strong></em>' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"] ? '<br /><em class="ws-menu-page-hilite">Downloads Distribution CNAME:</em> <em><code>' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' &mdash;&raquo; ' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"] ? '<br /><em class="ws-menu-page-hilite">Streaming Distribution CNAME:</em> <em><code>' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' &mdash;&raquo; ' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : '') . '</p>' . "\n";
         } else {
             if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"]) {
                 echo '<p><em class="ws-menu-page-hilite"><strong>Your Amazon CloudFront Distributions are: (NOT yet auto-configured).</strong></em></p>' . "\n";
             }
         }
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<table class="form-table" style="margin-top:0;">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th style="padding-top:0;">' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-cf-files-private-key-id">' . "\n";
         echo 'Amazon CloudFront Key Pair ID (your Key Pair ID):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_amazon_cf_files_private_key_id" id="ws-plugin--s2member-amazon-cf-files-private-key-id" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key_id"]) . '" data-s-prev-config-value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key_id"]) . '" /><br />' . "\n";
         echo 'See: <code>Amazon Web Services Account -› Security Credentials -› Key Pairs</code>.' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-cf-files-private-key-entry">' . "\n";
         echo 'Amazon CloudFront Private Key (contents of your <code>pk-[***].pem</code> file):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="hidden" name="ws_plugin__s2member_amazon_cf_files_private_key" id="ws-plugin--s2member-amazon-cf-files-private-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]) . '" data-s-prev-config-value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]) . '" />' . "\n";
         echo '<textarea name="ws_plugin__s2member_amazon_cf_files_private_key_entry" id="ws-plugin--s2member-amazon-cf-files-private-key-entry" rows="3" wrap="off" spellcheck="false" class="monospace">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]) . '</textarea><br />' . "\n";
         echo 'See: <code>Amazon Web Services Account -› Security Credentials -› Key Pairs</code>.<br />' . "\n";
         echo '<em>* Note, s2Member needs your <strong>Private Key file</strong>, NOT your Public Key file.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros">' . "\n";
         echo 'Auto-Configure your Amazon S3/CloudFront combination?' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-amazon-cf-files-auto-configure-distros")) . '"' . (!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros"><strong>Yes</strong>, automatically configure my Amazon CloudFront Distributions &amp; Amazon S3 ACLs for me.</label><br />' . "\n";
         echo '<em>s2Member will auto-configure and/or delete &amp; re-configure your Amazon CloudFront Distributions for you.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros_w_cnames" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames" value="' . esc_attr(wp_create_nonce("ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames")) . '"' . (!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"] || $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames"><strong>Yes</strong>, I want s2Member to auto-configure using custom CNAMES that I\'ll setup.</label><br />' . "\n";
         echo '<em>* Optional, do NOT check this box unless you know what you\'re doing. This requires DNS changes.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div id="ws-plugin--s2member-amazon-cf-files-auto-configure-distro-cnames" style="display:none;">' . "\n";
         echo '<table class="form-table">' . "\n";
         echo '<tbody>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-cf-files-downloads-distro-cname">' . "\n";
         echo 'Amazon CloudFront CNAME for File Downloads (optional):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_amazon_cf_files_distro_downloads_cname" id="ws-plugin--s2member-amazon-cf-files-downloads-distro-cname" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . '" /><br />' . "\n";
         echo 'Example: <code>s2-file-downloads.' . esc_html(c_ws_plugin__s2member_utils_urls::parse_url(site_url(), PHP_URL_HOST)) . '</code>.<br />' . "\n";
         echo '<em>* Optional, do NOT fill this in unless you know what you\'re doing. This requires DNS changes.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<th>' . "\n";
         echo '<label for="ws-plugin--s2member-amazon-cf-files-streaming-distro-cname">' . "\n";
         echo 'Amazon CloudFront CNAME for Streaming Files (optional):' . "\n";
         echo '</label>' . "\n";
         echo '</th>' . "\n";
         echo '</tr>' . "\n";
         echo '<tr>' . "\n";
         echo '<td>' . "\n";
         echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_amazon_cf_files_distro_streaming_cname" id="ws-plugin--s2member-amazon-cf-files-streaming-distro-cname" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . '" /><br />' . "\n";
         echo 'Example: <code>s2-streaming-files.' . esc_html(c_ws_plugin__s2member_utils_urls::parse_url(site_url(), PHP_URL_HOST)) . '</code>.<br />' . "\n";
         echo '<em>* Optional, do NOT fill this in unless you know what you\'re doing. This requires DNS changes.</em>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_amazon_cf", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_rtmp_streaming", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_rtmp_streaming", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="JW Player v6 &amp; RTMP Protocol Examples">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-rtmp-streaming-section">' . "\n";
         echo '<h3>JW Player v6 &amp; RTMP Protocol Examples</h3>' . "\n";
         echo '<a href="http://www.longtailvideo.com/players/" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/jwplayer-logo.png" class="ws-menu-page-right" style="width:179px; height:58px; border:0; border-radius:3px; background:#FFFFFF; padding:15px;" alt="." /></a>' . "\n";
         echo '<p>While it is possible to serve audio/video files protected by s2Member, without needing to integrate Amazon S3 or CloudFront; we DO highly recommend that you integrate both Amazon S3 and Amazon CloudFront in order to maximize speed and compatibility across various viewing platforms. That being said, there are code samples below that will serve audio/video files both with and without Amazon S3/CloudFront. You can also check the <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Forum URI")) . '" target="_blank" rel="external">s2Member Support Forums</a> for tips/tricks if you like.</p>' . "\n";
         echo '<p><strong>One of the great things about Amazon CloudFront</strong>, is its ability to <strong>stream/seek media files</strong> in the truest sense of the word. For sites delivering protected <em>FLV/MP4/OGG/WEBM</em> and other streaming audio/video file types over the <em>RTMP</em> protocol, Amazon CloudFront is our recommendation. Once you\'ve successfully configured s2Member to use both Amazon S3 and Amazon CloudFront together, please review the code samples below. s2Member can automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon CloudFront Streaming Distribution.</p>' . "\n";
         echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/jwplayer-s2stream-shortcodes/" target="_blank" rel="external">JW Player w/ <code>[s2Stream /]</code> Shortcodes</a>.</p>' . "\n";
         if (stripos(wp_get_theme(), 'infocus') !== FALSE) {
             echo '<p><strong>Note:</strong> It appears that you\'re using the inFocus WordPress theme. If you experience trouble with the shortcodes below, try wrapping the shortcode in <code>[raw][/raw]</code> tags (e.g., <code>[raw][s2Stream ... /][/raw]</code>).</p>' . "\n";
         }
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_rtmp_streaming", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3><code>[s2Stream /]</code> Video Shortcode Examples (recommended — it\'s the easiest way)</h3>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player (MP4 file, via Rewrite URLs. Amazon S3/CloudFront NOT required)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp4" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />Works with any audio/video file. This does NOT require s2Member to be integrated with Amazon S3/CloudFront.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-s2stream-mp4.x-php")) . '</p>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp4-rtmp\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4, via s2Member\'s Amazon S3/CloudFront integration)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp4-rtmp" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />Streams with the RTMP protocol, plus there is a full download fallback of the MP4 source file if streaming is not possible on a particular device.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-s2stream-mp4-rtmp.x-php")) . '</p>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp4-rtmp-only\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4 only, via s2Member\'s Amazon S3/CloudFront integration)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp4-rtmp-only" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />Streams with the RTMP protocol only, with no access to the source file, only to the RTMP stream.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-s2stream-mp4-rtmp-only.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3><code>[s2Stream /]</code> Audio Shortcode Examples (recommended — it\'s the easiest way)</h3>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp3\').toggle(); return false;" class="ws-dotted-link">JW Player (MP3 file, via Rewrite URLs. Amazon S3/CloudFront NOT required)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp3" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />Works with any audio/video file. This does NOT require s2Member to be integrated with Amazon S3/CloudFront.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-s2stream-mp3.x-php")) . '</p>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp3-rtmp\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP3, via s2Member\'s Amazon S3/CloudFront integration)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp3-rtmp" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />Streams with the RTMP protocol, plus there is a full download fallback of the MP3 source file if streaming is not possible on a particular device.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-s2stream-mp3-rtmp.x-php")) . '</p>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp3-rtmp-only\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP3 only, via s2Member\'s Amazon S3/CloudFront integration)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-s2stream-mp3-rtmp-only" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />Streams with the RTMP protocol only, with no access to the source file, only to the RTMP stream.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-s2stream-mp3-rtmp-only.x-php")) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3>PHP Code Examples (for more advanced integrations via PHP — in WordPress themes)</h3>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-standard-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player (MP4 file, via Rewrite URLs. Amazon S3/CloudFront NOT required)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-standard-mp4" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This does NOT require s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <code>s2Member -› Download Options -› Advanced Mod Rewrite Linkage</code>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-standard-mp4.x-php")) . '</p>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4, via s2Member\'s Amazon S3/CloudFront integration)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-streaming-mp4.x-php")) . '</p>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-sca\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4, via s2Member\'s JSON/Shortcode alternative)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-sca" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-streaming-mp4-sca.x-php")) . '</p>' . "\n";
         echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-webm\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4, advanced w/ multiple fallbacks)</a></p>' . "\n";
         echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-streaming-mp4-webm" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.<br /><br />' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/jwplayer-streaming-mp4-webm.x-php")) . '</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_rtmp_streaming", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_rewrite_linkage", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_rewrite_linkage", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Advanced Mod-Rewrite Linkage">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-rewrite-linkage-section">' . "\n";
         echo '<h3>Advanced Mod-Rewrite Linkage</h3>' . "\n";
         echo '<p>s2Member automatically creates <code>mod_rewrite</code> rules inside your <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory, which provide additional flexibility in the way protected files can be served to your Customers. With s2Member\'s <code>mod_rewrite</code> rules, it is now possible to link directly to a protected file, avoiding the use of query string variables <em>(it\'s completely optional though, i.e. NOT required)</em>.</p>' . "\n";
         echo '<p>This new flexibility may come in handy for site owners serving files through media playback devices that have issues with query string variables. For instance, it is now possible to link to an s2Member-protected file directly, like this: <code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/example-file.zip</code> instead of <code>... /?s2member_file_download=example-file.zip</code>. Either way works, but the direct link might be easier for some.</p>' . "\n";
         echo '<p>It is also possible to pass query string parameters through a direct link:<br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/example-file.zip?s2member_file_inline=yes&amp;s2member_file_download_key=[key]</code>.</p>' . "\n";
         echo '<p>That being said, s2Member\'s <code>mod_rewrite</code> rules allow for more advanced control over s2Member-specific parameters.</p>' . "\n";
         echo '<p>For example, you could just do this for inline files:<br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline</strong>/example-file.zip</code></p>' . "\n";
         echo '<p>Or, if you really want to get advanced, you could do something like this:<br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline-[yes|no]/s2member-file-download-key-[key]</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline-yes/s2member-file-download-key-xS54df5ER4d5x</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-inline-yes/s2member-skip-confirmation</strong>/example-file.zip</code></p>' . "\n";
         echo '<p>Or even this, if you\'re using Remote Header Authorization:<br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-remote</strong>/example-file.zip</code></p>' . "\n";
         echo '<p>Specifying storage location option dynamically:<br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-storage-[local|s3|cf]</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-storage-cf</strong>/example-cloudfront-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/s2member-file-storage-s3/s2member-file-inline</strong>/example-s3-file.html</code></p>' . "\n";
         echo '<p><em>* Note, the order of your s2Member-specific parameters with Advanced Mod-Rewrite Linkage is irrelevant. Feel free to add/remove, or even change the order. Everything discussed here is also Multisite compatible. Everything discussed here is also compatible when/if combined with Amazon S3/CDN Storage. However, NONE of this will work on servers that do NOT support <code>mod_rewrite</code>. Almost all web servers do though.</em></p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_rewrite_linkage", get_defined_vars());
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_rewrite_linkage", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_shortcode_attrs", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_shortcode_attrs", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Shortcode Attributes &amp; API Functions (Explained)">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-shortcode-attrs-section">' . "\n";
         echo '<h3>Shortcode Attributes &amp; API Functions (Explained In Full Detail)</h3>' . "\n";
         echo '<p>s2Member makes <a href="http://codex.wordpress.org/Shortcode_API#Overview" target="_blank" rel="external">Shortcodes</a> available to you, which allow you to generate File Download URLs and/or File Download Keys. Like most Shortcodes for WordPress, s2Member reads Attributes in your Shortcode. 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__s2member_during_down_ops_page_during_left_sections_during_shortcode_attrs", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4 style="margin:0;"><code>[s2File /]</code> &amp; <code>[s2Stream /]</code> Shortcode Attributes:</h4>' . "\n";
         echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_file_download_url()" target="_blank" rel="external">s2member_file_download_url()</a> for PHP integration.</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>download="file.zip"</code> Location of the file, relative to the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory; or, relative to the root of your Amazon S3 Bucket, when applicable.</li>' . "\n";
         echo '<li><code>download_key="no"</code> Defaults to <code>no</code>. If <code>download_key="1|on|yes|true|ip-forever|universal"</code>, s2Member will return a URL with an s2Member-generated File Download Key. You don\'t need to generate the File Download Key yourself, s2Member does it for you. If you set <code>download_key="ip-forever"</code>, the File Download Key that s2Member generates will last forever, for a specific IP Address; otherwise, by default, all File Download Keys expire after 24 hours automatically. If you set <code>download_key="universal"</code>, s2Member will generate a File Download Key that is good for anyone/everyone forever, with NO restrictions on who/where/when a file is accessed <em>(e.g. be careful with this one)</em>.</li>' . "\n";
         echo '<li><code>stream="no"</code> Defaults to <code>no</code> with <code>[s2File /]</code> Shortcode. Defaults to <code>yes</code> with <code>[s2Stream /]</code> Shortcode. If <code>stream="1|on|yes|true"</code>, s2Member will return a URL containing a parameter/directive, which forces the File Download to take place over the RTMP protocol if at all possible. This ONLY works when/if s2Member is configured to run with both Amazon S3/CloudFront. Please note however, it\'s better to use the example code provided in the section above, regarding: <code>JW Player and the RTMP Protocol</code>. Also note, if <code>get_streamer_json="1|on|yes|true"</code>, s2Member will automatically force <code>stream="yes"</code> for you.</li>' . "\n";
         echo '<li><code>inline=""</code> Defaults to <code>[empty]</code> with <code>[s2File /]</code> Shortcode. Defaults to <code>yes</code> with <code>[s2Stream /]</code> Shortcode. If <code>inline="1|on|yes|true"</code>, s2Member will serve the file inline, instead of as an actual File Download. If empty, s2Member will look at your <code>Inline File Extensions</code> configuration above, and serve the file inline; if, and only if, its extension matches one found in your configuration. By default, s2Member serves all files as attachments <em>(i.e. downloads)</em>, except in the case of the <code>[s2Stream /]</code> Shortcode where this defaults to <code>yes</code>. Please read the section above regarding <code>Inline File Extensions</code> for further details. Also note, this Shortcode Attribute does NOTHING for files served via Amazon CloudFront. See the tech-notes listed in the Amazon CloudFront section for further details and workarounds.</li>' . "\n";
         echo '<li><code>storage=""</code> Defaults to <code>[empty]</code>. If <code>storage="local|s3|cf"</code>, s2Member will serve the file from a specific source location, based on the value of this Shortcode Attribute. For example, if you\'ve configured Amazon S3 and/or CloudFront; but, there are a few files that you want to upload locally to the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory; you can force s2Member to serve a file from local storage by setting <code>storage="local"</code> explicitly.</li>' . "\n";
         echo '<li><code>remote="no"</code> Defaults to <code>no</code>. If <code>remote="1|on|yes|true"</code>, s2Member will authenticate access to the File Download via Remote Header Authorization, instead of through your web site. This is similar to <code>.htaccess</code> protection routines of yester-year</code>. Please check the <code>Remote Authorization and Podcasting</code> section for further details about how this works.</li>' . "\n";
         echo '<li><code>ssl=""</code> Defaults to <code>[empty]</code>. If <code>ssl="1|on|yes|true"</code>, s2Member will generate a File Download URL with an SSL protocol <em>(i.e. the URL will start with <code>https://</code> or <code>rtmpe://</code>)</em>. If empty, s2Member will only generate a File Download URL with an SSL protocol, when/if the Post/Page/URL firing the Shortcode itself, is also being viewed over SSL. Otherwise, s2Member will use a non-SSL protocol by default.</li>' . "\n";
         echo '<li><code>rewrite="no"</code> Defaults to <code>no</code> with <code>[s2File /]</code> Shortcode. Defaults to <code>yes</code> with <code>[s2Stream /]</code> Shortcode. If <code>rewrite="1|on|yes|true"</code>, s2Member will generate a File Download URL that takes full advantage of s2Member\'s Advanced Mod Rewrite functionality. If you\'re running an Apache web server, or another server that supports <code>mod_rewrite</code>, we highly recommend turning this on. s2Member\'s <code>mod_rewrite</code> URLs do NOT contain query string parameters, making them more portable/compatible with other software applications and/or plugins for WordPress. If you\'re integrating with JW Player, you MUST use <code>rewrite="yes"</code>.</li>' . "\n";
         echo '<li><code>rewrite_base=""</code> Defaults to <code>[empty]</code>. If <code>rewrite_base="' . esc_attr(site_url("/")) . '"</code>, s2Member will generate a File Download URL that takes full advantage of s2Member\'s Advanced Mod Rewrite functionality, and it will use the rewrite base URL as a prefix. This could be useful on some WordPress installations that use advanced directory structures. It could also be useful for site owners using virtual directories that point to <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code>. Note, if <code>rewrite_base</code> is set, s2Member will automatically force <code>rewrite="yes"</code> for you.</li>' . "\n";
         echo '<li><code>skip_confirmation="no"</code> Defaults to <code>no</code>. If <code>skip_confirmation="1|on|yes|true"</code>, s2Member will generate a File Download URL which contains a directive, telling s2Member NOT to introduce any JavaScript confirmation prompts on your site, for this File Download URL. Please note, s2Member will automatically detect links, anywhere in your content, and/or anywhere in your theme files, that contain <code>s2member_file_download</code> or <code>s2member-files</code>. Whenever a logged-in Member clicks a link that contains <code>s2member_file_download</code> or <code>s2member-files</code>, the system will politely ask the User to confirm the download using a very intuitive JavaScript confirmation prompt, which contains specific details about your configured download limitations. This way your Members will be aware of how many files they\'ve downloaded in the current period; and they\'ll be able to make a conscious decision about whether to proceed with a specific download or not.</li>' . "\n";
         echo '<li><code>url_to_storage_source="no"</code> Defaults to <code>no</code> with <code>[s2File /]</code> Shortcode. Defaults to <code>yes</code> with <code>[s2Stream /]</code> Shortcode. If <code>url_to_storage_source="1|on|yes|true"</code>, s2Member will generate a File Download URL which points directly to the storage source. This is only functional with Amazon S3 and/or CloudFront integrations. If you create a URL that points directly to the storage source <em>(i.e. points directly to Amazon S3 or CloudFront)</em>, s2Member will NOT be able to further authenticate the current User/Member; and, s2Member will NOT be able to count the File Download against the current User\'s account record, because the URL being generated does not pass back through s2Member at all, it points directly to the storage source. For this reason, if you set <code>url_to_storage_source="true"</code>, you should also set <code>check_user="******"</code> and <code>count_against_user="******"</code>, telling s2Member to authenticate the current User, and if authenticated, count this File Download URL against the current User\'s account record in real-time <em>(i.e. as the URL is being generated) </em>, while it still has a chance to do so. This Shortcode Attribute is useful when you stream files over the RTMP protocol; where an <code>http://</code> URL is not feasible. It also helps in situations where a 3rd-party software application will not work as intended, with s2Member\'s internal redirection to Amazon S3/CloudFront files. Important, when <code>check_user="******"</code> and/or <code>count_against_user="******"</code>, the Shortcode will return an empty and/or null object value in situations where the current User/Member does NOT have access to the file.</li>' . "\n";
         echo '<li><code>count_against_user="******"</code> Defaults to <code>no</code> with <code>[s2File /]</code> Shortcode. Defaults to <code>yes</code> with <code>[s2Stream /]</code> Shortcode. If <code>count_against_user="******"</code>, it will automatically force <code>check_user="******"</code> as well. In other words, s2Member will authenticate the current User, and if authenticated, count this File Download URL against the current User\'s account record in real-time <em>(i.e. as the URL is being generated) </em>. This is off by default with the <code>[s2File /]</code> Shortcode. By default, s2Member will simply generate a File Download URL, and upon a User/Member clicking the URL, s2Member will authenticate the User/Member at that time, count the File Download against their account record, and serve the File Download. In other words, under normal circumstances, there is no reason to set <code>check_user="******"</code> and/or <code>count_against_user="******"</code> when generating the URL itself. However, this is a useful Shortcode Attribute when <code>url_to_storage_source="true"</code>. Please note, when <code>check_user="******"</code> and/or <code>count_against_user="******"</code>, the Shortcode will return an empty and/or null object value in situations where the current User/Member does NOT have access to the file.</li>' . "\n";
         echo '<li><code>check_user="******"</code> Defaults to <code>no</code> with <code>[s2File /]</code> Shortcode. Defaults to <code>yes</code> with <code>[s2Stream /]</code> Shortcode. If <code>check_user="******"</code>, s2Member will authenticate the current User before allowing the File Download URL to be generated. This is off by default with the <code>[s2File /]</code> Shortcode. By default, s2Member will simply generate a File Download URL, and upon a User/Member clicking the URL, s2Member will authenticate the User/Member at that time, and serve the File Download to the User/Member. In other words, under normal circumstances, there is no reason to set <code>check_user="******"</code> and/or <code>count_against_user="******"</code> when generating the URL itself. However, this IS a useful Shortcode Attribute when <code>url_to_storage_source="true"</code>. Please note, when <code>check_user="******"</code> and/or <code>count_against_user="******"</code>, the Shortcode will return an empty and/or null object value in situations where the current User/Member does NOT have access to the file.</li>' . "\n";
         echo '<li><code>get_streamer_json="no"</code> Defaults to <code>no</code>. N/A with <code>[s2Stream /]</code> Shortcode. If <code>get_streamer_json="1|on|yes|true"</code>, the <code>[s2File /]</code> Shortcode will return a JSON object for JavaScript notation, making it possible to integrate the <code>[s2File /]</code> Shortcode into JavaScript routines that configure streaming media players. For further details, please review the section above: <code>JW Player &amp; RTMP Protocol Examples</code>. Note, if you set <code>get_streamer_json="true"</code>, s2Member will automatically force <code>url_to_storage_source="true"</code> and <code>stream="true"</code>. For that reason, you should carefully review the details and warning above regarding <code>url_to_storage_source</code>. If you set <code>get_streamer_json="true"</code>, you should also set <code>check_user="******"</code> and <code>count_against_user="******"</code>.</li>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_shortcode_attrs_s2file_lis", get_defined_vars());
         echo '</ul>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4 style="margin:0;">Additional <code>[s2Stream /]</code> Shortcode Attributes:</h4>' . "\n";
         echo '<p style="margin:0;"><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/jwplayer-s2stream-shortcodes/" target="_blank" rel="external">JW Player w/ <code>[s2Stream /]</code> Shortcodes</a>.</p>' . "\n";
         echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_file_download_url()" target="_blank" rel="external">s2member_file_download_url()</a> for PHP integration.</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>file_download="video.mp4"</code> Location of the audio/video file, relative to the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory; or, relative to the root of your Amazon S3 Bucket, when applicable.</li>' . "\n";
         echo '<li><code>player="jwplayer-v6-rtmp"</code> Required. Current supported players in this Shortcode include: <code>jwplayer-v6</code> (works with any audio/video file, and you do NOT need to have Amazon  S3 or CloudFront integrated for this to work), <code>jwplayer-v6-rtmp</code> (streams with the RTMP protocol, plus there is a full download fallback of the source file if streaming is not possible on a particular device; this requires both Amazon S3 and CloudFront integration), <code>jwplayer-v6-rtmp-only</code> (streams with the RTMP protocol only, with no access to the source file, only to the RTMP stream; this requires both Amazon S3 and CloudFront integration).</li>' . "\n";
         echo '<li><code>player_id=""</code> Optional. HTML div ID for the audio/video player. Defaults to a unique ID generated by s2Member for each instance of your Shortcode.</li>' . "\n";
         echo '<li><code>player_path="/jwplayer/jwplayer.js"</code> Required. Path to the player\'s JavaScript file (ex: <code>/jwplayer/jwplayer.js</code> — you should upload the <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">/jwplayer</a> folder to the root of your web directory).</li>' . "\n";
         echo '<li><code>player_{setting}=""</code> Optional. Any additional configuration attributes supported by your audio/video player, prefixed with <code>player_</code>. For JW Player v6, see <a href="http://www.longtailvideo.com/support/jw-player/28839/embedding-the-player" target="_blank" rel="external">this article please</a>. Examples: <code>player_width="480"</code>, <code>player_height="270"</code>, <code>player_title="My Video"</code>, <code>player_description="A video about something."</code>, <code>player_image="http://www.example.com/wp-content/uploads/video-preview.jpg"</code>, <code>player_mediaid="video_ei0wsx23"</code>, <code>player_autostart="true"</code>, <code>player_skin="/jwplayer/my-skin.xml"</code>, <code>player_key="my-license-key"</code>, <code>player_captions="{file:\'/assets/captions-en.vtt\',label:\'English\'}"</code> (<em>With <a href="http://www.longtailvideo.com/support/jw-player/28845/adding-video-captions" target="_blank" rel="external">Captions</a>, you can exclude the square array brackets to avoid Shortcode parsing issues. s2Member will automatically wrap your Caption objects with square array brackets.</em>). Please note that "Advanced Options Blocks" listed on <a href="http://www.longtailvideo.com/support/jw-player/28839/embedding-the-player" target="_blank" rel="external">this page</a> are NOT supported here. For those, please use: <code>player_option_blocks=""</code> (see below).</li>' . "\n";
         echo '<li><code>player_option_blocks=""</code> Optional. Any "Advanced Option Blocks" supported by your audio/video player. For JW Player v6, see <a href="http://www.longtailvideo.com/support/jw-player/28839/embedding-the-player" target="_blank" rel="external">this article please</a>. Here are some examples: <code>player_option_blocks="sharing:{}"</code>, <code>player_option_blocks="sharing:{}, logo: {file: \'/logo.png\', link: \'http://example.com\'}"</code>. Or: <code>player_option_blocks="c2hhcmluZzoge30="</code> (base64 encoded version of <code>sharing:{}</code>). Please note that "Advanced Options Blocks" can be defined in plain text or with a <a href="http://www.base64encode.org/" target="_blank" rel="external">base64 encoded string</a>. Advanced Option Blocks are JavaScript objects with properties. If you have trouble defining JavaScript object properties inside a Shortcode Attribute, please use <a href="http://www.base64encode.org/" target="_blank" rel="external">this tool</a> to base64 encode your Advanced Option Blocks, so that you end up with a string that\'s compatible with Shortcode Attributes.</li>' . "\n";
         echo '<li>Please check the <strong>Shortcode Attributes</strong> Tab in <a href="http://www.s2member.com/kb/jwplayer-s2stream-shortcodes/#using-s2stream-shortcodes" target="_blank" rel="external">this KB article</a> for further details on everything here.</li>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_shortcode_attrs_s2stream_lis", get_defined_vars());
         echo '</ul>' . "\n";
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
         echo '</tbody>' . "\n";
         echo '</table>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4 style="margin:0;"><code>[s2Key /]</code> Shortcode Attributes:</h4>' . "\n";
         echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_file_download_key()" target="_blank" rel="external">s2member_file_download_key()</a> for PHP integration.</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>file_download="file.zip"</code> Location of the file, relative to the <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/</code> directory; or, relative to the root of your Amazon S3 Bucket, when applicable.</li>' . "\n";
         echo '<li><code>directive=""</code> Defaults to <code>[empty]</code>. If <code>directive="ip-forever|universal"</code>, s2Member will return a special File Download Key. If you set <code>directive="ip-forever"</code>, the File Download Key that s2Member generates will last forever, for a specific IP Address; otherwise, by default, all File Download Keys expire after 24 hours automatically. If you set <code>directive="universal"</code>, s2Member will generate a File Download Key that is good for anyone/everyone forever, with NO restrictions on who/where/when a file is accessed <em>(e.g. be careful with this one)</em>.</li>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_shortcode_attrs_s2key_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__s2member_during_down_ops_page_during_left_sections_after_shortcode_attrs", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_gzip_conflicts", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_gzip_conflicts", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Preventing GZIP Conflicts On Server">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-gzip-conflicts-section">' . "\n";
         echo '<h3>Preventing GZIP Conflicts On Server (Instructions)</h3>' . "\n";
         echo '<p>Protected files served by s2Member through PHP scripts, are already compressed. Therefore, <a href="http://code.google.com/speed/articles/gzip.html" target="_blank" rel="nofollow external xlink">GZIP compression</a> is not needed during protected file delivery. Some web servers (i.e. Apache, LiteSpeed, and similar) include GZIP compression rules through server-side extensions, like <code>mod_deflate</code> for example. While s2Member encourages the use of extensions like <code>mod_deflate</code>, it is best to disable GZIP automatically (i.e. temporarily) during s2Member\'s delivery of a protected file through a PHP script. This avoids conflicts on the server which might otherwise lead to corrupted file downloads. s2Member makes a valiant effort to accomplish this via PHP, all on its own. However, it never hurts to add this section of code to the root <code>.htaccess</code> file for your WordPress installation. Optional, but highly recommended.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_gzip_conflicts", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p style="margin:0; font-weight:bold;">s2Member automatically adds this to your <code>.htaccess</code> file upon activation of the plugin.</p>' . "\n";
         echo '<p style="margin:0;">The following <code>mod_rewrite</code> rule goes inside this file: <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path(ABSPATH . ".htaccess")) . '</code></p>' . "\n";
         echo '<pre class="code"><code>' . esc_html(trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_no_gzip_htaccess"])))) . '</code></pre>';
         echo '<p><strong>* Tip:</strong> this covers all types of integration with s2Member File Downloads, even if you\'re using s2Member\'s Advanced Mod Rewrite Linkage.</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_gzip_conflicts", get_defined_vars());
     }
     if (apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_custom_capability_files", !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) {
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_custom_capability_files", get_defined_vars());
         echo '<div class="ws-menu-page-group" title="Custom Capability &amp; Member Level Files">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-capability-files-section">' . "\n";
         echo '<h3>Restricting Files, Based On Custom Capabilities</h3>' . "\n";
         echo '<p>If you\'re NOT familiar with Custom Capabilities yet, please read: <code>Dashboard -› s2Member -› API Scripting -› Custom Capability Packages</code>. Once you understand the basic concept of Custom Capabilities &amp; Protected File Downloads, you\'ll see that (by default) s2Member does NOT handle File Download Protection with respect to Custom Capabilities. That\'s where Custom Capability Sub-directories come in.</p>' . "\n";
         echo '<p>You can create Custom Capability Sub-directories under: <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '</code>. For instance, if you have a Custom Capability <code>music</code>, you can place protected files that should ONLY be accessible to Members with <code>access_s2member_ccap_music</code>, inside: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music/</code>. Some examples are provided below.</p>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_custom_capability_files", get_defined_vars());
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Custom Capabilities:</strong> (music,videos)</p>' . "\n";
         echo '<p>Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos</code></p>' . "\n";
         echo '<p>Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music/file.mp3</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos/file.avi</code></p>' . "\n";
         echo '<p>Now, here are some link examples, using Custom Capability Sub-directories:</p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/ccap-file-downloads.x-php")) . '</p>' . "\n";
         echo '<p><em>These links will ONLY work for Members who are logged-in, with the proper Capabilities.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>Membership Levels:</strong> (this also works fine)</p>' . "\n";
         echo '<p>Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level0</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level1</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level2</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level3</code><br />Sub-Directory: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level4</code></p>' . "\n";
         echo '<p>Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level0/tiger.doc</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level1/zebra.pdf</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level2/elephant.doc</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level3/rhino.pdf</code><br />Protected File: <code>/' . esc_html(c_ws_plugin__s2member_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-level4/lion.doc</code></p>' . "\n";
         echo '<p>Now, here are some link examples, using Member Level Sub-directories:</p>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/level-file-downloads.x-php")) . '</p>' . "\n";
         echo '<p><em>These links will ONLY work for Members who are logged-in, with an adequate Membership Level.</em></p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_custom_capability_files", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_down_ops_page_after_left_sections", get_defined_vars());
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
Esempio n. 21
0
 /**
  * Generates s2Member Security Badge.
  *
  * @package s2Member\Utilities
  * @since 3.5
  *
  * @param string $v A variation number to display. Defaults to `1`.
  * @param bool   $no_cache Defaults to false. If true, the HTML markup will contain query string params that prevent caching.
  * @param bool   $display_on_failure . Defaults to false. True if we need to display the 'NOT yet verified' version inside admin panels.
  *
  * @return string HTML markup for display of s2Member Security Badge.
  */
 public static function s_badge_gen($v = '1', $no_cache = FALSE, $display_on_failure = FALSE)
 {
     if ($v && file_exists($template = dirname(dirname(__FILE__)) . '/templates/badges/s-badge.php')) {
         switch ((int) $v) {
             case 1:
                 // Variation number 1.
                 $width_height_attrs = 'width="200" height="55"';
                 $width_height_styles = 'width:200px; height:55px;';
                 break;
                 // Break switch loop.
             // Break switch loop.
             case 2:
                 // Variation number 2.
                 $width_height_attrs = 'width="180" height="58"';
                 $width_height_styles = 'width:180px; height:58px;';
                 break;
                 // Break switch loop.
             // Break switch loop.
             case 3:
                 // Variation number 3.
                 $width_height_attrs = 'width="80" height="15"';
                 $width_height_styles = 'width:80px; height:15px;';
                 break;
                 // Break switch loop.
             // Break switch loop.
             default:
                 // Default case handler.
                 $width_height_attrs = $width_height_styles = '';
                 break;
                 // Break switch loop.
         }
         $badge = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($template)));
         $badge = preg_replace('/%%v%%/i', (string) (int) $v, $badge);
         $badge = preg_replace('/%%site_url%%/i', urlencode(home_url()), $badge);
         $badge = preg_replace('/%%no_cache%%/i', $no_cache ? '&amp;no_cache=' . urlencode(mt_rand()) : '', $badge);
         $badge = preg_replace('/%%display_on_failure%%/i', $display_on_failure ? '&amp;display_on_failure=1' : '', $badge);
         $badge = preg_replace(array('/%%width_height_attrs%%/i', '/%%width_height_styles%%/i'), array($width_height_attrs, $width_height_styles), $badge);
     }
     return !empty($badge) ? $badge : '';
     // Return Security Badge.
 }
 /**
  * Shortcode `[s2Member-Pro-Google-Button /]`.
  *
  * @package s2Member\Google
  * @since 1.5
  *
  * @attaches-to ``add_shortcode("s2Member-Pro-Google-Button");``
  *
  * @param array $attr An array of Attributes.
  * @param string $content Content inside the Shortcode.
  * @param string $shortcode The actual Shortcode name itself.
  * @return string The resulting Google Button Code; HTML markup.
  */
 public static function sc_google_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     c_ws_plugin__s2member_no_cache::no_cache_constants(true);
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $jwt_attr = c_ws_plugin__s2member_utils_encryption::encrypt(serialize($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", "rrt" => "", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor", "success" => "", "failure" => ""), $attr);
     if ($attr["modify"] || $attr["cancel"]) {
         $default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-edit-button.png";
         $code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-cancellation-button.php")));
         $code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
         $code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
         $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(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__s2member_utils_urls::n_amps($href);
         }
         unset($href, $url, $m);
     } else {
         if ($attr["sp"]) {
             $default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
             $code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-sp-checkout-button.php")));
             $code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
             $code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
             $code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
             $code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
             $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
         } else {
             if ($attr["level"] === "*") {
                 $default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
                 $code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-ccaps-checkout-button.php")));
                 $code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
                 $code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
                 $code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
                 $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
             } else {
                 $default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
                 $code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-checkout-button.php")));
                 $code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
                 $code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
                 $code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
                 $code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
                 $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
             }
         }
     }
     return $code;
 }
 /**
  * Builds the options panel for this Payment Gateway.
  *
  * @package s2Member\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function alipay_ops_page()
 {
     c_ws_plugin__s2member_menu_pages::update_all_options();
     // Updates options.
     $logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"];
     if (!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir)))) {
         mkdir($logs_dir, 0777, true) . clearstatcache();
     }
     $htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"] . "/.htaccess";
     $htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir_htaccess"])));
     if (is_dir($logs_dir) && is_writable($logs_dir) && !file_exists($htaccess)) {
         file_put_contents($htaccess, $htaccess_contents) . clearstatcache();
     }
     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
         if (!is_dir($logs_dir)) {
             // If the security-enabled logs directory does not exist yet.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) does not exist. Please create this directory manually &amp; make it writable (chmod 777).', true);
         } else {
             if (!is_writable($logs_dir)) {
                 // If the logs directory is not writable yet.
                 c_ws_plugin__s2member_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) is not writable. Please make this directory writable (chmod 777).', true);
             }
         }
         if (!file_exists($htaccess)) {
             // If the .htaccess file has not been created yet.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
         } else {
             if (!preg_match("/deny from all/i", file_get_contents($htaccess))) {
                 // Else if the .htaccess file does not offer the required protection.
                 c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
             }
         }
     }
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/alipay-ops.inc.php";
     return;
 }
Esempio n. 24
0
 /**
  * Defines several API Constants for s2Member.
  *
  * These are also duplicated into the JavaScript API for s2Member.
  * Except for a few that would pose a security issue. Such as the PayPal API Credentials;
  * those are NOT included in the JavaScript API.
  *
  * @package s2Member\API_Constants
  * @since 3.5
  *
  * @attaches-to ``add_action('init');``
  *
  * @return null
  */
 public static function constants()
 {
     do_action('ws_plugin__s2member_before_constants', get_defined_vars());
     $c = array();
     // Initialize configuration values array.
     $links = c_ws_plugin__s2member_cache::cached_page_links();
     $user = is_user_logged_in() && is_object($user = wp_get_current_user()) && $user->ID ? $user : FALSE;
     $level = c_ws_plugin__s2member_user_access::user_access_level($user);
     $file_downloads = c_ws_plugin__s2member_files::user_downloads($user);
     $login_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url($user);
     $custom = $user ? get_user_option('s2member_custom', $user->ID) : '';
     $subscr_id = $user ? get_user_option('s2member_subscr_id', $user->ID) : '';
     $subscr_gateway = $user ? get_user_option('s2member_subscr_gateway', $user->ID) : '';
     $registration_ip = $user ? get_user_option('s2member_registration_ip', $user->ID) : '';
     $custom_fields = $user ? get_user_option('s2member_custom_fields', $user->ID) : array();
     $paid_registration_times = $user ? get_user_option('s2member_paid_registration_times', $user->ID) : array();
     $login_counter = $user ? (int) get_user_option('s2member_login_counter') : -1;
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_during_constants', get_defined_vars());
     unset($__refs, $__v);
     /**
      * Current version of s2Member.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_VERSION; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_VERSION" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_VERSION);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\WS_PLUGIN__S2MEMBER_VERSION
      */
     if (!defined('S2MEMBER_VERSION')) {
         define('S2MEMBER_VERSION', $c[] = (string) WS_PLUGIN__S2MEMBER_VERSION);
     }
     /**
      * The number of times the current User has logged into your site.
      *
      * Negative `-1` through number of times logged-in.
      * Negative `-1` indicates they are NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_LOGIN_COUNTER; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_LOGIN_COUNTER" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_LOGIN_COUNTER);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 110720
      *
      * @var int
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_login_counter')`
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_LOGIN_COUNTER')) {
         define('S2MEMBER_CURRENT_USER_LOGIN_COUNTER', $c[] = (int) $login_counter);
     }
     /**
      * Is the current User logged-in at all.
      *
      * True if the current User IS logged-in, else false.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php
      * if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN)
      *   echo 'You ARE logged in.';
      * !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2If constant(S2MEMBER_CURRENT_USER_IS_LOGGED_IN)]
      *   You ARE logged-in.
      * [/s2If]
      *
      * <script type="text/javascript">
      *   if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN)
      *      document.write('You ARE logged-in.');
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var bool
      *
      * @see s2Member\API_Functions\is_user_not_logged_in()
      * @see http://codex.wordpress.org/Function_Reference/is_user_logged_in is_user_logged_in()
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_IS_LOGGED_IN')) {
         define('S2MEMBER_CURRENT_USER_IS_LOGGED_IN', $c[] = $user ? TRUE : FALSE);
     }
     /**
      * Is the current User logged-in as a Member.
      *
      * True if the current User IS logged-in with a Membership Level greater than `0`, else false.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php
      * if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER)
      *   echo 'You ARE logged in at Level #1 or higher.';
      * !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2If constant(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER)]
      *   You ARE logged in at Level #1 or higher.
      * [/s2If]
      *
      * <script type="text/javascript">
      *   if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER)
      *      document.write('You ARE logged in at Level #1 or higher.');
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var bool
      *
      * @see s2Member\API_Functions\is_user_not_logged_in()
      * @see http://codex.wordpress.org/Function_Reference/is_user_logged_in is_user_logged_in()
      *
      * @see s2Member\API_Functions\user_is()
      * @see s2Member\API_Functions\user_is_not()
      *
      * @see s2Member\API_Functions\current_user_is()
      * @see s2Member\API_Functions\current_user_is_not()
      * @see s2Member\API_Functions\current_user_is_for_blog()
      * @see s2Member\API_Functions\current_user_is_not_for_blog()
      *
      * @see s2Member\API_Functions\current_user_cannot()
      * @see s2Member\API_Functions\current_user_cannot_for_blog()
      * @see http://codex.wordpress.org/Function_Reference/user_can user_can()
      * @see http://codex.wordpress.org/Function_Reference/current_user_can current_user_can()
      * @see http://codex.wordpress.org/Function_Reference/current_user_can_for_blog current_user_can_for_blog()
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_access_role')`
      * @see `get_user_field('s2member_access_level')`
      * @see `get_user_field('s2member_access_label')`
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER')) {
         define('S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER', $c[] = $user && $level >= 1 ? TRUE : FALSE);
     }
     /**
      * The current User's Membership Access Level.
      *
      * Negative `-1` through max Membership Level number.
      * Negative `-1` indicates they are NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LEVEL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_ACCESS_LEVEL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_access_role')`
      * @see `get_user_field('s2member_access_level')`
      * @see `get_user_field('s2member_access_label')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LABEL
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_ACCESS_LEVEL')) {
         define('S2MEMBER_CURRENT_USER_ACCESS_LEVEL', $c[] = (int) $level);
     }
     /**
      * The current User's Membership Access Label.
      *
      * As configured by the site owner. Each Membership Level is associated with a Membership Label
      * *(i.e., Bronze, Silver, Gold, Platinum)*, or whatever the site owner has configured.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_ACCESS_LABEL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_ACCESS_LABEL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_access_role')`
      * @see `get_user_field('s2member_access_level')`
      * @see `get_user_field('s2member_access_label')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LEVEL
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_ACCESS_LABEL')) {
         define('S2MEMBER_CURRENT_USER_ACCESS_LABEL', $c[] = (string) @$GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $level . '_label']);
     }
     /**
      * The current User's Paid Subscription ID (when applicable).
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_SUBSCR_ID; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_SUBSCR_ID" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_SUBSCR_ID);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_subscr_id')`
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      * @see `get_user_option('s2member_subscr_id')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_SUBSCR_ID')) {
         define('S2MEMBER_CURRENT_USER_SUBSCR_ID', $c[] = $user ? (string) $subscr_id : '');
     }
     /**
      * The current User's Paid Subscription ID (when applicable);
      * otherwise, this will contain their WordPress User ID.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_subscr_or_wp_id')`
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      * @see `get_user_option('s2member_subscr_id')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID')) {
         define('S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID', $c[] = $user ? $subscr_id ? (string) $subscr_id : (string) $user->ID : '');
     }
     /**
      * The current User's Paid Subscription Gateway Code (when applicable).
      *
      * Usually one of these values: `paypal`, `authnet`, `clickbank`, `google`, `ccbill`, `alipay`.
      *
      * An empty string if NOT logged-in, or if NOT a paying Member.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_subscr_gateway')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      * @see `get_user_option('s2member_subscr_gateway')`
      */
     if (!defined('S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY')) {
         define('S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY', $c[] = $user ? (string) $subscr_gateway : '');
     }
     /**
      * The current User's Custom String, associated with their Profile.
      *
      * For paying Members, this should always start with the installation domain name.
      * This is taken from the `custom=""` Attribute in your Button/Form Shortcode.
      *
      * Other pipe delimited values may follow the installation domain name, if configured by the site owner.
      * For instance, this might be equal to something like: `www.example.com|cv1|cv2|cv3`.
      *
      * An empty string if NOT logged-in, or if NOT a paying Member.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_CUSTOM; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_CUSTOM" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_CUSTOM);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_custom')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      * @see `get_user_option('s2member_custom')`
      */
     if (!defined('S2MEMBER_CURRENT_USER_CUSTOM')) {
         define('S2MEMBER_CURRENT_USER_CUSTOM', $c[] = $user ? (string) $custom : '');
     }
     /**
      * The current User's Registration Time.
      *
      * The Registration Time, is the time at which the Username was created for the account, that's it.
      * There's nothing special about this. This simply returns a {@link http://en.wikipedia.org/wiki/Unix_time Unix Timestamp}.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_REGISTRATION_TIME; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_TIME" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_REGISTRATION_TIME);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_registration_time()
      *
      * @see s2Member\API_Functions\s2member_paid_registration_time()
      * @see `s2member_paid_registration_time('level1')`
      *
      * @see s2Member\API_Functions\get_user_field()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_DAYS
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      */
     if (!defined('S2MEMBER_CURRENT_USER_REGISTRATION_TIME')) {
         define('S2MEMBER_CURRENT_USER_REGISTRATION_TIME', $c[] = $user && $user->user_registered ? (int) strtotime($user->user_registered) : 0);
     }
     /**
      * The current User's first Paid Registration Time; regardless of which paid Level they gained access to.
      *
      * **NOTE** A Paid Registration Time, is NOT necessarily related specifically to a Payment.
      * s2Member records a Paid Registration Time, anytime a User acquires paid Membership Level Access.
      *
      * In other words, if you create a new User inside your Dashboard at a Membership Level greater than Level #0,
      * s2Member will record a Paid Registration Time immediately, because Membership Levels > 0, are reserved for paying Members.
      * s2Member monitors changes to all User accounts, and records the first Paid Registration Time for each Member, at each paid Membership Level.
      * So, s2Member stores the first Time a Member reaches each Level of paid access; and s2Member does NOT care if they *actually* paid, or not.
      *
      * If the current User has never been at a paid Membership Level, this will be equal to `0`.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME);
      * </script>
      * ```
      *
      * If you need to know the last time an actual payment was received, please use ``get_user_option ('s2member_last_payment_time')``.
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_registration_time()
      *
      * @see s2Member\API_Functions\s2member_paid_registration_time()
      * @see `s2member_paid_registration_time('level1')`
      *
      * @see s2Member\API_Functions\get_user_field()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_TIME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_DAYS
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      */
     if (!defined('S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME')) {
         define('S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME', $c[] = $user && (int) $paid_registration_times['level'] ? (int) $paid_registration_times['level'] : 0);
     }
     /**
      * The number of days the current User has been a paid Member.
      *
      * **NOTE** This is calculated using the first Paid Registration Time.
      * A Paid Registration Time, is NOT necessarily related specifically to a Payment.
      * s2Member records a Paid Registration Time, anytime a User acquires paid Membership Level Access.
      *
      * In other words, if you create a new User inside your Dashboard at a Membership Level greater than Level #0,
      * s2Member will record a Paid Registration Time immediately, because Membership Levels > 0, are reserved for paying Members.
      * s2Member monitors changes to all User accounts, and records the first Paid Registration Time for each Member, at each paid Membership Level.
      * So, s2Member stores the first Time a Member reaches each Level of paid access; and s2Member does NOT care if they *actually* paid, or not.
      *
      * If the current User has never been at a paid Membership Level, this will be equal to `0`.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS);
      * </script>
      * ```
      *
      * If you need to know the last time an actual payment was received, please use ``get_user_option ('s2member_last_payment_time')``.
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_registration_time()
      *
      * @see s2Member\API_Functions\s2member_paid_registration_time()
      * @see `s2member_paid_registration_time('level1')`
      *
      * @see s2Member\API_Functions\get_user_field()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_TIME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_DAYS
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      */
     if (!defined('S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS')) {
         define('S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS', $c[] = $user && (int) $paid_registration_times['level'] ? (int) floor((strtotime('now') - (int) $paid_registration_times['level']) / 86400) : 0);
     }
     /**
      * The number of days the current User has had an account, period.
      *
      * **NOTE** This is calculated with Registration Time.
      * The Registration Time, is the time at which the Username was created for the account, that's it.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_registration_time()
      *
      * @see s2Member\API_Functions\s2member_paid_registration_time()
      * @see `s2member_paid_registration_time('level1')`
      *
      * @see s2Member\API_Functions\get_user_field()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_TIME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS
      *
      * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
      */
     if (!defined('S2MEMBER_CURRENT_USER_REGISTRATION_DAYS')) {
         define('S2MEMBER_CURRENT_USER_REGISTRATION_DAYS', $c[] = $user && $user->user_registered ? (int) floor((strtotime('now') - strtotime($user->user_registered)) / 86400) : 0);
     }
     /**
      * The current User's Display Name.
      *
      * This is usually a name they prefer to be known by publicly.
      * Some Users/Members prefer to use their First Name as the Display Name, and keep their Last Name private.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_DISPLAY_NAME; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_DISPLAY_NAME);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('display_name')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_DISPLAY_NAME')) {
         define('S2MEMBER_CURRENT_USER_DISPLAY_NAME', $c[] = $user ? (string) $user->display_name : '');
     }
     /**
      * The current User's First Name.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_FIRST_NAME; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_FIRST_NAME);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('first_name')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_FIRST_NAME')) {
         define('S2MEMBER_CURRENT_USER_FIRST_NAME', $c[] = $user ? (string) $user->first_name : '');
     }
     /**
      * The current User's Last Name.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_LAST_NAME; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_LAST_NAME" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_LAST_NAME);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('last_name')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_LAST_NAME')) {
         define('S2MEMBER_CURRENT_USER_LAST_NAME', $c[] = $user ? (string) $user->last_name : '');
     }
     /**
      * The current User's Username.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_LOGIN; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_LOGIN" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_LOGIN);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('user_login')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_LOGIN')) {
         define('S2MEMBER_CURRENT_USER_LOGIN', $c[] = $user ? (string) $user->user_login : '');
     }
     /**
      * The current User's Email Address.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_EMAIL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_EMAIL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('user_email')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_EMAIL')) {
         define('S2MEMBER_CURRENT_USER_EMAIL', $c[] = $user ? (string) $user->user_email : '');
     }
     /**
      * The current User's IP Address (even if/when NOT logged-in).
      *
      * This is the current IP Address, taken from ``$_SERVER['REMOTE_ADDR']``.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_IP; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_IP" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_IP);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_registration_ip')`
      * @see `get_user_field('ip')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://www.php.net/manual/en/reserved.variables.server.php Superglobal $_SERVER
      * @see `$_SERVER['REMOTE_ADDR']`
      */
     if (!defined('S2MEMBER_CURRENT_USER_IP')) {
         define('S2MEMBER_CURRENT_USER_IP', $c[] = (string) @$_SERVER['REMOTE_ADDR']);
     }
     /**
      * IP Address the current User had during registration.
      *
      * This is the IP Address the User had at the time they registered.
      * It's useful when you need to know the original IP Address they used.
      * For instance, this is needed by some affiliate tracking systems; such as iDevAffiliate.
      *
      * An empty string if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_REGISTRATION_IP; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_IP" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_REGISTRATION_IP);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_registration_ip')`
      * @see `get_user_field('ip')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://www.php.net/manual/en/reserved.variables.server.php Superglobal $_SERVER
      * @see `$_SERVER['REMOTE_ADDR']`
      */
     if (!defined('S2MEMBER_CURRENT_USER_REGISTRATION_IP')) {
         define('S2MEMBER_CURRENT_USER_REGISTRATION_IP', $c[] = $user ? (string) $registration_ip : '');
     }
     /**
      * The current User's WordPress User ID.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_ID; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_ID" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_ID);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('id')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_ID')) {
         define('S2MEMBER_CURRENT_USER_ID', $c[] = $user ? (int) $user->ID : 0);
     }
     /**
      * The current User's fields, provided by s2Member.
      *
      * This holds a JSON-encoded array, containing these array keys:
      *
      * o `id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID}
      * o `ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP}
      * o `reg_ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP}
      * o `email` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL}
      * o `login` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN}
      * o `first_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME}
      * o `last_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME}
      * o `display_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME}
      * o `subscr_id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID}
      * o `subscr_or_wp_id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID}
      * o `subscr_gateway` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY}
      * o `custom` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM}
      * o and any Custom Registration/Profile Fields configured by the site owner.
      *
      * This will be an empty JSON-encoded array if NOT logged-in.
      *
      * ———— Code Sample ( Using ``json_decode(JSON, true)`` ) ————
      * ```
      * <!php
      * $fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
      * echo $fields['email']; # The current User's Email Address.
      * echo $fields['my_unique_field_id']; # A Custom Registration/Profile Field configured by the site owner.
      * !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get user_field="id" /]
      * [s2Get user_field="ip" /]
      * [s2Get user_field="reg_ip" /]
      * [s2Get user_field="email" /]
      * [s2Get user_field="login" /]
      * [s2Get user_field="first_name" /]
      * [s2Get user_field="last_name" /]
      * [s2Get user_field="display_name" /]
      * [s2Get user_field="s2member_subscr_id" /]
      * [s2Get user_field="s2member_subscr_wp_id" /]
      * [s2Get user_field="s2member_subscr_gateway" /]
      * [s2Get user_field="s2member_custom" /]
      * [s2Get user_field="my_custom_field_id" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_FIELDS.id);
      *   document.write(S2MEMBER_CURRENT_USER_FIELDS.display_name);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      */
     if (!defined('S2MEMBER_CURRENT_USER_FIELDS')) {
         define('S2MEMBER_CURRENT_USER_FIELDS', $c[] = $user ? json_encode(array_merge(array('id' => S2MEMBER_CURRENT_USER_ID, 'ip' => S2MEMBER_CURRENT_USER_IP, 'reg_ip' => S2MEMBER_CURRENT_USER_REGISTRATION_IP, 'email' => S2MEMBER_CURRENT_USER_EMAIL, 'login' => S2MEMBER_CURRENT_USER_LOGIN, 'first_name' => S2MEMBER_CURRENT_USER_FIRST_NAME, 'last_name' => S2MEMBER_CURRENT_USER_LAST_NAME, 'display_name' => S2MEMBER_CURRENT_USER_DISPLAY_NAME, 'subscr_id' => S2MEMBER_CURRENT_USER_SUBSCR_ID, 'subscr_or_wp_id' => S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID, 'subscr_gateway' => S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY, 'custom' => S2MEMBER_CURRENT_USER_CUSTOM), (array) $custom_fields)) : json_encode(array()));
     }
     /**
      * Indicates the number of unique Files the current User is allowed to download every X days.
      *
      * `0` means no access to File Downloads has been made available to the User.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     if (!defined('S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED')) {
         define('S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED', $c[] = (int) $file_downloads['allowed']);
     }
     /**
      * Does the current User have access to unlimited File Downloads.
      *
      * A value of true means the current User's allowed downloads are >= `999999999`, and false means it is not.
      * This is useful if you are allowing unlimited ( i.e., `999999999+` ) Downloads on some Membership Levels.
      * You can display `Unlimited` instead of a numerical value.
      *
      * This will be false if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php
      * if(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)
      *   echo 'You have access to unlimited downloads.';
      * !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2If constant(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)]
      *   You have access to unlimited downloads.
      * [/s2If]
      *
      * <script type="text/javascript">
      *   if(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)
      *      document.write('You have access to unlimited downloads.');
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var bool
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     if (!defined('S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED')) {
         define('S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED', $c[] = $file_downloads['allowed'] >= 999999999 ? TRUE : FALSE);
     }
     /**
      * Indicates the number of unique Files the current User has downloaded in the last X days.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @note This does NOT include File Downloads accessed with an Advanced File Download Key.
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     if (!defined('S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY')) {
         define('S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY', $c[] = (int) $file_downloads['currently']);
     }
     /**
      * Indicates the X number of days, configured by the site owner; for the current User.
      *
      * This will be equal to `0` if NOT logged-in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * You are allowed to download <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED; !> files, every <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
      * You've downloaded <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !> files in the last <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * You are allowed to download [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED" /] files, every [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
      * You've downloaded [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /] files in the last [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
      *
      * You are allowed to download <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED);</script> files, every <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS);</script> days.
      * You've downloaded <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY);</script> files in the last <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS);</script> days.
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     if (!defined('S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS')) {
         define('S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS', $c[] = (int) $file_downloads['allowed_days']);
     }
     /**
      * The configured Page ID, for the Download Limit Exceeded Page.
      *
      * This will be equal to `0` if NOT yet configured.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     if (!defined('S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID')) {
         define('S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID', $c[] = (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page']);
     }
     /**
      * The configured Page ID, for the Membership Options Page.
      *
      * This will be equal to `0` if NOT yet configured.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options ⥱ Membership Options Page`
      */
     if (!defined('S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID')) {
         define('S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID', $c[] = (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page']);
     }
     /**
      * The configured Page ID, for the Login Welcome Page.
      *
      * This will be equal to `0` if NOT yet configured.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_LOGIN_WELCOME_PAGE_ID; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_LOGIN_WELCOME_PAGE_ID" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_LOGIN_WELCOME_PAGE_ID);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options ⥱ Login Welcome Page`
      */
     if (!defined('S2MEMBER_LOGIN_WELCOME_PAGE_ID')) {
         define('S2MEMBER_LOGIN_WELCOME_PAGE_ID', $c[] = (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page']);
     }
     /**
      * A URL, which leads to the Stand-Alone Profile Modification Page.
      *
      * This is always a reference to `/?s2member_profile=1` *(i.e., the Stand-Alone version)*.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options ⥱ Profile Modifications`
      */
     if (!defined('S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL')) {
         define('S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL', $c[] = (string) home_url('/?s2member_profile=1'));
     }
     /**
      * A URL, which leads to the Download Limit Exceeded Page; as configured by the site owner.
      *
      * If the site owner has not yet configured a Download Limit Exceeded Page, this defaults to the Home Page.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     if (!defined('S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL')) {
         define('S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL', $c[] = (string) $links['file_download_limit_exceeded_page']);
     }
     /**
      * A URL, which leads to the Membership Options Page; as configured by the site owner.
      *
      * If the site owner has not yet configured a Membership Options Page, this defaults to the Home Page.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options ⥱ Membership Options Page`
      */
     if (!defined('S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL')) {
         define('S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL', $c[] = (string) $links['membership_options_page']);
     }
     // Signup page.
     /**
      * The URL, which leads to the Login Welcome Page; as configured by the site owner.
      *
      * If the site owner has not yet configured a Login Welcome Page, this defaults to the Home Page.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_LOGIN_WELCOME_PAGE_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_LOGIN_WELCOME_PAGE_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_LOGIN_WELCOME_PAGE_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options ⥱ Login Welcome Page`
      */
     if (!defined('S2MEMBER_LOGIN_WELCOME_PAGE_URL')) {
         define('S2MEMBER_LOGIN_WELCOME_PAGE_URL', $c[] = $login_redirection_url ? (string) $login_redirection_url : (string) $links['login_welcome_page']);
     }
     /**
      * The URL, which logs the current User out of their account.
      *
      * This is the value provided by WordPress. It's the same as using ``wp_logout_url()``.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_LOGOUT_PAGE_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_LOGOUT_PAGE_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_LOGOUT_PAGE_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_logout_url wp_logout_url()
      */
     if (!defined('S2MEMBER_LOGOUT_PAGE_URL')) {
         define('S2MEMBER_LOGOUT_PAGE_URL', $c[] = (string) wp_logout_url());
     }
     // Triggers `wp_nonce_tick()`; watch out for dynamic changes.
     /**
      * The URL, where a User can log into their account.
      *
      * This is the value provided by WordPress. It's the same as using ``wp_login_url()``.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_LOGIN_PAGE_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_LOGIN_PAGE_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_LOGIN_PAGE_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_login_url wp_login_url()
      */
     if (!defined('S2MEMBER_LOGIN_PAGE_URL')) {
         define('S2MEMBER_LOGIN_PAGE_URL', $c[] = (string) wp_login_url());
     }
     /**
      * Each Membership Level (Label); as configured by the site owner.
      *
      * The defaults are as follows:
      * o Level #0 ``S2MEMBER_LEVEL0_LABEL`` = Free Subscriber
      * o Level #1 ``S2MEMBER_LEVEL1_LABEL`` = Bronze Member
      * o Level #2 ``S2MEMBER_LEVEL2_LABEL`` = Silver Member
      * o Level #3 ``S2MEMBER_LEVEL3_LABEL`` = Gold Member
      * o Level #4 ``S2MEMBER_LEVEL4_LABEL`` = Platinum Member
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_LEVEL0_LABEL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_LEVEL0_LABEL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_LEVEL0_LABEL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\get_user_field()
      * @see `get_user_field('s2member_access_role')`
      * @see `get_user_field('s2member_access_level')`
      * @see `get_user_field('s2member_access_label')`
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LEVEL
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LABEL
      *
      * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options ⥱ Membership Level (Labels)`
      */
     for ($n = 0; $n <= $GLOBALS['WS_PLUGIN__']['s2member']['c']['levels']; $n++) {
         if (!defined($S2MEMBER_LEVELn_LABEL = 'S2MEMBER_LEVEL' . $n . '_LABEL')) {
             define($S2MEMBER_LEVELn_LABEL, $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $n . '_label']);
         }
     }
     /**
      * File Downloads allowed at each Membership Level; as configured by the site owner.
      *
      * The defaults are as follows:
      * o Level #0 ``S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED`` = `0`
      * o Level #1 ``S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED`` = `0`
      * o Level #2 ``S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED`` = `0`
      * o Level #3 ``S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED`` = `0`
      * o Level #4 ``S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED`` = `0`
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     for ($n = 0; $n <= $GLOBALS['WS_PLUGIN__']['s2member']['c']['levels']; $n++) {
         if (!defined($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED = 'S2MEMBER_LEVEL' . $n . '_FILE_DOWNLOADS_ALLOWED')) {
             define($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED, $c[] = (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $n . '_file_downloads_allowed']);
         }
     }
     /**
      * File Download days, at each Membership Level; as configured by the site owner.
      *
      * The defaults are as follows:
      * o Level #0 ``S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
      * o Level #1 ``S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
      * o Level #2 ``S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
      * o Level #3 ``S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
      * o Level #4 ``S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * At Level #1, Members are allowed to download <!php echo S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED; !> files, every <!php echo S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS; !> days.
      * You are currently at Membership Level #<!php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; !>. You've downloaded <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !> files in the last <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * At Level #1, Members are allowed to download [s2Get constant="S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED" /] files, every [s2Get constant="S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS" /] days.
      * You are currently at Membership Level #[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LEVEL" /]. You've downloaded [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /] files in the last [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
      *
      * At Level #1, Members are allowed to download <script type="text/javascript">document.write(S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED);</script> files, every <script type="text/javascript">document.write(S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS);</script> days.
      * You are currently at Membership Level #<script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_ACCESS_LEVEL);</script>. You've downloaded <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY);</script> files in the last <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS);</script> days.
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var int
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     for ($n = 0; $n <= $GLOBALS['WS_PLUGIN__']['s2member']['c']['levels']; $n++) {
         if (!defined($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS = 'S2MEMBER_LEVEL' . $n . '_FILE_DOWNLOADS_ALLOWED_DAYS')) {
             define($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS, $c[] = (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $n . '_file_downloads_allowed_days']);
         }
     }
     /**
      * Inline File Download extensions; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Functions\s2member_user_downloads()
      * @see s2Member\API_Functions\s2member_total_downloads_of()
      * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
      *
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
      * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
      *
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
      * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
      *
      * @see `Dashboard ⥱ s2Member ⥱ Download Options`
      */
     if (!defined('S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS')) {
         define('S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_inline_extensions']);
     }
     /**
      * From: Name, for s2Member-specific emails; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_REG_EMAIL_FROM_NAME; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_REG_EMAIL_FROM_NAME" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_REG_EMAIL_FROM_NAME);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_REG_EMAIL_FROM_EMAIL
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options`
      */
     if (!defined('S2MEMBER_REG_EMAIL_FROM_NAME')) {
         define('S2MEMBER_REG_EMAIL_FROM_NAME', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']);
     }
     /**
      * From: Email Address, for s2Member-specific emails; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_REG_EMAIL_FROM_EMAIL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_REG_EMAIL_FROM_EMAIL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_REG_EMAIL_FROM_EMAIL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_REG_EMAIL_FROM_NAME
      *
      * @see `Dashboard ⥱ s2Member ⥱ General Options`
      */
     if (!defined('S2MEMBER_REG_EMAIL_FROM_EMAIL')) {
         define('S2MEMBER_REG_EMAIL_FROM_EMAIL', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email']);
     }
     /**
      * Full URL to PayPal IPN handler, provided by s2Member.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_NOTIFY_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_NOTIFY_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_PAYPAL_NOTIFY_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_RETURN_URL
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ IPN Integration`
      */
     if (!defined('S2MEMBER_PAYPAL_NOTIFY_URL')) {
         define('S2MEMBER_PAYPAL_NOTIFY_URL', $c[] = (string) home_url('/?s2member_paypal_notify=1'));
     }
     /**
      * Full URL to PayPal Auto-Return/PDT handler, provided by s2Member.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_RETURN_URL; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_RETURN_URL" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_PAYPAL_RETURN_URL);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_NOTIFY_URL
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Auto-Return/PDT Integration`
      */
     if (!defined('S2MEMBER_PAYPAL_RETURN_URL')) {
         define('S2MEMBER_PAYPAL_RETURN_URL', $c[] = (string) home_url('/?s2member_paypal_return=1'));
     }
     /**
      * PayPal Business Email Address; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_BUSINESS; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_BUSINESS" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_PAYPAL_BUSINESS);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Account Details`
      */
     if (!defined('S2MEMBER_PAYPAL_BUSINESS')) {
         define('S2MEMBER_PAYPAL_BUSINESS', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_business']);
     }
     /**
      * PayPal endpoint domain (changes when Sandbox Mode is enabled).
      *
      * o In Sandbox Mode, this is: `www.sandbox.paypal.com`.
      * o In Production Mode, this is: `www.paypal.com`.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_ENDPOINT; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_ENDPOINT" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_PAYPAL_ENDPOINT);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_ENDPOINT
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Account Details`
      */
     if (!defined('S2MEMBER_PAYPAL_ENDPOINT')) {
         define('S2MEMBER_PAYPAL_ENDPOINT', $c[] = $GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_sandbox'] ? 'www.sandbox.paypal.com' : 'www.paypal.com');
     }
     /**
      * PayPal API endpoint domain (changes when Sandbox Mode is enabled).
      *
      * o In Sandbox Mode, this is: `api-3t.sandbox.paypal.com`.
      * o In Production Mode, this is: `api-3t.paypal.com`.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_API_ENDPOINT; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_API_ENDPOINT" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_PAYPAL_API_ENDPOINT);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_ENDPOINT
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Account Details`
      */
     if (!defined('S2MEMBER_PAYPAL_API_ENDPOINT')) {
         define('S2MEMBER_PAYPAL_API_ENDPOINT', $c[] = $GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_sandbox'] ? 'api-3t.sandbox.paypal.com' : 'api-3t.paypal.com');
     }
     /**
      * PayPal API Username; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_API_USERNAME; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_API_USERNAME" /]
      *
      * NOTE: For security purposes,
      * this API Constant is NOT available as a JavaScript Global.
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Account Details`
      */
     if (!defined('S2MEMBER_PAYPAL_API_USERNAME')) {
         define('S2MEMBER_PAYPAL_API_USERNAME', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_api_username']);
     }
     /**
      * PayPal API Password; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_API_PASSWORD; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_API_PASSWORD" /]
      *
      * NOTE: For security purposes,
      * this API Constant is NOT available as a JavaScript Global.
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Account Details`
      */
     if (!defined('S2MEMBER_PAYPAL_API_PASSWORD')) {
         define('S2MEMBER_PAYPAL_API_PASSWORD', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_api_password']);
     }
     /**
      * PayPal API Signature; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_API_SIGNATURE; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_API_SIGNATURE" /]
      *
      * NOTE: For security purposes,
      * this API Constant is NOT available as a JavaScript Global.
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Account Details`
      */
     if (!defined('S2MEMBER_PAYPAL_API_SIGNATURE')) {
         define('S2MEMBER_PAYPAL_API_SIGNATURE', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_api_signature']);
     }
     /**
      * PayPal PDT Identity Token; as configured by the site owner.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN" /]
      *
      * NOTE: For security purposes,
      * this API Constant is NOT available as a JavaScript Global.
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_RETURN_URL
      * @see s2Member\API_Constants\S2MEMBER_PAYPAL_NOTIFY_URL
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Options ⥱ Auto-Return/PDT Integration`
      */
     if (!defined('S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN')) {
         define('S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN', $c[] = (string) $GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_identity_token']);
     }
     /**
      * PayPal value for Payment Buttons with input name: `invoice`.
      *
      * This can be used to auto-fill the `invoice` value in PayPal Button Codes, with a unique Code~IP combination.
      * However, in cases where multiple Buttons are displayed on the same page, the alternative {@link s2Member\API_Functions\s2member_value_for_pp_inv()} function should be used instead.
      *
      * Note. This API Constant is excluded from the ``$c[]`` hash calculation used in the generation of {@link s2Member\API_Constants\WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5}.
      * It MUST be excluded, because the value of this particular API Constant will change too often *(i.e., it changes, depending on microtime)*.
      * So, when including this API Constant in the JavaScript API as a Global, care must be taken to build an Invoice, using JavaScript
      * to calculate the unique time-based code, with something like: `Math.round (new Date ().getTime ())`.
      *
      * These five API Constants are special.
      * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
      *
      * They are used by the PayPal Button Generator for s2Member.
      *
      * The `INV` value can be used to auto-fill the `invoice` for PayPal Button Codes, with a unique Code~IP combination.
      * However, in cases where multiple Buttons are displayed on the same page, the alternative {@link s2Member\API_Functions\s2member_value_for_pp_inv()} function should be used instead.
      *
      * The `ON0/OS0` values, are how s2Member identifies an existing Member *(and/or a Free Subscriber)*, who is already logged-in
      * when they click a PayPal Modification Button that was generated for you by s2Member's Button Generator.
      *
      * Instead of forcing a Member *(and/or a Free Subscriber)* to re-register for a new account,
      * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
      * These three Button Code parameters: `on0`, `os0`, `modify`, 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.
      *
      * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal.
      *
      * Anyway, these five API Constants are just documented here for clarity;
      * you probably won't use any of these directly; the Button Generator pops them in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_VALUE_FOR_PP_INV; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_VALUE_FOR_PP_INV" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_VALUE_FOR_PP_INV);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 110720
      *
      * @var string
      *
      * @see s2Member\API_Functions\s2member_value_for_pp_inv()
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Buttons`
      */
     if (!defined('S2MEMBER_VALUE_FOR_PP_INV')) {
         define('S2MEMBER_VALUE_FOR_PP_INV', uniqid() . '~' . S2MEMBER_CURRENT_USER_IP);
     }
     /**
      * PayPal value for Payment Buttons with input name: `on0`.
      *
      * Used in PayPal Modification Buttons *(i.e., upgrades/downgrades)*.
      *
      * This auto-fills the `on0` value in PayPal Button Codes. If a Button Code is presented to a logged-in Member,
      * this will auto-fill the value for the `on0` input variable, with the string: "Referencing Customer ID".
      * Otherwise, it will be set to a default value of: "Originating Domain".
      *
      * These five API Constants are special.
      * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
      *
      * They are used by the PayPal Button Generator for s2Member.
      *
      * The `INV` value can be used to auto-fill the `invoice` for PayPal Button Codes, with a unique Code~IP combination.
      * However, in cases where multiple Buttons are displayed on the same page, the alternative {@link s2Member\API_Functions\s2member_value_for_pp_inv()} function should be used instead.
      *
      * The `ON0/OS0` values, are how s2Member identifies an existing Member *(and/or a Free Subscriber)*, who is already logged-in
      * when they click a PayPal Modification Button that was generated for you by s2Member's Button Generator.
      *
      * Instead of forcing a Member *(and/or a Free Subscriber)* to re-register for a new account,
      * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
      * These three Button Code parameters: `on0`, `os0`, `modify`, 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.
      *
      * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal.
      *
      * Anyway, these five API Constants are just documented here for clarity;
      * you probably won't use any of these directly; the Button Generator pops them in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Buttons`
      */
     if (!defined('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0')) {
         define('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0', $c[] = S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID ? 'Referencing Customer ID' : 'Originating Domain');
     }
     /**
      * PayPal value for Payment Buttons with input name: `os0`.
      *
      * Used in PayPal Modification Buttons *(i.e., upgrades/downgrades)*.
      *
      * This auto-fills the `os0` value in PayPal Button Codes. If a Button Code is presented to a logged-in Member,
      * this will auto-fill the value for the `os0` input variable, with the value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID}.
      * Otherwise, it will be set to a default value of ``$_SERVER['HTTP_HOST']`` *(the originating domain name)*.
      *
      * These five API Constants are special.
      * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
      *
      * They are used by the PayPal Button Generator for s2Member.
      *
      * The `INV` value can be used to auto-fill the `invoice` for PayPal Button Codes, with a unique Code~IP combination.
      * However, in cases where multiple Buttons are displayed on the same page, the alternative {@link s2Member\API_Functions\s2member_value_for_pp_inv()} function should be used instead.
      *
      * The `ON0/OS0` values, are how s2Member identifies an existing Member *(and/or a Free Subscriber)*, who is already logged-in
      * when they click a PayPal Modification Button that was generated for you by s2Member's Button Generator.
      *
      * Instead of forcing a Member *(and/or a Free Subscriber)* to re-register for a new account,
      * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
      * These three Button Code parameters: `on0`, `os0`, `modify`, 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.
      *
      * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal.
      *
      * Anyway, these five API Constants are just documented here for clarity;
      * you probably won't use any of these directly; the Button Generator pops them in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Buttons`
      */
     if (!defined('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0')) {
         define('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0', $c[] = S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID ? S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID : (string) @$_SERVER['HTTP_HOST']);
     }
     /**
      * PayPal value for Payment Buttons with input name: `on1`.
      *
      * This auto-fills the `on1` value in PayPal Button Codes.
      * This always contains the string: "Customer IP Address".
      *
      * These five API Constants are special.
      * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
      *
      * They are used by the PayPal Button Generator for s2Member.
      *
      * The `INV` value can be used to auto-fill the `invoice` for PayPal Button Codes, with a unique Code~IP combination.
      * However, in cases where multiple Buttons are displayed on the same page, the alternative {@link s2Member\API_Functions\s2member_value_for_pp_inv()} function should be used instead.
      *
      * The `ON0/OS0` values, are how s2Member identifies an existing Member *(and/or a Free Subscriber)*, who is already logged-in
      * when they click a PayPal Modification Button that was generated for you by s2Member's Button Generator.
      *
      * Instead of forcing a Member *(and/or a Free Subscriber)* to re-register for a new account,
      * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
      * These three Button Code parameters: `on0`, `os0`, `modify`, 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.
      *
      * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal.
      *
      * Anyway, these five API Constants are just documented here for clarity;
      * you probably won't use any of these directly; the Button Generator pops them in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Buttons`
      */
     if (!defined('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1')) {
         define('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1', $c[] = 'Customer IP Address');
     }
     /**
      * PayPal value for Payment Buttons with input name: `os1`.
      *
      * This auto-fills the `os1` value in PayPal Button Codes,
      * with the Customer's IP Address, via ``$_SERVER['REMOTE_ADDR']``.
      *
      * These five API Constants are special.
      * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
      * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
      *
      * They are used by the PayPal Button Generator for s2Member.
      *
      * The `INV` value can be used to auto-fill the `invoice` for PayPal Button Codes, with a unique Code~IP combination.
      * However, in cases where multiple Buttons are displayed on the same page, the alternative {@link s2Member\API_Functions\s2member_value_for_pp_inv()} function should be used instead.
      *
      * The `ON0/OS0` values, are how s2Member identifies an existing Member *(and/or a Free Subscriber)*, who is already logged-in
      * when they click a PayPal Modification Button that was generated for you by s2Member's Button Generator.
      *
      * Instead of forcing a Member *(and/or a Free Subscriber)* to re-register for a new account,
      * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
      * These three Button Code parameters: `on0`, `os0`, `modify`, 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.
      *
      * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal.
      *
      * Anyway, these five API Constants are just documented here for clarity;
      * you probably won't use any of these directly; the Button Generator pops them in.
      *
      * ———— Quick PHP Code Sample ————
      * ```
      * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; !>
      * ```
      * ———— Shortcode & JavaScript Equivalents ————
      * ```
      * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1" /]
      *
      * <script type="text/javascript">
      *   document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1);
      * </script>
      * ```
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      *
      * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1
      *
      * @see `Dashboard ⥱ s2Member ⥱ PayPal Buttons`
      */
     if (!defined('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1')) {
         define('S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1', $c[] = (string) @$_SERVER['REMOTE_ADDR']);
     }
     /*
     Allows other Constants to be calculated with their checksums included too.
     */
     $c = apply_filters('ws_plugin__s2member_during_constants_c', $c, get_defined_vars());
     /**
      * Used internally by s2Member to compare the value of all API Constants at once.
      *
      * @package s2Member\API_Constants
      * @since 3.5
      *
      * @var string
      */
     if (!defined('WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5')) {
         define('WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5', md5(serialize($c) . c_ws_plugin__s2member_utilities::ver_checksum()));
     }
     /*
     Calls the after Hook. Do NOT set Constants here.
     */
     do_action('ws_plugin__s2member_after_constants', get_defined_vars());
 }
 /**
  * Processes List Server removals for s2Member.
  *
  * @package s2Member\List_Servers
  * @since 3.5
  *
  * @param string     $role A WordPress Role ID/Name, such as `subscriber`, or `s2member_level1`.
  * @param int|string $level A numeric s2Member Access Level number.
  * @param string     $login Username for the User.
  * @param string     $pass Plain Text Password for the User.
  * @param string     $email Email address for the User.
  * @param string     $fname First Name for the User.
  * @param string     $lname Last Name for the User.
  * @param string     $ip IP Address for the User.
  * @param bool       $opt_out Defaults to false; must be set to true. Indicates the User IS opting out.
  * @param int|string $user_id A WordPress User ID, numeric string or integer.
  *
  * @return bool True if at least one List Server is processed successfully, else false.
  *
  * @todo Integrate {@link https://labs.aweber.com/docs/php-library-walkthrough AWeber's API}.
  * @todo Add a separate option for mail debugging; or consolidate?
  * @todo Integrate AWeber API (much like the MailChimp API).
  */
 public static function process_list_server_removals($role = '', $level = '', $login = '', $pass = '', $email = '', $fname = '', $lname = '', $ip = '', $opt_out = FALSE, $user_id = 0)
 {
     global $current_site, $current_blog;
     // For Multisite support.
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_process_list_server_removals', get_defined_vars());
     unset($__refs, $__v);
     if (c_ws_plugin__s2member_list_servers::list_servers_integrated() && ($args = func_get_args()) && $role && is_string($role) && is_numeric($level) && $login && is_string($login) && is_string($pass = (string) $pass) && $email && is_string($email) && is_email($email) && is_string($fname = (string) $fname) && is_string($lname = (string) $lname) && is_string($ip = (string) $ip) && is_bool($opt_out = (bool) $opt_out) && $opt_out && $user_id && is_numeric($user_id) && is_object($user = new WP_User($user_id)) && !empty($user->ID)) {
         $ccaps = implode(',', c_ws_plugin__s2member_user_access::user_access_ccaps($user));
         $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status();
         c_ws_plugin__s2member_email_configs::email_config_release();
         if (!empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['mailchimp_api_key']) && !empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $level . '_mailchimp_list_ids'])) {
             if (!class_exists('NC_MCAPI')) {
                 // Include the MailChimp API Class here.
                 include_once dirname(dirname(__FILE__)) . '/externals/mailchimp/nc-mcapi.inc.php';
             }
             $mcapi = new NC_MCAPI($GLOBALS['WS_PLUGIN__']['s2member']['o']['mailchimp_api_key'], TRUE);
             foreach (preg_split('/[' . "\r\n\t" . ';,]+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $level . '_mailchimp_list_ids']) as $mailchimp_list) {
                 $mailchimp = array('function' => __FUNCTION__, 'func_get_args' => $args, 'api_removal_method' => 'listUnsubscribe');
                 if ($mailchimp['list_id'] = trim(preg_replace('/\\:\\:.*$/', '', $mailchimp_list))) {
                     if ($mailchimp['api_removal_response'] = $mcapi->{$mailchimp['api_removal_method']}($mailchimp['list_id'], $email, $mailchimp['api_removal_delete_member'] = apply_filters('ws_plugin__s2member_mailchimp_removal_delete_member', FALSE, get_defined_vars()), $mailchimp['api_removal_send_goodbye'] = apply_filters('ws_plugin__s2member_mailchimp_removal_send_goodbye', FALSE, get_defined_vars()), $mailchimp['api_removal_send_notify'] = apply_filters('ws_plugin__s2member_mailchimp_removal_send_notify', FALSE, get_defined_vars()))) {
                         $mailchimp['api_removal_success'] = $removal_success = TRUE;
                     }
                     // Flag indicating that we DO have a successful removal; affects the function's overall return value.
                     $mailchimp['api_removal_properties'] = $mcapi;
                     // Include API instance too; as it contains some additional information after each method is processed (need this in the logs).
                     $logt = c_ws_plugin__s2member_utilities::time_details();
                     $logv = c_ws_plugin__s2member_utilities::ver_details();
                     $logm = c_ws_plugin__s2member_utilities::mem_details();
                     $log4 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\n" . 'User-Agent: ' . @$_SERVER['HTTP_USER_AGENT'];
                     $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
                     $log2 = is_multisite() && !is_main_site() ? 'mailchimp-api-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'mailchimp-api.log';
                     if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
                         if (is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
                             if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
                                 file_put_contents($logs_dir . '/' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($mailchimp, TRUE)) . "\n\n", FILE_APPEND);
                             }
                         }
                     }
                 }
             }
         }
         if (!empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['getresponse_api_key']) && !empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $level . '_getresponse_list_ids'])) {
             foreach (preg_split('/[' . "\r\n\t" . ';,]+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $level . '_getresponse_list_ids']) as $getresponse_list) {
                 $getresponse = array('function' => __FUNCTION__, 'func_get_args' => $args, 'api_removal_method' => 'delete_contact');
                 if ($getresponse['list_id'] = $getresponse['list'] = trim($getresponse_list)) {
                     $getresponse['api_method'] = 'get_contacts';
                     $getresponse['api_headers'] = array('Content-Type' => 'application/json');
                     $getresponse['api_params'] = array($GLOBALS['WS_PLUGIN__']['s2member']['o']['getresponse_api_key'], array('campaigns' => array($getresponse['list_id']), 'email' => array('EQUALS' => $email)));
                     $getresponse['api_request'] = json_encode(array('method' => $getresponse['api_method'], 'params' => $getresponse['api_params'], 'id' => uniqid('', TRUE)));
                     if (is_object($getresponse['api_response'] = json_decode(c_ws_plugin__s2member_utils_urls::remote('https://api2.getresponse.com', $getresponse['api_request'], array('headers' => $getresponse['api_headers'])))) && empty($getresponse['api_response']->error) && ($getresponse['api_response_contact_ids'] = array_keys((array) $getresponse['api_response']->result)) && ($getresponse['api_response_contact_id'] = $getresponse['api_response_contact_ids'][0])) {
                         $getresponse['api_method'] = 'delete_contact';
                         // Update method now.
                         $getresponse['api_params'] = array($GLOBALS['WS_PLUGIN__']['s2member']['o']['getresponse_api_key'], array('contact' => $getresponse['api_response_contact_id']));
                         $getresponse['api_request'] = json_encode(array('method' => $getresponse['api_method'], 'params' => $getresponse['api_params'], 'id' => uniqid('', TRUE)));
                         if (is_object($getresponse['api_response'] = json_decode(c_ws_plugin__s2member_utils_urls::remote('https://api2.getresponse.com', $getresponse['api_request'], array('headers' => $getresponse['api_headers'])))) && empty($getresponse['api_response']->error) && $getresponse['api_response']->result->deleted) {
                             $getresponse['api_success'] = $success = TRUE;
                         }
                     }
                     $logt = c_ws_plugin__s2member_utilities::time_details();
                     $logv = c_ws_plugin__s2member_utilities::ver_details();
                     $logm = c_ws_plugin__s2member_utilities::mem_details();
                     $log4 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\n" . 'User-Agent: ' . @$_SERVER['HTTP_USER_AGENT'];
                     $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
                     $log2 = is_multisite() && !is_main_site() ? 'getresponse-api-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'getresponse-api.log';
                     if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
                         if (is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
                             if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
                                 file_put_contents($logs_dir . '/' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($getresponse, TRUE)) . "\n\n", FILE_APPEND);
                             }
                         }
                     }
                 }
             }
         }
         if (!empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $level . '_aweber_list_ids'])) {
             foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $level . '_aweber_list_ids']) as $aweber_list) {
                 $aweber = array('function' => __FUNCTION__, 'func_get_args' => $args, 'wp_mail_removal_method' => 'listUnsubscribe');
                 if ($aweber['list_id'] = trim($aweber_list)) {
                     $aweber['removal_bcc'] = apply_filters('ws_plugin__s2member_aweber_removal_bcc', FALSE, get_defined_vars());
                     c_ws_plugin__s2member_email_configs::email_config();
                     // Email configs MUST be ON for removal requests.
                     // The `From:` address MUST match AWeber account. See: <http://www.aweber.com/faq/questions/62/Can+I+Unsubscribe+People+Via+Email%3F>.
                     if ($aweber['wp_mail_removal_response'] = wp_mail($aweber['list_id'] . '@aweber.com', $aweber['wp_mail_removal_sbj'] = apply_filters('ws_plugin__s2member_aweber_removal_sbj', 'REMOVE#' . $email . '#s2Member#' . $aweber['list_id'], get_defined_vars()), $aweber['wp_mail_removal_msg'] = 'REMOVE', $aweber['wp_mail_removal_headers'] = 'From: "' . preg_replace('/"/', "'", $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']) . '" <' . $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'] . '>' . ($aweber['removal_bcc'] ? "\r\n" . 'Bcc: ' . $aweber['removal_bcc'] : '') . "\r\n" . 'Content-Type: text/plain; charset=UTF-8')) {
                         $aweber['wp_mail_removal_success'] = $removal_success = TRUE;
                     }
                     // Flag indicating that we DO have a successful removal; affects the function's overall return value.
                     c_ws_plugin__s2member_email_configs::email_config_release();
                     $logt = c_ws_plugin__s2member_utilities::time_details();
                     $logv = c_ws_plugin__s2member_utilities::ver_details();
                     $logm = c_ws_plugin__s2member_utilities::mem_details();
                     $log4 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\n" . 'User-Agent: ' . @$_SERVER['HTTP_USER_AGENT'];
                     $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
                     $log2 = is_multisite() && !is_main_site() ? 'aweber-api-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'aweber-api.log';
                     if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
                         if (is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
                             if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
                                 file_put_contents($logs_dir . '/' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($aweber, TRUE)) . "\n\n", FILE_APPEND);
                             }
                         }
                     }
                 }
             }
         }
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action('ws_plugin__s2member_during_process_list_server_removals', get_defined_vars());
         unset($__refs, $__v);
         if ($email_configs_were_on) {
             c_ws_plugin__s2member_email_configs::email_config();
         }
         if ($user_id) {
             update_user_option($user_id, 's2member_opt_in', '0');
         }
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_after_process_list_server_removals', get_defined_vars());
     unset($__refs, $__v);
     return apply_filters('ws_plugin__s2member_process_list_server_removals', isset($removal_success) && $removal_success, get_defined_vars());
 }
 /**
  * Handles PayPal Return URLs.
  *
  * @package s2Member\PayPal
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection.
  */
 public static function paypal_return()
 {
     global $current_site, $current_blog;
     do_action("ws_plugin__s2member_before_paypal_return", get_defined_vars());
     if (!empty($_GET["s2member_paypal_return"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !empty($_GET["s2member_paypal_proxy"]))) {
         $custom_success_redirection = !empty($_GET["s2member_paypal_return_success"]) ? esc_html(trim(stripslashes($_GET["s2member_paypal_return_success"]))) : false;
         $custom_success_redirection = $custom_success_redirection ? str_ireplace(array("&#038;", "&amp;"), "&", $custom_success_redirection) : $custom_success_redirection;
         if (is_array($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_postvars()) && ($_paypal = $paypal) && ($_paypal_s = serialize($_paypal))) {
             $paypal["s2member_log"][] = "Return-Data received on: " . date("D M j, Y g:i:s a T");
             $paypal["s2member_log"][] = "s2Member POST vars verified " . (!empty($paypal["proxy_verified"]) ? "with a Proxy Key" : "through a POST back to PayPal.");
             $paypal["subscr_gateway"] = !empty($_GET["s2member_paypal_proxy"]) ? esc_html(trim(stripslashes($_GET["s2member_paypal_proxy"]))) : "paypal";
             if (empty($_GET["s2member_paypal_proxy"]) || empty($_GET["s2member_paypal_proxy_use"]) || !preg_match("/ty-email/", $_GET["s2member_paypal_proxy_use"])) {
                 $payment_status_issues = "/^(failed|denied|expired|refunded|partially_refunded|reversed|reversal|canceled_reversal|voided)\$/i";
                 if (!empty($paypal["custom"]) && preg_match("/^" . preg_quote(preg_replace("/\\:([0-9]+)\$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"])) {
                     $paypal["s2member_log"][] = "s2Member originating domain ( `\$_SERVER[\"HTTP_HOST\"]` ) validated.";
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     if (!apply_filters("ws_plugin__s2member_during_paypal_return_conditionals", false, get_defined_vars())) {
                         unset($__refs, $__v);
                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_web_accept_sp::cp(get_defined_vars())) {
                             $paypal = $_paypal_cp;
                         } else {
                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_wa_ccaps_wo_level::cp(get_defined_vars())) {
                                 $paypal = $_paypal_cp;
                             } else {
                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_subscr_or_wa_w_level::cp(get_defined_vars())) {
                                     $paypal = $_paypal_cp;
                                 } else {
                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_subscr_modify_w_level::cp(get_defined_vars())) {
                                         $paypal = $_paypal_cp;
                                     } else {
                                         $paypal["s2member_log"][] = "Unexpected `txn_type/status`. The `txn_type/status` did not match a required action.";
                                         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after displaying an error message).";
                                         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unexpected <code>txn_type/status</code>.<br />The <code>txn_type/status</code> did not meet requirements.<br />Please contact Support for assistance.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                                     }
                                 }
                             }
                         }
                     } else {
                         // Else a custom conditional has been applied by filters.
                         unset($__refs, $__v);
                     }
                 } else {
                     if ($paypal["custom"] && ($paypal["custom"] === "www." . $_SERVER["HTTP_HOST"] || "www." . $paypal["custom"] === $_SERVER["HTTP_HOST"])) {
                         c_ws_plugin__s2member_admin_notices::enqueue_admin_notice("<strong>s2Member:</strong> Post-processing failed on at least one transaction. It appears that you have a PayPal Button configured with a <code>custom=\"\"</code> Shortcode Attribute that does NOT match up with your installation domain name. If your site uses the <code>www.</code> prefix, please include that. If it does not, please exclude the <code>www.</code> prefix. You should have <code>custom=\"" . preg_replace("/\\:([0-9]+)\$/", "", $_SERVER["HTTP_HOST"]) . "\"</code>", "*:*", true);
                     }
                     $paypal["s2member_log"][] = 'Unable to verify `$_SERVER["HTTP_HOST"]`. Please check the `custom` value in your Button Code. It MUST start with your domain name.';
                     $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after displaying an error message).";
                     echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to verify <code>$_SERVER["HTTP_HOST"]</code>.<br />Please contact Support for assistance.<br /><br />If you are the site owner, please check the <code>custom</code> value in your Button Code. It MUST start with your domain name.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                 }
             } else {
                 // In this case ... a Proxy has explicitly requested `ty-email` processing.
                 $paypal = $_paypal_cp = c_ws_plugin__s2member_paypal_return_in_proxy_ty_email::cp(get_defined_vars());
             }
         } else {
             if (!empty($_GET["s2member_paypal_proxy"]) && !empty($_GET["s2member_paypal_proxy_use"]) && preg_match("/x-preview/", $_GET["s2member_paypal_proxy_use"]) && ($paypal["subscr_gateway"] = esc_html(trim(stripslashes($_GET["s2member_paypal_proxy"]))))) {
                 $paypal = $_paypal_cp = c_ws_plugin__s2member_paypal_return_in_proxy_x_preview::cp(get_defined_vars());
             } else {
                 if (empty($_GET["tx"]) && empty($_GET["s2member_paypal_proxy"]) && ($paypal["subscr_gateway"] = "paypal")) {
                     $paypal = $_paypal_cp = c_ws_plugin__s2member_paypal_return_in_no_tx_data::cp(get_defined_vars());
                 } else {
                     if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_identity_token"]) {
                         c_ws_plugin__s2member_admin_notices::enqueue_admin_notice("<strong>s2Member:</strong> You have no PayPal PDT Identity Token configured. PayPal Auto-Return handling failed. Please update your PayPal PDT Identity Key. See: <code>s2Member -› PayPal Options -› PayPal PDT/Auto-Return Integration</code>. Thank you!", "*:*", true);
                     }
                     $paypal["s2member_log"][] = "Unable to verify \$_POST vars. This is most likely related to an invalid configuration of s2Member, or a problem with server compatibility.";
                     $paypal["s2member_log"][] = "Please make sure that you configure a PayPal PDT Identity Token for your installation of s2Member. See: `s2Member -› PayPal Options -› PayPal PDT/Auto-Return Integration`.";
                     $paypal["s2member_log"][] = "See also, this KB article: `http://www.s2member.com/kb/server-scanner/`. We suggest that you run the s2Member Server Scanner.";
                     $paypal["s2member_log"][] = var_export($_REQUEST, true);
                     $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after displaying an error message).";
                     echo c_ws_plugin__s2member_return_templates::return_template("default", _x('<strong>ERROR:</strong> Unable to verify <code>$_POST</code> vars.<br />Please contact Support for assistance.<br /><br />This is most likely related to an invalid configuration of s2Member, or a problem with server compatibility. If you are the site owner, and you\'re absolutely SURE that your configuration is valid, you may want to run some tests on your server, just to be sure <code>$_POST</code> variables are populated, and that your server is able to connect/communicate with your Payment Gateway over an HTTPS connection.<br /><br />s2Member uses the <code>WP_Http</code> class for remote connections; which will try to use <code>cURL</code> first, and then fall back on the <code>FOPEN</code> method when <code>cURL</code> is not available. On a Windows server, you may have to disable your <code>cURL</code> extension; and instead, set <code>allow_url_fopen = yes</code> in your php.ini file. The <code>cURL</code> extension (usually) does NOT support SSL connections on a Windows server.<br /><br />Please see <a href="http://www.s2member.com/forums/topic/ideal-server-configuration-for-s2member/" target="_blank">this thread</a> for details regarding the ideal server configuration for s2Member.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                 }
             }
         }
         /*
         Add RTN proxy (when available) to the ``$paypal`` array.
         */
         if (!empty($_GET["s2member_paypal_proxy"])) {
             $paypal["s2member_paypal_proxy"] = $_GET["s2member_paypal_proxy"];
         }
         /*
         Add IPN proxy use vars (when available) to the ``$paypal`` array.
         */
         if (!empty($_GET["s2member_paypal_proxy_use"])) {
             $paypal["s2member_paypal_proxy_use"] = $_GET["s2member_paypal_proxy_use"];
         }
         /*
         Also add RTN proxy self-verification (when available) to the ``$paypal`` array.
         */
         if (!empty($_GET["s2member_paypal_proxy_verification"])) {
             $paypal["s2member_paypal_proxy_verification"] = $_GET["s2member_paypal_proxy_verification"];
         }
         /*
         Also add RTN success redirection URL (when available) to the ``$paypal`` array.
         */
         if (!empty($_GET["s2member_paypal_return_success"])) {
             $paypal["s2member_paypal_return_success"] = $_GET["s2member_paypal_return_success"];
         }
         /*
         Also add RTN t and r Attributes (when available) to the ``$paypal`` array.
         */
         if (!empty($_GET["s2member_paypal_return_tra"])) {
             $paypal["s2member_paypal_return_tra"] = $_GET["s2member_paypal_return_tra"];
         }
         /*
         If debugging/logging is enabled; we need to append $paypal to the log file.
         	Logging now supports Multisite Networking as well.
         */
         $logt = c_ws_plugin__s2member_utilities::time_details();
         $logv = c_ws_plugin__s2member_utilities::ver_details();
         $logm = c_ws_plugin__s2member_utilities::mem_details();
         $log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . $_SERVER["HTTP_USER_AGENT"];
         $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
         $log2 = is_multisite() && !is_main_site() ? "paypal-rtn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-rtn.log";
         if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
             if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
                 if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
                     file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($paypal, true)) . "\n\n", FILE_APPEND);
                 }
             }
         }
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action("ws_plugin__s2member_during_paypal_return", get_defined_vars());
         unset($__refs, $__v);
         exit;
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_after_paypal_return", get_defined_vars());
     unset($__refs, $__v);
 }
Esempio n. 27
0
 /**
  * Builds and handles the Logs page.
  *
  * @package s2Member\Menu_Pages
  * @since 120310
  */
 public static function logs_page()
 {
     do_action('ws_plugin__s2member_before_logs_page', get_defined_vars());
     c_ws_plugin__s2member_menu_pages::update_all_options();
     c_ws_plugin__s2member_menu_pages::archive_logs_start_fresh();
     c_ws_plugin__s2member_menu_pages::delete_logs_start_fresh();
     $logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'];
     if (!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir)))) {
         mkdir($logs_dir, 0777, TRUE) . clearstatcache();
     }
     $htaccess = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'] . '/.htaccess';
     $htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir_htaccess'])));
     if (is_dir($logs_dir) && is_writable($logs_dir) && !file_exists($htaccess)) {
         file_put_contents($htaccess, $htaccess_contents) . clearstatcache();
     }
     if (!is_dir($logs_dir)) {
         // If the security-enabled logs directory does not exist yet.
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) does not exist. Please create this directory manually &amp; make it writable (chmod 777).', TRUE);
     } else {
         if (!is_writable($logs_dir)) {
             // If the logs directory is not writable yet.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) is not writable. Please make this directory writable (chmod 777).', TRUE);
         }
     }
     if (!file_exists($htaccess)) {
         // If the .htaccess file has not been created yet.
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', TRUE);
     } else {
         if (!preg_match('/deny from all/i', file_get_contents($htaccess))) {
             // Else if the .htaccess file does not offer the required protection.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', TRUE);
         }
     }
     if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
         // Logging disabled?
         c_ws_plugin__s2member_admin_notices::display_admin_notice('Logging is currently disabled by your configuration.');
     }
     include_once dirname(dirname(__FILE__)) . '/menu-pages/logs.inc.php';
     do_action('ws_plugin__s2member_after_logs_page', get_defined_vars());
 }
Esempio n. 28
0
 /**
  * Allows access to the main Multisite Registration Form.
  *
  * @package s2Member\Option_Forces
  * @since 3.5
  *
  * @attaches-to ``add_filter("pre_site_option_registration");``
  *
  * @param string $users_can_register Expects *( `none`, `all`, `blog`, `user` )*, passed through by the Filter.
  * @return string One of `none|all|user`; depending on several factors.
  */
 public static function check_mms_register_access($users_can_register = FALSE)
 {
     global $wpdb;
     // Global database object reference
     global $current_site, $current_blog;
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_check_register_access", get_defined_vars());
     unset($__refs, $__v);
     $by_default = $users_can_register = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_grants"];
     if (c_ws_plugin__s2member_utils_conds::bp_is_installed() && is_multisite() && !c_ws_plugin__s2member_utils_conds::is_multisite_farm()) {
         return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = c_ws_plugin__s2member_option_forces::check_register_access() ? "user" : "none", get_defined_vars());
     } else {
         if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm()) {
             // Blog Farm?
             return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "none", get_defined_vars());
         } else {
             if (!is_network_admin() && $users_can_register !== "all") {
                 if (is_main_site() && current_user_can("create_users") || is_super_admin()) {
                     return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "all", get_defined_vars());
                 } else {
                     if (is_user_logged_in() && is_object($user = wp_get_current_user()) && $user->ID && is_object($user = new WP_User($user->ID, $current_site->blog_id)) && $user->ID && $user->has_cap("access_s2member_level1")) {
                         $mms_options = c_ws_plugin__s2member_utilities::mms_options();
                         $blogs_allowed = (int) @$mms_options["mms_registration_blogs_level" . c_ws_plugin__s2member_user_access::user_access_level($user)];
                         $user_blogs = is_array($blogs = get_blogs_of_user($user->ID)) ? count($blogs) - 1 : 0;
                         $user_blogs = $user_blogs >= 0 ? $user_blogs : 0;
                         // NOT less than zero.
                         $blogs_allowed = $blogs_allowed >= 0 ? $blogs_allowed : 0;
                         if ($user_blogs < $blogs_allowed) {
                             return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "all", get_defined_vars());
                         }
                     } else {
                         if (!is_user_logged_in() && is_main_site() && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
                             if (preg_match($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_w_level_regex"], $item_number, $m) && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $m[1]])) {
                                 return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "all", get_defined_vars());
                             } else {
                                 return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "user", get_defined_vars());
                             }
                         }
                     }
                 }
             } else {
                 if (!is_network_admin() && $users_can_register === "all") {
                     if (is_user_logged_in() && !(is_main_site() && current_user_can("create_users")) && !is_super_admin() && is_object($user = wp_get_current_user()) && $user->ID && is_object($user = new WP_User($user->ID, $current_site->blog_id)) && $user->ID) {
                         $mms_options = c_ws_plugin__s2member_utilities::mms_options();
                         $blogs_allowed = (int) @$mms_options["mms_registration_blogs_level" . c_ws_plugin__s2member_user_access::user_access_level($user)];
                         $user_blogs = is_array($blogs = get_blogs_of_user($user->ID)) ? count($blogs) - 1 : 0;
                         $user_blogs = $user_blogs >= 0 ? $user_blogs : 0;
                         // NOT less than zero.
                         $blogs_allowed = $blogs_allowed >= 0 ? $blogs_allowed : 0;
                         if ($user_blogs >= $blogs_allowed) {
                             return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "none", get_defined_vars());
                         }
                     }
                 }
             }
         }
     }
     return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register, get_defined_vars());
 }
Esempio n. 29
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>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="PayPal Pro Requirements">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-requirements-section">' . "\n";
     echo '<h3>Is "PayPal Payments Pro" required for me to use Pro-Forms?</h3>' . "\n";
     echo '<p>Yes, PayPal Payments Pro is required for Pro-Forms. However, there are some exceptions to that rule.</p>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h4>PayPal Payments Pro is Absolutely Required:</h4>' . "\n";
     echo '<ul>' . "\n";
     echo '	<li>For you to accept on-site credit card payments via Pro-Forms; i.e., not just PayPal Express Checkout.</li>' . "\n";
     echo '	<li>For Cancelation, Billing Update, and Billing Modification Pro-Forms to work as expected in all cases.</li>' . "\n";
     echo '	<li>Generally speaking, for you to take full advantage of everything that Pro-Forms can do; and to have them all work as originally intended.</li>' . "\n";
     echo '</ul>' . "\n";
     echo '<p><em><strong>See also:</strong> <a href="https://s2member.com/kb-article/supported-paypal-account-types/" target="_blank" rel="external">Supported PayPal Account Types</a></em></p>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h4>PayPal Payments Pro is NOT Required (Exceptions):</h4>' . "\n";
     echo '<ul>' . "\n";
     echo '	<li>For you to introduce Free Registration Pro-Forms. In fact, you can use Free Registration Pro-Forms w/o even configuring PayPal API credentials.</li>' . "\n";
     echo '	<li>For you to accept PayPal Express Checkout only (not ideal). See: <a href="https://s2member.com/kb-article/do-s2member-pro-forms-work-with-paypal-standard-i-e-without-paypal-pro/" target="_blank" rel="external">this KB article</a> for details and important limitations.</li>' . "\n";
     echo '	<li style="font-style:italic;">If you integrate with Stripe™ instead (free, most popular). See: <a href="https://s2member.com/kb-article/does-s2member-integrate-w-stripe-bitcoin/" target="_blank" rel="external">Does s2Member Pro integrate w/ Stripe? Bitcoin?</a></li>' . "\n";
     echo '</ul>' . "\n";
     echo '</div>' . "\n";
     echo '</div>' . "\n";
     echo '<div class="ws-menu-page-group" title="Free Registration Forms">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-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;" autocomplete="off">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-registration-form-shortcode.php")));
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr("0")), $ws_plugin__s2member_pro_temp_s);
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"])), $ws_plugin__s2member_pro_temp_s);
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
     echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-registration-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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__"]["s2member"]["c"]["levels"]; $n++) {
         echo '<div class="ws-menu-page-group" title="Forms For Level #' . $n . ' Access">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-level' . $n . '-forms-section">' . "\n";
         echo '<h3>Pro-Form Generator For Level #' . $n . ' 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 s2Member 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, s2Member will automatically terminate their Membership privileges. s2Member makes extensive use of the PayPal IPN service. s2Member receives updates from PayPal behind-the-scene.</p>' . "\n";
         echo '<p><em><strong>Please note:</strong> 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;" autocomplete="off">' . "\n";
         echo '<p id="ws-plugin--s2member-pro-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-pro-level' . $n . '-trial-term">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n";
         echo '<p><span id="ws-plugin--s2member-pro-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-pro-level' . $n . '-term">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/" . ($GLOBALS["WS_PLUGIN__"]["s2member"]["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--s2member-pro-level' . $n . '-desc" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["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--s2member-pro-level' . $n . '-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-pro-level' . $n . '-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__s2member_pro_paypalFormGenerate(\'level' . $n . '\');" /></p>' . "\n";
         echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member → 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-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;" autocomplete="off">' . "\n";
         echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
         $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-form-shortcode.php")));
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($n)), $ws_plugin__s2member_pro_temp_s);
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])), $ws_plugin__s2member_pro_temp_s);
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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="Billing Modification Forms">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-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, s2Member 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-scenes, 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. s2Member\'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: <strong>s2Member → API Scripting</strong>.</em></p>' . "\n";
     echo !is_multisite() || !c_ws_plugin__s2member_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;" autocomplete="off">' . "\n";
     echo '<p>Modification: <select id="ws-plugin--s2member-pro-modification-level">' . "\n";
     for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
         echo '<optgroup label="Level #' . $n . '">' . "\n";
         echo '<option value="upgrade:' . $n . '">&uarr; Upgrade To Level #' . $n . '</option>' . "\n";
         echo $n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? '<option value="downgrade:' . $n . '">&darr; Downgrade To Level #' . $n . '</option>' . "\n" : '';
         echo '</optgroup>' . "\n";
         echo $n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] ? '<option disabled="disabled"></option>' . "\n" : '';
     }
     echo '</select></p>' . "\n";
     echo '<p id="ws-plugin--s2member-pro-modification-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--s2member-pro-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-pro-modification-trial-term">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
     echo '<p><span id="ws-plugin--s2member-pro-modification-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-pro-modification-term">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/" . ($GLOBALS["WS_PLUGIN__"]["s2member"]["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--s2member-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--s2member-pro-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-pro-modification-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__s2member_pro_paypalFormGenerate(\'modification\');" /></p>' . "\n";
     echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member → 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-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;" autocomplete="off">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-form-shortcode.php")));
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr("1")), $ws_plugin__s2member_pro_temp_s);
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_pro_temp_s);
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
     $ws_plugin__s2member_pro_temp_s = preg_replace("/\\/]\$/", 'modify="1" /]', $ws_plugin__s2member_pro_temp_s);
     // Adds modify="1" to the end of the Shortcode.
     echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-modification-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="Capability (Buy Now) Forms">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-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: <strong>s2Member → API Scripting → Custom Capabiities</strong>.</p>' . "\n";
         echo '<p>With s2Member, 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 s2Member 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 s2Member 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 s2Member 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;" autocomplete="off">' . "\n";
         echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-pro-ccap-term">' . trim(c_ws_plugin__s2member_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--s2member-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--s2member-pro-ccap-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-pro-ccap-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__s2member_pro_paypalCcapFormGenerate();" /></p>' . "\n";
         echo '<p>Custom Capabilities (comma-delimited) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member → 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 s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-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;" autocomplete="off">' . "\n";
         echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
         $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-ccaps-checkout-form-shortcode.php")));
         $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
         echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-ccap-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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="Billing Update Forms">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-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;" autocomplete="off">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-update-form-shortcode.php")));
     echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-update-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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="Billing Cancellation Forms">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-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="http://s2member.com/r/paypal-developer-network/" 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. s2Member is notified silently behind-the-scenes, and will immediately cancel all future billing. s2Member will later terminate their account access, at the correct point in time. This works in conjunction with the s2Member Auto-EOT System. For further details, see: <strong>s2Member → PayPal Options → EOT Behavior</strong>.</em></p>' . "\n";
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-cancellation-form-shortcode.php")));
     echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-cancellation-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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="Member Registration Access Links">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-reg-links-section">' . "\n";
     echo '<h3>Registration Access Link Generator (for Customer Service)</h3>' . "\n";
     echo '<p>s2Member 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 <strong>Users → Add New</strong>. 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;" autocomplete="off">' . "\n";
     echo '<p>Paid Membership Level#: <select id="ws-plugin--s2member-pro-reg-link-level">' . "\n";
     for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) {
         echo '<option value="' . $n . '">s2Member Level #' . $n . '</option>' . "\n";
     }
     echo '</select></p>' . "\n";
     echo '<p>Paid Subscr. ID: <input type="text" autocomplete="off" id="ws-plugin--s2member-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, s2Member 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--s2member-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__s2member_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__s2member_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__s2member_pro_paypalRegLinkGenerate();" /> <img id="ws-plugin--s2member-pro-reg-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
     echo '<p' . (is_multisite() && c_ws_plugin__s2member_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: s2Member → API Scripting → Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--s2member-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--s2member-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 s2Member 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--s2member-pro-reg-link" class="monospace" style="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="Specific Post/Page (Buy Now) Forms">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-sp-forms-section">' . "\n";
     echo '<h3>Pro-Form Generator For Specific Post/Page Forms</h3>' . "\n";
     echo '<p>s2Member 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. s2Member will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link (see: <strong>s2Member → PayPal Options → Specific Post/Page Email</strong>). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
     echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file &amp; music downloads, access to additional support services, and the list goes on 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: <strong>s2Member → Restriction Options → Specific Post/Page Access</strong>. 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 s2Member seamlessly. You can even Package Additional Posts/Pages together into one transaction.</p>' . "\n";
     echo '<p><em><strong>Please note:</strong> 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;" autocomplete="off">' . "\n";
     echo '<p><select id="ws-plugin--s2member-pro-sp-leading-id">' . "\n";
     echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
     $ws_plugin__s2member_pro_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
     foreach ($ws_plugin__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 s2Member for Specific Post/Page Access yet. See: s2Member → Restriction Options → Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p><select id="ws-plugin--s2member-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__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 (i.e., only one Access Link is needed, and s2Member 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* s2Member 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 s2Member for Specific Post/Page Access yet. See: s2Member → 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--s2member-pro-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-pro-sp-hours">' . trim(c_ws_plugin__s2member_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--s2member-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--s2member-pro-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-pro-sp-currency">' . trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__s2member_pro_paypalSpFormGenerate();" /></p>' . "\n";
     echo '</form>' . "\n";
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '<tr>' . "\n";
     echo '<td>' . "\n";
     echo '<form onsubmit="return false;" autocomplete="off">' . "\n";
     echo '<strong>WordPress Shortcode:</strong> (recommended for both the WordPress Visual &amp; HTML Editors)<br />' . "\n";
     $ws_plugin__s2member_pro_temp_s = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-form-shortcode.php")));
     $ws_plugin__s2member_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_pro_temp_s);
     echo '<input type="text" autocomplete="off" id="ws-plugin--s2member-pro-sp-shortcode" value="' . format_to_edit($ws_plugin__s2member_pro_temp_s) . '" onclick="this.select ();" class="monospace" />' . "\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="Specific Post/Page Access Links">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-sp-links-section">' . "\n";
     echo '<h3>Specific Post/Page Access Link Generator (for Customer Service)</h3>' . "\n";
     echo '<p>s2Member automatically generates Specific Post/Page 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 Specific Post/Page Access 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;" autocomplete="off">' . "\n";
     echo '<p><select id="ws-plugin--s2member-pro-sp-link-leading-id">' . "\n";
     echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
     $ws_plugin__s2member_pro_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp("exclude-conflicts");
     foreach ($ws_plugin__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 s2Member for Specific Post/Page Access yet. See: s2Member → Restriction Options → Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p><select id="ws-plugin--s2member-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__s2member_pro_temp_a_singulars as $ws_plugin__s2member_pro_temp_o) {
         echo '<option value="' . esc_attr($ws_plugin__s2member_pro_temp_o->ID) . '">' . esc_html($ws_plugin__s2member_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 (i.e., only one Access Link is needed, and s2Member 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* s2Member 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 s2Member for Specific Post/Page Access yet. See: s2Member → Restriction Options → Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
     echo '<p><select id="ws-plugin--s2member-pro-sp-link-hours">' . trim(c_ws_plugin__s2member_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__s2member_pro_paypalSpLinkGenerate();" /> <img id="ws-plugin--s2member-pro-sp-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
     echo '<p id="ws-plugin--s2member-pro-sp-link" class="monospace" style="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__s2member_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--s2member-pro-forms-success-section">' . "\n";
         echo '<h3>Custom Return URLs Upon Success (optional, for developers)</h3>' . "\n";
         echo '<p>s2Member 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 s2Member, under: <strong>s2Member → API / Tracking</strong>. In other words, if you don\'t use the <code>success=""</code> attribute in your Shortcode, s2Member 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--s2member-pro-forms-success-free-registration\').toggle(); return false;" class="ws-dotted-link">open/close</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-pro-forms-success-free-registration" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%role%%</code> = The Role ID <code>(subscriber, s2member_level[0-9]+, administrator, editor, author, contributor)</code>.</li>' . "\n";
         echo '<li><code>%%level%%</code> = The Level number <code>(0, 1, 2, 3, 4)</code>. (<em>deprecated, no longer recommended; use <code>%%role%%</code></em>)</li>' . "\n";
         echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> (<em>in comma-delimited format</em>).</li>' . "\n";
         echo '<li><code>%%auto_eot_time%%</code> = Auto-EOT Time (if applicable). Ex: <code>1299925670</code> (<em>unix timestamp</em>).</li>' . "\n";
         echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n";
         echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n";
         echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
         echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, 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.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_decrypt()" target="_blank" rel="external">s2member_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;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member → General Options → Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</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--s2member-pro-forms-success-sales\').toggle(); return false;" class="ws-dotted-link">open/close</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-pro-forms-success-sales" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%subscr_id%%</code> = The PayPal Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. PayPal does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring (i.e., there is only ONE payment), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%subscr_baid%%</code> = Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. This is the Subscription\'s Billing Agreement ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'Applicable only with PayPal Pro (Payflow Edition); and only for Express Checkout transactions that require a Billing Agreement. In all other cases, the %%subscr_baid%% is simply set to the %%subscr_id%% value; i.e., it is a duplicate of %%subscr_id%% in most cases.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%initial%%</code> = The Initial Fee 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 `s2Member → API Notifications → Payment Notifications` instead.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. If you offer something 100% free, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) for the Membership Subscription.</li>' . "\n";
         echo '<li><code>%%item_name%%</code> = The Item Name (as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number).</li>' . "\n";
         echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D (this means 1 Day)\\n%%initial_term%% = 1 W (this means 1 Week)\\n%%initial_term%% = 1 M (this means 1 Month)\\n%%initial_term%% = 1 Y (this means 1 Year)\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D (this means 1 Day)\\n%%regular_term%% = 1 W (this means 1 Week)\\n%%regular_term%% = 1 M (this means 1 Month)\\n%%regular_term%% = 1 Y (this means 1 Year)\\n%%regular_term%% = 1 L (this means 1 Lifetime)\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period (or duration) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
         echo '<li><code>%%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 <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_decrypt()" target="_blank" rel="external">s2member_decrypt()</a>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Coupon Replacement Codes:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
         echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
         echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member → General Options → Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</div>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3>Independent Custom Capability Sales (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-pro-forms-success-ccaps\').toggle(); return false;" class="ws-dotted-link">open/close</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-pro-forms-success-ccaps" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%txn_id%%</code> = The Payment Transaction ID, which is always unique for each payment received.</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%amount%%</code> = The Amount of the payment. 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 <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_decrypt()" target="_blank" rel="external">s2member_decrypt()</a>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Coupon Replacement Codes:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
         echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
         echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n";
         echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n";
         echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n";
         echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member → General Options → Registration/Profile Fields</em>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</div>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3>Specific Post/Page Transactions (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-pro-forms-success-sp-sales\').toggle(); return false;" class="ws-dotted-link">open/close</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-pro-forms-success-sp-sales" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%sp_access_url%%</code> = The full URL (generated by s2Member) where the Customer can gain access.</li>' . "\n";
         echo '<li><code>%%sp_access_exp%%</code> = Human readable expiration for <code>%%sp_access_url%%</code>. Ex: <em>(link expires in <code>%%sp_access_exp%%</code>)</em>.</li>' . "\n";
         echo '<li><code>%%txn_id%%</code> = The PayPal Transaction ID. PayPal assigns a unique identifier for every purchase.</li>' . "\n";
         echo '<li><code>%%currency%%</code> = Three-character currency code (uppercase); e.g., <code>USD</code></li>' . "\n";
         echo '<li><code>%%currency_symbol%%</code> = Currency code symbol; e.g., <code>$</code></li>' . "\n";
         echo '<li><code>%%amount%%</code> = The full Amount 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 <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_decrypt()" target="_blank" rel="external">s2member_decrypt()</a>.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Coupon Replacement Codes:</strong>' . "\n";
         echo '<ul class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%full_coupon_code%%</code> = A full Coupon Code—if one is accepted by your configuration of s2Member. This may indicate an Affiliate Coupon Code, which will include your Affiliate Suffix Chars too (i.e., the full Coupon Code).</li>' . "\n";
         echo '<li><code>%%coupon_code%%</code> = A Coupon Code—if one is accepted by your configuration of s2Member. This will NOT include any Affiliate Suffix Chars. This indicates the actual Coupon Code accepted by your configuration of s2Member (excluding any Affiliate ID).</li>' . "\n";
         echo '<li><code>%%coupon_affiliate_id%%</code> = This is the end of an Affiliate Coupon Code <em>(i.e., the referring affiliate\'s ID)</em>. This is only applicable if an Affiliate Coupon Code is accepted by your configuration of s2Member.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\n";
         echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
         echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
         echo '</ul>' . "\n";
         echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
         echo '<em>(The campaign (i.e., christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
         echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
         echo '</div>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h3>Cancellations &amp; Billing Updates (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-pro-forms-success-cancellations-updates\').toggle(); return false;" class="ws-dotted-link">open/close</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-pro-forms-success-cancellations-updates" style="display:none;">' . "\n";
         echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;" class="ws-menu-page-li-margins">' . "\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 <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_decrypt()" target="_blank" rel="external">s2member_decrypt()</a>.</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--s2member-pro-forms-success-verification\').toggle(); return false;" class="ws-dotted-link">open/close</a>)</h3>' . "\n";
         echo '<div id="ws-plugin--s2member-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 s2Member. 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 s2Member API Function: <code>s2member_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>s2Member 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__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-s2p-v-query-ok-1.x-php")) . '</p>' . "\n";
         echo '<p>s2Member will only verify a query string for up to 10 seconds. After 10 seconds, <code>s2member_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 s2Member, under: <strong>s2Member → API / Tracking</strong>. 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>s2member_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__s2member_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. s2Member 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--s2member-pro-shortcode-attrs-section">' . "\n";
     echo '<h3>Shortcode Attributes (Explained In Full Detail)</h3>' . "\n";
     echo '<p>When you generate a Form, s2Member will make a <a href="http://s2member.com/r/shortcode-reference/" target="_blank" rel="external">Shortcode</a> available to you. Like most Shortcodes for WordPress, s2Member reads Attributes in your Shortcode. These Attributes will be pre-configured by one of s2Member\'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 class="ws-menu-page-li-margins">' . "\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; s2Member 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; s2Member 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=""</code> When you set this Attribute, visitors must prove they\'re human by typing a <a href="http://s2member.com/r/captcha-reference/" target="_blank" rel="external">captcha/security code</a>. This service is powered by Google\'s reCaptcha system. 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>. Or, if you supplied reCaptcha v2 keys in your s2Member General Options (i.e., you are using reCaptcha v2), this must be <code>light</code> or <code>dark</code>.</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__s2member_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://s2member.com/r/iso-3166/" target="_blank" rel="external">ISO-3166-1 specification</a>. If this is empty(i.e., <code>""</code>) s2Member 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. This can be as long as you like. However, all descriptions passed through PayPal APIs are truncated automatically to 60 characters max (i.e., the maximum allowed length for PayPal descriptions is 60 characters). Not valid when <code>cancel="1"</code>.</li>' . "\n";
     echo '<li><code>dg="0"</code> The Digital Goods directive. s2Member will eventually be integrated with <a href="http://s2member.com/r/paypal-express-checkout-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>lang=""</code> Optional 5 character Button Language Code <em>(ake: Locale Code—ex: <code>en_US</code>)</em>. This controls the interface language of the PayPal Express Checkout Button itself. If unspecified, the language defaults to English (i.e., <code>en_US</code>; or to the value set by an optional MO translation file; which translates s2Member overall). See <a href="http://s2member.com/r/paypal-locale-codes/" target="_blank" rel="external">this list of possible Locale Codes</a>.</li>' . "\n";
     echo '<li><code>lc=""</code> Optional 2 character Country/Locale Code <em>(i.e., Country Code—ex: <code>US</code>)</em>. This controls the interface language used when/if 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. See <a href="http://s2member.com/r/paypal-locale-codes/" target="_blank" rel="external">this list of possible Country Codes</a>. 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__s2member_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>, s2Member 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="0"</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>s2Member → 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. Can also be <code>0.00</code> to provide free access. 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__s2member_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).—<strong>NOTICE (regarding Payflow):</strong> If you are operating a PayPal Pro (Payflow Edition) account, 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, semi-yearly or yearly.</li>' . "\n";
     echo '<li><code>rt="M"</code> Regular Term. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__s2member_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> If you are operating a PayPal Pro (Payflow Edition) account, 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, semi-yearly or yearly.</li>' . "\n";
     echo '<li><code>rr="1"</code> Recurring directive. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__s2member_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: s2Member → PayPal Options)</em>. <strong>IMPORTANT NOTE:</strong> If you don\'t offer a trial period; i.e., the first charge occurs when a customer completes checkout, you should set this to the number of <em>additional</em> payments, and NOT to the total number. For instance, if I want to charge the customer a total of 3 times, and one of those charges occurs when they complete checkout, I set should this to <code>rrt="2"</code> for a grand total of three all together.</li>' . "\n";
     echo '<li><code>rra="2"</code> Reattempt billing when/if a recurring payment fails; exactly X number of times; and then automatically suspend the customer\'s account (i.e., the customer loses access). By default, 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. The value of this attribute configures Max Failed Payments. A setting of <code>rra="2"</code> means that you allow a maximum of 2 failed payments. Setting <code>rra="0"</code> means that you allow an infinite number of 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__s2member_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__s2member_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>. Please see <a href="http://s2member.com/kb-article/can-i-customize-pro-forms/" target="_blank" rel="external">this KB article</a> for further details.</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>unsub="0"</code> Unsubscribe user? Only valid when <code>cancel="1"</code>. Possible values: <code>0</code> = do NOT unsubscribe (wait until an EOT occurs), <code>1</code> = yes, unusbscribe user immediately; i.e., when they submit the cancellation form. <em>NOTE: Just to clarify, this pertains to List Servers that you\'ve configured with s2Member. Setting <code>unsub="1"</code> will cause the user to be unsubscribed from a mailing list (if they are currently subscribed).</em></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 '<div class="ws-menu-page-group" title="Wrapping Multiple Shortcodes as Checkout Options">' . "\n";
     echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-form-options-section">' . "\n";
     echo '<h3>Wrapping Multiple Shortcodes as "Checkout Options"</h3>' . "\n";
     echo '<p>If you would like to offer a single Pro-Form w/ multiple "Checkout Options", it\'s quite easy. Generate each of your Pro-Form Shortcodes the same as you normally would (using some of the Pro-Form Generators on this page). Then, you can simply wrap them all inside another Pro-Form Shortcode (as seen below). For instance, if you generate two Pro-Form Shortcodes (or you have multiple Pro-Form Shortcodes on-site already); you can simply take those and wrap them inside another Pro-Form Shortcode and it consolidates all the Pro-Form Shortcodes into a single Pro-Form with multiple "Checkout Options" (i.e., it creates a drop-down menu for your customers to choose from). The following is a VERY simple example.</p>' . "\n";
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     echo '<td>' . "\n";
     echo '<pre class="code">';
     echo '<code>';
     echo '[s2Member-Pro-PayPal-Form]' . "\n";
     echo "\t" . '[s2Member-Pro-PayPal-Form /]' . "\n";
     echo "\t" . '[s2Member-Pro-PayPal-Form /]' . "\n";
     echo '[/s2Member-Pro-PayPal-Form]';
     echo '</code>';
     echo '</pre>' . "\n";
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h3>How do "Checkout Options" work behind-the-scenes?</h3>' . "\n";
     echo '<p>Given this simple example (as seen below); s2Member will first take the primary default Shortcode Attributes (from the top-level parent Shortcode); and then it merges those together with Shortcode Attributes from a particular Checkout Option (i.e., a child). The one s2Member merges with is based on the currently selected Checkout Option (i.e., the Checkout Option selected by your customer).</p>' . "\n";
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     echo '<td>' . "\n";
     echo '<pre class="code">';
     echo '<code>';
     echo '[s2Member-Pro-PayPal-Form rp="1" rt="M" rr="1" accept_coupons="1"]' . "\n";
     echo "\t" . '[s2Member-Pro-PayPal-Form level="1" desc="Option 1 ($10.00)" ra="10.00" /]' . "\n";
     echo "\t" . '[s2Member-Pro-PayPal-Form level="2" desc="Option 2 ($20.00)" ra="20.00" /]' . "\n";
     echo "\t" . '[s2Member-Pro-PayPal-Form level="3" desc="Option 3 ($30.00)" ra="30.00" /]' . "\n";
     echo '[/s2Member-Pro-PayPal-Form]';
     echo '</code>';
     echo '</pre>' . "\n";
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '<p style="font-style:italic;">In this example, the default checkout Level is 1 (because the default Checkout Option is always the first Checkout Option); but that can change depending on which Checkout Option is selected by the customer. All of these Checkout Options will be associated with different prices; and each Checkout Option will provide access to a different Membership Level. The customer may choose which one they would like to pay for and gain access to.</p>' . "\n";
     echo '<p style="font-style:italic;">All of these Checkout Options will allow a Coupon Code; because that\'s an absolute default Shortcode Attribute (in this particular example); which is not overwritten by any of the children. All of these Checkout Options will charge the customer on a recurring basis (once each month); because those are absolute default Shortcode Attributes (in this particular example) i.e., <code>rp="1" rt="M" rr="1"</code>; which are not overwritten by any of the children.</p>' . "\n";
     echo '<p style="font-style:italic;">~ You\'ll be happy to know that ANY Shortcode Attribute can be declared (and/or overridden); in any of these tags. There is no special subset of restricted Shortcode Attributes in any of these; you can do whatever you like once you understand how this works. In addition, this works for Specific Post/Page Access, Buy Now Access, Recurring Access; etc. You can even mix these together if you like. Just wrap all of your Pro-Form Shortcodes with another Pro-Form Shortcode :-)</p>' . "\n";
     echo '</div>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h3>Linking To A Pro-Form w/ Multiple "Checkout Options"</h3>' . "\n";
     echo '<p>It is also possible to link to a Pro-Form and pre-select a specific Checkout Option that appears in the list. Starting from the first Checkout Option in the list (we call this Checkout Option 1) you can choose which Checkout Option number you want to have selected by default. This is accomplished by linking to any Post/Page on your site which contains a Pro-Form Shortcode; and then adding the <code>?s2p-option=</code> variable onto the end of that URL (as seen below).</p>' . "\n";
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     echo '<td>' . "\n";
     echo 'This example would pre-select option 2.' . "\n";
     echo '<pre class="code">';
     echo '<code>';
     echo 'http://www.example.com/my-checkout-form/?s2p-option=2';
     echo '</code>';
     echo '</pre>' . "\n";
     echo 'The absolute default Checkout Option is always the first one (Checkout Option 1).<br />' . "\n";
     echo 'This would pre-select option 1 (but this is NOT necessary, because it\'s the default already).' . "\n";
     echo '<pre class="code">';
     echo '<code>';
     echo 'http://www.example.com/my-checkout-form/?s2p-option=1';
     echo '</code>';
     echo '</pre>' . "\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__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
 /**
  * Calls upon the PayPal PayFlow API, and returns the response.
  *
  * @package s2Member\PayPal
  * @since 120514
  *
  * @param array $post_vars An array of variables to send through the PayPal PayFlow API call.
  * @return array An array of variables returned by the PayPal PayFlow API.
  */
 public static function paypal_payflow_api_response($post_vars = FALSE)
 {
     global $current_site, $current_blog;
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_paypal_payflow_api_response", get_defined_vars());
     unset($__refs, $__v);
     $url = "https://" . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "pilot-payflowpro.paypal.com" : "payflowpro.paypal.com");
     $post_vars = apply_filters("ws_plugin__s2member_paypal_payflow_api_post_vars", $post_vars, get_defined_vars());
     $post_vars = is_array($post_vars) ? $post_vars : array();
     $post_vars["VERBOSITY"] = "HIGH";
     $post_vars["USER"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_username"];
     $post_vars["PARTNER"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_partner"];
     $post_vars["VENDOR"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_vendor"];
     $post_vars["PWD"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_password"];
     foreach ($post_vars as $_key => &$_value) {
         $_value = c_ws_plugin__s2member_paypal_utilities::paypal_payflow_api_nv_cleanup($_key, $_value);
     }
     unset($_key, $_value);
     $input_time = date("D M j, Y g:i:s a T");
     $nvp_post_vars = "";
     foreach ($post_vars as $_key => $_value) {
         $nvp_post_vars .= ($nvp_post_vars ? "&" : "") . $_key . "[" . strlen($_value) . "]=" . $_value;
     }
     unset($_key, $_value);
     $nvp = trim(c_ws_plugin__s2member_utils_urls::remote($url, $nvp_post_vars, array("timeout" => 20, "headers" => array("Content-Type" => "text/namevalue"))));
     $output_time = date("D M j, Y g:i:s a T");
     wp_parse_str($nvp, $response);
     $response = c_ws_plugin__s2member_utils_strings::trim_deep($response);
     if ($response["RESULT"] !== "0") {
         if (strlen($response["RESPMSG"])) {
             /* translators: Exclude `%2$s`. These are English details returned by PayPal. Replace `%2$s` with: `Unable to process, please try again`, or something to that affect. Or, if you prefer, you could Filter ``$response["__error"]`` with `ws_plugin__s2member_paypal_payflow_api_response`. */
             $response["__error"] = sprintf(_x('Error #%1$s. %2$s.', "s2member-front", "s2member"), $response["RESULT"], rtrim($response["RESPMSG"], "."));
         } else {
             $response["__error"] = _x("Error. Please contact Support for assistance.", "s2member-front", "s2member");
         }
     } else {
         if (isset($response["TRXRESULT"]) && $response["TRXRESULT"] !== "0") {
             if (strlen($response["TRXRESPMSG"])) {
                 /* translators: Exclude `%2$s`. These are English details returned by PayPal. Replace `%2$s` with: `Unable to process, please try again`, or something to that affect. Or, if you prefer, you could Filter ``$response["__error"]`` with `ws_plugin__s2member_paypal_payflow_api_response`. */
                 $response["__error"] = sprintf(_x('Error #%1$s. %2$s.', "s2member-front", "s2member"), $response["TRXRESULT"], rtrim($response["TRXRESPMSG"], "."));
             } else {
                 $response["__error"] = _x("Error. Please contact Support for assistance.", "s2member-front", "s2member");
             }
         }
     }
     $logt = c_ws_plugin__s2member_utilities::time_details();
     $logv = c_ws_plugin__s2member_utilities::ver_details();
     $logm = c_ws_plugin__s2member_utilities::mem_details();
     $log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . @$_SERVER["HTTP_USER_AGENT"];
     $log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
     $log2 = is_multisite() && !is_main_site() ? "paypal-payflow-api-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-payflow-api.log";
     if (isset($post_vars["ACCT"]) && strlen($post_vars["ACCT"]) > 4) {
         $post_vars["ACCT"] = str_repeat("*", strlen($post_vars["ACCT"]) - 4) . substr($post_vars["ACCT"], -4);
     }
     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
         if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
             if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
                 if ($log = "-------- Input vars: ( " . $input_time . " ) --------\n" . $nvp_post_vars . "\n" . var_export($post_vars, true) . "\n") {
                     if ($log .= "-------- Output string/vars: ( " . $output_time . " ) --------\n" . $nvp . "\n" . var_export($response, true)) {
                         file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info($log) . "\n\n", FILE_APPEND);
                     }
                 }
             }
         }
     }
     return apply_filters("ws_plugin__s2member_paypal_payflow_api_response", c_ws_plugin__s2member_paypal_utilities::_paypal_payflow_api_response_filters($response), get_defined_vars());
 }