/** * Builds the options panel for this Payment Gateway. * * @package optimizeMember\Menu_Pages * @since 140617 */ public static function stripe_ops_page() { c_ws_plugin__optimizemember_menu_pages::update_all_options(); // Updates options. $logs_dir = $GLOBALS['WS_PLUGIN__']['optimizemember']['c']['logs_dir']; if (!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__optimizemember_utils_dirs::strip_dir_app_data($logs_dir)))) { mkdir($logs_dir, 0777, TRUE) . clearstatcache(); } $htaccess = $GLOBALS['WS_PLUGIN__']['optimizemember']['c']['logs_dir'] . '/.htaccess'; $htaccess_contents = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']['optimizemember']['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__']['optimizemember']['o']['gateway_debug_logs']) { if (!is_dir($logs_dir)) { // If the security-enabled logs directory does not exist yet. c_ws_plugin__optimizemember_admin_notices::display_admin_notice('The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__optimizemember_utils_dirs::doc_root_path($logs_dir)) . '</code>) does not exist. Please create this directory manually & make it writable (chmod 777).', TRUE); } else { if (!is_writable($logs_dir)) { // If the logs directory is not writable yet. c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__optimizemember_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__optimizemember_admin_notices::display_admin_notice('The .htaccess protection file (<code>' . esc_html(c_ws_plugin__optimizemember_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__optimizemember_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>' . esc_html(c_ws_plugin__optimizemember_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/stripe-ops.inc.php'; }
/** * Applies custom Return Template Headers. * * @package optimizeMember\Return_Templates * @since 110720 * * @attaches-to ``add_filter("ws_plugin__optimizemember_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__"]["optimizemember"]["o"]["pro_" . $vars["template"] . "_return_template_header"])) { $code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_" . $vars["template"] . "_return_template_header"]; $code = !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code; return $custom_header = $code; } /**/ return $default_header; }
/** * Generates footer code, when/if configured. * * @package optimizeMember\WP_Footer * @since 110524RC * * @return null */ public static function wp_footer_code() { do_action("ws_plugin__optimizemember_before_wp_footer_code", get_defined_vars()); /**/ if ($code = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["wp_footer_code"]) { if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site()) { echo do_shortcode($code) . "\n"; /* No PHP here. */ } else { echo do_shortcode(c_ws_plugin__optimizemember_utilities::evl($code)); } } /**/ do_action("ws_plugin__optimizemember_after_wp_footer_code", get_defined_vars()); /**/ return; /* Return for uniformity. */ }
/** * Handles Return templates w/ response message. * * @package optimizeMember\Return_Templates * @since 110720 * * @param str $template Optional A Subscr. Gateway code should be used as the template name, or `default` is a multipurpose template. Defaults to `default`. Used in template selection. * @param str $response Optional. Response message to fill template with, using the Replacement Code `%%response%%` inside the template file. Defaults to: `Thank you. Please click the link below.`. * @param str $continue_html Optional. The HTML value of the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: `Continue`. * @param str $continue_link Optional. The HREF value for the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: ``home_url ("/")``. * @return str The full HTML code of the template. All Replacement Codes inside the template file will have already been filled by this routine. */ public static function return_template($template = FALSE, $response = FALSE, $continue_html = FALSE, $continue_link = FALSE) { eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_before_return_template", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ $template = $template ? $template : "default"; $continue_link = $continue_link ? $continue_link : home_url("/"); $continue_html = $continue_html ? $continue_html : _x("Continue", "s2member-front", "s2member"); $response = $response ? $response : _x("Thank you. Please click the link below.", "s2member-front", "s2member"); /**/ $custom_template = file_exists(TEMPLATEPATH . "/" . $template . "-return.php") ? TEMPLATEPATH . "/" . $template . "-return.php" : false; $custom_template = file_exists(TEMPLATEPATH . "/" . $template . "-return.html") ? TEMPLATEPATH . "/" . $template . "-return.html" : $custom_template; /**/ $custom_template = file_exists(WP_CONTENT_DIR . "/" . $template . "-return.php") ? WP_CONTENT_DIR . "/" . $template . "-return.php" : $custom_template; $custom_template = file_exists(WP_CONTENT_DIR . "/" . $template . "-return.html") ? WP_CONTENT_DIR . "/" . $template . "-return.html" : $custom_template; /**/ $custom_template = !$custom_template && file_exists(TEMPLATEPATH . "/default-return.php") ? TEMPLATEPATH . "/default-return.php" : $custom_template; $custom_template = !$custom_template && file_exists(TEMPLATEPATH . "/default-return.html") ? TEMPLATEPATH . "/default-return.html" : $custom_template; /**/ $custom_template = !$custom_template && file_exists(WP_CONTENT_DIR . "/default-return.php") ? WP_CONTENT_DIR . "/default-return.php" : $custom_template; $custom_template = !$custom_template && file_exists(WP_CONTENT_DIR . "/default-return.html") ? WP_CONTENT_DIR . "/default-return.html" : $custom_template; /**/ $specific_template = $custom_template ? $custom_template : (file_exists($_default_specific_template = dirname(dirname(__FILE__)) . "/templates/returns/" . $template . "-return.php") ? $_default_specific_template : false); /**/ $code = trim(file_get_contents($specific_template ? $specific_template : ($_default_template = dirname(dirname(__FILE__)) . "/templates/returns/default-return.php"))); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); /**/ $doctype_html_head = c_ws_plugin__optimizemember_utils_html::doctype_html_head(get_bloginfo("name"), "ws_plugin__optimizemember_during_return_template_head_" . ($specific_template ? basename($specific_template) : "default-return.php")); $code = preg_replace("/%%doctype_html_head%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_doctype_html_head", $doctype_html_head, get_defined_vars())), $code); /**/ $code = preg_replace("/%%header%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_header", sprintf(_x('[ %s ] <strong><em>says…</em></strong>', "s2member-front", "s2member"), esc_html($_SERVER["HTTP_HOST"])), get_defined_vars())), $code); /**/ $code = preg_replace("/%%response%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_response", $response, get_defined_vars())), $code); $code = preg_replace("/%%continue%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_continue", '<a href="' . esc_attr($continue_link) . '">' . $continue_html . '</a>', get_defined_vars())), $code); $code = preg_replace("/%%support%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_support", sprintf(_x('If you need assistance, please <a href="%s" target="_blank">contact support</a>.', "s2member-front", "s2member"), esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["reg_email_support_link"])), get_defined_vars())), $code); $code = preg_replace("/%%tracking%%/i", c_ws_plugin__optimizemember_utils_strings::esc_ds(apply_filters("ws_plugin__optimizemember_return_template_tracking", c_ws_plugin__optimizemember_tracking_codes::generate_all_tracking_codes(), get_defined_vars())), $code); /**/ return apply_filters("ws_plugin__optimizemember_return_template", $code, get_defined_vars()); }
/** * Displays Capability Tracking Codes. * * These are stored inside optimizeMember's Transient Queue by the IPN processor. * * Tracking Codes are only displayed/processed one time. * optimizeMember will display Tracking Codes in (1) of these 3 locations: * * o On the Return URL / Thank-You Page, after returning from your Payment Gateway. * o Otherwise, if possible, on the Login Form *( in the footer )* after returning from your Payment Gateway. * o Otherwise, in the footer of your WordPress theme, as soon as possible; or after the Customer's next login. * * @package optimizeMember\Tracking * @since 110815 * * @attaches-to ``add_action("login_footer");`` * @attaches-to ``add_action("wp_footer");`` * @also-called-by {@link optimizeMember\Tracking\c_ws_plugin__optimizemember_tracking_codes::generate_all_tracking_codes()} * * @return null After displaying possible Tracking Code(s). */ public static function display_ccap_tracking_codes() { do_action("ws_plugin__optimizemember_before_display_ccap_tracking_codes", get_defined_vars()); /**/ if (!empty($_COOKIE["optimizemember_tracking"]) && ($subscr_or_txn_id = c_ws_plugin__optimizemember_utils_encryption::decrypt($_COOKIE["optimizemember_tracking"])) || ($reg_cookies = c_ws_plugin__optimizemember_register_access::reg_cookies_ok()) && extract($reg_cookies) && ($subscr_or_txn_id = $subscr_id)) { if ($code = get_transient($transient = "s2m_" . md5("optimizemember_transient_ccap_tracking_codes_" . $subscr_or_txn_id))) { delete_transient($transient); /* Only display this ONE time. Delete transient immediately. */ /**/ echo '<img src="' . esc_attr(site_url("/?optimizemember_delete_tracking_cookie=1")) . '" alt="." style="width:1px; height:1px; border:0;" />' . "\n"; /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_during_display_ccap_tracking_codes", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site()) { echo do_shortcode($code) . "\n"; /* No PHP here. */ } else { echo do_shortcode(c_ws_plugin__optimizemember_utilities::evl($code)); } } } /**/ do_action("ws_plugin__optimizemember_after_display_ccap_tracking_codes", get_defined_vars()); /**/ return; /* Return for uniformity. */ }
/** * Generates optimizeMember Security Badge. * * @package optimizeMember\Utilities * @since 3.5 * * @param str $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 str HTML markup for display of optimizeMember 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")) { $badge = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($template))); $badge = preg_replace("/%%site_url%%/i", urlencode(site_url()), preg_replace("/%%v%%/i", (string) $v, $badge)); $badge = preg_replace("/%%no_cache%%/i", $no_cache ? "&no_cache=" . urlencode(mt_rand(0, PHP_INT_MAX)) : "", $badge); $badge = preg_replace("/%%display_on_failure%%/i", $display_on_failure ? "&display_on_failure=1" : "", $badge); } /**/ return !empty($badge) ? $badge : ""; /* Return Security Badge. */ }
/** * Shortcode `[optimizeMember-Pro-ccBill-Button /]`. * * @package optimizeMember\ccBill * @since 1.5 * * @attaches-to ``add_shortcode("optimizeMember-Pro-ccBill-Button");`` * * @param array $attr An array of Attributes. * @param str $content Content inside the Shortcode. * @param str $shortcode The actual Shortcode name itself. * @return str The resulting ccBill Button Code, HTML markup. */ public static function sc_ccbill_button($attr = FALSE, $content = FALSE, $shortcode = FALSE) { c_ws_plugin__optimizemember_no_cache::no_cache_constants(true); /**/ $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); /**/ $attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "2.95", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "sub_account" => "", "form" => "", "output" => "anchor"), $attr); /**/ $attr["tt"] = strtoupper($attr["tt"]); $attr["rt"] = strtoupper($attr["rt"]); $attr["ccaps"] = strtolower($attr["ccaps"]); $attr["rr"] = $attr["rt"] === "L" ? "0" : $attr["rr"]; $attr["rr"] = $attr["level"] === "*" ? "0" : $attr["rr"]; /**/ if ($attr["rr"] && ($attr["ta"] <= 0 || $attr["tp"] <= 0 || !$attr["tt"])) { eval('$attr["ta"] = $attr["ra"]; $attr["tp"] = $attr["rp"]; $attr["tt"] = $attr["rt"];'); } /**/ if ($attr["modify"] || $attr["cancel"]) { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-edit-button.png"; /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-cancellation-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } /**/ unset($href, $url, $m); } else { if ($attr["sp"]) { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-button.png"; /**/ $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"]; /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-sp-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => round($attr["exp"] / 24), "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_desc" => $attr["desc"], "s2_invoice" => $attr["sp_ids_exp"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]); /**/ if ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) { $vars["s2_referencing"] = $referencing; } /**/ $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_link_gen($vars))), $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; $code = $attr["output"] === "url" ? $url : $code; /**/ unset($href, $url, $m); } else { if ($attr["level"] === "*") { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-button.png"; /**/ $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-ccaps-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]); /**/ if ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) { $vars["s2_referencing"] = $referencing; } /**/ $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_link_gen($vars))), $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; $code = $attr["output"] === "url" ? $url : $code; /**/ unset($href, $url, $m); } else { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/ccbill-button.png"; /**/ $attr["desc"] = !$attr["desc"] ? $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $attr["level"] . "_label"] : $attr["desc"]; /**/ $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-checkout-button.php"))); /* * Custom button */ if (!empty($content)) { $code = preg_replace('/%%button_markup%%/', $content, $code); } else { $code = preg_replace("/%%button_markup%%/", '<a href="%%url%%"><img src="%%images%%/ccbill-button.png" style="width:auto; height:auto; border:0;" alt="ccBill" /></a>', $code); } $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ if (!$attr["rr"]) { $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_p1" => "0 D", "s2_p3" => $attr["rp"] . " " . $attr["rt"], "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]); } else { /* Otherwise, we need to include both an Initial and Regular/Recurring period. This will ALWAYS recur. */ $vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ta"], "formPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["tp"], $attr["tt"]), "formRecurringPrice" => $attr["ra"], "formRecurringPeriod" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "formRebills" => "99", "currencyCode" => c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_p1" => $attr["tp"] . " " . $attr["tt"], "s2_p3" => $attr["rp"] . " " . $attr["rt"], "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]); } /**/ if ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) { $vars["s2_referencing"] = $referencing; } /**/ $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_ccbill_utilities::ccbill_link_gen($vars))), $code); /* * Only when there is no custom button */ if (empty($content)) { $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); } /**/ $code = $attr["output"] === "anchor" ? $code : $code; $code = $attr["output"] === "url" ? $url : $code; /**/ unset($href, $url, $m); } } } /**/ $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code); return $code; }
public function __construct() { echo '<div class="wrap ws-menu-page op-bsw-wizard op-bsw-content">' . "\n"; /**/ echo '<div class="op-bsw-header">'; echo '<div class="op-logo"><img src="' . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images/" . 'logo-optimizepress.png" alt="OptimizePress" height="50" class="animated flipInY"></div>'; echo '</div>'; echo '<div class="op-bsw-main-content inline-input-fields">'; echo '<h2>OptimizeMember Pro / PayPal Pro Forms</h2>' . "\n"; /**/ echo '<table class="ws-menu-page-table">' . "\n"; echo '<tbody class="ws-menu-page-table-tbody">' . "\n"; echo '<tr class="ws-menu-page-table-tr">' . "\n"; echo '<td class="ws-menu-page-table-l">' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="Quick-Start Guide For PayPal Pro">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-forms-guide-section">' . "\n"; echo '<img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/large-icon.png" title="optimizeMember ( a Membership management system for WordPress )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n"; echo '<h3>Quick-Start Guide For PayPal Pro Integration</h3>' . "\n"; //echo '<p style="margin-bottom:0;"><strong>See also:</strong> This KB article: <a href="http://www.optimizepress.com/kb/pro-forms/" target="_blank" rel="external">optimizeMember Pro Forms</a>.</p>'."\n"; //echo '<p style="margin-top:0;"><strong>See also:</strong> This KB article: <a href="http://www.optimizepress.com/kb/paypal-account-types/" target="_blank" rel="external">PayPal Compatibility (Account Types)</a>.</p>'."\n"; echo '<p>The optimizeMember Pro Module makes it possible for optimizeMember to use PayPal Pro Forms ( instead of standard PayPal Buttons ). PayPal Pro Forms integrate seamlessly with WordPress Shortcodes. This allows you to keep Customers on your site at all times, and it consolidates the Checkout / Registration steps into a single form that you can dress up just the way you like. If you would like to take advantage of PayPal Pro integration, please supply your PayPal API Username, Password, and Signature. See <code>optimizeMember -> PayPal Options</code>.</p>' . "\n"; echo '<p><em><strong>*PayPal Pro Integration*</strong> You will need a <a href="http://www.optimizepress.com/paypal" target="_blank" rel="external">PayPal Business Account, w/Pro Service</a>. PayPal Pro accounts require a formal application, along with a small monthly fee. Once you have a PayPal Pro account, you\'ll need access to your <a href="http://www.optimizepress.com/paypal-profile-api-access" target="_blank" rel="external">PayPal API Credentials</a>. Log into your PayPal Pro account, and navigate to <code>Profile -> API Access (or Request API Credentials)</code>. You\'ll choose <code>( Request API Signature )</code>.</em></p>' . "\n"; echo '<p><em><strong>*Recurring Billing*</strong> If you plan to use any of the ( `Subscription` ) options in the Form Generators below, you will ALSO need <a href="http://www.optimizepress.com/paypal-pro-recurring-payments-faqs" target="_blank" rel="external">Recurring Billing</a> enabled for your PayPal Pro account. PayPal\'s Recurring Billing service for Pro accounts is <strong>required</strong> for all types of ( `Subscriptions` ), whether you intend for them to be recurring or not. However, it is NOT required for ( `Buy Now` ) functionality. The drop-down menus, in the sections below, have been marked ( `Subscription` ) and ( `Buy Now` ) just for this reason. This way you can see which options will require the use of PayPal\'s Recurring Billing service. PayPal will charge you a small monthly fee for their Recurring Billing service; which is an add-on for PayPal Pro accounts.</em></p>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>*Secure Server*</strong> In order to comply with PayPal and PCI Compliance policies, as set forth by major credit card companies; you will need to host all of your PayPal Pro Forms on an SSL enabled site. Please check with your hosting provider to ask about obtaining an SSL certificate for your domain. Please note... when you create PayPal Pro Forms with optimizeMember; you\'ll be supplied with WordPress Shortcodes, which you\'ll insert into Posts/Pages of your choosing. These special Posts/Pages will need to be displayed in SSL mode, using links that start with ( <code>https://</code> ). — You can skip the SSL certificate during Sandbox testing. SSL is not required until you officially go live. Once you\'re live, you can add the Custom Field <code>optimizemember_force_ssl = yes</code> to any Post/Page.</em></p>' . "\n" : '<p><em><strong>*Secure Server*</strong> In order to comply with PayPal and PCI Compliance policies, as set forth by major credit card companies; you will need to host all of your PayPal Pro Forms on an SSL enabled page. When you create PayPal Pro Forms with optimizeMember; you\'ll be supplied with WordPress Shortcodes, which you\'ll insert into Posts/Pages of your choosing. These special Posts/Pages will need to be displayed in SSL mode, using links that start with ( <code>https://</code> ). You can add the Custom Field <code>optimizemember_force_ssl = yes</code> to any Post/Page that contains a Pro Form Shortcode. This tells optimizeMember to force those special Posts/Pages to be viewed over SSL at all times; no matter what.</em></p>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>*SSL Compatibility*</strong> All themes available at <a href="http://www.optimizepress.com/" target="_blank" rel="external">optimizePress.com</a> include full support for SSL, as does WordPress itself. However, there are many themes/plugins that do NOT support SSL enabled Posts/Pages like they should. For this reason, you should be very careful when choosing a WordPress theme to use with optimizeMember Pro. Otherwise, your visitors could see the famous "Secure/Insecure" warnings in Internet Explorer browsers. With optimizeMember installed, you can add the Custom Field <code>optimizemember_force_ssl = yes</code> to any Post/Page. optimizeMember will buffer output on those special Posts/Pages, converting everything over to <code>https://</code> for you automatically, and forcing those specific Posts/Pages to be viewed over a secure SSL connection; so long as your server supports the https protocol.</em></p>' . "\n" : ''; echo '<p><em><strong>*PayPal Pro is NOT Absolutely Required*</strong> optimizeMember is very flexible. It is now possible to integrate Pro Forms without a PayPal Pro account, whereby the enhanced Form Shortcodes that optimizeMember provides can be integrated ONLY with PayPal Express Checkout. In other words, if you get declined for PayPal Pro service, you can still use optimizeMember Pro Forms. Ask PayPal to activate Express Checkout for you. ( it\'s free ). Once Express Checkout is enabled, you will have access to your <a href="http://www.optimizepress.com/paypal-profile-api-access" target="_blank" rel="external">PayPal API Credentials</a>. Log into your PayPal account, and navigate to <code>Profile -> API Access (or Request API Credentials)</code>. You\'ll choose <code>( Request API Signature )</code>. Now ... here is the tricky part; whenever you generate a Pro Form Shortcode with optimizeMember, be sure to change <code>accept="paypal,visa,mastercard,amex,discover,maestro,solo"</code> to just <code>accept="paypal"</code>; thereby excluding the on-site credit card processing functionality; which is available only with PayPal Pro.</em></p>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="PayPal Pro / Free Registration Forms">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-registration-forms-section">' . "\n"; echo '<h3>One Form Does It All For Free Registrations ( copy/paste )</h3>' . "\n"; echo '<p>Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0.</p>' . "\n"; echo '<p><em><strong>*Note*</strong> the use of this particular Form will override your Open Registration configuration. In other words, making this Form available is the same as turning Open Registration <code>(on)</code>. One of the benefits to this functionality, is that it makes it possible for you to integrate this Free Registration Form in creative ways ( i.e. making it available ONLY under certain circumstances ); while still leaving Open Registration <code>(off)</code> throughout the rest of the site.</em></p>' . "\n"; echo '<p><em><strong>*Tip ( optional )*</strong> It is also possible to change the <code>level="0"</code> Attribute to something other than the default Level #0 ( Free Subscriber ). For example, if you need to, you can change it to <code>level="1"</code>, attach Custom Capabilities with the <code>ccaps=""</code> Attribute, and even limit this access to a certain timeframe with <code>tp="30" tt="D"</code> ( i.e. 30 Days ). So this Form is very flexible. It can be used to allow free access to just about any aspect of your service. For more information on Attributes, please see the section below: Shortcode Attributes ( Explained ).</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-registration-form-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("0")), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level0_label"])), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-registration-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<div class="ws-menu-page-group" title="PayPal Pro Forms For Level ' . $labelText . ' Access">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-level' . $n . '-forms-section">' . "\n"; echo '<h3>Pro Form Generator For Level ' . $labelText . ' Access</h3>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Form Code). These special PayPal Forms are customized to work with optimizeMember seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, optimizeMember will automatically terminate their Membership privileges. optimizeMember makes extensive use of the PayPal IPN service. optimizeMember receives updates from PayPal behind-the-scene.</p>' . "\n"; echo '<p><em>* Forms are NOT saved here. This is only a Form Generator. Once you\'ve generated your Form, copy/paste it into any Post/Page you like. You\'ll want to provide your visitors with a link to the Post/Page where this Form is located. We suggest placing a link to this Form on your Membership Options Page. That way your visitors can get registered & checkout!</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p id="ws-plugin--optimizemember-pro-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-pro-level' . $n . '-trial-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n"; echo '<p><span id="ws-plugin--optimizemember-pro-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-level' . $n . '-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_payflow_api_username"] ? "payflow" : "paypal") . "-membership-regular-terms.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-desc" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="68" /></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-level' . $n . '-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalFormGenerate(\'level' . $n . '\');" class="button-primary" /></p>' . "\n"; echo '<p' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-ccaps" size="40" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-form-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($n)), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"])), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; } /**/ echo '<div class="ws-menu-page-group" title="PayPal Pro Billing Modification Forms">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-modification-forms-section">' . "\n"; echo '<h3>Pro Form Generator For Billing Modifications</h3>' . "\n"; echo '<p>If you\'d like to give your Members ( and/or your Free Subscribers ) the ability to change ( modify ) their billing plan; you can generate a new PayPal Modification Form here. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Form available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade link into your Login Welcome Page, which would up-sell existing Level #1 Members to a more expensive plan that you offer.</p>' . "\n"; echo '<p><em><strong>*Modification Process*</strong> Very simple. A Member clicks a link to a special Post/Page, which contains a Modification Form you\'ve generated. The Member fills in their billing information. After a successful form submission, optimizeMember will update the status of their account to the Level, pricing, and terms that you configure below. If the Member already has an existing paid Subscription with you, that paid Subscription will be cancelled automatically behind-the-scene, and a new paid Subscription will be created to replace the old one. Again, the new paid Subscription is based on the Level, pricing, and terms that you specify below. If you need to give Customers some sort of grace period when/if they upgrade to a more expensive plan, please feel free to handle this through the application of free days, or with special pricing configured below.</em></p>' . "\n"; echo '<p><em><strong>*Integrating Conditionals*</strong> Since each Modification Form is configured for a specific Level, you may want to create multiple Modification Forms, one for each combination you intend to make available. optimizeMember\'s API Conditionals can help you display the proper Form to each Customer, based on the status of their existing account. For further details, see: <code>optimizeMember -> API Scripting</code>.</em></p>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>*Independent Custom Capabilities*</strong> If you just want to sell an existing Member new Custom Capabilities, without affecting their paid Subscription in any way, please see the next Form Generator: <code>Capability (Buy Now) Forms</code>. Independent Capability Forms facilitate Buy Now functionality, specifically for Custom Capabilities, without affecting the Customer\'s primary Subscription and Membership Level Access.</em></p>' . "\n" : ''; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p>Modification: <select id="ws-plugin--optimizemember-pro-modification-level">' . "\n"; /**/ for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<optgroup label="Level ' . $labelText . '">' . "\n"; echo '<option value="upgrade:' . $n . '">↑ Upgrade To Level ' . $labelText . '</option>' . "\n"; echo $n < $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"] ? '<option value="downgrade:' . $n . '">↓ Downgrade To Level ' . $labelText . '</option>' . "\n" : ''; echo '</optgroup>' . "\n"; /**/ echo $n < $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"] ? '<option disabled="disabled"></option>' . "\n" : ''; } /**/ echo '</select></p>' . "\n"; /**/ echo '<p id="ws-plugin--optimizemember-pro-modification-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-pro-modification-trial-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-trial-amount" value="0.00" size="4" /></p>' . "\n"; echo '<p><span id="ws-plugin--optimizemember-pro-modification-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-modification-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/" . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_payflow_api_username"] ? "payflow" : "paypal") . "-membership-regular-terms.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-desc" value="Description and pricing details here." size="68" /></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-modification-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalFormGenerate(\'modification\');" class="button-primary" /></p>' . "\n"; echo '<p' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-ccaps" size="40" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-form-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("1")), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level1_label"])), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/\\/]\$/", 'modify="1" /]', $ws_plugin__optimizemember_pro_temp_s); /* Adds modify="1" to the end of the Shortcode. */ echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-modification-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) { echo '<div class="ws-menu-page-group" title="PayPal Pro Capability (Buy Now) Forms">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-ccap-forms-section">' . "\n"; echo '<h3>Pro Form Generator For Independent Custom Capabilities</h3>' . "\n"; echo '<p>This is VERY advanced. For further details, please check your Dashboard: <code>optimizeMember -> API Scripting -> Custom Capabiities</code>.</p>' . "\n"; echo '<p>With optimizeMember, you can sell one or more Custom Capabilities using Buy Now functionality, to "existing" Users/Members, regardless of which Membership Level they have on your site <em>( i.e. you could even sell Independent Custom Capabilities to Users at Membership Level #0, normally referred to as Free Subscribers, if you like )</em>. So this is quite flexible. Independent Custom Capabilities do NOT rely on any specific Membership Level. That\'s why optimizeMember refers to these as `Independent` Custom Capabilities, because you can sell Capabilities this way, through Buy Now functionality, and the Customer\'s Membership Level Access, along with any existing paid Subscription they may already have with you, will remain completely unaffected. That being said, if you intend to charge a recurring fee for Custom Capabilities, please use a <code>Billing Modification Form</code> instead; because Independent Custom Capabilities can only be sold through Buy Now functionality.</p>' . "\n"; echo '<p>Independent Custom Capabilities are added to a Customer\'s account immediately after checkout, and the Customer will have the Custom Capabilities for as long as their Membership lasts, based on their primary Subscription with your site, and/or forever, if they have a Lifetime account with you. In other words, Independent Custom Capabilities will exist on the Customer\'s account forever, or until an EOT <em>( End Of Term )</em> occurs on their primary Subscription with you; in which case optimizeMember would demote or delete the Customer\'s account <em>( based on your EOT configuration )</em>, and all Custom Capabilities are removed as well.</p>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each set of Custom Capabilities that you plan to sell. Then press (Generate Form Code). These special PayPal Forms are customized to work with optimizeMember seamlessly. The Customer will be granted additional access to one or more Custom Capabilities that you specify; while the Customer\'s Membership Level Access and any existing paid Subscription they may already have with you, will remain completely unaffected.</p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-ccap-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-ccap-terms.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-desc" value="Description and pricing details here." size="68" /></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-ccap-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalCcapFormGenerate();" class="button-primary" /></p>' . "\n"; echo '<p>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-ccaps" size="40" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-ccaps-checkout-form-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; } /**/ echo '<div class="ws-menu-page-group" title="PayPal Pro Billing Update Forms">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-update-forms-section">' . "\n"; echo '<h3>One Form Does It All For Billing Updates ( copy/paste )</h3>' . "\n"; echo '<p>An Update Form can be provided to existing Members, as a way for them to update their billing information; without modifying their existing paid Subscription in any way. For instance, a Customer may need to update their billing information, because their credit card is expiring, or because they moved their bank account.</p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-update-form-shortcode.php"))); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-update-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="PayPal Pro Billing Cancellation Forms">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-cancellation-forms-section">' . "\n"; echo '<h3>One Form Does It All For Cancellations ( copy/paste )</h3>' . "\n"; echo '<p>According to PayPal\'s policy on recurring billing, you MUST provide each and every Customer with an easy to way to cancel future charges. Generating a Cancellation Form here, and making that Form available to all Customers is our recommendation. For further details and legalities, please visit the <a href="https://www.x.com/" target="_blank" rel="external">PayPal Developer Network</a>.</p>' . "\n"; echo '<p><em><strong>*Cancellation Process*</strong> Very simple. A Member clicks a link to a Post/Page that contains a Cancellation Form you\'ve generated. The Member clicks the Submit button to confirm the cancellation. optimizeMember is notified silently behind-the-scene, and will immediately cancel all future billing. optimizeMember will later terminate their account access, at the correct point in time. This works in conjunction with the optimizeMember Auto-EOT System. For further details, see: <code>optimizeMember -> PayPal Options -> EOT Behavior</code>.</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-cancellation-form-shortcode.php"))); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-cancellation-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="PayPal Member Registration Access Links">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-reg-links-section">' . "\n"; echo '<h3>Registration Access Link Generator ( for Customer Service )</h3>' . "\n"; echo '<p>optimizeMember Pro Forms consolidate the Registration/Checkout process into a single-step solution, so it is unlikely that you will ever need this tool. That being said, if you DO need to deal with a Customer Service issue that requires a simple paid Registration Access Link to be created manually, you can use this tool for that. Alternatively, you can create their account yourself/manually by going to <code>optimizeMember -> Add A Member</code>. Either of these methods will work fine.</p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p>Paid Membership Level#: <select id="ws-plugin--optimizemember-pro-reg-link-level">' . "\n"; for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<option value="' . $n . '">optimizeMember Level ' . $labelText . '</option>' . "\n"; } echo '</select></p>' . "\n"; echo '<p>Paid Subscr. ID: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-subscr-id" value="" size="50" /> <a href="#" onclick="alert(\'The Customer\\\'s Paid Subscr. ID ( aka: Recurring Profile ID, Transaction ID ) must be unique. This value can be obtained from inside your PayPal account in the History tab. Each paying Customer MUST be associated with a unique Paid Subscr. ID. If the Customer is NOT associated with a Paid Subscr. ID, you will need to generate a unique value for this field on your own. But keep in mind, optimizeMember will be unable to maintain future communication with the PayPal IPN ( i.e. Notification ) service if this value does not reflect a real Paid Subscr. ID that exists in your PayPal History log.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; echo '<p>Custom String Value: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-custom" value="' . esc_attr($_SERVER["HTTP_HOST"]) . '" size="30" /> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\\n' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_pro_paypalRegLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-pro-reg-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n"; echo '<p' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-ccaps" size="40" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \\-]/g, \'_\').replace (/[^a-z_0-9,]/gi, \'\').toLowerCase ());" /></p>' . "\n"; echo '<p>Fixed Term Length ( for Buy Now transactions ): <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-fixed-term" value="" size="10" /> <a href="#" onclick="alert(\'If the Customer purchased Membership through a Buy Now transaction ( i.e. there is no Initial/Trial Period and no recurring charges for ongoing access ), you may configure a Fixed Term Length in this field. This way the Customer\\\'s Membership Access is revoked by optimizeMember at the appropriate time. This will be a numeric value, followed by a space, then a single letter.\\n\\nHere are some examples:\\n\\n1 D ( this means 1 Day )\\n1 W ( this means 1 Week )\\n1 M ( this means 1 Month )\\n1 Y ( this means 1 Year )\\n1 L ( this means 1 Lifetime )\'); return false;">[?]</a></p>' . "\n"; echo '<p id="ws-plugin--optimizemember-pro-reg-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="PayPal Specific Post/Page (Buy Now) Forms">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-sp-forms-section">' . "\n"; echo '<h3>Pro Form Generator For Specific Post/Page Forms</h3>' . "\n"; echo '<p>optimizeMember now supports an additional layer of functionality ( very powerful ), which allows you to sell access to specific Posts/Pages that you\'ve created in WordPress. Specific Post/Page Access works independently from Member Level Access. That is, you can sell an unlimited number of Posts/Pages using "Buy Now" functionality. Your Customers will NOT be required to have a Membership Account with your site in order to receive access. If they are already a Member, that\'s fine, but they won\'t need to be.</p>' . "\n"; echo '<p>In other words, Customers will NOT need to login, just to receive access to the Specific Post/Page they purchased access to. optimizeMember will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link ( see: <code>optimizeMember -> PayPal Options -> Specific Post/Page Email</code> ). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n"; echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress. A Specific Post/Page that is protected by optimizeMember, might contain a download link for your eBook, access to file & music downloads, access to additional support services, and the list goes on and on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress Post/Page that you\'ve created. To protect Specific Posts/Pages, please see: <code>optimizeMember -> Restriction Options -> Specific Post/Page Access</code>. Once you\'ve configured your Specific Post/Page Restrictions, those Posts/Pages will be available in the menus below.</p>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each Post/Page that you plan to sell. Then press (Generate Form Code). These special PayPal Forms are customized to work with optimizeMember seamlessly. You can even Package Additional Posts/Pages together into one transaction.</p>' . "\n"; echo '<p><em>* Forms are NOT saved here. This is only a Form Generator. Once you\'ve generated your Form, copy/paste it into any Post/Page you like. You\'ll want to provide your visitors with a link to the Post/Page where this Form is located.</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-leading-id">' . "\n"; echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n"; /**/ $ws_plugin__optimizemember_pro_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts"); /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n"; echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n"; /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-sp-hours">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-sp-hours.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-desc" value="Description and pricing details here." size="68" /></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nWith PayPal Pro integration, this is only applied to PayPal Express Checkout pages; when/if a Customer chooses PayPal as the Payment Method.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-pro-sp-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Form Code" onclick="ws_plugin__optimizemember_pro_paypalSpFormGenerate();" class="button-primary" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-form-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="PayPal Specific Post/Page Access Links">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-sp-links-section">' . "\n"; echo '<h3>Specific Post/Page Link Generator ( for Customer Service )</h3>' . "\n"; echo '<p>optimizeMember automatically generates Specific Post/Page Links for your Customers after checkout, and also sends them a link in a Confirmation Email. However, if you ever need to deal with a Customer Service issue that requires a new Specific Post/Page Link to be created manually, you can use this tool for that.</p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-leading-id">' . "\n"; echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n"; /**/ $ws_plugin__optimizemember_pro_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts"); /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n"; echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n"; /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-hours">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-sp-hours.php"))) . '</select> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_pro_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-pro-sp-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n"; echo '<p id="ws-plugin--optimizemember-pro-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) { echo '<div class="ws-menu-page-group" title="Custom Return URLs Upon Success">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-forms-success-section">' . "\n"; echo '<h3>Custom Return URLs Upon Success ( optional, for developers )</h3>' . "\n"; echo '<p>optimizeMember Pro opens the door for Custom Return URLs upon success. You can add a special attribute to any Form Shortcode ( <code>success="/my-thank-you-page/"</code> ). This makes it possible to integrate PayPal Pro Forms in very creative ways; and even receive/verify Replacement Code variables, as needed. For example, ( <code>success="/my-thank-you-page/?subscr_id=%%subscr_id%%"</code> ).</p>' . "\n"; echo '<p><em>A Custom Return URL is 100% optional. In fact, if you only need to obtain details for the purpose of tracking sales, you should just use the simpler API Tracking methods provided by optimizeMember, under: <code>optimizeMember -> API / Tracking</code>. In other words, if you don\'t use the <code>success=""</code> attribute in your Shortcode, optimizeMember will handle things gracefully, all on its own. So using a Custom Return URL is only necessary when you need advanced customization for one reason or another.</em></p>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<h3>Free Registration Forms ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-free-registration\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-forms-success-free-registration" style="display:none;">' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%role%%</code> = The Role ID <code>( subscriber, optimizemember_level[0-9]+, administrator, editor, author, contributor )</code>.</li>' . "\n"; echo '<li><code>%%level%%</code> = The Level number <code>( 0, 1, 2, 3, 4 )</code>. ( <em>deprecated, no longer recommended; use <code>%%role%%</code></em> )</li>' . "\n"; echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> ( <em>in comma-delimited format</em> ).</li>' . "\n"; echo '<li><code>%%auto_eot_time%%</code> = Auto-EOT Time ( if applicable ). Ex: <code>1299925670</code> ( <em>unix timestamp</em> ).</li>' . "\n"; echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n"; echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n"; echo '<li><code>%%user_full_name%%</code> = The Full Name ( First & Last ) of the Member who registered their Username.</li>' . "\n"; echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n"; echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n"; echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n"; echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n"; echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>' . "\n"; echo '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n"; echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use <a href="http://www.optimizepress.com/codex/stable/s2member/api_functions/package-functions/#src_doc_optimizemember_decrypt()" target="_blank" rel="external">optimizemember_decrypt()</a>.</li>' . "\n"; echo '</ul>' . "\n"; /**/ echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n"; echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n"; echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n"; echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> optimizeMember -> General Options -> Registration/Profile Fields</em>.</li>' . "\n"; echo '</ul>' . "\n"; /**/ echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n"; echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n"; echo '</ul>' . "\n"; echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n"; echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n"; echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<h3>Membership Sales / Signups & Modifications ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-sales\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-forms-success-sales" style="display:none;">' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%subscr_id%%</code> = The PayPal Subscription ID, which remains constant throughout any & 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 & Fixed-Term Subscriptions are NOT recurring ( i.e. there is only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n"; echo '<li><code>%%initial%%</code> = The Initial Fee charged during signup. If you offered a 100% Free Trial, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent, whenever they initially signed up, no matter what. Even if that amount is 0.\\n\\nIf a Customer signs up, under the terms of a 100% Free Trial Period, this will be 0. So be careful using %%initial%% when you offer a 100% Free Trial Period, because a $0.00 sale amount could cause havoc with affiliate programs.\\n\\nIf you\\\'re offering a 100% Free Trial Period, and you need to track sales through affiliate programs, you can either hard-code an amount; or use `optimizeMember -> API Notifications -> Payment Notifications` instead.\'); return false;">?</a> ]</li>' . "\n"; echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. This value is <code>always > 0</code>, no matter what. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. The %%regular%% rate is always > 0. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n"; echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% & %%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 & Last ) of the Customer who purchased the Membership Subscription.</li>' . "\n"; echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n"; echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <code><em>level:custom_capabilities:fixed term</em></code> ) for the Membership Subscription.</li>' . "\n"; echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n"; echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n"; echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n"; echo '<li><code>%%modification%%</code> = <code>1</code> if/when a Billing Modification has just taken place; otherwise <code>0</code> indicates a new Customer.</li>' . "\n"; echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n"; echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n"; echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n"; echo '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n"; echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n"; echo '</ul>' . "\n"; /**/ echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n"; echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n"; echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n"; echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> optimizeMember -> General Options -> Registration/Profile Fields</em>.</li>' . "\n"; echo '</ul>' . "\n"; /**/ echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n"; echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n"; echo '</ul>' . "\n"; echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n"; echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n"; echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<h3>Independent Custom Capability Sales ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-ccaps\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-forms-success-ccaps" style="display:none;">' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%txn_id%%</code> = The Payment Transaction ID, which is always unique for each payment received.</li>' . "\n"; echo '<li><code>%%amount%%</code> = The Amount of the payment. Most affiliate programs calculate commissions from this.</li>' . "\n"; echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n"; echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n"; echo '<li><code>%%full_name%%</code> = The Full Name ( First & Last ) of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n"; echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Independent Custom Capabilities.</li>' . "\n"; echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <code><em>*level:custom_capabilities:fixed term</em></code> ) that the payment is for. [ <a href="#" onclick="alert(\'With Independent Custom Capabilities, the `level` portion of this string will be an asterisk ( `*` ), since the Membership Level is irrelevant, and remains `as it was`.\'); return false;">?</a> ]</li>' . "\n"; echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n"; echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file with your Payment Gateway.</li>' . "\n"; echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n"; echo '<li><code>%%user_ip%%</code> = The Customer\'s original IP Address, during checkout/registration via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n"; echo '<li><code>%%user_id%%</code> = A unique WordPress User ID that references this account in the WordPress database.</li>' . "\n"; echo '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n"; echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, it might contain a link to the login page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n"; echo '</ul>' . "\n"; /**/ echo '<strong>Custom Registration/Profile Fields are also supported here:</strong>' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>date_of_birth</code>.</li>' . "\n"; echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>street_address</code>.</li>' . "\n"; echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration/Profile Field with the ID <code>country</code>.</li>' . "\n"; echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> optimizeMember -> General Options -> Registration/Profile Fields</em>.</li>' . "\n"; echo '</ul>' . "\n"; /**/ echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n"; echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n"; echo '</ul>' . "\n"; echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n"; echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n"; echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<h3>Specific Post/Page Transactions ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-sp-sales\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-forms-success-sp-sales" style="display:none;">' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%sp_access_url%%</code> = The full URL ( generated by optimizeMember ) where the Customer can gain access.</li>' . "\n"; echo '<li><code>%%sp_access_exp%%</code> = Human readable expiration for <code>%%sp_access_url%%</code>. Ex: <em>( link expires in <code>%%sp_access_exp%%</code> )</em>.</li>' . "\n"; echo '<li><code>%%txn_id%%</code> = The PayPal Transaction ID. PayPal assigns a unique identifier for every purchase.</li>' . "\n"; echo '<li><code>%%amount%%</code> = The full Amount of the sale. Most affiliate programs calculate commissions from this.</li>' . "\n"; echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n"; echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n"; echo '<li><code>%%full_name%%</code> = The Full Name ( First & Last ) of the Customer who purchased Specific Post/Page Access.</li>' . "\n"; echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased Specific Post/Page Access.</li>' . "\n"; echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n"; echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> ( translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code> ).</li>' . "\n"; echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n"; echo '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link to the Specific Post/Page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n"; echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link to the Specific Post/Page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n"; echo '</ul>' . "\n"; /**/ echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n"; echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n"; echo '</ul>' . "\n"; echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n"; echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n"; echo '<code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<h3>Cancellations & Billing Updates ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-cancellations-updates\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-forms-success-cancellations-updates" style="display:none;">' . "\n"; echo '<ul style="margin: 10px 0 10px 20px; list-style: disc outside;">' . "\n"; echo '<li><code>%%response%%</code> = Deprecated. Use <code>%%s_response%%</code>. A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link back to their account page. You don\'t have to use this. You can generate your own response if you like.</li>' . "\n"; echo '<li><code>%%s_response%%</code> = A successful response message that *would* have been displayed to the Customer, had they NOT been redirected to your Custom Return URL upon success. This may contain some basic HTML. For instance, a link back to their account page. You don\'t have to use this. You can generate your own response if you like. Value is encrypted. Use optimizemember_decrypt().</li>' . "\n"; echo '</ul>' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<h3>Verify The Integrity Of Replacement Codes ( <a href="#" onclick="jQuery(\'div#ws-plugin--optimizemember-pro-forms-success-verification\').toggle(); return false;" class="ws-dotted-link">open/close</a> )</h3>' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-forms-success-verification" style="display:none;">' . "\n"; echo '<p>If you know a little PHP, you can verify the integrity of the Replacement Codes returned by optimizeMember. This is important, because in this particular situation, Replacement Codes are passed publicly in the query string of your Custom Return URL. In other words, a Customer could manually change one of the values; like the dollar amounts. For this reason, you should always verify the integrity of the details being returned to any processing routines that receive this information. In the PHP code for your Custom Return URL, you can use this optimizeMember API Function: <code>optimizemember_pro_paypal_s2p_v_query_ok()</code>.</p>' . "\n"; echo '<p>Here are some examples:</p>' . "\n"; echo '<p>1. <strong>Shortcode attribute:</strong> <code>success="/thank-you/?subscr_id=%%subscr_id%%&initial=%%initial%%&regular=%%regular%%"</code></p>' . "\n"; echo '<p>2. <strong>optimizeMember returns Customer to:</strong> <code>/thank-you/?subscr_id=123&initial=0.00&regular=24.95&s2p-v=234098234-23409sdfs234sd234209sdf</code></p>' . "\n"; echo '<p>3. <strong>Now, in your Custom Return Page, you will need to do this before trusting anything:</strong></p>' . "\n"; echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-s2p-v-query-ok-1.x-php")) . '</p>' . "\n"; echo '<p>optimizeMember will only verify a query string for up to 10 seconds. After 10 seconds, <code>optimizemember_pro_paypal_s2p_v_query_ok()</code> will always return <code>false</code>, even if the integrity of the query string is valid. This prevents a Customer from bookmarking your Return URL; thereby causing duplicate commissions; in case you\'re using it for tracking purposes.</p>' . "\n"; echo '<p>Again, if you only need to obtain details for the purpose of tracking sales, you should just use the simpler API Tracking methods provided by optimizeMember, under: <code>optimizeMember -> API / Tracking</code>. The API Tracking methods are specifically designed for tracking sales, exactly ONE time for each Customer.</p>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<p><em>If it is your intention to allow Customers to bookmark your Custom Return URL, you can still do that. Just be aware that <code>optimizemember_pro_paypal_s2p_v_query_ok()</code> will return <code>false</code> after the first 10 seconds. If you want to verify after 10 seconds, you can pass a second argument to the function, like this:</em></p>' . "\n"; echo '<p>' . c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/paypal-s2p-v-query-ok-2.x-php")) . '</p>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<h3>Could a Customer change the timestamp in the URL?</h3>' . "\n"; echo '<p>Based on the structure of the URL, it would appear possible; however, it\'s NOT. optimizeMember uses an advanced checksum.</p>' . "\n"; echo '<h3>Can I get rid of the <code>s2p-v</code> variable?</h3>' . "\n"; echo '<p>No, this variable is always passed to your Custom Return URL, it\'s for important verification purposes.</p>' . "\n"; echo '</div>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; } /**/ echo '<div class="ws-menu-page-group" title="Shortcode Attributes ( Explained )">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-shortcode-attrs-section">' . "\n"; echo '<h3>Shortcode Attributes ( Explained In Full Detail )</h3>' . "\n"; echo '<p>When you generate a Form, optimizeMember will make a <a href="http://codex.wordpress.org/Shortcode_API#Overview" target="_blank" rel="external">Shortcode</a> available to you. Like most Shortcodes for WordPress, optimizeMember reads Attributes in your Shortcode. These Attributes will be pre-configured by one of optimizeMember\'s Form Generators automatically; so there really is nothing more you need to do. However, many site owners like to know exactly how these Shortcode Attributes work. Below, is a brief overview of each possible Shortcode Attribute.</p>' . "\n"; /**/ echo '<table class="form-table" style="margin-top:0;">' . "\n"; echo '<tbody>' . "\n"; echo '<tr style="padding-top:0;">' . "\n"; /**/ echo '<td style="padding-top:0;">' . "\n"; echo '<ul>' . "\n"; echo '<li><code>accept="paypal,visa,mastercard,amex,discover,maestro,solo"</code> Accepted Billing Methods. A comma-delimited list of Billing Methods you want to accept. Due to a PayPal policy, you may NOT exclude PayPal from this list; optimizeMember won\'t let you. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>accept_via_paypal="paypal"</code> Accepted Billing via PayPal. A comma-delimited list of Billing Methods you want to accept through PayPal, as opposed to processing them on-site. Due to a PayPal policy, you may NOT exclude PayPal from this list; optimizeMember won\'t let you. <strong>Tip:</strong> If you don\'t have a PayPal Pro account, you can set <code>accept="paypal"</code>, or set <code>accept_via_paypal="paypal,visa,mastercard,amex,discover,maestro,solo"</code>. With one or both of these configurations, all you need is a PayPal Standard account with Express Checkout <em>( which is free )</em>. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>accept_coupons="1"</code> Accept Coupons? Possible values: <code>0</code> = do NOT accept Coupons on this particular Form; <code>1</code> = DO accept Coupon Codes on this particular Form.</li>' . "\n"; echo '<li><code>cancel="0"</code> Cancellation Form. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Cancellation Form, <code>1</code> = this IS a Cancellation Form.</li>' . "\n"; echo '<li><code>captcha="clean"</code> When you set this Attribute, visitors must prove they\'re human by typing a <a href="http://en.wikipedia.org/wiki/CAPTCHA" target="_blank" rel="external">captcha/security code</a>. Possible values: <code>0</code> = do NOT require a captcha code on this Form; <code>clean</code> = DO require a captcha code on this Form; using the <code>clean</code> theme style. Possible theme styles include: <code>red</code>, <code>white</code>, <code>clean</code>, and <code>blackglass</code>. This service is powered by Google\'s reCaptcha system.</li>' . "\n"; echo '<li><code>cc="USD"</code> 3 character Currency Code. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>ccaps="music,videos"</code> A comma-delimited list of Custom Capabilities. Only valid w/ Membership Level Access and/or Independent Custom Capabilities.</li>' . "\n" : ''; echo '<li><code>coupon="SAVE-10"</code> Default/pre-filled Coupon Code. This is optional, and the Coupon Code ( if supplied ) must exist in your Coupon Code configuration.</li>' . "\n"; echo '<li><code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '"</code> must start with your domain. Additional values can be piped in ( ex: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3|etc"</code> ). Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>default_country_code="US"</code> If you set this 2-character value, it will pre-configure the default Country that is selected in the drop-down menu for Checkout and Billing Update Forms. This MUST be an uppercase country code, following the <a href="http://www.iso.org/iso/english_country_names_and_code_elements" target="_blank" rel="external">ISO-3166-1 specification</a>. If this is empty ( i.e. <code>""</code> ) optimizeMember will set the default country code automatically; based on currency. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>desc="Gold Membership @ $29/mo"</code> A brief purchase Description. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>dg="0"</code> The Digital Goods directive. optimizeMember will eventually be integrated with <a href="http://www.optimizepress.com/paypal-express-co-digitals" target="_blank" rel="external">Digital Goods</a> for inline Express Checkout. But for now, this should always be <code>0</code>.</li>' . "\n"; echo '<li><code>exp="72"</code> Access Expires ( in hours ). Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n"; echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n"; echo '<li><code>lc=""</code> Optional 2 character Locale Code <em>( i.e. Country Code )</em>. This controls the interface language used if/when a Customer chooses PayPal Express Checkout as their payment method. If unspecified, the language is determined by PayPal Express Checkout when possible, defaulting to <code>US</code> <em>english</em> when not possible. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>level="1"</code> Membership Level [1-4] <em>( or, up to the number of configured Levels )</em>. Only valid for Forms providing Membership Level Access, which includes Free Registration Forms too. Free Registration Forms allow a value of <code>level="0"</code> whenever <code>register="1"</code> for Free Registration. In addition, Free Registration Forms will also allow visitors to register for free, even at higher Levels if you wish. Free Registration Forms will accept any value [0-4] <em>( or, up to the number of configured Levels )</em>.' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' With Independent Custom Capabilities this MUST be set to <code>level="*"</code>, and <code>ccaps=""</code> must NOT be empty <em>( i.e. <code>level="*" ccaps="music,videos"</code> )</em>.') . '</li>' . "\n"; echo '<li><code>modify="0"</code> Modification directive. Only valid w/ Membership Level Access. Possible values: <code>0</code> = allows Customers to modify their current Subscription or sign up for a new one, <code>1</code> = allows Customers to only modify their current Subscription. When <code>modify="1"</code>, optimizeMember will force a Customer to be logged-in before they can fill out the Form ( very handy ). This is slightly different than PayPal "Button" Codes; there is no "2" option for "Forms"; only <code>0</code> & <code>1</code> are valid values.</li>' . "\n"; echo '<li><code>ns="1"</code> The <em>no_shipping</em> directive. Possible values: <code>0</code> = prompt for an address, but do not require one, <code>1</code> = do not prompt for a shipping address, <code>2</code> = prompt for an address, and require one. Applies only to PayPal Express Checkout; because Pro Forms do not ask for a Shipping Address. However, you may request a Shipping Address by creating Custom Fields under: <em>optimizeMember -> General Options -> Registration/Profile Fields</em>. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>ps="paypal"</code> PayPal checkout Page Style. Applies only to PayPal Express Checkout. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>register="0"</code> Free Registration Form. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Free Registration Form, <code>1</code> = this IS a Free Registration Form.</li>' . "\n"; echo '<li><code>ra="0.01"</code> Regular, Buy Now, and/or Recurring Amount. Must be >= <code>0.01</code>. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>rp="1"</code> Regular Period. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Must be >= <code>1</code> ( ex: <code>1</code> Week, <code>2</code> Months, <code>1</code> Month, <code>3</code> Days ).</li>' . "\n"; echo '<li><code>rt="M"</code> Regular Term. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years, <code>L</code> = Lifetime. — <strong>NOTICE (regarding Payflow):</strong> Please be aware that <code>D</code> = Days is NOT possible under PayPal Pro (Payflow Edition). If you are operating a PayPal Pro account, with the Payflow Edition, please take note. Payflow supports ONLY a specific set of recurring intervals. Pro Forms integrated with the Payflow API, can be configured to charge: weekly, bi-weekly, monthly, quarterly, every six months, or yearly.</li>' . "\n"; echo '<li><code>rr="1"</code> Recurring directive. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>0</code> = non-recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>1</code> = recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>BN</code> = non-recurring "Buy Now" functionality, no Trial Period possible.</li>' . "\n"; echo '<li><code>rrt=""</code> Recurring Times <em>( i.e. a fixed number of installments )</em>. Only valid w/ Membership Level Access. When unspecified, any recurring charges will remain ongoing until cancelled, or until payments start failing. If this is set to <code>1 or higher</code> the regular recurring charges will only continue for X billing cycles, depending on what you specify. This is only valid when <code>rr="1"</code> for recurring "Subscriptions". Please note that a fixed number of installments, also means a fixed period of access. If a Customer\'s billing is monthly, and you set <code>rrt="3"</code>, billing will continue for only 3 monthly installments. After that, billing would stop, and their access to the site would be revoked as well <em>( based on your EOT Behavior setting under: optimizeMember -> PayPal Options )</em>.</li>' . "\n"; echo '<li><code>rra="2"</code> Reattempt failed payments? Possible values: <code>0</code> = do NOT reattempt billing when/if a recurring payment fails; <code>1 or higher</code> = yes, DO reattempt billing when/if a recurring payment fails. With PayPal Pro integration, PayPal will retry a maximum of 2 times whenever <code>rra="2"</code>; after that, a Subscription would be terminated due to Max Failed Payments having been reached. With PayPal Pro integration, the value of this attribute also configures Max Failed Payments. So a setting of <code>rra="2"</code> means that you allow a maximum of 2 failed payments.</li>' . "\n"; echo '<li><code>sp="0"</code> Specific Post/Page Form. Possible values: <code>0</code> = this is NOT a Specific Post/Page Access Form, <code>1</code> = this IS a Specific Post/Page Access Form.</li>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>success=""</code> 100% optional. This can be used to create a Custom Return URL on success. Please see the sub-section above titled: <em>Custom Return URLs on Success</em>.</li>' . "\n" : ''; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>template=""</code> 100% optional. This can be a custom template file that exists inside your WordPress theme directory. For example: <code>template="checkout.php"</code>.</li>' . "\n" : ''; echo '<li><code>ta="0.00"</code> Trial Amount. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n"; echo '<li><code>tp="0"</code> Trial Period. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n"; echo '<li><code>tt="D"</code> Trial Term. Only valid w/ Membership Level Access. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years.</li>' . "\n"; echo '<li><code>update="0"</code> Billing Update Form. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Billing Update Form, <code>1</code> = this IS a Billing Update Form.</li>' . "\n"; echo '</ul>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '</td>' . "\n"; /**/ echo '<td class="ws-menu-page-table-r">' . "\n"; c_ws_plugin__optimizemember_menu_pages_rs::display(); echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; /**/ echo '</div>' . "\n"; echo '</div>' . "\n"; }
/** * shortcode parsing of membership file downloads element * @param array $atts * @param string $content * @return String */ static function membership_download($atts, $content) { // Decode encoded chars $atts = op_urldecode($atts); extract(shortcode_atts(array('style' => 1), $atts)); //</editor-fold> // some preliminary checks // creating member dir if it does not exist if (!is_dir($files_dir = $GLOBALS['WS_PLUGIN__']['optimizemember']['c']['files_dir'])) { if (is_writable(dirname(c_ws_plugin__optimizemember_utils_dirs::strip_dir_app_data($files_dir)))) { mkdir($files_dir, 0777, true); } } // creating .htaccess file if it does not exist! 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__optimizemember_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']['optimizemember']['c']['files_dir_htaccess'])))); } } $content = do_shortcode(op_clean_shortcode_content($content)); $content = op_process_asset_content($content); if (!empty($content)) { $html = '<ul class="downloadlist-' . $style . ' border">' . $content . '</ul>'; } else { $html = ''; } return $html; }
/** * Shortcode `[optimizeMember-Pro-Google-Button /]`. * * @package optimizeMember\Google * @since 1.5 * * @attaches-to ``add_shortcode("optimizeMember-Pro-Google-Button");`` * * @param array $attr An array of Attributes. * @param str $content Content inside the Shortcode. * @param str $shortcode The actual Shortcode name itself. * @return str The resulting Google Button Code, HTML markup. */ public static function sc_google_button($attr = FALSE, $content = FALSE, $shortcode = FALSE) { c_ws_plugin__optimizemember_no_cache::no_cache_constants(true); /**/ $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); /**/ $attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor"), $attr); /**/ $attr["tt"] = strtoupper($attr["tt"]); $attr["rt"] = strtoupper($attr["rt"]); $attr["rr"] = strtoupper($attr["rr"]); $attr["ccaps"] = strtolower($attr["ccaps"]); $attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"]; $attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"]; $attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"]; /**/ if ($attr["modify"] || $attr["cancel"]) { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/google-edit-button.png"; /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-cancellation-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } /**/ unset($href, $url, $m); } else { if ($attr["sp"]) { $default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"]) . "&w=180&h=46&style=trans&variant=text&loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member")); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-sp-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ foreach ($attr as $key => $val) { $code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($val)), $code); } /**/ if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) { $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code); } /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } /**/ unset($href, $url, $m); } else { if ($attr["level"] === "*") { $default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"]) . "&w=180&h=46&style=trans&variant=text&loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member")); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-ccaps-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ foreach ($attr as $key => $val) { $code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($val)), $code); } /**/ if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) { $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code); } /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } /**/ unset($href, $url, $m); } else { $default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"]) . "&w=180&h=46&style=trans&variant=text&loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member")); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-checkout-button.php"))); /* * Custom button */ if (!empty($content)) { $code = preg_replace('/%%button_markup%%/', $content, $code); $code = preg_replace('/%%url%%/', '%%wpurl%%/?optimizemember_pro_google_co=1&co[level]=%%level%%&co[ccaps]=%%ccaps%%&co[desc]=%%desc%%&co[cc]=%%cc%%&co[custom]=%%custom%%&co[ta]=%%ta%%&co[tp]=%%tp%%&co[tt]=%%tt%%&co[ra]=%%ra%%&co[rp]=%%rp%%&co[rt]=%%rt%%&co[rr]=%%rr%%&co[image]=%%image%%&co[output]=%%output%%', $code); } else { $code = preg_replace("/%%button_markup%%/", '<a href="%%wpurl%%/?optimizemember_pro_google_co=1&co[level]=%%level%%&co[ccaps]=%%ccaps%%&co[desc]=%%desc%%&co[cc]=%%cc%%&co[custom]=%%custom%%&co[ta]=%%ta%%&co[tp]=%%tp%%&co[tt]=%%tt%%&co[ra]=%%ra%%&co[rp]=%%rp%%&co[rt]=%%rt%%&co[rr]=%%rr%%&co[image]=%%image%%&co[output]=%%output%%"><img src="https://checkout.google.com/buttons/checkout.gif?w=180&h=46&style=trans&variant=text&loc=' . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member")) . '" style="width:auto; height:auto; border:0;" alt="Google" /></a>', $code); } $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ foreach ($attr as $key => $val) { $code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($val)), $code); } /**/ if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) { $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code); } /* * Only when there is no custom button */ if (empty($content)) { $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); } /**/ $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } /**/ unset($href, $url, $m); } } } /**/ $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code); return $code; }
/** * Writes no GZIP rules into root `.htaccess` file. * * @package optimizeMember\Files * @since 120212 * * @return bool True if successfull, else false on any type of failure. */ public static function write_no_gzip_into_root_htaccess() { if (c_ws_plugin__optimizemember_files::remove_no_gzip_from_root_htaccess()) { $start_line = "# BEGIN optimizeMember GZIP exclusions"; $end_line = "# END optimizeMember GZIP exclusions"; $htaccess = ABSPATH . ".htaccess"; $ideally_position_before = "# BEGIN WordPress"; /**/ $no_gzip = $start_line . "\n" . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_no_gzip_htaccess"]))) . "\n" . $end_line; /**/ if (file_exists($htaccess) && is_readable($htaccess) && is_writable($htaccess) && ($htaccess_contents = file_get_contents($htaccess)) !== false && is_string($htaccess_contents = trim($htaccess_contents))) { if (stripos($htaccess_contents, $ideally_position_before) !== false) { $htaccess_contents = trim(str_ireplace($ideally_position_before, $no_gzip . "\n\n" . $ideally_position_before, $htaccess_contents)); } else { /* Else, let's put it at the very top of the file by default. */ $htaccess_contents = trim($no_gzip . "\n\n" . $htaccess_contents); } /**/ return file_put_contents($htaccess, $htaccess_contents); } else { if (!file_exists($htaccess) && is_writable(dirname($htaccess))) { return file_put_contents($htaccess, $no_gzip); } } } return false; }
/** * Auto-configures an Amazon S3 Bucket's ACLs. * * @package optimizeMember\Files * @since 110926 * * @return array Array containing a true `success` element on success, else a failure array. * Failure array will contain a failure `code`, and a failure `message`. */ public static function amazon_s3_auto_configure_acls() { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"] as $option => $option_value) { if (preg_match("/^amazon_s3_files_/", $option) && ($option = preg_replace("/^amazon_s3_files_/", "", $option))) { $s3c[$option] = $option_value; } } /**/ $cfc["distros_s3_access_id"] = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distros_s3_access_id"]; /**/ if ($s3c["bucket"] && $s3c["access_key"] && $s3c["secret_key"]) { $s3_date = gmdate("D, d M Y H:i:s") . " GMT"; $s3_location = strtolower($s3c["bucket"]) !== $s3c["bucket"] ? "/" . $s3c["bucket"] . "/?acl" : "/?acl"; $s3_domain = strtolower($s3c["bucket"]) !== $s3c["bucket"] ? "s3.amazonaws.com" : $s3c["bucket"] . ".s3.amazonaws.com"; $s3_signature = base64_encode(c_ws_plugin__optimizemember_files_in::amazon_s3_sign("GET\n\n\n" . $s3_date . "\n/" . $s3c["bucket"] . "/?acl")); $s3_args = array("method" => "GET", "redirection" => 0, "headers" => array("Host" => $s3_domain, "Date" => $s3_date, "Authorization" => "AWS " . $s3c["access_key"] . ":" . $s3_signature)); /**/ if (($s3_response = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $s3_domain . $s3_location, false, array_merge($s3_args, array("timeout" => 20)), "array")) && $s3_response["code"] === 200) { if (preg_match("/\\<Owner\\>(.+?)\\<\\/Owner\\>/is", $s3_response["body"], $s3_owner_tag) && preg_match("/\\<ID\\>(.+?)\\<\\/ID\\>/is", $s3_owner_tag[1], $s3_owner_id_tag) && (preg_match("/\\<DisplayName\\>(.*?)\\<\\/DisplayName\\>/is", $s3_owner_tag[1], $s3_owner_display_name_tag) || ($s3_owner_display_name_tag = array("-", "Owner")))) { $s3_owner = array("access_id" => trim($s3_owner_id_tag[1]), "display_name" => trim($s3_owner_display_name_tag[1])); $s3_acls_xml = '<AccessControlPolicy><Owner><ID>' . esc_html($s3_owner["access_id"]) . '</ID><DisplayName>' . esc_html($s3_owner["display_name"]) . '</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>' . esc_html($s3_owner["access_id"]) . '</ID><DisplayName>' . esc_html($s3_owner["display_name"]) . '</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant>' . ($cfc["distros_s3_access_id"] ? '<Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>' . esc_html($cfc["distros_s3_access_id"]) . '</ID><DisplayName>optimizeMember/CloudFront</DisplayName></Grantee><Permission>READ</Permission></Grant>' : '') . '</AccessControlList></AccessControlPolicy>'; $s3_signature = base64_encode(c_ws_plugin__optimizemember_files_in::amazon_s3_sign("PUT\n\napplication/xml\n" . $s3_date . "\n/" . $s3c["bucket"] . "/?acl")); $s3_args = array("method" => "PUT", "redirection" => 0, "body" => $s3_acls_xml, "headers" => array("Host" => $s3_domain, "Content-Type" => "application/xml", "Date" => $s3_date, "Authorization" => "AWS " . $s3c["access_key"] . ":" . $s3_signature)); /**/ if (($s3_response = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $s3_domain . $s3_location, false, array_merge($s3_args, array("timeout" => 20)), "array")) && $s3_response["code"] === 200) { $s3_location = strtolower($s3c["bucket"]) !== $s3c["bucket"] ? "/" . $s3c["bucket"] . "/?policy" : "/?policy"; ($s3_policy_id = md5(uniqid("optimizeMember/CloudFront:", true))) . ($s3_policy_sid = md5(uniqid("optimizeMember/CloudFront:", true))); $s3_policy_json = '{"Version":"2008-10-17","Id":"' . c_ws_plugin__optimizemember_utils_strings::esc_dq($s3_policy_id) . '","Statement":[{"Sid":"' . c_ws_plugin__optimizemember_utils_strings::esc_dq($s3_policy_sid) . '","Effect":"Allow","Principal":{"CanonicalUser":"******"distros_s3_access_id"]) . '"},"Action":"s3:GetObject","Resource":"arn:aws:s3:::' . c_ws_plugin__optimizemember_utils_strings::esc_dq($s3c["bucket"]) . '/*"}]}'; $s3_signature = base64_encode(c_ws_plugin__optimizemember_files_in::amazon_s3_sign("PUT\n\napplication/json\n" . $s3_date . "\n/" . $s3c["bucket"] . "/?policy")); $s3_args = array("method" => "PUT", "redirection" => 0, "body" => $s3_policy_json, "headers" => array("Host" => $s3_domain, "Content-Type" => "application/json", "Date" => $s3_date, "Authorization" => "AWS " . $s3c["access_key"] . ":" . $s3_signature)); /**/ if (!$cfc["distros_s3_access_id"] || ($s3_response = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $s3_domain . $s3_location, false, array_merge($s3_args, array("timeout" => 20)), "array")) && ($s3_response["code"] === 200 || $s3_response["code"] === 204)) { $s3_location = strtolower($s3c["bucket"]) !== $s3c["bucket"] ? "/" . $s3c["bucket"] . "/crossdomain.xml" : "/crossdomain.xml"; $s3_policy_xml = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/cfg-files/s2-cross-xml.php"))); $s3_signature = base64_encode(c_ws_plugin__optimizemember_files_in::amazon_s3_sign("PUT\n\ntext/xml\n" . $s3_date . "\nx-amz-acl:public-read\n/" . $s3c["bucket"] . "/crossdomain.xml")); $s3_args = array("method" => "PUT", "redirection" => 0, "body" => $s3_policy_xml, "headers" => array("Host" => $s3_domain, "Content-Type" => "text/xml", "Date" => $s3_date, "X-Amz-Acl" => "public-read", "Authorization" => "AWS " . $s3c["access_key"] . ":" . $s3_signature)); /**/ if (($s3_response = c_ws_plugin__optimizemember_utils_urls::remote("https://" . $s3_domain . $s3_location, false, array_merge($s3_args, array("timeout" => 20)), "array")) && $s3_response["code"] === 200) { return array("success" => true, "code" => null, "message" => null); } else { if (isset($s3_response["code"], $s3_response["message"])) { /* translators: In this translation, `%s` may be filled with an English message, which comes from the Amazon S3 API call. Feel free to exclude `%s` if you like. */ return array("success" => false, "code" => $s3_response["code"], "message" => sprintf(_x("Unable to update existing Amazon S3 Cross-Domain Policy. %s", "s2member-admin", "s2member"), $s3_response["message"])); } else { /* Else, we use a default error code and message. */ return array("success" => false, "code" => -94, "message" => _x("Unable to update existing Amazon S3 Cross-Domain Policy. Connection failed.", "s2member-admin", "s2member")); } } } else { if (isset($s3_response["code"], $s3_response["message"])) { /* translators: In this translation, `%s` may be filled with an English message, which comes from the Amazon S3 API call. Feel free to exclude `%s` if you like. */ return array("success" => false, "code" => $s3_response["code"], "message" => sprintf(_x("Unable to update existing Amazon S3 Bucket Policy. %s", "s2member-admin", "s2member"), $s3_response["message"])); } else { /* Else, we use a default error code and message. */ return array("success" => false, "code" => -95, "message" => _x("Unable to update existing Amazon S3 Bucket Policy. Connection failed.", "s2member-admin", "s2member")); } } } else { if (isset($s3_response["code"], $s3_response["message"])) { /* translators: In this translation, `%s` may be filled with an English message, which comes from the Amazon S3 API call. Feel free to exclude `%s` if you like. */ return array("success" => false, "code" => $s3_response["code"], "message" => sprintf(_x("Unable to update existing Amazon S3 Bucket ACLs. %s", "s2member-admin", "s2member"), $s3_response["message"])); } else { /* Else, we use a default error code and message. */ return array("success" => false, "code" => -96, "message" => _x("Unable to update existing Amazon S3 Bucket ACLs. Connection failed.", "s2member-admin", "s2member")); } } } else { /* Else, we use a default error code and message. */ return array("success" => false, "code" => -97, "message" => _x("Unable to acquire/read existing Amazon S3 Bucket ACLs. Unexpected response.", "s2member-admin", "s2member")); } } else { if (isset($s3_response["code"], $s3_response["message"])) { /* translators: In this translation, `%s` may be filled with an English message, which comes from the Amazon S3 API call. Feel free to exclude `%s` if you like. */ return array("success" => false, "code" => $s3_response["code"], "message" => sprintf(_x("Unable to acquire existing Amazon S3 Bucket ACLs. %s", "s2member-admin", "s2member"), $s3_response["message"])); } else { /* Else, we use a default error code and message. */ return array("success" => false, "code" => -98, "message" => _x("Unable to acquire existing Amazon S3 Bucket ACLs. Connection failed.", "s2member-admin", "s2member")); } } } else { /* Else, we use a default error code and message. */ return array("success" => false, "code" => -99, "message" => _x("Unable to auto-configure existing Amazon S3 Bucket ACLs. Incomplete Amazon S3 configuration options. Missing one of: Amazon S3 Bucket, Access Key, or Secret Key.", "s2member-admin", "s2member")); } }
/** * Builds and handles the Download Options page. * * @package optimizeMember\Menu_Pages * @since 3.5 * * @return null */ public static function down_ops_page() { do_action("ws_plugin__optimizemember_before_down_ops_page", get_defined_vars()); /**/ c_ws_plugin__optimizemember_menu_pages::update_all_options(); /**/ $files_dir = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"]; /**/ $htaccess = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"] . "/.htaccess"; $htaccess_contents = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir_htaccess"]))); /**/ $no_gzip_htaccess = ABSPATH . ".htaccess"; $no_gzip_htaccess_contents = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_no_gzip_htaccess"]))); /**/ if (!c_ws_plugin__optimizemember_files::no_gzip_rules_in_root_htaccess()) { c_ws_plugin__optimizemember_files::write_no_gzip_into_root_htaccess() . clearstatcache(); } /**/ if (!is_dir($files_dir) && is_writable(dirname(c_ws_plugin__optimizemember_utils_dirs::strip_dir_app_data($files_dir)))) { mkdir($files_dir, 0777, true) . clearstatcache(); } /**/ if (is_dir($files_dir) && is_writable($files_dir) && !file_exists($htaccess)) { file_put_contents($htaccess, $htaccess_contents) . clearstatcache(); } /**/ if (!c_ws_plugin__optimizemember_files::no_gzip_rules_in_root_htaccess()) { c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Possible GZIP conflict on server. Unable to write GZIP exclusions into root .htaccess file (<code>' . esc_html(c_ws_plugin__optimizemember_utils_dirs::doc_root_path($no_gzip_htaccess)) . '</code>). Please read the panel below: <strong>Preventing GZIP Conflicts</strong>, and add this section yourself:<br /><pre>' . esc_html($no_gzip_htaccess_contents) . '</pre>', true); } /**/ if (!is_dir($files_dir)) { /* If the security-enabled files directory does not exist yet. */ c_ws_plugin__optimizemember_admin_notices::display_admin_notice('The security-enabled files directory (<code>' . esc_html(c_ws_plugin__optimizemember_utils_dirs::doc_root_path($files_dir)) . '</code>) does not exist. Please create this directory manually.', true); } /**/ if (!file_exists($htaccess)) { /* If the `.htaccess` file has not been created yet. */ c_ws_plugin__optimizemember_admin_notices::display_admin_notice('The .htaccess protection file (<code>' . esc_html(c_ws_plugin__optimizemember_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__optimizemember_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>' . esc_html(c_ws_plugin__optimizemember_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 (!empty($_POST["ws_plugin__optimizemember_amazon_cf_files_auto_configure_distros"]) && ($nonce = $_POST["ws_plugin__optimizemember_amazon_cf_files_auto_configure_distros"]) && wp_verify_nonce($nonce, "ws-plugin--optimizemember-amazon-cf-files-auto-configure-distros")) { if (($amazon_cf_auto_configure_distros = c_ws_plugin__optimizemember_files_in::amazon_cf_auto_configure_distros()) && $amazon_cf_auto_configure_distros["success"]) { c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Amazon CloudFront Distributions auto-configured successfully. Please allow 30 minutes for propagation.' . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_downloads_cname"] ? '<br /><em>Downloads Distribution CNAME: <code>' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' —» ' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_streaming_cname"] ? '<br /><em>Streaming Distribution CNAME: <code>' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' —» ' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : '')); } else { /* Else there was an error. We need to report this back to the site owner so they can understand what's going on. */ (c_ws_plugin__optimizemember_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"] = true) . c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Unable to auto-configure Amazon CloudFront Distributions.<br />Error code: <code>' . esc_html($amazon_cf_auto_configure_distros["code"]) . '</code>. Error Message: <code>' . esc_html($amazon_cf_auto_configure_distros["message"]) . '</code>', true); } } /**/ if (!empty($_POST["ws_plugin__optimizemember_amazon_s3_files_auto_configure_acls"]) && ($nonce = $_POST["ws_plugin__optimizemember_amazon_s3_files_auto_configure_acls"]) && wp_verify_nonce($nonce, "ws-plugin--optimizemember-amazon-s3-files-auto-configure-acls")) { if (($amazon_s3_auto_configure_acls = c_ws_plugin__optimizemember_files_in::amazon_s3_auto_configure_acls()) && $amazon_s3_auto_configure_acls["success"]) { c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Amazon S3 ACLs auto-configured successfully.'); } else { /* Else there was an error. We need to report this back to the site owner so they can understand what's going on. */ (c_ws_plugin__optimizemember_menu_pages::$pre_display_errors["s3_files_auto_configure_acls"] = true) . c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Unable to auto-configure Amazon S3 ACLs.<br />Error code: <code>' . esc_html($amazon_s3_auto_configure_acls["code"]) . '</code>. Error Message: <code>' . esc_html($amazon_s3_auto_configure_acls["message"]) . '</code>', true); } } /**/ include_once dirname(dirname(__FILE__)) . "/menu-pages/down-ops.inc.php"; /**/ do_action("ws_plugin__optimizemember_after_down_ops_page", get_defined_vars()); /**/ return; /* Return for uniformity. */ }
/** * Handles the Shortcode for: `[optimizeMember-PayPal-Button /]`. * * @package optimizeMember\PayPal * @since 3.5 * * @attaches-to ``add_shortcode("optimizeMember-PayPal-Button");`` * * @param array $attr An array of Attributes. * @param str $content Content inside the Shortcode. * @param str $shortcode The actual Shortcode name itself. * @return str The resulting PayPal Button Code. */ public static function sc_paypal_button($attr = FALSE, $content = FALSE, $shortcode = FALSE) { eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_before_sc_paypal_button", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ c_ws_plugin__optimizemember_no_cache::no_cache_constants(true); /**/ $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); /**/ $attr = shortcode_atts(apply_filters("ws_plugin__optimizemember_sc_paypal_button_default_attrs", array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "ps" => "paypal", "lc" => "", "cc" => "USD", "dg" => "0", "ns" => "1", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "rrt" => "", "rra" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "button"), get_defined_vars()), $attr); /**/ $attr["modify"] = $attr["modify"] === "1" && (!is_user_logged_in() || !get_user_option("optimizemember_subscr_id")) && $attr["tp"] ? "0" : $attr["modify"]; /**/ $attr["lc"] = strtoupper($attr["lc"]); $attr["tt"] = strtoupper($attr["tt"]); $attr["rt"] = strtoupper($attr["rt"]); $attr["rr"] = strtoupper($attr["rr"]); $attr["ccaps"] = strtolower($attr["ccaps"]); $attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"]; $attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"]; $attr["ns"] = $attr["dg"] === "1" ? "1" : $attr["ns"]; /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_before_sc_paypal_button_after_shortcode_atts", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ if ($attr["cancel"]) { $default_image = "https://www.paypal.com/" . _x("en_US", "s2member-front paypal-button-lang-code", "s2member") . "/i/btn/btn_unsubscribe_LG.gif"; /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(site_url())), $code); /**/ $code = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $code); $code = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_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__optimizemember_utils_urls::n_amps($href); } /**/ unset($href, $url, $m); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_during_sc_paypal_cancellation_button", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } else { if ($attr["sp"]) { $default_image = "https://www.paypal.com/" . _x("en_US", "s2member-front paypal-button-lang-code", "s2member") . "/i/btn/btn_xpressCheckout.gif"; /**/ $paypal_on0_input_value = ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "Referencing Customer ID" : "Originating Domain"; $paypal_os0_input_value = $referencing ? $referencing : $_SERVER["HTTP_HOST"]; /**/ $paypal_on1_input_value = "Customer IP Address"; $paypal_os1_input_value = $_SERVER["REMOTE_ADDR"]; /**/ $paypal_invoice_input_value = uniqid() . "~" . $_SERVER["REMOTE_ADDR"]; /**/ $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"]; /**/ $success_return_url = site_url("/?optimizemember_paypal_return=1"); $success_return_url = apply_filters("ws_plugin__optimizemember_during_sc_paypal_button_success_return_url", $success_return_url, get_defined_vars()); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(site_url())), $code); /**/ $code = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $code); $code = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $code); $code = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(home_url("/"))), $code); $code = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $code); $code = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($success_return_url)), $code); $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["custom"])), $code); /**/ $code = preg_replace('/ name\\="lc" value\\="(.*?)"/', ' name="lc" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["lc"])) . '"', $code); $code = preg_replace('/ name\\="no_shipping" value\\="(.*?)"/', ' name="no_shipping" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ns"])) . '"', $code); $code = preg_replace('/ name\\="item_name" value\\="(.*?)"/', ' name="item_name" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["desc"])) . '"', $code); $code = preg_replace('/ name\\="item_number" value\\="(.*?)"/', ' name="item_number" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["sp_ids_exp"])) . '"', $code); $code = preg_replace('/ name\\="page_style" value\\="(.*?)"/', ' name="page_style" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ps"])) . '"', $code); $code = preg_replace('/ name\\="currency_code" value\\="(.*?)"/', ' name="currency_code" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["cc"])) . '"', $code); $code = preg_replace('/ name\\="custom" value\\="(.*?)"/', ' name="custom" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["custom"])) . '"', $code); /**/ $code = preg_replace('/ name\\="invoice" value\\="(.*?)"/', ' name="invoice" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_invoice_input_value)) . '"', $code); /**/ $code = preg_replace('/ name\\="on0" value\\="(.*?)"/', ' name="on0" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_on0_input_value)) . '"', $code); $code = preg_replace('/ name\\="os0" value\\="(.*?)"/', ' name="os0" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_os0_input_value)) . '"', $code); $code = preg_replace('/ name\\="on1" value\\="(.*?)"/', ' name="on1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_on1_input_value)) . '"', $code); $code = preg_replace('/ name\\="os1" value\\="(.*?)"/', ' name="os1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_os1_input_value)) . '"', $code); /**/ $code = preg_replace('/ name\\="amount" value\\="(.*?)"/', ' name="amount" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ra"])) . '"', $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? '<a href="' . esc_attr(c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code)) . '"><img src="' . esc_attr($attr["image"] && $attr["image"] !== "default" ? $attr["image"] : $default_image) . '" style="width:auto; height:auto; border:0;" alt="PayPal" /></a>' : $code; $code = $attr["output"] === "url" ? c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code) : $code; /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_during_sc_paypal_sp_button", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } else { if ($attr["level"] === "*") { $default_image = "https://www.paypal.com/" . _x("en_US", "s2member-front paypal-button-lang-code", "s2member") . "/i/btn/btn_xpressCheckout.gif"; /**/ $paypal_on0_input_value = ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "Referencing Customer ID" : "Originating Domain"; $paypal_os0_input_value = $referencing ? $referencing : $_SERVER["HTTP_HOST"]; /**/ $paypal_on1_input_value = "Customer IP Address"; $paypal_os1_input_value = $_SERVER["REMOTE_ADDR"]; /**/ $paypal_invoice_input_value = uniqid() . "~" . $_SERVER["REMOTE_ADDR"]; /**/ $attr["level_ccaps_eotper"] = $attr["rr"] === "BN" && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); /**/ $success_return_url = site_url("/?optimizemember_paypal_return=1"); $success_return_url = apply_filters("ws_plugin__optimizemember_during_sc_paypal_button_success_return_url", $success_return_url, get_defined_vars()); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-ccaps-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(site_url())), $code); /**/ $code = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $code); $code = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $code); $code = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(home_url("/"))), $code); $code = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $code); $code = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($success_return_url)), $code); $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["custom"])), $code); /**/ $code = preg_replace('/ name\\="lc" value\\="(.*?)"/', ' name="lc" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["lc"])) . '"', $code); $code = preg_replace('/ name\\="no_shipping" value\\="(.*?)"/', ' name="no_shipping" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ns"])) . '"', $code); $code = preg_replace('/ name\\="item_name" value\\="(.*?)"/', ' name="item_name" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["desc"])) . '"', $code); $code = preg_replace('/ name\\="item_number" value\\="(.*?)"/', ' name="item_number" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["level_ccaps_eotper"])) . '"', $code); $code = preg_replace('/ name\\="page_style" value\\="(.*?)"/', ' name="page_style" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ps"])) . '"', $code); $code = preg_replace('/ name\\="currency_code" value\\="(.*?)"/', ' name="currency_code" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["cc"])) . '"', $code); $code = preg_replace('/ name\\="custom" value\\="(.*?)"/', ' name="custom" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["custom"])) . '"', $code); /**/ $code = preg_replace('/ name\\="invoice" value\\="(.*?)"/', ' name="invoice" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_invoice_input_value)) . '"', $code); /**/ $code = preg_replace('/ name\\="on0" value\\="(.*?)"/', ' name="on0" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_on0_input_value)) . '"', $code); $code = preg_replace('/ name\\="os0" value\\="(.*?)"/', ' name="os0" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_os0_input_value)) . '"', $code); $code = preg_replace('/ name\\="on1" value\\="(.*?)"/', ' name="on1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_on1_input_value)) . '"', $code); $code = preg_replace('/ name\\="os1" value\\="(.*?)"/', ' name="os1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_os1_input_value)) . '"', $code); /**/ $code = preg_replace('/ name\\="amount" value\\="(.*?)"/', ' name="amount" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ra"])) . '"', $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? '<a href="' . esc_attr(c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code)) . '"><img src="' . esc_attr($attr["image"] && $attr["image"] !== "default" ? $attr["image"] : $default_image) . '" style="width:auto; height:auto; border:0;" alt="PayPal" /></a>' : $code; $code = $attr["output"] === "url" ? c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code) : $code; /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_during_sc_paypal_ccaps_button", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } else { $default_image = "https://www.paypal.com/" . _x("en_US", "s2member-front paypal-button-lang-code", "s2member") . "/i/btn/btn_xpressCheckout.gif"; /**/ $paypal_on0_input_value = ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "Referencing Customer ID" : "Originating Domain"; $paypal_os0_input_value = $referencing ? $referencing : $_SERVER["HTTP_HOST"]; /**/ $paypal_on1_input_value = "Customer IP Address"; $paypal_os1_input_value = $_SERVER["REMOTE_ADDR"]; /**/ $paypal_invoice_input_value = uniqid() . "~" . $_SERVER["REMOTE_ADDR"]; /**/ $attr["desc"] = !$attr["desc"] ? $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $attr["level"] . "_label"] : $attr["desc"]; /**/ $attr["level_ccaps_eotper"] = $attr["rr"] === "BN" && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); /**/ $success_return_tra = array("ta" => $attr["ta"], "tp" => $attr["tp"], "tt" => $attr["tt"], "ra" => $attr["ra"], "rp" => $attr["rp"], "rt" => $attr["rt"], "rr" => $attr["rr"], "rrt" => $attr["rrt"], "rra" => $attr["rra"], "invoice" => $paypal_invoice_input_value, "checksum" => md5($paypal_invoice_input_value . $_SERVER["REMOTE_ADDR"] . $attr["level_ccaps_eotper"])); /**/ $success_return_url = site_url("/?optimizemember_paypal_return=1"); $success_return_url = add_query_arg("optimizemember_paypal_return_tra", urlencode(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($success_return_tra))), $success_return_url); $success_return_url = apply_filters("ws_plugin__optimizemember_during_sc_paypal_button_success_return_url", $success_return_url, get_defined_vars()); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(site_url())), $code); /**/ $code = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $code); $code = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $code); $code = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $attr["level"] . "_label"])), $code); $code = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(home_url("/"))), $code); /* This brings them back to Front Page. */ $code = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $code); $code = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($success_return_url)), $code); $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["custom"])), $code); $code = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["level"])), $code); /**/ $code = preg_replace('/ \\<\\!--(\\<input type\\="hidden" name\\="(amount|src|srt|sra|a1|p1|t1|a3|p3|t3)" value\\="(.*?)" \\/\\>)--\\>/', " \$1", $code); $code = $attr["rr"] === "BN" ? preg_replace('/ (\\<input type\\="hidden" name\\="cmd" value\\=")(.*?)(" \\/\\>)/', " \$1_xclick\$3", $code) : $code; $code = $attr["rr"] === "BN" ? preg_replace('/ (\\<input type\\="hidden" name\\="(src|srt|sra|a1|p1|t1|a3|p3|t3)" value\\="(.*?)" \\/\\>)/', " <!--\$1-->", $code) : $code; $code = $attr["rr"] === "BN" || !$attr["tp"] ? preg_replace('/ (\\<input type\\="hidden" name\\="(a1|p1|t1)" value\\="(.*?)" \\/\\>)/', " <!--\$1-->", $code) : $code; $code = $attr["rr"] !== "BN" ? preg_replace('/ (\\<input type\\="hidden" name\\="cmd" value\\=")(.*?)(" \\/\\>)/', " \$1_xclick-subscriptions\$3", $code) : $code; $code = $attr["rr"] !== "BN" ? preg_replace('/ (\\<input type\\="hidden" name\\="amount" value\\="(.*?)" \\/\\>)/', " <!--\$1-->", $code) : $code; /**/ $code = preg_replace('/ name\\="lc" value\\="(.*?)"/', ' name="lc" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["lc"])) . '"', $code); $code = preg_replace('/ name\\="no_shipping" value\\="(.*?)"/', ' name="no_shipping" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ns"])) . '"', $code); $code = preg_replace('/ name\\="item_name" value\\="(.*?)"/', ' name="item_name" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["desc"])) . '"', $code); $code = preg_replace('/ name\\="item_number" value\\="(.*?)"/', ' name="item_number" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["level_ccaps_eotper"])) . '"', $code); $code = preg_replace('/ name\\="page_style" value\\="(.*?)"/', ' name="page_style" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ps"])) . '"', $code); $code = preg_replace('/ name\\="currency_code" value\\="(.*?)"/', ' name="currency_code" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["cc"])) . '"', $code); $code = preg_replace('/ name\\="custom" value\\="(.*?)"/', ' name="custom" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["custom"])) . '"', $code); /**/ $code = preg_replace('/ name\\="invoice" value\\="(.*?)"/', ' name="invoice" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_invoice_input_value)) . '"', $code); /**/ $code = preg_replace('/ name\\="on0" value\\="(.*?)"/', ' name="on0" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_on0_input_value)) . '"', $code); $code = preg_replace('/ name\\="os0" value\\="(.*?)"/', ' name="os0" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_os0_input_value)) . '"', $code); $code = preg_replace('/ name\\="on1" value\\="(.*?)"/', ' name="on1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_on1_input_value)) . '"', $code); $code = preg_replace('/ name\\="os1" value\\="(.*?)"/', ' name="os1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($paypal_os1_input_value)) . '"', $code); /**/ $code = preg_replace('/ name\\="modify" value\\="(.*?)"/', ' name="modify" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["modify"])) . '"', $code); /**/ $code = preg_replace('/ name\\="amount" value\\="(.*?)"/', ' name="amount" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ra"])) . '"', $code); /**/ $code = preg_replace('/ name\\="src" value\\="(.*?)"/', ' name="src" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["rr"])) . '"', $code); $code = preg_replace('/ name\\="srt" value\\="(.*?)"/', ' name="srt" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["rrt"])) . '"', $code); $code = preg_replace('/ name\\="sra" value\\="(.*?)"/', ' name="sra" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["rra"])) . '"', $code); /**/ $code = preg_replace('/ name\\="a1" value\\="(.*?)"/', ' name="a1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ta"])) . '"', $code); $code = preg_replace('/ name\\="p1" value\\="(.*?)"/', ' name="p1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["tp"])) . '"', $code); $code = preg_replace('/ name\\="t1" value\\="(.*?)"/', ' name="t1" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["tt"])) . '"', $code); $code = preg_replace('/ name\\="a3" value\\="(.*?)"/', ' name="a3" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["ra"])) . '"', $code); $code = preg_replace('/ name\\="p3" value\\="(.*?)"/', ' name="p3" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["rp"])) . '"', $code); $code = preg_replace('/ name\\="t3" value\\="(.*?)"/', ' name="t3" value="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["rt"])) . '"', $code); /* * Custom button */ if (!empty($content)) { $code = preg_replace('/%%button_markup%%/', $content, $code); /* * <input type="image" src="https://www.paypal.com/<?php echo esc_attr (_x ("en_US", "s2member-front paypal-button-lang-code", "s2member")); ?>/i/btn/btn_xpressCheckout.gif" style="width:auto; height:auto; border:0;" alt="PayPal" /> */ } else { $code = preg_replace('/%%button_markup%%/', sprintf('<input type="image" src="https://www.paypal.com/%s/i/btn/btn_xpressCheckout.gif" style="width:auto; height:auto; border:0;" alt="PayPal" />', esc_attr(_x("en_US", "s2member-front paypal-button-lang-code", "s2member"))), $code); $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code); } /**/ $code = $attr["output"] === "anchor" ? '<a href="' . esc_attr(c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code)) . '"><img src="' . esc_attr($attr["image"] && $attr["image"] !== "default" ? $attr["image"] : $default_image) . '" style="width:auto; height:auto; border:0;" alt="PayPal" /></a>' : $code; $code = $attr["output"] === "url" ? c_ws_plugin__optimizemember_utils_forms::form_whips_2_url($code) : $code; /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); $attr["modify"] ? do_action("ws_plugin__optimizemember_during_sc_paypal_modification_button", get_defined_vars()) : do_action("ws_plugin__optimizemember_during_sc_paypal_button", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } } } /**/ $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code); $code = c_ws_plugin__optimizemember_sc_paypal_button_e::sc_paypal_button_encryption($code, get_defined_vars()); /**/ return apply_filters("ws_plugin__optimizemember_sc_paypal_button", $code, get_defined_vars()); }
/** * Activation routines for optimizeMember. * * @package optimizeMember\Installation * @since 3.5 * * @return null */ public static function activate($reactivation_reason = FALSE) { global $wpdb; /* Global database object reference. */ global $current_site, $current_blog; /* Multisite. */ /**/ do_action("ws_plugin__optimizemember_before_activation", get_defined_vars()); /**/ c_ws_plugin__optimizemember_roles_caps::config_roles(); /* Config Roles/Caps. */ update_option("ws_plugin__optimizemember_activated_levels", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]); /**/ /*THIS LINE MOVE PRO FOLDER INTO RIGHT PLACE!*/ //@rename($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir"].'/optimizeMember-pro', WP_PLUGIN_DIR.'/optimizeMember-pro'); if (!is_dir($files_dir = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) { if (is_writable(dirname(c_ws_plugin__optimizemember_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__optimizemember_preserve_files_dir_htaccess", false, get_defined_vars())) { file_put_contents($htaccess, trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir_htaccess"])))); } } /**/ c_ws_plugin__optimizemember_files::write_no_gzip_into_root_htaccess(); /**/ if (!is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["logs_dir"])) { if (is_writable(dirname(c_ws_plugin__optimizemember_utils_dirs::strip_dir_app_data($logs_dir)))) { mkdir($logs_dir, 0777, true); } } /**/ if (is_dir($logs_dir) && is_writable($logs_dir)) { if (!file_exists($htaccess = $logs_dir . "/.htaccess") || !apply_filters("ws_plugin__optimizemember_preserve_logs_dir_htaccess", false, get_defined_vars())) { file_put_contents($htaccess, trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["logs_dir_htaccess"])))); } } /**/ !is_array(get_option("ws_plugin__optimizemember_cache")) ? update_option("ws_plugin__optimizemember_cache", array()) : null; !is_array(get_option("ws_plugin__optimizemember_notices")) ? update_option("ws_plugin__optimizemember_notices", array()) : null; !is_array(get_option("ws_plugin__optimizemember_options")) ? update_option("ws_plugin__optimizemember_options", array()) : null; !is_numeric(get_option("ws_plugin__optimizemember_configured")) ? update_option("ws_plugin__optimizemember_configured", "0") : null; /**/ if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["configured"]) { $v = get_option("ws_plugin__optimizemember_activated_version"); /* Currently. */ /**/ if (!$v || !version_compare($v, "3.2", ">=")) { $like = "`meta_key` LIKE 's2member\\_%' AND `meta_key` NOT LIKE '%s2member\\_originating\\_blog%'"; $wpdb->query("UPDATE `" . $wpdb->usermeta . "` SET `meta_key` = CONCAT('" . $wpdb->prefix . "', `meta_key`) WHERE " . $like); } /**/ if (!$v || !version_compare($v, "3.2.5", ">=")) { $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '\\_transient\\_%'"); } /**/ if (!$v || !version_compare($v, "3.2.6", ">=")) { $wpdb->query("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` = 'optimizemember_ccaps_req' AND `meta_value` IN('','a:0:{}','a:1:{i:0;s:0:\"\";}')"); } /**/ if (!$v || !version_compare($v, "110912", ">=") && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["filter_wp_query"] === array("all")) { //$notice = '<strong>IMPORTANT:</strong> This version of optimizeMember changes the way your <code>Alternative View Protections</code> work. Please review your options under: <code>optimizeMember -> Restriction Options -> Alternative View Protections</code>.<br />'; $notice = ''; c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops")); } /**/ $notice = '<strong>optimizeMember</strong> has been <strong>reactivated</strong>, with ' . ($reactivation_reason === "levels" ? '<code>' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]) . '</code> Membership Levels' : 'the latest version') . '.<br />'; $notice .= 'You now have version ' . esc_html(WS_PLUGIN__OPTIMIZEMEMBER_VERSION) . '. Your existing configuration remains.'; /**/ if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) { /* No Changelog on a Multisite Blog Farm. */ //$notice .= '<br />Have fun, <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-info#rm-changelog")).'">read the Changelog</a>, and make some money! :-)'; /**/ c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops")); } } else { $notice = '<strong>Note:</strong> optimizeMember adds some new data columns to your list of Users/Members. If your list gets overcrowded, please use the <strong>Screen Options</strong> tab <em>( upper right-hand corner )</em>. With WordPress Screen Options, you can add/remove specific data columns; thereby making the most important data easier to read. For example, if you create Custom Registration/Profile Fields with optimizeMember, those Custom Fields will result in new data columns; which can cause your list of Users/Members to become nearly unreadable. So just use the Screen Options tab to clean things up.'; /**/ c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, "blog:users.php", false, false, true); /**/ $notice = '<strong>optimizeMember</strong> v' . esc_html(WS_PLUGIN__OPTIMIZEMEMBER_VERSION) . ' has been <strong>activated</strong>. Nice work!<br />'; $notice .= 'Have fun, <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-start")) . '">read the Quick Start Guide</a>, and make some money! :-)'; /**/ c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops")); } /**/ if (is_multisite() && is_main_site()) { $wpdb->query("INSERT INTO `" . $wpdb->usermeta . "` (`user_id`, `meta_key`, `meta_value`) SELECT `ID`, 'optimizemember_originating_blog', '" . esc_sql($current_site->blog_id) . "' FROM `" . $wpdb->users . "` WHERE `ID` NOT IN (SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 'optimizemember_originating_blog')"); /**/ $notice = '<strong>Multisite Network</strong> updated automatically by <strong>optimizeMember</strong> v' . esc_html(WS_PLUGIN__OPTIMIZEMEMBER_VERSION) . '.<br />'; $notice .= 'You\'ll want to configure optimizeMember\'s Multisite options now.<br />'; $notice .= 'In the Dashboard for your Main Site, see:<br />'; $notice .= '<code>optimizeMember -> Multisite ( Config )</code>.'; /**/ c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops")); /**/ update_site_option("ws_plugin__optimizemember_options", (array) get_option("ws_plugin__optimizemember_options")); /**/ update_option("ws_plugin__optimizemember_activated_mms_version", WS_PLUGIN__OPTIMIZEMEMBER_VERSION); } /**/ update_option("ws_plugin__optimizemember_activated_version", WS_PLUGIN__OPTIMIZEMEMBER_VERSION); /**/ do_action("ws_plugin__optimizemember_after_activation", get_defined_vars()); /**/ return; /* Return for uniformity. */ }
/** * Widget display. * * @package optimizeMember\Widgets * @since 1.5 * * @param array $args Optional. An array of basic settings. * @param array $instance Optional. An array of options for this instance. * @return null */ public function widget($args = FALSE, $instance = FALSE) { $options = c_ws_plugin__optimizemember_pro_login_widget::configure_options_and_their_defaults((array) $instance); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_login_widget_before_display", get_defined_vars(), $this); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ echo $args["before_widget"]; /* OK, here we go into this widget. */ /**/ if (is_user_logged_in() && strlen($options["profile_title"]) || !is_user_logged_in() && strlen($options["title"])) { echo $args["before_title"] . apply_filters("widget_title", $options[is_user_logged_in() ? "profile_title" : "title"]) . $args["after_title"]; } /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_login_widget_during_display_before", get_defined_vars(), $this); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ if (!is_user_logged_in()) { $links = c_ws_plugin__optimizemember_cache::cached_page_links(); /**/ $ops_page = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"]; /**/ if ($ops_page && is_page($ops_page) && !empty($_GET["_optimizemember_seeking"]["_uri"])) { $seeking = trim(base64_decode(trim(stripslashes((string) $_GET["_optimizemember_seeking"]["_uri"])))); } /**/ $options["login_redirect"] = $options["login_redirect"] === "%%previous%%" && empty($seeking) && $ops_page && is_page($ops_page) ? "" : $options["login_redirect"]; $options["login_redirect"] = $options["login_redirect"] === "%%previous%%" && empty($seeking) && is_front_page() ? "" : $options["login_redirect"]; $options["login_redirect"] = $options["login_redirect"] === "%%previous%%" && !empty($seeking) && $seeking === "/" ? "" : $options["login_redirect"]; /**/ $redirect_to = $options["login_redirect"]; $redirect_to = preg_replace("/%%previous%%/i", !empty($seeking) ? $seeking : $_SERVER["REQUEST_URI"], $redirect_to); $redirect_to = preg_replace("/%%home%%/i", home_url("/"), $redirect_to); /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget">' . "\n"; /**/ echo '<form method="post" action="' . esc_url(site_url('wp-login.php', 'login_post')) . '" class="ws-plugin--optimizemember-pro-login-widget-form">' . "\n"; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-username">' . "\n"; echo '<label for="ws-plugin--optimizemember-pro-login-widget-username">' . _x("Username", "s2member-front", "s2member") . ':</label><br />' . "\n"; echo '<input type="text" name="log" id="ws-plugin--optimizemember-pro-login-widget-username" title="Username" />' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-password">' . "\n"; echo '<label for="ws-plugin--optimizemember-pro-login-widget-password">' . _x("Password", "s2member-front", "s2member") . ':</label><br />' . "\n"; echo '<input type="password" name="pwd" id="ws-plugin--optimizemember-pro-login-widget-password" title="Password" />' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-lost-password">' . "\n"; $reg_cookies_ok_url = is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && is_main_site() ? c_ws_plugin__optimizemember_utils_urls::wp_signup_url() : c_ws_plugin__optimizemember_utils_urls::wp_register_url(); echo $options["signup_url"] ? '<a href="' . esc_attr($options["signup_url"] !== "%%automatic%%" ? $options["signup_url"] : (c_ws_plugin__optimizemember_register_access::reg_cookies_ok() ? $reg_cookies_ok_url : $links["membership_options_page"])) . '" tabindex="-1">' . _x("signup now", "s2member-front", "s2member") . '</a> | ' : ''; echo '<a href="' . esc_attr(wp_lostpassword_url()) . '" tabindex="-1">' . _x("forgot password?", "s2member-front", "s2member") . '</a>' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-remember-me">' . "\n"; echo '<label><input type="checkbox" name="rememberme" value="forever" />' . _x("Remember Me", "s2member-front", "s2member") . '</label>' . "\n"; echo '</div>' . "\n"; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-submit">' . "\n"; echo $redirect_to ? '<input type="hidden" name="redirect_to" value="' . esc_attr($redirect_to) . '" />' . "\n" : ''; echo '<input type="submit" value="' . esc_attr(_x("Log Me In", "s2member-front", "s2member")) . '" />' . "\n"; echo '</div>' . "\n"; /**/ echo '</form>' . "\n"; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-code">' . "\n"; /**/ if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site()) { echo do_shortcode(trim($options["logged_out_code"])); } else { /* Otherwise, it's OK to execute PHP code. */ echo do_shortcode(c_ws_plugin__optimizemember_utilities::evl(trim($options["logged_out_code"]))); } /**/ echo '</div>' . "\n"; /**/ echo '<div style="clear:both;"></div>' . "\n"; /**/ echo '</div>' . "\n"; } else { if (is_user_logged_in() && is_object($user = wp_get_current_user()) && !empty($user->ID) && ($user_id = $user->ID)) { $links = c_ws_plugin__optimizemember_cache::cached_page_links(); /**/ $ops_page = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"]; $welcome_page = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"]; /**/ $options["logout_redirect"] = $options["logout_redirect"] === "%%previous%%" && $ops_page && is_page($ops_page) ? "" : $options["logout_redirect"]; $options["logout_redirect"] = $options["logout_redirect"] === "%%previous%%" && $welcome_page && is_page($welcome_page) ? "" : $options["logout_redirect"]; /**/ $redirect_to = preg_replace("/%%previous%%/i", $_SERVER["REQUEST_URI"], $redirect_to = $options["logout_redirect"]); $redirect_to = preg_replace("/%%home%%/i", home_url("/"), $redirect_to); /**/ echo '<div id="ws-plugin--optimizemember-pro-login-widget" class="ws-plugin--optimizemember-pro-login-widget">' . "\n"; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-profile-summary">' . "\n"; /**/ echo $options["display_gravatar"] ? ($options["link_gravatar"] ? '<a href="http://www.gravatar.com/" target="_blank">' : '') . get_avatar($user_id, 48) . ($options["link_gravatar"] ? '</a>' : '') . "\n" : ''; /**/ echo $options["display_name"] ? '<div class="ws-plugin--optimizemember-pro-login-widget-profile-summary-name">' . esc_html($user->display_name) . '</div>' . "\n" : ''; /**/ echo '<div class="ws-plugin--optimizemember-pro-login-widget-profile-summary-code">' . "\n"; /**/ if (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site()) { echo do_shortcode(trim($options["logged_in_code"])); } else { /* Otherwise, it's OK to execute PHP code. */ echo do_shortcode(c_ws_plugin__optimizemember_utilities::evl(trim($options["logged_in_code"]))); } /**/ echo '</div>' . "\n"; /**/ echo $options["my_account_url"] ? '<div class="ws-plugin--optimizemember-pro-login-widget-profile-summary-my-account"><a href="' . esc_attr($options["my_account_url"] !== "%%automatic%%" ? c_ws_plugin__optimizemember_login_redirects::fill_login_redirect_rc_vars($options["my_account_url"]) : (($login_redirection_url = c_ws_plugin__optimizemember_login_redirects::login_redirection_url($user)) ? $login_redirection_url : $links["login_welcome_page"])) . '">' . _x("My Account", "s2member-front", "s2member") . '</a></div>' . "\n" : ''; echo $options["my_profile_url"] ? '<div class="ws-plugin--optimizemember-pro-login-widget-profile-summary-edit-profile"><a href="' . ($options["my_profile_url"] !== "%%automatic%%" ? esc_attr(c_ws_plugin__optimizemember_login_redirects::fill_login_redirect_rc_vars($options["my_profile_url"])) : esc_attr(site_url("/?optimizemember_profile=1")) . '" onclick="if(!window.open(\'' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr(site_url("/?optimizemember_profile=1"))) . '\',\'_profile\', \'width=600,height=400,left=\'+((screen.width/2)-(600/2))+\',screenX=\'+((screen.width/2)-(600/2))+\',top=\'+((screen.height/2)-(400/2))+\',screenY=\'+((screen.height/2)-(400/2))+\',location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1\')) alert(\'' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Please disable popup blockers and try again!", "s2member-front", "s2member")) . '\'); return false;') . '">' . _x("Edit My Profile", "s2member-front", "s2member") . '</a></div>' . "\n" : ''; echo '<div class="ws-plugin--optimizemember-pro-login-widget-profile-summary-logout"><a href="' . esc_attr(wp_logout_url($redirect_to)) . '">' . _x("Logout", "s2member-front", "s2member") . '</a></div>' . "\n"; /**/ echo '<div style="clear:both;"></div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; } } /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_login_widget_during_display_after", get_defined_vars(), $this); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ echo $args["after_widget"]; /**/ do_action("ws_plugin__optimizemember_pro_login_widget_after_display", get_defined_vars(), $this); /**/ return; /* Return for uniformity. */ }
/** * Shortcode `[optimizeMember-Pro-AliPay-Button /]`. * * @package optimizeMember\AliPay * @since 1.5 * * @attaches-to ``add_shortcode("optimizeMember-Pro-AliPay-Button");`` * * @param array $attr An array of Attributes. * @param str $content Content inside the Shortcode. * @param str $shortcode The actual Shortcode name itself. * @return str The resulting AliPay Button Code, HTML markup. */ public static function sc_alipay_button($attr = FALSE, $content = FALSE, $shortcode = FALSE) { c_ws_plugin__optimizemember_no_cache::no_cache_constants(true); /**/ $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); /**/ $attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "custom" => $_SERVER["HTTP_HOST"], "ra" => "0.01", "rp" => "1", "rt" => "M", "sp" => "0", "success" => "", "image" => "default", "output" => "anchor"), $attr); /**/ $attr["rt"] = strtoupper($attr["rt"]); $attr["ccaps"] = strtolower($attr["ccaps"]); $attr["success"] = str_ireplace(array("&", "&"), "&", $attr["success"]); /**/ if ($attr["sp"]) { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/alipay-button.gif"; /**/ $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"]; /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/alipay-sp-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ $vars = array("service" => "create_direct_pay_by_user", "payment_type" => 1, "partner" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_partner_id"], "seller_email" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_seller_email"], "subject" => $_SERVER["HTTP_HOST"], "body" => $attr["desc"], "out_trade_no" => uniqid() . "~" . $attr["sp_ids_exp"] . (($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "~" . $referencing : "~") . "~" . $_SERVER["REMOTE_ADDR"], "extra_common_param" => $attr["custom"], "total_fee" => $attr["ra"], "paymethod" => "directPay", "show_url" => home_url("/"), "return_url" => $attr["success"] ? $attr["success"] : site_url("/?optimizemember_pro_alipay_return=1"), "notify_url" => site_url("/")); /**/ $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_alipay_utilities::alipay_link_gen($vars))), $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; $code = $attr["output"] === "url" ? $url : $code; /**/ unset($href, $url, $m); } else { if ($attr["level"] === "*") { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/alipay-button.gif"; /**/ $attr["level_ccaps_eotper"] = $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/alipay-ccaps-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ $vars = array("service" => "create_direct_pay_by_user", "payment_type" => 1, "partner" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_partner_id"], "seller_email" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_seller_email"], "subject" => $_SERVER["HTTP_HOST"], "body" => $attr["desc"], "out_trade_no" => uniqid() . "~" . $attr["level_ccaps_eotper"] . (($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "~" . $referencing : "~") . "~" . $_SERVER["REMOTE_ADDR"], "extra_common_param" => $attr["custom"], "total_fee" => $attr["ra"], "paymethod" => "directPay", "show_url" => home_url("/"), "return_url" => $attr["success"] && !$referencing ? $attr["success"] : site_url("/?optimizemember_pro_alipay_return=1"), "notify_url" => site_url("/")); /**/ $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_alipay_utilities::alipay_link_gen($vars))), $code); /**/ $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); /**/ $code = $attr["output"] === "anchor" ? $code : $code; $code = $attr["output"] === "url" ? $url : $code; /**/ unset($href, $url, $m); } else { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/alipay-button.gif"; /**/ $attr["desc"] = !$attr["desc"] ? $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $attr["level"] . "_label"] : $attr["desc"]; /**/ $attr["level_ccaps_eotper"] = $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); /**/ $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/alipay-checkout-button.php"))); /* * Custom button */ if (!empty($content)) { $code = preg_replace('/%%button_markup%%/', $content, $code); } else { $code = preg_replace("/%%button_markup%%/", '<a href="%%url%%"><img src="%%images%%/alipay-button.gif" style="width:auto; height:auto; border:0;" alt="AliPay" /></a>', $code); } $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); /**/ $vars = array("service" => "create_direct_pay_by_user", "payment_type" => 1, "partner" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_partner_id"], "seller_email" => $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_seller_email"], "subject" => $_SERVER["HTTP_HOST"], "body" => $attr["desc"], "out_trade_no" => uniqid() . "~" . $attr["level_ccaps_eotper"] . (($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? "~" . $referencing : "~") . "~" . $_SERVER["REMOTE_ADDR"], "extra_common_param" => $attr["custom"], "total_fee" => $attr["ra"], "paymethod" => "directPay", "show_url" => home_url("/"), "return_url" => $attr["success"] && !$referencing ? $attr["success"] : site_url("/?optimizemember_pro_alipay_return=1"), "notify_url" => site_url("/")); /**/ $code = preg_replace("/%%url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($url = c_ws_plugin__optimizemember_pro_alipay_utilities::alipay_link_gen($vars))), $code); /* * Only when there is no custom button */ if (empty($content)) { $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); } /**/ $code = $attr["output"] === "anchor" ? $code : $code; $code = $attr["output"] === "url" ? $url : $code; /**/ unset($href, $url, $m); } } /**/ $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code); return $code; }
/** * Builds the options panel for this Payment Gateway. * * @package optimizeMember\Menu_Pages * @since 1.5 * * @return null */ public static function ccbill_ops_page() { c_ws_plugin__optimizemember_menu_pages::update_all_options(); /**/ $logs_dir = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["logs_dir"]; /**/ if (!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__optimizemember_utils_dirs::strip_dir_app_data($logs_dir)))) { mkdir($logs_dir, 0777, true) . clearstatcache(); } /**/ $htaccess = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["logs_dir"] . "/.htaccess"; $htaccess_contents = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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__"]["optimizemember"]["o"]["gateway_debug_logs"]) { if (!is_dir($logs_dir)) { /* If the security-enabled logs directory does not exist yet. */ c_ws_plugin__optimizemember_admin_notices::display_admin_notice('The security-enabled logs directory ( <code>' . esc_html(c_ws_plugin__optimizemember_utils_dirs::doc_root_path($logs_dir)) . '</code> ) does not exist. Please create this directory manually & make it writable ( chmod 777 ).', true); } else { if (!is_writable($logs_dir)) { /* If the logs directory is not writable yet. */ c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory ( <code>' . esc_html(c_ws_plugin__optimizemember_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__optimizemember_admin_notices::display_admin_notice('The .htaccess protection file ( <code>' . esc_html(c_ws_plugin__optimizemember_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__optimizemember_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file ( <code>' . esc_html(c_ws_plugin__optimizemember_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/ccbill-ops.inc.php"; /**/ return; /* Return for uniformity. */ }
public function __construct() { echo '<div class="wrap ws-menu-page op-bsw-wizard op-bsw-content">' . "\n"; /**/ echo '<div class="op-bsw-header">'; echo '<div class="op-logo"><img src="' . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images/" . 'logo-optimizepress.png" alt="OptimizePress" height="50" class="animated flipInY"></div>'; echo '</div>'; echo '<div class="op-bsw-main-content">'; echo '<h2>File 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__optimizemember_options_form" id="ws-plugin--optimizemember-options-form">' . "\n"; echo '<input type="hidden" name="ws_plugin__optimizemember_options_save" id="ws-plugin--optimizemember-options-save" value="' . esc_attr(wp_create_nonce("ws-plugin--optimizemember-options-save")) . '" />' . "\n"; echo '<input type="hidden" name="ws_plugin__optimizemember_amazon_cf_files_distros_auto_config_status" id="ws-plugin--optimizemember-amazon-cf-files-distros-auto-config-status" value="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distros_auto_config_status"]) . '" />' . "\n"; echo '<input type="hidden" name="ws_plugin__optimizemember_configured" id="ws-plugin--optimizemember-configured" value="1" />' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_down_ops_page_before_left_sections", get_defined_vars()); /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_restrictions", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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--optimizemember-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__optimizemember_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__optimizemember_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '</code></p>' . "\n"; echo '<p>- Now, you can link to any protected file, using this special format:<br /> <code>' . esc_html(site_url("/?optimizemember_file_download=example-file.zip")) . '</code><br /> <small><em><strong>optimizemember_file_download</strong> = file, relative to the /' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/ directory. In other words, just the file name.</em></small></p>' . "\n"; echo '<p>- Or, use: <code>[opmFile download="example-file.zip" /]</code> <em>( easier Shortcode if you prefer )</em><br /> <small><em><strong>Shortcode equivalent:</strong> <code>[opmFile /]</code> produces the entire URL for you, easier.</em></small></p>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<p>optimizeMember 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__"]["optimizemember"]["c"]["streaming_file_extns"])) . '</code>.</p>' . "\n"; echo '<p>optimizeMember will automatically detect links, anywhere in your content, and/or anywhere in your theme files, that contain <code>optimizemember_file_download</code> or <code>optimizemember-files</code>. Whenever a logged-in Member clicks a link that contains <code>optimizemember_file_download</code> or <code>optimizemember-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>&optimizemember_skip_confirmation</code>. Shortcode alternative: <code>[opmFile 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>?optimizemember_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 optimizeMember\'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__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<tr>' . "\n"; /**/ echo '<th style="padding-top:0;">' . "\n"; echo '<label for="ws-plugin--optimizemember-level' . $n . '-file-downloads-allowed">' . "\n"; echo $n === $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"] ? 'File Downloads ( Highest Level ' . $labelText . ' ):' . "\n" : 'File Downloads ( Level ' . $labelText . ' 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__optimizemember_level' . $n . '_file_downloads_allowed" id="ws-plugin--optimizemember-level' . $n . '-file-downloads-allowed" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_file_downloads_allowed"]) . '" style="width:200px;" /> every <input type="text" maxlength="3" autocomplete="off" name="ws_plugin__optimizemember_level' . $n . '_file_downloads_allowed_days" id="ws-plugin--optimizemember-level' . $n . '-file-downloads-allowed-days" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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__"]["optimizemember"]["c"]["levels"] ? 'highest Level ' . $labelText : 'Level ' . $labelText . ' 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__"]["optimizemember"]["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__optimizemember_during_down_ops_page_during_left_sections_after_restrictions", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_limit_exceeded_page", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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--optimizemember-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__optimizemember_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--optimizemember-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__optimizemember_file_download_limit_exceeded_page" id="ws-plugin--optimizemember-file-download-limit-exceeded-page">' . "\n"; echo '<option value="">— Select —</option>' . "\n"; foreach ($ws_plugin__optimizemember_temp_a = array_merge((array) get_pages()) as $ws_plugin__optimizemember_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '"' . ($ws_plugin__optimizemember_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["file_download_limit_exceeded_page"] ? ' selected="selected"' : '') . '>' . esc_html($ws_plugin__optimizemember_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__optimizemember_during_down_ops_page_during_left_sections_after_limit_exceeded_page", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_advanced_restrictions", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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--optimizemember-restrictions-section">' . "\n"; echo '<h3>Advanced Download Restrictions ( optional, for greater flexibility )</h3>' . "\n"; echo '<p>By default, optimizeMember uses your Basic Download Restrictions, as configured above. However, you can force optimizeMember to allow File Downloads, using an extra query string parameter: <code>&optimizemember_file_download_key=[Key]</code>. A File Download `Key` is passed through this parameter; it tells optimizeMember 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/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ). There is also a Shortcode equivalent, which does NOT require PHP at all, as seen below.</p>' . "\n"; do_action("ws_plugin__optimizemember_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("/?optimizemember_file_download=example-file.zip")) . '<code>&optimizemember_file_download_key=<?php echo optimizemember_file_download_key("example-file.zip"); ?></code><br /> <small><em><strong>optimizemember_file_download_key</strong> = <?php echo optimizemember_file_download_key("file, relative to the /' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/ directory"); ?></em></small></p>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<p>' . esc_html(site_url("/?optimizemember_file_download=example-file.zip")) . '<code>&optimizemember_file_download_key=[opmKey file_download="example-file.zip" /]</code><br /> <small><em><strong>Shortcode equivalent:</strong> <code>[opmKey file_download="example-file.zip" /]</code></em></small></p>' . "\n"; /**/ echo '<div class="ws-menu-page-hr"></div>' . "\n"; /**/ echo '<p><code>[opmFile download="example-file.zip" download_key="true" /]</code> <em>( Key is auto-generated in this case )</em><br /> <small><em><strong>Shortcode equivalent:</strong> <code>[opmFile /]</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 optimizemember_file_download_key(), is part of the optimizeMember 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 optimizeMember. 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>optimizemember_file_download_key()</code> actually produces.</p>' . "\n"; echo '<p><code>optimizemember_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>optimizemember_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 optimizeMember\'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__optimizemember_during_down_ops_page_during_left_sections_after_advanced_restrictions", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_inline_extensions", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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--optimizemember-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, optimizeMember 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 optimizeMember 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>&optimizemember_file_inline=yes</code>. Shortcode alternative: <code>[opmFile download="example-file.zip" inline="yes" /]</code>.</p>' . "\n"; do_action("ws_plugin__optimizemember_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--optimizemember-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__optimizemember_file_download_inline_extensions" id="ws-plugin--optimizemember-file-download-inline-extensions" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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__optimizemember_during_down_ops_page_during_left_sections_after_inline_extensions", get_defined_vars()); } /**/ /* if(apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_remote_authorization", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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--optimizemember-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>&optimizemember_file_remote=yes</code>. Shortcode alternative: <code>[opmFile 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.</p>'."\n"; do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_during_remote_authorization", get_defined_vars()); echo '</div>'."\n"; echo '</div>'."\n"; do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_after_remote_authorization", get_defined_vars()); } */ /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_amazon_s3", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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__optimizemember_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' default-state="open"' : '') . '>' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-amazon-s3-section">' . "\n"; echo '<h3>Amazon S3/CDN Storage & Delivery ( optional )</h3>' . "\n"; echo '<a href="http://aws.amazon.com/s3/" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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. optimizeMember can be configured here to ONLY use Amazon S3 <em>( i.e. without Amazon CloudFront )</em>. Or, optimizeMember 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. optimizeMember has been integrated with Amazon S3, so that <em>( if you wish )</em>, instead of using the <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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, optimizeMember will assume all protected files are inside your Amazon S3 Bucket; and the <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/</code> directory is no longer used at all. That being said, all other aspects of optimizeMember\'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 optimizeMember 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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/</code> directory.</p>' . "\n"; echo '<p>optimizeMember 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__optimizemember_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> optimizeMember 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, optimizeMember will generate Amazon S3 URLs ( internally ); which allow Customers temporary access to specific files inside your S3 Bucket. optimizeMember\'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 optimizeMember, 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 optimizeMember. 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__optimizemember_amazon_s3_file_expires_time</code>.</em></p>' . "\n"; echo '<p><em><strong>Linking To Protected Files:</strong> Nothing changes. optimizeMember\'s integration with Amazon S3 serves protected files through the same links that all optimizeMember site owners use. For example, you might use: <code>' . esc_html(site_url("/?optimizemember_file_download=example-file.zip")) . '</code>, where <strong>optimizemember_file_download</strong> = the file, relative to the root of your Amazon S3 Bucket. In other words, just the file name in most cases. optimizeMember 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>optimizeMember -> Download Options -> Basic Download Restrictions</code>. Also see: <code>optimizeMember -> Download Options -> Advanced Mod-Rewrite Linkage</code>.</em></p>' . "\n"; echo '<p><em><strong>Content Type, Disposition & Inline Files:</strong> The query string parameter <code>&optimizemember_file_inline=yes</code> DOES work for files served directly through Amazon S3. optimizeMember 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, optimizeMember 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--optimizemember-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__optimizemember_amazon_s3_files_bucket" id="ws-plugin--optimizemember-amazon-s3-files-bucket" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_s3_files_bucket"]) . '" /><br />' . "\n"; echo 'Your Amazon S3 Bucket will be used, instead of the <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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--optimizemember-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__optimizemember_amazon_s3_files_access_key" id="ws-plugin--optimizemember-amazon-s3-files-access-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_s3_files_access_key"]) . '" /><br />' . "\n"; echo 'See: <code>Amazon Web Services Account -> Security Credentials -> Access Credentials</code>.' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th>' . "\n"; echo '<label for="ws-plugin--optimizemember-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__optimizemember_amazon_s3_files_secret_key" id="ws-plugin--optimizemember-amazon-s3-files-secret-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_s3_files_secret_key"]) . '" /><br />' . "\n"; echo 'See: <code>Amazon Web Services Account -> Security Credentials -> Access Credentials</code>.' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_after_amazon_s3", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_amazon_cf", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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__optimizemember_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' default-state="open"' : '') . '>' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-amazon-cf-section">' . "\n"; echo '<h3>Amazon S3/CloudFront CDN Storage & Delivery ( optional )</h3>' . "\n"; echo '<a href="http://aws.amazon.com/cloudfront/" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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. optimizeMember can be configured to ONLY use Amazon S3 <em>( i.e. without Amazon CloudFront )</em>. Or, optimizeMember 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. optimizeMember 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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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 & 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 optimizeMember to use both Amazon S3 and Amazon CloudFront together, please review the section below regarding <code>JW Player & RTMP Protocol Examples</code>. optimizeMember 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, optimizeMember will assume all protected files are inside your Amazon S3 Bucket; and the <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/</code> directory is no longer used at all. That being said, all other aspects of optimizeMember\'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 optimizeMember will use your Amazon S3 Bucket, automatically connecting it to both of the Amazon CloudFront Distributions, which optimizeMember auto-configures for you <em>( see below )</em>. In this way, optimizeMember uses Amazon CloudFront as a CDN <em>( i.e. Content Delivery Network )</em> for your protected files.</p>' . "\n"; echo '<p>optimizeMember 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, optimizeMember will auto-create and auto-configure those for you, allowing you to serve protected files.</p>' . "\n"; do_action("ws_plugin__optimizemember_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> optimizeMember\'s auto-configuration routines for Amazon CloudFront (below), are designed to create & 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, optimizeMember will automatically configure an ACL & 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> optimizeMember 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, optimizeMember will generate Amazon CloudFront URLs ( internally ); which allow Customers temporary access to specific files inside your S3 Bucket — via CloudFront Distributions. optimizeMember\'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 optimizeMember, 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 optimizeMember. 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__optimizemember_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. optimizeMember\'s integration with Amazon S3/CloudFront serves protected files through the same links that all optimizeMember site owners use. For example, you might use: <code>' . esc_html(site_url("/?optimizemember_file_download=example-file.zip")) . '</code>, where <strong>optimizemember_file_download</strong> = the file, relative to the root of your Amazon S3 Bucket. In other words, just the file name in most cases. optimizeMember 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>optimizeMember -> Download Options -> Basic Download Restrictions</code>. Also see: <code>optimizeMember -> 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 & RTMP Protocol Examples</code>.</em></p>' . "\n"; echo '<p><em><strong>Content Type, Disposition & Inline Files:</strong> An IMPORTANT issue. The query string parameter <code>&optimizemember_file_inline=yes</code> does NOTHING for files served via Amazon CloudFront. optimizeMember 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__optimizemember_utils_conds::is_localhost() ? '<p><em><strong>Localhost Developers:</strong> optimizeMember\'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 & 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. optimizeMember 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">( optimizeMember has detected that OpenSSL-Win[32/64] IS installed in the correct location, thank you! )</strong>' : ' <strong class="ws-menu-page-hilite">( optimizeMember has detected that OpenSSL-Win[32/64] is NOT currently available )</strong>') . '</em></p>' . "\n" : ''; /**/ if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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__"]["optimizemember"]["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__"]["optimizemember"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' —» ' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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__"]["optimizemember"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' —» ' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : '') . '</p>' . "\n"; } else { if (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["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--optimizemember-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__optimizemember_amazon_cf_files_private_key_id" id="ws-plugin--optimizemember-amazon-cf-files-private-key-id" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_private_key_id"]) . '" data-s-prev-config-value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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--optimizemember-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__optimizemember_amazon_cf_files_private_key" id="ws-plugin--optimizemember-amazon-cf-files-private-key" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_private_key"]) . '" data-s-prev-config-value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_private_key"]) . '" />' . "\n"; echo '<textarea name="ws_plugin__optimizemember_amazon_cf_files_private_key_entry" id="ws-plugin--optimizemember-amazon-cf-files-private-key-entry" rows="3" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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, optimizeMember 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--optimizemember-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__optimizemember_amazon_cf_files_auto_configure_distros" id="ws-plugin--optimizemember-amazon-cf-files-auto-configure-distros" value="' . esc_attr(wp_create_nonce("ws-plugin--optimizemember-amazon-cf-files-auto-configure-distros")) . '"' . (!empty(c_ws_plugin__optimizemember_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--optimizemember-amazon-cf-files-auto-configure-distros"><strong>Yes</strong>, automatically configure my Amazon CloudFront Distributions & Amazon S3 ACLs for me.</label><br />' . "\n"; echo '<em>optimizeMember will auto-configure and/or delete & 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__optimizemember_amazon_cf_files_auto_configure_distros_w_cnames" id="ws-plugin--optimizemember-amazon-cf-files-auto-configure-distros-w-cnames" value="' . esc_attr(wp_create_nonce("ws-plugin--optimizemember-amazon-cf-files-auto-configure-distros-w-cnames")) . '"' . (!empty(c_ws_plugin__optimizemember_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) && ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_downloads_cname"] || $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_streaming_cname"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--optimizemember-amazon-cf-files-auto-configure-distros-w-cnames"><strong>Yes</strong>, I want optimizeMember 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--optimizemember-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--optimizemember-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__optimizemember_amazon_cf_files_distro_downloads_cname" id="ws-plugin--optimizemember-amazon-cf-files-downloads-distro-cname" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_downloads_cname"]) . '" /><br />' . "\n"; echo 'Example: <code>s2-file-downloads.' . esc_html(c_ws_plugin__optimizemember_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--optimizemember-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__optimizemember_amazon_cf_files_distro_streaming_cname" id="ws-plugin--optimizemember-amazon-cf-files-streaming-distro-cname" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["amazon_cf_files_distro_streaming_cname"]) . '" /><br />' . "\n"; echo 'Example: <code>s2-streaming-files.' . esc_html(c_ws_plugin__optimizemember_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__optimizemember_during_down_ops_page_during_left_sections_after_amazon_cf", get_defined_vars()); } /**/ /* if(apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_rtmp_streaming", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_before_rtmp_streaming", get_defined_vars()); echo '<div class="ws-menu-page-group" title="JW Player v6 & RTMP Protocol Examples">'."\n"; echo '<div class="ws-menu-page-section ws-plugin--optimizemember-rtmp-streaming-section">'."\n"; echo '<h3>JW Player v6 & RTMP Protocol Examples</h3>'."\n"; echo '<a href="http://www.longtailvideo.com/players/" target="_blank"><img src="'.esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]).'/images/jwplayer-logo.png" class="ws-menu-page-right" style="width:179px; height:58px; border:0;" alt="." /></a>'."\n"; echo '<p>While it is possible to serve audio/video files protected by optimizeMember, 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__optimizemember_readmes::parse_readme_value("Forum URI")).'" target="_blank" rel="external">optimizeMember 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 optimizeMember to use both Amazon S3 and Amazon CloudFront together, please review the code samples below. optimizeMember 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.optimizepress.com/kb/jwplayer-opmStream-shortcodes/" target="_blank" rel="external">JW Player w/ <code>[opmStream /]</code> Shortcodes</a>.</p>'."\n"; do_action("ws_plugin__optimizemember_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>[opmStream /]</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--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-opmStream-mp4.x-php")).'</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-mp4-rtmp\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP4, via optimizeMember\'s Amazon S3/CloudFront integration )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-opmStream-mp4-rtmp.x-php")).'</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-mp4-rtmp-only\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP4 only, via optimizeMember\'s Amazon S3/CloudFront integration )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-opmStream-mp4-rtmp-only.x-php")).'</p>'."\n"; echo '<div class="ws-menu-page-hr"></div>'."\n"; echo '<h3><code>[opmStream /]</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--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-opmStream-mp3.x-php")).'</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-mp3-rtmp\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP3, via optimizeMember\'s Amazon S3/CloudFront integration )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-opmStream-mp3-rtmp.x-php")).'</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-mp3-rtmp-only\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP3 only, via optimizeMember\'s Amazon S3/CloudFront integration )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-opmStream-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-opmStream-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--optimizemember-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--optimizemember-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br />Also see: <code>optimizeMember -> Download Options -> Advanced Mod Rewrite Linkage</code>.<br /><br />'.c_ws_plugin__optimizemember_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--optimizemember-rtmp-streaming-details-jwplayer-streaming-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP4, via optimizeMember\'s Amazon S3/CloudFront integration )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_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--optimizemember-rtmp-streaming-details-jwplayer-streaming-mp4-sca\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP4, via optimizeMember\'s JSON/Shortcode alternative )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_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--optimizemember-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--optimizemember-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_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__optimizemember_during_down_ops_page_during_left_sections_after_rtmp_streaming", get_defined_vars()); } if(apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_rtmp_streaming", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_before_rtmp_streaming", get_defined_vars()); echo '<div class="ws-menu-page-group" title="JW Player v5 & RTMP Protocol Examples ( Deprecated )">'."\n"; echo '<div class="ws-menu-page-section ws-plugin--optimizemember-rtmp-streaming-section">'."\n"; echo '<h3>JW Player v5 & RTMP Protocol Examples ( Deprecated )</h3>'."\n"; echo '<a href="http://www.longtailvideo.com/players/" target="_blank"><img src="'.esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]).'/images/jwplayer-logo.png" class="ws-menu-page-right" style="width:179px; height:58px; border:0;" alt="." /></a>'."\n"; echo '<p>While it is possible to serve audio/video files protected by optimizeMember, 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__optimizemember_readmes::parse_readme_value("Forum URI")).'" target="_blank" rel="external">optimizeMember 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 optimizeMember to use both Amazon S3 and Amazon CloudFront together, please review the code samples below. optimizeMember can automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon CloudFront Streaming Distribution.</p>'."\n"; do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_during_rtmp_streaming", get_defined_vars()); echo '<div class="ws-menu-page-hr"></div>'."\n"; echo '<h3>PHP Code Examples (for more advanced integrations)</h3>'."\n"; echo '<p>These examples exist from past versions of optimizeMember. JW Player v5 is now outdated by JW Player v6 (recommended).</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-v5-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--optimizemember-rtmp-streaming-details-jwplayer-v5-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-standard-mp4.x-php")).'</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-v5-streaming-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP4, via optimizeMember\'s Amazon S3/CloudFront integration )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-v5-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-streaming-mp4.x-php")).'</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-v5-streaming-mp4-sca\').toggle(); return false;" class="ws-dotted-link">JW Player ( RTMP streaming MP4, via optimizeMember\'s JSON/Shortcode alternative )</a></p>'."\n"; echo '<p id="ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-v5-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-streaming-mp4-sca.x-php")).'</p>'."\n"; echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--optimizemember-rtmp-streaming-details-jwplayer-v5-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--optimizemember-rtmp-streaming-details-jwplayer-v5-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 optimizeMember to be integrated with Amazon S3/CloudFront.<br /><br />'.c_ws_plugin__optimizemember_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-streaming-mp4-webm.x-php")).'</p>'."\n"; echo '</div>'."\n"; echo '</div>'."\n"; do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_after_rtmp_streaming", get_defined_vars()); } */ /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_rewrite_linkage", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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--optimizemember-rewrite-linkage-section">' . "\n"; echo '<h3>Advanced Mod-Rewrite Linkage</h3>' . "\n"; echo '<p>optimizeMember automatically creates <code>mod_rewrite</code> rules inside your <code>/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/</code> directory, which provide additional flexibility in the way protected files can be served to your Customers. With optimizeMember\'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 optimizeMember-protected file directly, like this: <code>... /wp-content/plugins/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/example-file.zip</code> instead of <code>... /?optimizemember_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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/example-file.zip?optimizemember_file_inline=yes&optimizemember_file_download_key=[key]</code>.</p>' . "\n"; echo '<p>That being said, optimizeMember\'s <code>mod_rewrite</code> rules allow for more advanced control over optimizeMember-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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-file-inline-[yes|no]/optimizemember-file-download-key-[key]</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-file-inline-yes/optimizemember-file-download-key-xS54df5ER4d5x</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-file-storage-[local|s3|cf]</strong>/example-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-file-storage-cf</strong>/example-cloudfront-file.zip</code><br /><code>... /wp-content/plugins/' . esc_html(c_ws_plugin__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '<strong class="ws-menu-page-hilite">/optimizemember-file-storage-s3/optimizemember-file-inline</strong>/example-s3-file.html</code></p>' . "\n"; echo '<p><em>* Note, the order of your optimizeMember-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__optimizemember_during_down_ops_page_during_left_sections_during_rewrite_linkage", get_defined_vars()); echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_after_rewrite_linkage", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_shortcode_attrs", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_before_shortcode_attrs", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="Shortcode Attributes & API Functions ( Explained )">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-shortcode-attrs-section">' . "\n"; echo '<h3>Shortcode Attributes & API Functions ( Explained In Full Detail )</h3>' . "\n"; echo '<p>optimizeMember makes Shortcodes available to you, which allow you to generate File Download URLs and/or File Download Keys. Like most Shortcodes for WordPress, optimizeMember 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__optimizemember_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>[opmFile /]</code> & <code>[opmStream /]</code> Shortcode Attributes:</h4>' . "\n"; //echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.optimizepress.com/codex/stable/s2member/api_functions/package-functions/#src_doc_optimizemember_file_download_url()" target="_blank" rel="external">optimizemember_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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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>, optimizeMember will return a URL with an optimizeMember-generated File Download Key. You don\'t need to generate the File Download Key yourself, optimizeMember does it for you. If you set <code>download_key="ip-forever"</code>, the File Download Key that optimizeMember 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>, optimizeMember 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>[opmFile /]</code> Shortcode. Defaults to <code>yes</code> with <code>[opmStream /]</code> Shortcode. If <code>stream="1|on|yes|true"</code>, optimizeMember 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 optimizeMember 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>, optimizeMember will automatically force <code>stream="yes"</code> for you.</li>' . "\n"; echo '<li><code>inline=""</code> Defaults to <code>[empty]</code> with <code>[opmFile /]</code> Shortcode. Defaults to <code>yes</code> with <code>[opmStream /]</code> Shortcode. If <code>inline="1|on|yes|true"</code>, optimizeMember will serve the file inline, instead of as an actual File Download. If empty, optimizeMember 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, optimizeMember serves all files as attachments <em>( i.e. downloads )</em>, except in the case of the <code>[opmStream /]</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>, optimizeMember 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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/</code> directory; you can force optimizeMember 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>, optimizeMember 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>, optimizeMember 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, optimizeMember 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, optimizeMember will use a non-SSL protocol by default.</li>' . "\n"; echo '<li><code>rewrite="no"</code> Defaults to <code>no</code> with <code>[opmFile /]</code> Shortcode. Defaults to <code>yes</code> with <code>[opmStream /]</code> Shortcode. If <code>rewrite="1|on|yes|true"</code>, optimizeMember will generate a File Download URL that takes full advantage of optimizeMember\'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. optimizeMember\'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>, optimizeMember will generate a File Download URL that takes full advantage of optimizeMember\'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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) . '/</code>. Note, if <code>rewrite_base</code> is set, optimizeMember 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>, optimizeMember will generate a File Download URL which contains a directive, telling optimizeMember NOT to introduce any JavaScript confirmation prompts on your site, for this File Download URL. Please note, optimizeMember will automatically detect links, anywhere in your content, and/or anywhere in your theme files, that contain <code>optimizemember_file_download</code> or <code>optimizemember-files</code>. Whenever a logged-in Member clicks a link that contains <code>optimizemember_file_download</code> or <code>optimizemember-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>[opmFile /]</code> Shortcode. Defaults to <code>yes</code> with <code>[opmStream /]</code> Shortcode. If <code>url_to_storage_source="1|on|yes|true"</code>, optimizeMember 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>, optimizeMember will NOT be able to further authenticate the current User/Member; and, optimizeMember 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 optimizeMember 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 optimizeMember 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 optimizeMember\'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>[opmFile /]</code> Shortcode. Defaults to <code>yes</code> with <code>[opmStream /]</code> Shortcode. If <code>count_against_user="******"</code>, it will automatically force <code>check_user="******"</code> as well. In other words, optimizeMember 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>[opmFile /]</code> Shortcode. By default, optimizeMember will simply generate a File Download URL, and upon a User/Member clicking the URL, optimizeMember 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>[opmFile /]</code> Shortcode. Defaults to <code>yes</code> with <code>[opmStream /]</code> Shortcode. If <code>check_user="******"</code>, optimizeMember will authenticate the current User before allowing the File Download URL to be generated. This is off by default with the <code>[opmFile /]</code> Shortcode. By default, optimizeMember will simply generate a File Download URL, and upon a User/Member clicking the URL, optimizeMember 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>[opmStream /]</code> Shortcode. If <code>get_streamer_json="1|on|yes|true"</code>, the <code>[opmFile /]</code> Shortcode will return a JSON object for JavaScript notation, making it possible to integrate the <code>[opmFile /]</code> Shortcode into JavaScript routines that configure streaming media players. For further details, please review the section above: <code>JW Player & RTMP Protocol Examples</code>. Note, if you set <code>get_streamer_json="true"</code>, optimizeMember 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__optimizemember_during_down_ops_page_during_left_sections_during_shortcode_attrs_opmFile_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>[opmStream /]</code> Shortcode Attributes:</h4>' . "\n"; //echo '<p style="margin:0;"><strong>See also:</strong> This KB article: <a href="http://www.optimizepress.com/kb/jwplayer-opmStream-shortcodes/" target="_blank" rel="external">JW Player w/ <code>[opmStream /]</code> Shortcodes</a>.</p>'."\n"; //echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.optimizepress.com/codex/stable/s2member/api_functions/package-functions/#src_doc_optimizemember_file_download_url()" target="_blank" rel="external">optimizemember_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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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 optimizeMember 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_image="http://www.example.com/wp-content/uploads/video-preview.jpg"</code>, <code>player_autostart="true"</code>, <code>player_skin="/jwplayer/my-skin.xml"</code>, <code>player_key="my-license-key"</code>. 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>.</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"; do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_during_shortcode_attrs_opmStream_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>[opmKey /]</code> Shortcode Attributes:</h4>' . "\n"; //echo '<p style="margin:0;"><strong>See also:</strong> API Function <a href="http://www.optimizepress.com/codex/stable/s2member/api_functions/package-functions/#src_doc_optimizemember_file_download_key()" target="_blank" rel="external">optimizemember_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__optimizemember_utils_dirs::basename_dir_app_data($GLOBALS["WS_PLUGIN__"]["optimizemember"]["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>, optimizeMember will return a special File Download Key. If you set <code>directive="ip-forever"</code>, the File Download Key that optimizeMember 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>, optimizeMember 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__optimizemember_during_down_ops_page_during_left_sections_during_shortcode_attrs_opmKey_lis", get_defined_vars()); echo '</ul>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_after_shortcode_attrs", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_display_gzip_conflicts", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_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--optimizemember-gzip-conflicts-section">' . "\n"; echo '<h3>Preventing GZIP Conflicts On Server ( Instructions )</h3>' . "\n"; echo '<p>Protected files served by optimizeMember 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 optimizeMember encourages the use of extensions like <code>mod_deflate</code>, it is best to disable GZIP automatically (i.e. temporarily) during optimizeMember\'s delivery of a protected file through a PHP script. This avoids conflicts on the server which might otherwise lead to corrupted file downloads. optimizeMember 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__optimizemember_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;">optimizeMember 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__optimizemember_utils_dirs::doc_root_path(ABSPATH . ".htaccess")) . '</code></p>' . "\n"; echo '<pre><code>' . esc_html(trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_no_gzip_htaccess"])))) . '</code></pre>'; echo '<p><strong>* Tip:</strong> this covers all types of integration with optimizeMember File Downloads, even if you\'re using optimizeMember\'s Advanced Mod Rewrite Linkage.</p>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_down_ops_page_during_left_sections_after_gzip_conflicts", get_defined_vars()); } /**/ do_action("ws_plugin__optimizemember_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" class="op-pb-button green" value="Save All Changes" /></p>' . "\n"; /**/ echo '</form>' . "\n"; /**/ echo '</td>' . "\n"; /**/ echo '<td class="ws-menu-page-table-r">' . "\n"; c_ws_plugin__optimizemember_menu_pages_rs::display(); echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; /**/ echo '</div>' . "\n"; echo '</div>' . "\n"; }
/** * Shortcode `[optimizeMember-Pro-AuthNet-Form /]`. * * @package optimizeMember\AuthNet * @since 1.5 * * @attaches-to ``add_shortcode("optimizeMember-Pro-AuthNet-Form");`` * * @param array $attr An array of Attributes. * @param str $content Content inside the Shortcode. * @param str $shortcode The actual Shortcode name itself. * @return str The resulting Form Code, HTML markup. */ public static function sc_authnet_form($attr = FALSE, $content = FALSE, $shortcode = FALSE) { eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_before_sc_authnet_form", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ c_ws_plugin__optimizemember_no_cache::no_cache_constants(true); /**/ $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); /**/ $attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => $attr["register"] ? "0" : "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "rrt" => "", "modify" => "0", "cancel" => "0", "sp" => "0", "register" => "0", "update" => "0", "accept" => "visa,mastercard,amex,discover", "coupon" => "", "accept_coupons" => "0", "default_country_code" => "US", "captcha" => "", "template" => "", "success" => ""), $attr); /**/ $attr["tt"] = strtoupper($attr["tt"]); $attr["rt"] = strtoupper($attr["rt"]); $attr["rr"] = strtoupper($attr["rr"]); $attr["ccaps"] = strtolower($attr["ccaps"]); $attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"]; $attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"]; $attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"]; $attr["cc"] = "USD"; $attr["default_country_code"] = strtoupper($attr["default_country_code"]); $attr["success"] = c_ws_plugin__optimizemember_utils_urls::n_amps($attr["success"]); /**/ $attr["accept"] = trim($attr["accept"]) ? preg_split("/[;,]+/", preg_replace("/[\r\n\t\\s]+/", "", strtolower($attr["accept"]))) : array(); $attr["accept"] = empty($attr["accept"]) ? array_merge($attr["accept"], array("visa")) : $attr["accept"]; /**/ $attr["coupon"] = $_GET["s2p-coupon"] ? trim(strip_tags(stripslashes($_GET["s2p-coupon"]))) : $attr["coupon"]; /**/ $attr["singular"] = get_the_ID(); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_before_sc_authnet_form_after_shortcode_atts", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ if ($attr["cancel"]) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); /* Obtain a possible response and/or validation error. */ $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_cancellation_response($attr); /* Empty post vars on successful response. */ $_p = $response["response"] && !$response["error"] ? array() : $_p; /* Build the reCaptcha box via JavaScript. */ if ($attr["captcha"]) { $captcha = '<div id="s2member-pro-authnet-cancellation-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-cancellation-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-cancellation-form-captcha-section">' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-cancellation-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-cancellation-form-captcha-section-title">' . "\n"; $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n"; $captcha .= '</div>' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-cancellation-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-cancellation-form-captcha-div">' . "\n"; /**/ $captcha .= '<label id="s2member-pro-authnet-cancellation-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-cancellation-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr["captcha"], 10) . "\n"; $captcha .= '</label>' . "\n"; /**/ $captcha .= '</div>' . "\n"; /**/ $captcha .= '</div>' . "\n"; } /* Build the hidden input variables. */ $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_cancellation[nonce]" id="s2member-pro-authnet-cancellation-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-cancellation")) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_cancellation[attr]" id="s2member-pro-authnet-cancellation-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; /* Get the form template. */ $custom_template = file_exists(TEMPLATEPATH . "/authnet-cancellation-form.php") ? TEMPLATEPATH . "/authnet-cancellation-form.php" : false; $custom_template = file_exists(TEMPLATEPATH . "/authnet-cancellation-form.html") ? TEMPLATEPATH . "/authnet-cancellation-form.html" : $custom_template; $custom_template = $attr["template"] && file_exists(TEMPLATEPATH . "/" . $attr["template"]) ? TEMPLATEPATH . "/" . $attr["template"] : $custom_template; $custom_template = $attr["template"] && file_exists(WP_CONTENT_DIR . "/" . $attr["template"]) ? WP_CONTENT_DIR . "/" . $attr["template"] : $custom_template; /**/ $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/forms/authnet-cancellation-form.php")); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); /* Fill in the action. */ $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code); /* Fill in the response. */ $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code); /* Fill in the description. */ $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code); /* Fill the captcha section. */ $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code); /* Fill hidden inputs. */ $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_during_sc_authnet_cancellation_form", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } else { if ($attr["register"]) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); /* Obtain a possible response and/or validation error. */ $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_registration_response($attr); /* Empty post vars on successful response. */ $_p = $response["response"] && !$response["error"] ? array() : $_p; /* Build all of the custom fields. */ if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) { /* Only display Custom Fields if configured. */ if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level($attr["level"], "registration")) { $tabindex = 99; /* Start tabindex at 99 ( +1 below = 100 ). */ /**/ $custom_fields = '<div id="s2member-pro-authnet-registration-form-custom-fields-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-registration-form-section s2member-pro-authnet-form-custom-fields-section s2member-pro-authnet-registration-form-custom-fields-section">' . "\n"; /**/ $custom_fields .= '<div id="s2member-pro-authnet-registration-form-custom-fields-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-registration-form-section-title s2member-pro-authnet-form-custom-fields-section-title s2member-pro-authnet-registration-form-custom-fields-section-title">' . "\n"; $custom_fields .= _x("Additional Info", "s2member-front", "s2member") . "\n"; $custom_fields .= '</div>' . "\n"; /**/ foreach (json_decode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"], true) as $field) { if (in_array($field["id"], $fields_applicable)) { $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"])); $field_id_class = preg_replace("/_/", "-", $field_var); /**/ if (!empty($field["section"]) && $field["section"] === "yes") { /* Starts a new section? */ $custom_fields .= '<div id="s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-divider-section" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-custom-reg-field-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . '">' . (!empty($field["sectitle"]) ? $field["sectitle"] : '') . '</div>'; } /**/ $custom_fields .= '<div id="s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-div s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-div">' . "\n"; /**/ $custom_fields .= '<label for="s2member-pro-authnet-registration-custom-reg-field-' . esc_attr($field_id_class) . '" id="s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-label" class="s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-label s2member-pro-authnet-registration-form-custom-reg-field-' . $field_id_class . '-label">' . "\n"; $custom_fields .= '<span' . (preg_match("/^(checkbox|pre_checkbox)\$/", $field["type"]) ? ' style="display:none;"' : '') . '>' . $field["label"] . ($field["required"] === "yes" ? ' *' : '') . '</span></label>' . (preg_match("/^(checkbox|pre_checkbox)\$/", $field["type"]) ? '' : '<br />') . "\n"; $custom_fields .= c_ws_plugin__optimizemember_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, "optimizemember_pro_authnet_registration[custom_fields][", "s2member-pro-authnet-registration-custom-reg-field-", "s2member-pro-authnet-custom-reg-field-" . $field_id_class . " s2member-pro-authnet-registration-custom-reg-field-" . $field_id_class, "", $tabindex = $tabindex + 1, "", $_p, $_p["optimizemember_pro_authnet_registration"]["custom_fields"][$field_var], "registration"); /**/ $custom_fields .= '</div>' . "\n"; } } /**/ $custom_fields .= '</div>' . "\n"; } } /* Build the reCaptcha box via JavaScript. */ if ($attr["captcha"]) { $captcha = '<div id="s2member-pro-authnet-registration-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-registration-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-registration-form-captcha-section">' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-registration-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-registration-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-registration-form-captcha-section-title">' . "\n"; $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n"; $captcha .= '</div>' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-registration-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-registration-form-captcha-div">' . "\n"; /**/ $captcha .= '<label id="s2member-pro-authnet-registration-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-registration-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr["captcha"], 200) . "\n"; $captcha .= '</label>' . "\n"; /**/ $captcha .= '</div>' . "\n"; /**/ $captcha .= '</div>' . "\n"; } /* Build the opt-in checkbox. */ if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) { $opt_in = '<div id="s2member-pro-authnet-registration-form-custom-reg-field-opt-in-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-registration-form-div s2member-pro-authnet-form-custom-reg-field-opt-in-div s2member-pro-authnet-registration-form-custom-reg-field-opt-in-div">' . "\n"; /**/ $opt_in .= '<label for="s2member-pro-authnet-registration-form-custom-reg-field-opt-in" id="s2member-pro-authnet-registration-form-custom-reg-field-opt-in-label" class="s2member-pro-authnet-form-custom-reg-field-opt-in-label s2member-pro-authnet-registration-form-custom-reg-field-opt-in-label">' . "\n"; $opt_in .= '<input type="checkbox" name="optimizemember_pro_authnet_registration[custom_fields][opt_in]" id="s2member-pro-authnet-registration-form-custom-reg-field-opt-in" class="s2member-pro-authnet-form-custom-reg-field-opt-in s2member-pro-authnet-registration-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] == 1 || $_p["optimizemember_pro_authnet_registration"]["custom_fields"]["opt_in"] ? ' checked="checked"' : '') . ' tabindex="300" />' . "\n"; $opt_in .= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in_label"] . "\n"; $opt_in .= '</label>' . "\n"; /**/ $opt_in .= '</div>' . "\n"; } /* Build the hidden input variables. */ $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_registration[nonce]" id="s2member-pro-authnet-registration-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-registration")) . '" />'; $hidden_inputs .= !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_names"] ? '<input type="hidden" id="s2member-pro-authnet-registration-names-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_password"] ? '<input type="hidden" id="s2member-pro-authnet-registration-password-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_registration[attr]" id="s2member-pro-authnet-registration-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; /* Get the form template. */ $custom_template = file_exists(TEMPLATEPATH . "/authnet-registration-form.php") ? TEMPLATEPATH . "/authnet-registration-form.php" : false; $custom_template = file_exists(TEMPLATEPATH . "/authnet-registration-form.html") ? TEMPLATEPATH . "/authnet-registration-form.html" : $custom_template; $custom_template = $attr["template"] && file_exists(TEMPLATEPATH . "/" . $attr["template"]) ? TEMPLATEPATH . "/" . $attr["template"] : $custom_template; $custom_template = $attr["template"] && file_exists(WP_CONTENT_DIR . "/" . $attr["template"]) ? WP_CONTENT_DIR . "/" . $attr["template"] : $custom_template; /**/ $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/forms/authnet-registration-form.php")); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); /* Fill in the action. */ $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code); /* Fill in the response. */ $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code); /* Fill in the description. */ $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code); /* Fill in the registration section. */ $code = preg_replace("/%%first_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_registration"]["first_name"])), $code); $code = preg_replace("/%%last_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_registration"]["last_name"])), $code); $code = preg_replace("/%%email_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["email"])), $code); $code = preg_replace("/%%username_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["username"])), $code); $code = preg_replace("/%%password1_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["password1"])), $code); $code = preg_replace("/%%password2_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_registration"]["password2"])), $code); /* Fill in the custom fields section. */ $code = preg_replace("/%%custom_fields%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($custom_fields), $code); /* Fill the captcha section. */ $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code); /* Fill the opt-in box. */ $code = preg_replace("/%%opt_in%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($opt_in), $code); /* Fill hidden inputs. */ $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_during_sc_authnet_registration_form", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } else { if ($attr["update"]) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); /* Obtain a possible response and/or validation error. */ $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_update_response($attr); /* Empty post vars on successful response. */ $_p = $response["response"] && !$response["error"] ? array() : $_p; /* Build the list of card type options. */ foreach (array("Visa" => _x("Visa", "s2member-front", "s2member"), "MasterCard" => _x("MasterCard", "s2member-front", "s2member"), "Discover" => _x("Discover", "s2member-front", "s2member"), "Amex" => _x("American Express", "s2member-front", "s2member")) as $card_type_v => $card_type_l) { $card_type_options .= '<label for="s2member-pro-authnet-update-card-type-' . esc_attr(strtolower($card_type_v)) . '" id="s2member-pro-authnet-update-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label" class="s2member-pro-authnet-form-card-type-label s2member-pro-authnet-update-form-card-type-label s2member-pro-authnet-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label s2member-pro-authnet-update-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label' . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled' : '') . '">' . "\n" . '<input type="radio" aria-required="true" name="optimizemember_pro_authnet_update[card_type]" id="s2member-pro-authnet-update-card-type-' . esc_attr(strtolower($card_type_v)) . '" class="s2member-pro-authnet-card-type-' . esc_attr(strtolower($card_type_v)) . ' s2member-pro-authnet-update-card-type-' . esc_attr(strtolower($card_type_v)) . '" value="' . esc_attr($card_type_v) . '"' . (!empty($_p["optimizemember_pro_authnet_update"]["card_type"]) && in_array(strtolower($_p["optimizemember_pro_authnet_update"]["card_type"]), $attr["accept"]) && $_p["optimizemember_pro_authnet_update"]["card_type"] === $card_type_v ? ' checked="checked"' : '') . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled="disabled"' : '') . ' tabindex="10" />' . "\n" . '</label>'; } /* Build the list of country code options. $country_default_by_currency = false. Authorize.Net always processes in USD, so the country is empty by default. Authorize.Net always processes in USD. International transactions are converted automatically through banking institutions. */ $country_default_by_currency = !$_p["optimizemember_pro_authnet_update"]["country"] && $attr["cc"] === "USD" ? "US" : $country_default_by_currency; $country_default_by_currency = !$_p["optimizemember_pro_authnet_update"]["country"] && $attr["cc"] === "CAD" ? "CA" : $country_default_by_currency; $country_default_by_currency = !$_p["optimizemember_pro_authnet_update"]["country"] && $attr["cc"] === "GBP" ? "GB" : $country_default_by_currency; $country_default_by_currency = apply_filters("ws_plugin__optimizemember_pro_authnet_default_country", false, get_defined_vars()); /**/ $default_country_v = $attr["default_country_code"] ? $attr["default_country_code"] : $country_default_by_currency; /**/ $country_options = '<option value=""></option>'; /* Start with an empty option value. */ /**/ foreach (preg_split("/[\r\n]+/", file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/iso-3166-1.txt")) as $country) { list($country_l, $country_v) = preg_split("/;/", $country, 2); /**/ if ($country_l && $country_v) { /* Here we also check on the default pre-selected country; as determined above; based on currency. */ $country_options .= '<option value="' . esc_attr(strtoupper($country_v)) . '"' . ($_p["optimizemember_pro_authnet_update"]["country"] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>'; } } /* Build the reCaptcha box via JavaScript. */ if ($attr["captcha"]) { $captcha = '<div id="s2member-pro-authnet-update-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-update-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-update-form-captcha-section">' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-update-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-update-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-update-form-captcha-section-title">' . "\n"; $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n"; $captcha .= '</div>' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-update-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-update-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-update-form-captcha-div">' . "\n"; /**/ $captcha .= '<label id="s2member-pro-authnet-update-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-update-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr["captcha"], 200) . "\n"; $captcha .= '</label>' . "\n"; /**/ $captcha .= '</div>' . "\n"; /**/ $captcha .= '</div>' . "\n"; } /* Build the hidden input variables. */ $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_update[nonce]" id="s2member-pro-authnet-update-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-update")) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_update[attr]" id="s2member-pro-authnet-update-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; /* Get the form template. */ $custom_template = file_exists(TEMPLATEPATH . "/authnet-update-form.php") ? TEMPLATEPATH . "/authnet-update-form.php" : false; $custom_template = file_exists(TEMPLATEPATH . "/authnet-update-form.html") ? TEMPLATEPATH . "/authnet-update-form.html" : $custom_template; $custom_template = $attr["template"] && file_exists(TEMPLATEPATH . "/" . $attr["template"]) ? TEMPLATEPATH . "/" . $attr["template"] : $custom_template; $custom_template = $attr["template"] && file_exists(WP_CONTENT_DIR . "/" . $attr["template"]) ? WP_CONTENT_DIR . "/" . $attr["template"] : $custom_template; /**/ $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/forms/authnet-update-form.php")); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); /* Fill in the action. */ $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code); /* Fill in the response. */ $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code); /* Fill in the description. */ $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code); /* Fill in the billing method section. */ $code = preg_replace("/%%card_type_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($card_type_options), $code); $code = preg_replace("/%%card_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_number"])), $code); $code = preg_replace("/%%card_expiration_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_expiration"])), $code); $code = preg_replace("/%%card_verification_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_verification"])), $code); $code = preg_replace("/%%card_start_date_issue_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["card_start_date_issue_number"])), $code); /* Fill in the billing address section. */ $code = preg_replace("/%%street_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["street"])), $code); $code = preg_replace("/%%city_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["city"])), $code); $code = preg_replace("/%%state_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["state"])), $code); $code = preg_replace("/%%country_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($country_options), $code); $code = preg_replace("/%%zip_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_update"]["zip"])), $code); /* Fill the captcha section. */ $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code); /* Fill hidden inputs. */ $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_during_sc_authnet_update_form", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } else { if ($attr["sp"]) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); /* Configure internal attributes. */ $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"]; /* Combined `sp:ids:expiration hours`. */ $attr["coupon"] = $_p["optimizemember_pro_authnet_sp_checkout"]["coupon"] ? $_p["optimizemember_pro_authnet_sp_checkout"]["coupon"] : $attr["coupon"]; /* Obtain a possible response and/or validation error. */ $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_sp_checkout_response($attr); /* Empty post vars on successful response. */ $_p = $response["response"] && !$response["error"] ? array() : $_p; /* Build the list of card type options. */ foreach (array("Visa" => _x("Visa", "s2member-front", "s2member"), "MasterCard" => _x("MasterCard", "s2member-front", "s2member"), "Discover" => _x("Discover", "s2member-front", "s2member"), "Amex" => _x("American Express", "s2member-front", "s2member")) as $card_type_v => $card_type_l) { $card_type_options .= '<label for="s2member-pro-authnet-sp-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" id="s2member-pro-authnet-sp-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label" class="s2member-pro-authnet-form-card-type-label s2member-pro-authnet-sp-checkout-form-card-type-label s2member-pro-authnet-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label s2member-pro-authnet-sp-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label' . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled' : '') . '">' . "\n" . '<input type="radio" aria-required="true" name="optimizemember_pro_authnet_sp_checkout[card_type]" id="s2member-pro-authnet-sp-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" class="s2member-pro-authnet-card-type-' . esc_attr(strtolower($card_type_v)) . ' s2member-pro-authnet-sp-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" value="' . esc_attr($card_type_v) . '"' . (!empty($_p["optimizemember_pro_authnet_sp_checkout"]["card_type"]) && in_array(strtolower($_p["optimizemember_pro_authnet_sp_checkout"]["card_type"]), $attr["accept"]) && $_p["optimizemember_pro_authnet_sp_checkout"]["card_type"] === $card_type_v ? ' checked="checked"' : '') . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled="disabled"' : '') . ' tabindex="100" />' . "\n" . '</label>'; } /* Build the list of country code options. $country_default_by_currency = false. Authorize.Net always processes in USD, so the country is empty by default. Authorize.Net always processes in USD. International transactions are converted automatically through banking institutions. */ $country_default_by_currency = !$_p["optimizemember_pro_authnet_sp_checkout"]["country"] && $attr["cc"] === "USD" ? "US" : $country_default_by_currency; $country_default_by_currency = !$_p["optimizemember_pro_authnet_sp_checkout"]["country"] && $attr["cc"] === "CAD" ? "CA" : $country_default_by_currency; $country_default_by_currency = !$_p["optimizemember_pro_authnet_sp_checkout"]["country"] && $attr["cc"] === "GBP" ? "GB" : $country_default_by_currency; $country_default_by_currency = apply_filters("ws_plugin__optimizemember_pro_authnet_default_country", false, get_defined_vars()); /**/ $default_country_v = $attr["default_country_code"] ? $attr["default_country_code"] : $country_default_by_currency; /**/ $country_options = '<option value=""></option>'; /* Start with an empty option value. */ /**/ foreach (preg_split("/[\r\n]+/", file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/iso-3166-1.txt")) as $country) { list($country_l, $country_v) = preg_split("/;/", $country, 2); /**/ if ($country_l && $country_v) { /* Here we also check on the default pre-selected country; as determined above; based on currency. */ $country_options .= '<option value="' . esc_attr(strtoupper($country_v)) . '"' . ($_p["optimizemember_pro_authnet_sp_checkout"]["country"] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>'; } } /* Build the reCaptcha box via JavaScript. */ if ($attr["captcha"]) { $captcha = '<div id="s2member-pro-authnet-sp-checkout-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-sp-checkout-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-sp-checkout-form-captcha-section">' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-sp-checkout-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-sp-checkout-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-sp-checkout-form-captcha-section-title">' . "\n"; $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n"; $captcha .= '</div>' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-sp-checkout-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-sp-checkout-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-sp-checkout-form-captcha-div">' . "\n"; /**/ $captcha .= '<label id="s2member-pro-authnet-sp-checkout-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-sp-checkout-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr["captcha"], 300) . "\n"; $captcha .= '</label>' . "\n"; /**/ $captcha .= '</div>' . "\n"; /**/ $captcha .= '</div>' . "\n"; } /* Build the opt-in checkbox. */ if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) { $opt_in = '<div id="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-sp-checkout-form-div s2member-pro-authnet-form-custom-reg-field-opt-in-div s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-div">' . "\n"; /**/ $opt_in .= '<label for="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in" id="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-label" class="s2member-pro-authnet-form-custom-reg-field-opt-in-label s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in-label">' . "\n"; $opt_in .= '<input type="checkbox" name="optimizemember_pro_authnet_sp_checkout[custom_fields][opt_in]" id="s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in" class="s2member-pro-authnet-form-custom-reg-field-opt-in s2member-pro-authnet-sp-checkout-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] == 1 || $_p["optimizemember_pro_authnet_sp_checkout"]["custom_fields"]["opt_in"] ? ' checked="checked"' : '') . ' tabindex="400" />' . "\n"; $opt_in .= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in_label"] . "\n"; $opt_in .= '</label>' . "\n"; /**/ $opt_in .= '</div>' . "\n"; } /* Build the hidden input variables. */ $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_sp_checkout[nonce]" id="s2member-pro-authnet-sp-checkout-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-sp-checkout")) . '" />'; $hidden_inputs .= !$attr["accept_coupons"] ? '<input type="hidden" id="s2member-pro-authnet-sp-checkout-coupons-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_tax_may_apply() ? '<input type="hidden" id="s2member-pro-authnet-sp-checkout-tax-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_sp_checkout[attr]" id="s2member-pro-authnet-sp-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; /* Get the form template. */ $custom_template = file_exists(TEMPLATEPATH . "/authnet-sp-checkout-form.php") ? TEMPLATEPATH . "/authnet-sp-checkout-form.php" : false; $custom_template = file_exists(TEMPLATEPATH . "/authnet-sp-checkout-form.html") ? TEMPLATEPATH . "/authnet-sp-checkout-form.html" : $custom_template; $custom_template = $attr["template"] && file_exists(TEMPLATEPATH . "/" . $attr["template"]) ? TEMPLATEPATH . "/" . $attr["template"] : $custom_template; $custom_template = $attr["template"] && file_exists(WP_CONTENT_DIR . "/" . $attr["template"]) ? WP_CONTENT_DIR . "/" . $attr["template"] : $custom_template; /**/ $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/forms/authnet-sp-checkout-form.php")); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); /* Fill in the action. */ $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code); /* Fill in the response. */ $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code); /* Fill in the description. */ $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code); /* Fill in the coupon value. */ $code = preg_replace("/%%coupon_response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_apply_coupon($attr, $attr["coupon"], "response", array("affiliates-1px-response"))), $code); $code = preg_replace("/%%coupon_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($attr["coupon"])), $code); /* Fill in the registration section. */ $code = preg_replace("/%%first_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_sp_checkout"]["first_name"])), $code); $code = preg_replace("/%%last_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_sp_checkout"]["last_name"])), $code); $code = preg_replace("/%%email_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["email"])), $code); /* Fill in the billing method section. */ $code = preg_replace("/%%card_type_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($card_type_options), $code); $code = preg_replace("/%%card_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_number"])), $code); $code = preg_replace("/%%card_expiration_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_expiration"])), $code); $code = preg_replace("/%%card_verification_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_verification"])), $code); $code = preg_replace("/%%card_start_date_issue_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["card_start_date_issue_number"])), $code); /* Fill in the billing address section. */ $code = preg_replace("/%%street_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["street"])), $code); $code = preg_replace("/%%city_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["city"])), $code); $code = preg_replace("/%%state_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["state"])), $code); $code = preg_replace("/%%country_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($country_options), $code); $code = preg_replace("/%%zip_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_sp_checkout"]["zip"])), $code); /* Fill the captcha section. */ $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code); /* Fill the opt-in box. */ $code = preg_replace("/%%opt_in%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($opt_in), $code); /* Fill hidden inputs. */ $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_pro_during_sc_authnet_sp_form", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } else { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); /* Configure internal attributes. */ $attr["level_ccaps_eotper"] = $attr["rr"] === "BN" && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); /* Clean any trailing separators from this string. */ $attr["coupon"] = $_p["optimizemember_pro_authnet_checkout"]["coupon"] ? $_p["optimizemember_pro_authnet_checkout"]["coupon"] : $attr["coupon"]; /* Obtain a possible response and/or validation error. */ $response = c_ws_plugin__optimizemember_pro_authnet_responses::authnet_checkout_response($attr); /* Empty post vars on successful response. */ $_p = $response["response"] && !$response["error"] ? array() : $_p; /* Build the list of card type options. */ foreach (array("Visa" => _x("Visa", "s2member-front", "s2member"), "MasterCard" => _x("MasterCard", "s2member-front", "s2member"), "Discover" => _x("Discover", "s2member-front", "s2member"), "Amex" => _x("American Express", "s2member-front", "s2member")) as $card_type_v => $card_type_l) { $card_type_options .= '<label for="s2member-pro-authnet-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" id="s2member-pro-authnet-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label" class="s2member-pro-authnet-form-card-type-label s2member-pro-authnet-checkout-form-card-type-label s2member-pro-authnet-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label s2member-pro-authnet-checkout-form-card-type-' . esc_attr(strtolower($card_type_v)) . '-label' . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled' : '') . '">' . "\n" . '<input type="radio" aria-required="true" name="optimizemember_pro_authnet_checkout[card_type]" id="s2member-pro-authnet-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" class="s2member-pro-authnet-card-type-' . esc_attr(strtolower($card_type_v)) . ' s2member-pro-authnet-checkout-card-type-' . esc_attr(strtolower($card_type_v)) . '" value="' . esc_attr($card_type_v) . '"' . (!empty($_p["optimizemember_pro_authnet_checkout"]["card_type"]) && in_array(strtolower($_p["optimizemember_pro_authnet_checkout"]["card_type"]), $attr["accept"]) && $_p["optimizemember_pro_authnet_checkout"]["card_type"] === $card_type_v ? ' checked="checked"' : '') . (!in_array(strtolower($card_type_v), $attr["accept"]) ? ' disabled="disabled"' : '') . ' tabindex="200" />' . "\n" . '</label>'; } /* Build the list of country code options. $country_default_by_currency = false. Authorize.Net always processes in USD, so the country is empty by default. Authorize.Net always processes in USD. International transactions are converted automatically through banking institutions. */ $country_default_by_currency = !$_p["optimizemember_pro_authnet_checkout"]["country"] && $attr["cc"] === "USD" ? "US" : $country_default_by_currency; $country_default_by_currency = !$_p["optimizemember_pro_authnet_checkout"]["country"] && $attr["cc"] === "CAD" ? "CA" : $country_default_by_currency; $country_default_by_currency = !$_p["optimizemember_pro_authnet_checkout"]["country"] && $attr["cc"] === "GBP" ? "GB" : $country_default_by_currency; $country_default_by_currency = apply_filters("ws_plugin__optimizemember_pro_authnet_default_country", false, get_defined_vars()); /**/ $default_country_v = $attr["default_country_code"] ? $attr["default_country_code"] : $country_default_by_currency; /**/ $country_options = '<option value=""></option>'; /* Start with an empty option value. */ /**/ foreach (preg_split("/[\r\n]+/", file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/iso-3166-1.txt")) as $country) { list($country_l, $country_v) = preg_split("/;/", $country, 2); /**/ if ($country_l && $country_v) { /* Here we also check on the default pre-selected country; as determined above; based on currency. */ $country_options .= '<option value="' . esc_attr(strtoupper($country_v)) . '"' . ($_p["optimizemember_pro_authnet_checkout"]["country"] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>'; } } /* Build all of the custom fields. */ if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) { /* Only display Custom Fields if configured. */ if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level($attr["level"] === "*" ? "auto-detection" : $attr["level"], "registration")) { $tabindex = 99; /* Start tabindex at 99 ( +1 below = 100 ). */ /**/ $custom_fields = '<div id="s2member-pro-authnet-checkout-form-custom-fields-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-checkout-form-section s2member-pro-authnet-form-custom-fields-section s2member-pro-authnet-checkout-form-custom-fields-section">' . "\n"; /**/ $custom_fields .= '<div id="s2member-pro-authnet-checkout-form-custom-fields-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-checkout-form-section-title s2member-pro-authnet-form-custom-fields-section-title s2member-pro-authnet-checkout-form-custom-fields-section-title">' . "\n"; $custom_fields .= _x("Additional Info", "s2member-front", "s2member") . "\n"; $custom_fields .= '</div>' . "\n"; /**/ foreach (json_decode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"], true) as $field) { if (in_array($field["id"], $fields_applicable)) { $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"])); $field_id_class = preg_replace("/_/", "-", $field_var); /**/ if (!empty($field["section"]) && $field["section"] === "yes") { /* Starts a new section? */ $custom_fields .= '<div id="s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-custom-reg-field-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . ' s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . '">' . (!empty($field["sectitle"]) ? $field["sectitle"] : '') . '</div>'; } /**/ $custom_fields .= '<div id="s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-div s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-div">' . "\n"; /**/ $custom_fields .= '<label for="s2member-pro-authnet-checkout-custom-reg-field-' . esc_attr($field_id_class) . '" id="s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-label" class="s2member-pro-authnet-form-custom-reg-field-' . $field_id_class . '-label s2member-pro-authnet-checkout-form-custom-reg-field-' . $field_id_class . '-label">' . "\n"; $custom_fields .= '<span' . (preg_match("/^(checkbox|pre_checkbox)\$/", $field["type"]) ? ' style="display:none;"' : '') . '>' . $field["label"] . ($field["required"] === "yes" ? ' *' : '') . '</span></label>' . (preg_match("/^(checkbox|pre_checkbox)\$/", $field["type"]) ? '' : '<br />') . "\n"; $custom_fields .= c_ws_plugin__optimizemember_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, "optimizemember_pro_authnet_checkout[custom_fields][", "s2member-pro-authnet-checkout-custom-reg-field-", "s2member-pro-authnet-custom-reg-field-" . $field_id_class . " s2member-pro-authnet-checkout-custom-reg-field-" . $field_id_class, "", $tabindex = $tabindex + 1, "", $_p, $_p["optimizemember_pro_authnet_checkout"]["custom_fields"][$field_var], "registration"); /**/ $custom_fields .= '</div>' . "\n"; } } /**/ $custom_fields .= '</div>' . "\n"; } } /* Build the reCaptcha box via JavaScript. */ if ($attr["captcha"]) { $captcha = '<div id="s2member-pro-authnet-checkout-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-checkout-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-checkout-form-captcha-section">' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-checkout-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-checkout-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-checkout-form-captcha-section-title">' . "\n"; $captcha .= _x("Security Code", "s2member-front", "s2member") . "\n"; $captcha .= '</div>' . "\n"; /**/ $captcha .= '<div id="s2member-pro-authnet-checkout-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-checkout-form-captcha-div">' . "\n"; /**/ $captcha .= '<label id="s2member-pro-authnet-checkout-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-checkout-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr["captcha"], 400) . "\n"; $captcha .= '</label>' . "\n"; /**/ $captcha .= '</div>' . "\n"; /**/ $captcha .= '</div>' . "\n"; } /* Build the opt-in checkbox. */ if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) { $opt_in = '<div id="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-checkout-form-div s2member-pro-authnet-form-custom-reg-field-opt-in-div s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-div">' . "\n"; /**/ $opt_in .= '<label for="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in" id="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-label" class="s2member-pro-authnet-form-custom-reg-field-opt-in-label s2member-pro-authnet-checkout-form-custom-reg-field-opt-in-label">' . "\n"; $opt_in .= '<input type="checkbox" name="optimizemember_pro_authnet_checkout[custom_fields][opt_in]" id="s2member-pro-authnet-checkout-form-custom-reg-field-opt-in" class="s2member-pro-authnet-form-custom-reg-field-opt-in s2member-pro-authnet-checkout-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in"] == 1 || $_p["optimizemember_pro_authnet_checkout"]["custom_fields"]["opt_in"] ? ' checked="checked"' : '') . ' tabindex="500" />' . "\n"; $opt_in .= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_opt_in_label"] . "\n"; $opt_in .= '</label>' . "\n"; /**/ $opt_in .= '</div>' . "\n"; } /* Build the hidden input variables. */ $hidden_inputs = '<input type="hidden" name="optimizemember_pro_authnet_checkout[nonce]" id="s2member-pro-authnet-checkout-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-checkout")) . '" />'; $hidden_inputs .= !$attr["accept_coupons"] ? '<input type="hidden" id="s2member-pro-authnet-checkout-coupons-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_password"] ? '<input type="hidden" id="s2member-pro-authnet-checkout-password-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_tax_may_apply() ? '<input type="hidden" id="s2member-pro-authnet-checkout-tax-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_authnet_checkout[attr]" id="s2member-pro-authnet-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; /* Get the form template. */ $custom_template = file_exists(TEMPLATEPATH . "/authnet-checkout-form.php") ? TEMPLATEPATH . "/authnet-checkout-form.php" : false; $custom_template = file_exists(TEMPLATEPATH . "/authnet-checkout-form.html") ? TEMPLATEPATH . "/authnet-checkout-form.html" : $custom_template; $custom_template = $attr["template"] && file_exists(TEMPLATEPATH . "/" . $attr["template"]) ? TEMPLATEPATH . "/" . $attr["template"] : $custom_template; $custom_template = $attr["template"] && file_exists(WP_CONTENT_DIR . "/" . $attr["template"]) ? WP_CONTENT_DIR . "/" . $attr["template"] : $custom_template; /**/ $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/forms/authnet-checkout-form.php")); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); /* Fill in the action. */ $code = preg_replace("/%%action%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code); /* Fill in the response. */ $code = preg_replace("/%%response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($response["response"]), $code); /* Fill in the description. */ $code = preg_replace("/%%description%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($attr["desc"]), $code); /* Fill in the coupon value. */ $code = preg_replace("/%%coupon_response%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(c_ws_plugin__optimizemember_pro_authnet_utilities::authnet_apply_coupon($attr, $attr["coupon"], "response", array("affiliates-1px-response"))), $code); $code = preg_replace("/%%coupon_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($attr["coupon"])), $code); /* Fill in the registration section. */ $code = preg_replace("/%%first_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_checkout"]["first_name"])), $code); $code = preg_replace("/%%last_name_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_p["optimizemember_pro_authnet_checkout"]["last_name"])), $code); $code = preg_replace("/%%email_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["email"])), $code); $code = preg_replace("/%%username_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["username"])), $code); $code = preg_replace("/%%password1_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["password1"])), $code); $code = preg_replace("/%%password2_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["password2"])), $code); /* Fill in the custom fields section. */ $code = preg_replace("/%%custom_fields%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($custom_fields), $code); /* Fill in the billing method section. */ $code = preg_replace("/%%card_type_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($card_type_options), $code); $code = preg_replace("/%%card_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_number"])), $code); $code = preg_replace("/%%card_expiration_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_expiration"])), $code); $code = preg_replace("/%%card_verification_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_verification"])), $code); $code = preg_replace("/%%card_start_date_issue_number_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["card_start_date_issue_number"])), $code); /* Fill in the billing address section. */ $code = preg_replace("/%%street_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["street"])), $code); $code = preg_replace("/%%city_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["city"])), $code); $code = preg_replace("/%%state_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["state"])), $code); $code = preg_replace("/%%country_options%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($country_options), $code); $code = preg_replace("/%%zip_value%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(format_to_edit($_p["optimizemember_pro_authnet_checkout"]["zip"])), $code); /* Fill the captcha section. */ $code = preg_replace("/%%captcha%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($captcha), $code); /* Fill the opt-in box. */ $code = preg_replace("/%%opt_in%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($opt_in), $code); /* Fill hidden inputs. */ $code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds($hidden_inputs), $code); /* * Custom button */ if (!empty($content)) { $code = preg_replace('/%%button_markup%%/', $content, $code); } else { $code = preg_replace("/%%button_markup%%/", sprintf('<input type="submit" id="s2member-pro-authnet-checkout-submit" class="s2member-pro-authnet-submit s2member-pro-authnet-checkout-submit" value="%s" tabindex="600" />', esc_attr(_x("Submit Form", "s2member-front", "s2member"))), $code); } /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); $attr["modify"] ? do_action("ws_plugin__optimizemember_pro_during_sc_authnet_modification_form", get_defined_vars()) : do_action("ws_plugin__optimizemember_pro_during_sc_authnet_form", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } } } } /**/ $code = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', $code); return apply_filters("ws_plugin__optimizemember_pro_sc_authnet_form", $code, get_defined_vars()); }
public function __construct() { echo '<div class="wrap ws-menu-page op-bsw-wizard op-bsw-content">' . "\n"; /**/ echo '<div class="op-bsw-header">'; echo '<div class="op-logo"><img src="' . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images/" . 'logo-optimizepress.png" alt="OptimizePress" height="50" class="animated flipInY"></div>'; echo '</div>'; echo '<div class="op-bsw-main-content inline-input-fields">'; echo '<h2>Google Checkout Buttons</h2>' . "\n"; /**/ echo '<table class="ws-menu-page-table">' . "\n"; echo '<tbody class="ws-menu-page-table-tbody">' . "\n"; echo '<tr class="ws-menu-page-table-tr">' . "\n"; echo '<td class="ws-menu-page-table-l">' . "\n"; /**/ for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<div class="ws-menu-page-group" title="Google Checkout For Level ' . $labelText . ' Access">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-level' . $n . '-buttons-section">' . "\n"; echo '<h3>Button Code Generator For Level ' . $labelText . ' Access</h3>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Button Code). These Google Checkout Buttons are customized to work with optimizeMember seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, optimizeMember will automatically terminate their Membership privileges. optimizeMember makes extensive use of the Google API Callback service. optimizeMember receives updates from Google behind-the-scene. <em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back & re-generate a new one.</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-pro-level' . $n . '-shortcode">' . "\n"; echo 'Button Code<br />For Level ' . $labelText . ':<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-level' . $n . '-button-prev"></div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p id="ws-plugin--optimizemember-pro-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-pro-level' . $n . '-trial-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n"; echo '<p><span id="ws-plugin--optimizemember-pro-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-level' . $n . '-term" class="google-checkout-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-membership-regular-terms.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-desc" class="google-checkout-buttons-description-input" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n"; //echo '<p' . ((is_multisite () && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-ccaps" size="40" /></p>' . "\n"; echo 'Packages: '; if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) { echo '<input type="checkbox" onchange="showSelectedValues(\'ccpchk_' . $n . '\', \'ccaps\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchk_' . $n . '" value="' . $val . '" /> ' . $val . "\n"; } } else { echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>'; } echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-pro-level' . $n . '-ccaps" value="" />' . "\n"; echo '<p>Currency: <select id="ws-plugin--optimizemember-pro-level' . $n . '-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_pro_googleButtonGenerate(\'level' . $n . '\');" class="button-primary" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-checkout-button-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($n)), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"])), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; } /**/ ?> <script type="text/javascript"> window.showSelectedValues = function(param, elemId, n) { var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map( function () {return this.value;}).get().join(","); jQuery("#ws-plugin--optimizemember-pro-level"+n+"-" + elemId).val(text); } window.showSingleSelectedValues = function(param, elemId, n) { var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map( function () {return this.value;}).get().join(","); jQuery("#ws-plugin--optimizemember-pro-" + elemId + "-ccaps").val(text); } /**/ </script> <?php echo '<div class="ws-menu-page-group" title="Google Modification/Cancellation Buttons">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-cancellation-buttons-section">' . "\n"; echo '<h3>One Button Does It All For Modifications/Cancellations ( copy/paste )</h3>' . "\n"; echo '<p>Every Google Recurring Subscription can be modified by the Customer, or even cancelled by the Customer through Google Checkout. It\'s very simple. A Member clicks a Modification/Cancellation Button. This brings the Customer to a "Purchase History" screen inside their Google Checkout account. Here they\'ll have easy access to make any changes they like. When important changes occur ( such as a cancellation ), information regarding this event will be relayed back to optimizeMember through Google\'s API Callback service. optimizeMember will react appropriately at that time.</p>' . "\n"; echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n"; echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through Google Checkout... but, optimizeMember continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. optimizeMember will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by optimizeMember.</em></p>' . "\n"; echo '<p><em>optimizeMember will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, optimizeMember will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). optimizeMember also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-pro-cancellation-shortcode">' . "\n"; echo 'Button Code<br />For Cancellations:<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-cancellation-button-prev">' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/google-cancellation-button.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_pro_temp_s); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/&/", "&", $ws_plugin__optimizemember_pro_temp_s); /* Match this with the JavaScript generator. */ echo preg_replace("/\\<a/", '<a target="_blank"', $ws_plugin__optimizemember_pro_temp_s); echo '</div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td class="align-top">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p>No configuration necessary.</p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-cancellation-button-shortcode.php"))); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-cancellation-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) { echo '<div class="ws-menu-page-group" title="Google Capability (Buy Now) Buttons">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-ccap-buttons-section">' . "\n"; echo '<h3>Button Code Generator For Independent Custom Capabilities</h3>' . "\n"; echo '<p>This is VERY advanced. For further details, please check your Dashboard: <code>optimizeMember -> API Scripting -> Custom Capabiities</code>.</p>' . "\n"; echo '<p>With optimizeMember, you can sell one or more Custom Capabilities using Buy Now functionality, to "existing" Users/Members, regardless of which Membership Level they have on your site <em>( i.e. you could even sell Independent Custom Capabilities to Users at Membership Level #0, normally referred to as Free Subscribers, if you like )</em>. So this is quite flexible. Independent Custom Capabilities do NOT rely on any specific Membership Level. That\'s why optimizeMember refers to these as `Independent` Custom Capabilities, because you can sell Capabilities this way, through Buy Now functionality, and the Customer\'s Membership Level Access, along with any existing paid Subscription they may already have with you, will remain completely unaffected. That being said, if you intend to charge a recurring fee for Custom Capabilities, please use a <code>Membership Level# Button</code> instead; because Independent Custom Capabilities can only be sold through Buy Now functionality.</p>' . "\n"; echo '<p>Independent Custom Capabilities are added to a Customer\'s account immediately after checkout, and the Customer will have the Custom Capabilities for as long as their Membership lasts, based on their primary Subscription with your site, and/or forever, if they have a Lifetime account with you. In other words, Independent Custom Capabilities will exist on the Customer\'s account forever, or until an EOT <em>( End Of Term )</em> occurs on their primary Subscription with you; in which case optimizeMember would demote or delete the Customer\'s account <em>( based on your EOT configuration )</em>, and all Custom Capabilities are removed as well.</p>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each set of Custom Capabilities that you plan to sell. Then press (Generate Button Code). These Google Checkout Buttons are customized to work with optimizeMember seamlessly. The Customer will be granted additional access to one or more Custom Capabilities that you specify; while the Customer\'s Membership Level Access and any existing paid Subscription they may already have with you, will remain completely unaffected.</p>' . "\n"; echo '<p><em><strong>*Important Note*</strong> Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button. Otherwise, post-processing of their transaction will fail to recognize the Customer\'s existing account within WordPress. Please display this Button only to Users/Members that are already logged into their account ( perhaps in your Login Welcome Page for optimizeMember ), or in another location where you can be absolutely sure that a User/Member is logged in. optimizeMember\'s Simple Conditionals could also be used to ensure a User/Member is logged in, by wrapping your Shortcode within a Conditional test. For further details, please see: <code>optimizeMember -> API Scripting -> Simple Conditionals</code>.</em></p>' . "\n"; echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. If you lose your Button Code, you\'ll need to come back & re-generate a new one.</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-pro-ccap-shortcode">' . "\n"; echo 'Button Code<br />For Capabilities:<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-ccap-button-prev"></div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-ccap-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-membership-ccap-terms.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-desc" class="google-checkout-buttons-description-input" value="Description and pricing details here." size="73" /></p>' . "\n"; //echo '<p>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-ccaps" size="40" /></p>' . "\n"; echo 'Packages: '; $n = 1; if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) { echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkccaps_' . $n . '\', \'ccap\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkccaps_' . $n . '" value="' . $val . '" /> ' . $val . "\n"; } } else { echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>'; } echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-pro-ccap-ccaps" value="" />' . "\n"; echo '<p>Currency: <select id="ws-plugin--optimizemember-pro-ccap-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_pro_googleCcapButtonGenerate();" class="button-primary" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-ccaps-checkout-button-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-ccap-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; } /**/ echo '<div class="ws-menu-page-group" title="Google Member Registration Access Links">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-reg-links-section">' . "\n"; echo '<h3>Registration Access Link Generator ( for Customer Service )</h3>' . "\n"; echo '<p>optimizeMember automatically generates Registration Access Links for your Customers after checkout, and also sends them a link in a Confirmation Email. However, if you ever need to deal with a Customer Service issue that requires a new Registration Access Link to be created manually, you can use this tool for that. Alternatively, you can create their account yourself/manually by going to <code>optimizeMember -> Add A Member</code>. Either of these methods will work fine.</p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p>Paid Membership Level#: <select id="ws-plugin--optimizemember-pro-reg-link-level">' . "\n"; for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<option value="' . $n . '">optimizeMember Level ' . $labelText . '</option>' . "\n"; } echo '</select></p>' . "\n"; echo '<p>Paid Subscr. ID: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-subscr-id" value="" size="50" /> <a href="#" onclick="alert(\'The Customer\\\'s Paid Subscr. ID ( aka: Google TID/SID with an `s2-` prefix ) must be unique. This value can be obtained from inside your Google Checkout account in the transaction Description field. Each paying Customer MUST be associated with a unique Paid Subscr. ID. If the Customer is NOT associated with a Paid Subscr. ID, you will need to generate a unique value for this field on your own. But keep in mind, optimizeMember will be unable to maintain future communication with the Google IPN ( i.e. Notification/Callback ) service if this value does not reflect a real Paid Subscr. ID that exists in your Google Checkout transaction log.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; echo '<p>Custom String Value: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-custom" value="' . esc_attr($_SERVER["HTTP_HOST"]) . '" size="30" /> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\\n' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_pro_googleRegLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-pro-reg-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n"; //echo '<p' . ((is_multisite () && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-ccaps" size="40" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^a-z_0-9,]/gi, \'\').toLowerCase ());" /></p>' . "\n"; echo 'Packages: '; $n = 1; if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) { echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkreg_' . $n . '\', \'reg-link\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkreg_' . $n . '" value="' . $val . '" /> ' . $val . "\n"; } } else { echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>'; } echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-pro-reg-link-ccaps" value="" />' . "\n"; echo '<p>Fixed Term Length ( for Buy Now transactions ): <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-reg-link-fixed-term" value="" size="10" /> <a href="#" onclick="alert(\'If the Customer purchased Membership through a Buy Now transaction ( i.e. there is no Initial/Trial Period and no recurring charges for ongoing access ), you may configure a Fixed Term Length in this field. This way the Customer\\\'s Membership Access is revoked by optimizeMember at the appropriate time. This will be a numeric value, followed by a space, then a single letter.\\n\\nHere are some examples:\\n\\n1 D ( this means 1 Day )\\n1 W ( this means 1 Week )\\n1 M ( this means 1 Month )\\n1 Y ( this means 1 Year )\\n1 L ( this means 1 Lifetime )\'); return false;">[?]</a></p>' . "\n"; echo '<p id="ws-plugin--optimizemember-pro-reg-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="Google Specific Post/Page (Buy Now) Buttons">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-sp-buttons-section">' . "\n"; echo '<h3>Button Code Generator For Specific Post/Page Buttons</h3>' . "\n"; echo '<p>optimizeMember now supports an additional layer of functionality ( very powerful ), which allows you to sell access to specific Posts/Pages that you\'ve created in WordPress. Specific Post/Page Access works independently from Member Level Access. That is, you can sell an unlimited number of Posts/Pages using "Buy Now" Buttons, and your Customers will NOT be required to have a Membership Account with your site in order to receive access. If they are already a Member, that\'s fine, but they won\'t need to be.</p>' . "\n"; echo '<p>In other words, Customers will NOT need to login, just to receive access to the Specific Post/Page they purchased access to. optimizeMember will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link ( see: <code>optimizeMember -> Google Options -> Specific Post/Page Email</code> ). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n"; echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress. A Specific Post/Page that is protected by optimizeMember, might contain a download link for your eBook, access to file & music downloads, access to additional support services, and the list goes on and on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress Post/Page that you\'ve created. To protect Specific Posts/Pages, please see: <code>optimizeMember -> Restriction Options -> Specific Post/Page Access</code>. Once you\'ve configured your Specific Post/Page Restrictions, those Posts/Pages will be available in the menus below.</p>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each Post/Page that you plan to sell. Then press (Generate Button Code). These Google Checkout Buttons are customized to work with optimizeMember seamlessly. You can even Package Additional Posts/Pages together into one transaction. <em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your WordPress Editor, wherever you feel it would be most appropriate. If you lose your Button Code, you\'ll need to come back & re-generate a new one.</em></p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-pro-sp-shortcode">' . "\n"; echo 'Button Code<br />Specific Posts/Pages:<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-pro-sp-button-prev"></div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-leading-id">' . "\n"; echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n"; /**/ $ws_plugin__optimizemember_pro_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts"); /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n"; echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n"; /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-pro-sp-hours" class="google-checkout-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-sp-hours.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-desc" value="Description and pricing details here." size="68" /></p>' . "\n"; echo '<p>Currency: <select id="ws-plugin--optimizemember-pro-sp-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_pro_googleSpButtonGenerate();" class="button-primary" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_pro_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/google-sp-checkout-button-shortcode.php"))); $ws_plugin__optimizemember_pro_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_pro_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-pro-sp-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_pro_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="Google Specific Post/Page Access Links">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-sp-links-section">' . "\n"; echo '<h3>Specific Post/Page Link Generator ( for Customer Service )</h3>' . "\n"; echo '<p>optimizeMember automatically generates Specific Post/Page Links for your Customers after checkout, and also sends them a link in a Confirmation Email. However, if you ever need to deal with a Customer Service issue that requires a new Specific Post/Page Link to be created manually, you can use this tool for that.</p>' . "\n"; /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-leading-id">' . "\n"; echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n"; /**/ $ws_plugin__optimizemember_pro_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts"); /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n"; echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n"; /**/ foreach ($ws_plugin__optimizemember_pro_temp_a_singulars as $ws_plugin__optimizemember_pro_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_pro_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_pro_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-pro-sp-link-hours">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/google-sp-hours.php"))) . '</select> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_pro_googleSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-pro-sp-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n"; echo '<p id="ws-plugin--optimizemember-pro-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '<div class="ws-menu-page-group" title="Shortcode Attributes ( Explained )">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-pro-shortcode-attrs-section">' . "\n"; echo '<h3>Shortcode Attributes ( Explained In Full Detail )</h3>' . "\n"; echo '<p>When you generate a Button Code, optimizeMember will make a <a href="http://codex.wordpress.org/Shortcode_API#Overview" target="_blank" rel="external">Shortcode</a> available to you. Like most Shortcodes for WordPress, optimizeMember reads Attributes in your Shortcode. These Attributes will be pre-configured by one of optimizeMember\'s Button Generators automatically; so there really is nothing more you need to do. However, many site owners like to know exactly how these Shortcode Attributes work. Below, is a brief overview of each possible Shortcode Attribute.</p>' . "\n"; /**/ echo '<table class="form-table" style="margin-top:0;">' . "\n"; echo '<tbody>' . "\n"; echo '<tr style="padding-top:0;">' . "\n"; /**/ echo '<td style="padding-top:0;">' . "\n"; echo '<ul>' . "\n"; echo '<li><code>cancel="0"</code> Cancellation Button. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Cancellation Button, <code>1</code> = this IS a Cancellation Button.</li>' . "\n"; echo '<li><code>cc="USD"</code> 3 character Currency Code. Not valid when <code>modify|cancel="1"</code>.</li>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>ccaps="music,videos"</code> A comma-delimited list of Custom Capabilities. Only valid w/ Membership Level Access and/or Independent Custom Capabilities.</li>' . "\n" : ''; echo '<li><code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '"</code> must start with your domain. Additional values can be piped in ( ex: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3|etc"</code> ). Not valid when <code>modify|cancel="1"</code>.</li>' . "\n"; echo '<li><code>desc="Gold Membership"</code> A brief purchase Description. Not valid when <code>modify|cancel="1"</code>.</li>' . "\n"; echo '<li><code>exp="72"</code> Access Expires ( in hours ). Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n"; echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n"; echo '<li><code>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default Google Checkout Button, <code>http://...</code> = location of your custom Image.</li>' . "\n"; echo '<li><code>level="1"</code> Membership Level [1-4] <em>( or, up to the number of configured Levels )</em>. Only valid for Buttons providing paid Membership Level Access.' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' Or, with Independent Custom Capabilities this MUST be set to <code>level="*"</code>, and <code>ccaps=""</code> must NOT be empty <em>( i.e. <code>level="*" ccaps="music,videos"</code> )</em>.') . '</li>' . "\n"; echo '<li><code>modify="0"</code> Modification Button. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Modification Button, <code>1</code> = this IS a Modification Button.</li>' . "\n"; echo '<li><code>output="anchor"</code> Output Type. Possible values: <code>anchor</code> = Google Checkout Button ( <a> anchor tag ) URL w/ ?query string, <code>url</code> = raw URL w/ ?query string.</li>' . "\n"; echo '<li><code>ra="0.01"</code> Regular, Buy Now, and/or Recurring Amount. Must be >= <code>0.01</code>. Not valid when <code>modify|cancel="1"</code>.</li>' . "\n"; echo '<li><code>rp="1"</code> Regular Period. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Must be >= <code>1</code> ( ex: <code>1</code> Week, <code>2</code> Months, <code>1</code> Month, <code>3</code> Days ).</li>' . "\n"; echo '<li><code>rt="M"</code> Regular Term. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years, <code>L</code> = Lifetime.</li>' . "\n"; echo '<li><code>rr="1"</code> Recurring directive. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>0</code> = non-recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>1</code> = recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>BN</code> = non-recurring "Buy Now" functionality, no Trial Period possible.</li>' . "\n"; echo '<li><code>sp="0"</code> Specific Post/Page Button. Possible values: <code>0</code> = this is NOT a Specific Post/Page Access Button, <code>1</code> = this IS a Specific Post/Page Access Button.</li>' . "\n"; echo '<li><code>ta="0.00"</code> Trial Amount. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n"; echo '<li><code>tp="0"</code> Trial Period. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n"; echo '<li><code>tt="D"</code> Trial Term. Only valid w/ Membership Level Access. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years.</li>' . "\n"; echo '</ul>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ echo '</td>' . "\n"; /**/ echo '<td class="ws-menu-page-table-r">' . "\n"; c_ws_plugin__optimizemember_menu_pages_rs::display(); echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; /**/ echo '</div>' . "\n"; echo '</div>' . "\n"; }
/** * Shortcode `[optimizeMember-Pro-Stripe-Form /]`. * * @package optimizeMember\Stripe * @since 140617 * * @attaches-to ``add_shortcode('optimizeMember-Pro-Stripe-Form');`` * * @param array $attr An array of Attributes. * @param string $content Content inside the Shortcode. * @param string $shortcode The actual Shortcode name itself. * * @return string The resulting Form Code, HTML markup. */ public static function sc_stripe_form($attr, $content = '', $shortcode = '') { $raw_content = $content; foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('ws_plugin__optimizemember_pro_before_sc_stripe_form', get_defined_vars()); unset($__refs, $__v); // Ditch these temporary vars. c_ws_plugin__optimizemember_no_cache::no_cache_constants(TRUE); $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); $options = array(); // Initialize options to an empty array. $option_selections = ''; // Initialize w/ no options. if ($content && ($content = strip_tags($content))) { // This allows for nested Pro Form Shortcodes as options. $content = str_replace('optimizeMember-Pro-Stripe-Form ', 'optimizeMember-Pro-Stripe-xFormOption ', $content); } if ($content && ($content_options = do_shortcode($content))) { foreach (preg_split('/\\s*\\|\\:\\:\\|\\s*/', $content_options, NULL, PREG_SPLIT_NO_EMPTY) as $_content_option_key => $_content_option) { $_content_option_id = $_content_option_key + 1; $options[$_content_option_id] = maybe_unserialize(trim($_content_option)); if (!is_array($options[$_content_option_id])) { unset($options[$_content_option_id]); continue; // Invalid option. } if (!empty($_REQUEST['s2p-option']) && (int) $_REQUEST['s2p-option'] === $_content_option_id) { $options[$_content_option_id]['selected'] = TRUE; } } unset($_content_option_key, $_content_option, $_content_option_id); // Housekeeping. foreach ($options as $_option_id => $_option) { if (!empty($_option['selected'])) { $attr = array_merge($attr, $_option); $_selected_option_id = $_option_id; } } unset($_option_id, $_option); // Housekeeping. if (empty($_selected_option_id)) { foreach ($options as $_option_id => $_option) { $attr = array_merge($attr, $_option); break; // Force a selected option (default). } } unset($_option_id, $_option, $_selected_option_id); // Housekeeping. foreach ($options as $_option_id => $_option) { // Build option selections. $option_selections .= '<option value="' . esc_attr($_option_id) . '"' . (!empty($_option['selected']) ? ' selected="selected"' : '') . '>' . esc_html($_option['desc']) . '</option>'; } unset($_option_id, $_option); // Housekeeping. } $attr = shortcode_atts(array('ids' => '0', 'exp' => '72', 'level' => @$attr['register'] ? '0' : '1', 'ccaps' => '', 'desc' => '', 'cc' => 'USD', 'custom' => $_SERVER['HTTP_HOST'], 'ta' => '0', 'tp' => '0', 'tt' => 'D', 'ra' => '0.01', 'rp' => '1', 'rt' => 'M', 'rr' => '1', 'rrt' => '', 'modify' => '0', 'cancel' => '0', 'sp' => '0', 'register' => '0', 'update' => '0', 'coupon' => '', 'accept_coupons' => '0', 'default_country_code' => 'US', 'captcha' => '', 'template' => '', 'success' => ''), $attr); $attr['tt'] = strtoupper($attr['tt']); // Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). $attr['rt'] = strtoupper($attr['rt']); // Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts(). $attr['rr'] = strtoupper($attr['rr']); // Must be provided in upper-case format. Numerical, or BN value. Only after running shortcode_atts(). $attr['ccaps'] = strtolower($attr['ccaps']); // Custom Capabilities must be typed in lower-case format. Only after running shortcode_atts(). $attr['ccaps'] = str_replace(' ', '', $attr['ccaps']); // Custom Capabilities should not have spaces. $attr['rr'] = $attr['rt'] === 'L' ? 'BN' : $attr['rr']; // Lifetime Subscriptions require Buy Now. Only after running shortcode_atts(). $attr['rr'] = $attr['level'] === '*' ? 'BN' : $attr['rr']; // Independent Ccaps require Buy Now. Only after running shortcode_atts(). $attr['rr'] = !$attr['tp'] && !$attr['rr'] ? 'BN' : $attr['rr']; // No Trial / non-recurring. Only after running shortcode_atts(). $attr['default_country_code'] = strtoupper($attr['default_country_code']); // This MUST be in uppercase format. $attr['success'] = c_ws_plugin__optimizemember_utils_urls::n_amps($attr['success']); // Normalize ampersands. $attr['coupon'] = !empty($_GET['s2p-coupon']) ? trim(strip_tags(stripslashes($_GET['s2p-coupon']))) : $attr['coupon']; $attr['singular'] = get_the_ID(); // Collect the Singular ID for this Post/Page. foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('ws_plugin__optimizemember_pro_before_sc_stripe_form_after_shortcode_atts', get_defined_vars()); unset($__refs, $__v); // Ditch these temporary vars. if ($attr['cancel']) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_cancellation_response($attr); $_p = $response['response'] && !$response['error'] ? array() : $_p; if ($attr['captcha']) { $captcha = '<div id="optimizemember-pro-stripe-cancellation-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-cancellation-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-cancellation-form-captcha-section">' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-cancellation-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-cancellation-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-cancellation-form-captcha-section-title">' . "\n"; $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-cancellation-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-cancellation-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-cancellation-form-captcha-div">' . "\n"; $captcha .= '<label id="optimizemember-pro-stripe-cancellation-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-cancellation-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 10) . "\n"; $captcha .= '</label>' . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '</div>' . "\n"; } else { $captcha = ''; } // Not applicable. $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_cancellation[nonce]" id="optimizemember-pro-stripe-cancellation-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-cancellation')) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_cancellation[attr]" id="optimizemember-pro-stripe-cancellation-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; $hidden_inputs .= '<input type="hidden" name="s2p-option" value="' . esc_attr((string) @$_REQUEST['s2p-option']) . '" />'; $custom_template = file_exists(TEMPLATEPATH . '/stripe-cancellation-form.php') ? TEMPLATEPATH . '/stripe-cancellation-form.php' : FALSE; $custom_template = file_exists(TEMPLATEPATH . '/stripe-cancellation-form.html') ? TEMPLATEPATH . '/stripe-cancellation-form.html' : $custom_template; $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template; $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template; $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-cancellation-form.php')); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code); $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code); $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code); $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code); $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code); foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('ws_plugin__optimizemember_pro_during_sc_stripe_cancellation_form', get_defined_vars()); unset($__refs, $__v); // Ditch these temporary vars. } else { if ($attr['register']) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_registration_response($attr); $_p = $response['response'] && !$response['error'] ? array() : $_p; $custom_fields = ''; // Initialize custom fields. if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields']) { // Only display Custom Fields if configured. if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level($attr['level'], 'registration')) { $tabindex = 99; // Start tabindex at 99 ( +1 below = 100 ). $custom_fields = '<div id="optimizemember-pro-stripe-registration-form-custom-fields-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-registration-form-section optimizemember-pro-stripe-form-custom-fields-section optimizemember-pro-stripe-registration-form-custom-fields-section">' . "\n"; $custom_fields .= '<div id="optimizemember-pro-stripe-registration-form-custom-fields-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-registration-form-section-title optimizemember-pro-stripe-form-custom-fields-section-title optimizemember-pro-stripe-registration-form-custom-fields-section-title">' . "\n"; $custom_fields .= _x('Additional Info', 's2member-front', 's2member') . "\n"; $custom_fields .= '</div>' . "\n"; foreach (json_decode($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields'], TRUE) as $field) { if (in_array($field['id'], $fields_applicable)) { $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id'])); $field_id_class = preg_replace('/_/', '-', $field_var); if (!empty($field['section']) && $field['section'] === 'yes') { // Starts a new section? $custom_fields .= '<div id="optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-divider-section" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-custom-reg-field-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . '">' . (!empty($field['sectitle']) ? $field['sectitle'] : '') . '</div>'; } $custom_fields .= '<div id="optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-div optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-div">' . "\n"; $custom_fields .= '<label for="optimizemember-pro-stripe-registration-custom-reg-field-' . esc_attr($field_id_class) . '" id="optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-label" class="optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-label optimizemember-pro-stripe-registration-form-custom-reg-field-' . $field_id_class . '-label">' . "\n"; $custom_fields .= '<span' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? ' style="display:none;"' : '') . '>' . $field['label'] . ($field['required'] === 'yes' ? ' *' : '') . '</span></label>' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? '' : '<br />') . "\n"; $custom_fields .= c_ws_plugin__optimizemember_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, 'optimizemember_pro_stripe_registration[custom_fields][', 'optimizemember-pro-stripe-registration-custom-reg-field-', 'optimizemember-pro-stripe-custom-reg-field-' . $field_id_class . ' optimizemember-pro-stripe-registration-custom-reg-field-' . $field_id_class, '', $tabindex = $tabindex + 1, '', $_p, @$_p['optimizemember_pro_stripe_registration']['custom_fields'][$field_var], 'registration'); $custom_fields .= '</div>' . "\n"; } } $custom_fields .= '</div>' . "\n"; } } if ($attr['captcha']) { $captcha = '<div id="optimizemember-pro-stripe-registration-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-registration-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-registration-form-captcha-section">' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-registration-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-registration-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-registration-form-captcha-section-title">' . "\n"; $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-registration-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-registration-form-captcha-div">' . "\n"; $captcha .= '<label id="optimizemember-pro-stripe-registration-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-registration-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 200) . "\n"; $captcha .= '</label>' . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '</div>' . "\n"; } else { $captcha = ''; } // Not applicable. if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) { $opt_in = '<div id="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-registration-form-div optimizemember-pro-stripe-form-custom-reg-field-opt-in-div optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-div">' . "\n"; $opt_in .= '<label for="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in" id="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-label" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in-label optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in-label">' . "\n"; $opt_in .= '<input type="checkbox" name="optimizemember_pro_stripe_registration[custom_fields][opt_in]" id="optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in optimizemember-pro-stripe-registration-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] == 1 || @$_p['optimizemember_pro_stripe_registration']['custom_fields']['opt_in'] ? ' checked="checked"' : '') . ' tabindex="300" />' . "\n"; $opt_in .= $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in_label'] . "\n"; $opt_in .= '</label>' . '\\n'; $opt_in .= '</div>' . '\\n'; } else { $opt_in = ''; } // Not applicable. $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_registration[nonce]" id="optimizemember-pro-stripe-registration-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-registration')) . '" />'; $hidden_inputs .= !$GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_names'] ? '<input type="hidden" id="optimizemember-pro-stripe-registration-names-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !$GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_password'] ? '<input type="hidden" id="optimizemember-pro-stripe-registration-password-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_registration[attr]" id="optimizemember-pro-stripe-registration-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; $hidden_inputs .= '<input type="hidden" name="s2p-option" value="' . esc_attr((string) @$_REQUEST['s2p-option']) . '" />'; $custom_template = file_exists(TEMPLATEPATH . '/stripe-registration-form.php') ? TEMPLATEPATH . '/stripe-registration-form.php' : FALSE; $custom_template = file_exists(TEMPLATEPATH . '/stripe-registration-form.html') ? TEMPLATEPATH . '/stripe-registration-form.html' : $custom_template; $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template; $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template; $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-registration-form.php')); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code); $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code); $code = preg_replace('/%%options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($option_selections), $code); $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code); $code = preg_replace('/%%first_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_registration']['first_name'])), $code); $code = preg_replace('/%%last_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_registration']['last_name'])), $code); $code = preg_replace('/%%email_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['email'])), $code); $code = preg_replace('/%%username_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['username'])), $code); $code = preg_replace('/%%password1_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['password1'])), $code); $code = preg_replace('/%%password2_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_registration']['password2'])), $code); $code = preg_replace('/%%custom_fields%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($custom_fields), $code); $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code); $code = preg_replace('/%%opt_in%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($opt_in), $code); $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code); foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('ws_plugin__optimizemember_pro_during_sc_stripe_registration_form', get_defined_vars()); unset($__refs, $__v); // Ditch these temporary vars. } else { if ($attr['update']) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_update_response($attr); $_p = $response['response'] && !$response['error'] ? array() : $_p; if ($attr['captcha']) { $captcha = '<div id="optimizemember-pro-stripe-update-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-update-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-update-form-captcha-section">' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-update-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-update-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-update-form-captcha-section-title">' . "\n"; $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-update-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-update-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-update-form-captcha-div">' . "\n"; $captcha .= '<label id="optimizemember-pro-stripe-update-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-update-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 200) . "\n"; $captcha .= '</label>' . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '</div>' . "\n"; } else { $captcha = ''; } // Not applicable. $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_update[nonce]" id="optimizemember-pro-stripe-update-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-update')) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_update[card_token]" id="optimizemember-pro-stripe-update-card-token" value="' . esc_attr(@$_p['optimizemember_pro_stripe_update']['card_token']) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_update[card_token_summary]" id="optimizemember-pro-stripe-update-card-token-summary" value="' . esc_attr(@$_p['optimizemember_pro_stripe_update']['card_token_summary']) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_update[attr]" id="optimizemember-pro-stripe-update-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; $hidden_inputs .= '<input type="hidden" name="s2p-option" value="' . esc_attr((string) @$_REQUEST['s2p-option']) . '" />'; $custom_template = file_exists(TEMPLATEPATH . '/stripe-update-form.php') ? TEMPLATEPATH . '/stripe-update-form.php' : FALSE; $custom_template = file_exists(TEMPLATEPATH . '/stripe-update-form.html') ? TEMPLATEPATH . '/stripe-update-form.html' : $custom_template; $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template; $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template; $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-update-form.php')); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code); $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code); $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code); $code = preg_replace('/%%card_token%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_update']['card_token'])), $code); $code = preg_replace('/%%card_token_summary%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_update']['card_token_summary'])), $code); $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code); $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code); foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('ws_plugin__optimizemember_pro_during_sc_stripe_update_form', get_defined_vars()); unset($__refs, $__v); // Ditch these temporary vars. } else { if ($attr['sp']) { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); $attr['sp_ids_exp'] = 'sp:' . $attr['ids'] . ':' . $attr['exp']; // Combined `sp:ids:expiration hours`. $attr['coupon'] = !empty($_p['optimizemember_pro_stripe_sp_checkout']['coupon']) ? $_p['optimizemember_pro_stripe_sp_checkout']['coupon'] : $attr['coupon']; $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_sp_checkout_response($attr); $_p = $response['response'] && !$response['error'] ? array() : $_p; $country_default_by_currency = !@$_p['optimizemember_pro_stripe_sp_checkout']['country'] && $attr['cc'] === 'USD' ? 'US' : ''; $country_default_by_currency = !@$_p['optimizemember_pro_stripe_sp_checkout']['country'] && $attr['cc'] === 'CAD' ? 'CA' : $country_default_by_currency; $country_default_by_currency = !@$_p['optimizemember_pro_stripe_sp_checkout']['country'] && $attr['cc'] === 'GBP' ? 'GB' : $country_default_by_currency; $country_default_by_currency = apply_filters('ws_plugin__optimizemember_pro_stripe_default_country', $country_default_by_currency, get_defined_vars()); $default_country_v = $attr['default_country_code'] ? $attr['default_country_code'] : $country_default_by_currency; $country_options = '<option value=""></option>'; // Start with an empty option value. foreach (preg_split('/[' . "\r\n" . ']+/', file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . '/iso-3166-1.txt')) as $country) { list($country_l, $country_v) = preg_split('/;/', $country, 2); if ($country_l && $country_v) { // Here we also check on the default pre-selected country; as determined above; based on currency. $country_options .= '<option value="' . esc_attr(strtoupper($country_v)) . '"' . (@$_p['optimizemember_pro_stripe_sp_checkout']['country'] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>'; } } if ($attr['captcha']) { $captcha = '<div id="optimizemember-pro-stripe-sp-checkout-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-sp-checkout-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-sp-checkout-form-captcha-section">' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-sp-checkout-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-sp-checkout-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-sp-checkout-form-captcha-section-title">' . "\n"; $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-sp-checkout-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-sp-checkout-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-sp-checkout-form-captcha-div">' . "\n"; $captcha .= '<label id="optimizemember-pro-stripe-sp-checkout-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-sp-checkout-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 300) . "\n"; $captcha .= '</label>' . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '</div>' . "\n"; } else { $captcha = ''; } // Not applicable. /* Build the opt-in checkbox. */ if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) { $opt_in = '<div id="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-sp-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-opt-in-div optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-div">' . "\n"; $opt_in .= '<label for="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in" id="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-label" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in-label optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in-label">' . "\n"; $opt_in .= '<input type="checkbox" name="optimizemember_pro_stripe_sp_checkout[custom_fields][opt_in]" id="optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in optimizemember-pro-stripe-sp-checkout-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] == 1 || @$_p['optimizemember_pro_stripe_sp_checkout']['custom_fields']['opt_in'] ? ' checked="checked"' : '') . ' tabindex="400" />' . "\n"; $opt_in .= $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in_label'] . "\n"; $opt_in .= '</label>' . "\n"; $opt_in .= '</div>' . "\n"; } else { $opt_in = ''; } // Not applicable. $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[nonce]" id="optimizemember-pro-stripe-sp-checkout-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-sp-checkout')) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[card_token]" id="optimizemember-pro-stripe-sp-checkout-card-token" value="' . esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token']) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[card_token_summary]" id="optimizemember-pro-stripe-sp-checkout-card-token-summary" value="' . esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token_summary']) . '" />'; $hidden_inputs .= !$attr['accept_coupons'] ? '<input type="hidden" id="optimizemember-pro-stripe-sp-checkout-coupons-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !c_ws_plugin__optimizemember_pro_stripe_utilities::tax_may_apply() ? '<input type="hidden" id="optimizemember-pro-stripe-sp-checkout-tax-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= ($cp_attr = c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'])) && $cp_attr['ta'] <= 0.0 && $cp_attr['ra'] <= 0.0 ? '<input type="hidden" id="optimizemember-pro-stripe-sp-checkout-payment-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_sp_checkout[attr]" id="optimizemember-pro-stripe-sp-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; $custom_template = file_exists(TEMPLATEPATH . '/stripe-sp-checkout-form.php') ? TEMPLATEPATH . '/stripe-sp-checkout-form.php' : FALSE; $custom_template = file_exists(TEMPLATEPATH . '/stripe-sp-checkout-form.html') ? TEMPLATEPATH . '/stripe-sp-checkout-form.html' : $custom_template; $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template; $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template; $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-sp-checkout-form.php')); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code); $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code); $code = preg_replace('/%%options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($option_selections), $code); $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code); $code = preg_replace('/%%coupon_response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'], 'response', array('affiliates-1px-response'))), $code); $code = preg_replace('/%%coupon_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit($attr['coupon'])), $code); $code = preg_replace('/%%first_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['first_name'])), $code); $code = preg_replace('/%%last_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_sp_checkout']['last_name'])), $code); $code = preg_replace('/%%email_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_sp_checkout']['email'])), $code); $code = preg_replace('/%%card_token%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token'])), $code); $code = preg_replace('/%%card_token_summary%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_sp_checkout']['card_token_summary'])), $code); $code = preg_replace('/%%state_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_sp_checkout']['state'])), $code); $code = preg_replace('/%%country_options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($country_options), $code); $code = preg_replace('/%%zip_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_sp_checkout']['zip'])), $code); $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code); $code = preg_replace('/%%opt_in%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($opt_in), $code); $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code); foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('ws_plugin__optimizemember_pro_during_sc_stripe_sp_form', get_defined_vars()); unset($__refs, $__v); // Ditch these temporary vars. } else { $_p = c_ws_plugin__optimizemember_utils_strings::trim_deep(stripslashes_deep($_POST)); $attr['level_ccaps_eotper'] = $attr['rr'] === 'BN' && $attr['rt'] !== 'L' ? $attr['level'] . ':' . $attr['ccaps'] . ':' . $attr['rp'] . ' ' . $attr['rt'] : $attr['level'] . ':' . $attr['ccaps']; $attr['level_ccaps_eotper'] = rtrim($attr['level_ccaps_eotper'], ':'); // Clean any trailing separators from this string. $attr['coupon'] = !empty($_p['optimizemember_pro_stripe_checkout']['coupon']) ? $_p['optimizemember_pro_stripe_checkout']['coupon'] : $attr['coupon']; $response = c_ws_plugin__optimizemember_pro_stripe_responses::stripe_checkout_response($attr); $_p = $response['response'] && !$response['error'] ? array() : $_p; $country_default_by_currency = !@$_p['optimizemember_pro_stripe_checkout']['country'] && $attr['cc'] === 'USD' ? 'US' : ''; $country_default_by_currency = !@$_p['optimizemember_pro_stripe_checkout']['country'] && $attr['cc'] === 'CAD' ? 'CA' : $country_default_by_currency; $country_default_by_currency = !@$_p['optimizemember_pro_stripe_checkout']['country'] && $attr['cc'] === 'GBP' ? 'GB' : $country_default_by_currency; $country_default_by_currency = apply_filters('ws_plugin__optimizemember_pro_stripe_default_country', $country_default_by_currency, get_defined_vars()); $default_country_v = $attr['default_country_code'] ? $attr['default_country_code'] : $country_default_by_currency; $country_options = '<option value=""></option>'; // Start with an empty option value. foreach (preg_split('/[' . "\r\n" . ']+/', file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . '/iso-3166-1.txt')) as $country) { list($country_l, $country_v) = preg_split('/;/', $country, 2); if ($country_l && $country_v) { // Here we also check on the default pre-selected country; as determined above; based on currency. $country_options .= '<option value="' . esc_attr(strtoupper($country_v)) . '"' . (@$_p['optimizemember_pro_stripe_checkout']['country'] === $country_v || $default_country_v === $country_v ? ' selected="selected"' : '') . '>' . esc_html(ucwords(strtolower($country_l))) . '</option>'; } } $custom_fields = ''; // Initialize custom fields. if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields']) { // Only display Custom Fields if configured. if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level($attr['level'] === '*' ? 'auto-detection' : $attr['level'], 'registration')) { $tabindex = 99; // Start tabindex at 99 (+1 below = 100). $custom_fields = '<div id="optimizemember-pro-stripe-checkout-form-custom-fields-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-checkout-form-section optimizemember-pro-stripe-form-custom-fields-section optimizemember-pro-stripe-checkout-form-custom-fields-section">' . "\n"; $custom_fields .= '<div id="optimizemember-pro-stripe-checkout-form-custom-fields-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-checkout-form-section-title optimizemember-pro-stripe-form-custom-fields-section-title optimizemember-pro-stripe-checkout-form-custom-fields-section-title">' . "\n"; $custom_fields .= _x('Additional Info', 's2member-front', 's2member') . "\n"; $custom_fields .= '</div>' . "\n"; foreach (json_decode($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_fields'], TRUE) as $field) { if (in_array($field['id'], $fields_applicable)) { $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id'])); $field_id_class = preg_replace('/_/', '-', $field_var); if (!empty($field['section']) && $field['section'] === 'yes') { // Starts a new section? $custom_fields .= '<div id="optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . ' optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . '">' . (!empty($field['sectitle']) ? $field['sectitle'] : '') . '</div>'; } $custom_fields .= '<div id="optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-div optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-div">' . "\n"; $custom_fields .= '<label for="optimizemember-pro-stripe-checkout-custom-reg-field-' . esc_attr($field_id_class) . '" id="optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-label" class="optimizemember-pro-stripe-form-custom-reg-field-' . $field_id_class . '-label optimizemember-pro-stripe-checkout-form-custom-reg-field-' . $field_id_class . '-label">' . "\n"; $custom_fields .= '<span' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? ' style="display:none;"' : '') . '>' . $field['label'] . ($field['required'] === 'yes' ? ' *' : '') . '</span></label>' . (preg_match('/^(checkbox|pre_checkbox)$/', $field['type']) ? '' : '<br />') . "\n"; $custom_fields .= c_ws_plugin__optimizemember_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, 'optimizemember_pro_stripe_checkout[custom_fields][', 'optimizemember-pro-stripe-checkout-custom-reg-field-', 'optimizemember-pro-stripe-custom-reg-field-' . $field_id_class . ' optimizemember-pro-stripe-checkout-custom-reg-field-' . $field_id_class, '', $tabindex = $tabindex + 1, '', $_p, @$_p['optimizemember_pro_stripe_checkout']['custom_fields'][$field_var], 'registration'); $custom_fields .= '</div>' . "\n"; } } $custom_fields .= '</div>' . "\n"; } } if ($attr['captcha']) { $captcha = '<div id="optimizemember-pro-stripe-checkout-form-captcha-section" class="optimizemember-pro-stripe-form-section optimizemember-pro-stripe-checkout-form-section optimizemember-pro-stripe-form-captcha-section optimizemember-pro-stripe-checkout-form-captcha-section">' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-checkout-form-captcha-section-title" class="optimizemember-pro-stripe-form-section-title optimizemember-pro-stripe-checkout-form-section-title optimizemember-pro-stripe-form-captcha-section-title optimizemember-pro-stripe-checkout-form-captcha-section-title">' . "\n"; $captcha .= _x('Security Code', 's2member-front', 's2member') . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '<div id="optimizemember-pro-stripe-checkout-form-captcha-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-captcha-div optimizemember-pro-stripe-checkout-form-captcha-div">' . "\n"; $captcha .= '<label id="optimizemember-pro-stripe-checkout-form-captcha-label" class="optimizemember-pro-stripe-form-captcha-label optimizemember-pro-stripe-checkout-form-captcha-label">' . "\n"; $captcha .= c_ws_plugin__optimizemember_utils_captchas::recaptcha_script_tag($attr['captcha'], 400) . "\n"; $captcha .= '</label>' . "\n"; $captcha .= '</div>' . "\n"; $captcha .= '</div>' . "\n"; } else { $captcha = ''; } // Not applicable. if ($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] && c_ws_plugin__optimizemember_list_servers::list_servers_integrated()) { $opt_in = '<div id="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-div" class="optimizemember-pro-stripe-form-div optimizemember-pro-stripe-checkout-form-div optimizemember-pro-stripe-form-custom-reg-field-opt-in-div optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-div">' . "\n"; $opt_in .= '<label for="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in" id="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-label" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in-label optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in-label">' . "\n"; $opt_in .= '<input type="checkbox" name="optimizemember_pro_stripe_checkout[custom_fields][opt_in]" id="optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in" class="optimizemember-pro-stripe-form-custom-reg-field-opt-in optimizemember-pro-stripe-checkout-form-custom-reg-field-opt-in" value="1"' . (empty($_p) && $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in'] == 1 || @$_p['optimizemember_pro_stripe_checkout']['custom_fields']['opt_in'] ? ' checked="checked"' : '') . ' tabindex="500" />' . "\n"; $opt_in .= $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_opt_in_label'] . "\n"; $opt_in .= '</label>' . "\n"; $opt_in .= '</div>' . "\n"; } else { $opt_in = ''; } // Not applicable. $hidden_inputs = '<input type="hidden" name="optimizemember_pro_stripe_checkout[nonce]" id="optimizemember-pro-stripe-checkout-nonce" value="' . esc_attr(wp_create_nonce('optimizemember-pro-stripe-checkout')) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_checkout[card_token]" id="optimizemember-pro-stripe-checkout-card-token" value="' . esc_attr(@$_p['optimizemember_pro_stripe_checkout']['card_token']) . '" />'; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_checkout[card_token_summary]" id="optimizemember-pro-stripe-checkout-card-token-summary" value="' . esc_attr(@$_p['optimizemember_pro_stripe_checkout']['card_token_summary']) . '" />'; $hidden_inputs .= !$attr['accept_coupons'] ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-coupons-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !$GLOBALS['WS_PLUGIN__']['optimizemember']['o']['custom_reg_password'] ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-password-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= !c_ws_plugin__optimizemember_pro_stripe_utilities::tax_may_apply() ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-tax-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= ($cp_attr = c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'])) && $cp_attr['ta'] <= 0.0 && $cp_attr['ra'] <= 0.0 ? '<input type="hidden" id="optimizemember-pro-stripe-checkout-payment-not-required-or-not-possible" value="1" />' : ''; $hidden_inputs .= '<input type="hidden" name="optimizemember_pro_stripe_checkout[attr]" id="optimizemember-pro-stripe-checkout-attr" value="' . esc_attr(c_ws_plugin__optimizemember_utils_encryption::encrypt(serialize($attr))) . '" />'; $custom_template = file_exists(TEMPLATEPATH . '/stripe-checkout-form.php') ? TEMPLATEPATH . '/stripe-checkout-form.php' : FALSE; $custom_template = file_exists(TEMPLATEPATH . '/stripe-checkout-form.html') ? TEMPLATEPATH . '/stripe-checkout-form.html' : $custom_template; $custom_template = $attr['template'] && file_exists(TEMPLATEPATH . '/' . $attr['template']) ? TEMPLATEPATH . '/' . $attr['template'] : $custom_template; $custom_template = $attr['template'] && file_exists(WP_CONTENT_DIR . '/' . $attr['template']) ? WP_CONTENT_DIR . '/' . $attr['template'] : $custom_template; $code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . '/templates/forms/stripe-checkout-form.php')); $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__optimizemember_utilities::evl($code) : $code); $code = preg_replace('/%%action%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr($_SERVER['REQUEST_URI'])), $code); $code = preg_replace('/%%response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($response['response']), $code); $code = preg_replace('/%%options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($option_selections), $code); $code = preg_replace('/%%description%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($attr['desc']), $code); $code = preg_replace('/%%coupon_response%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(c_ws_plugin__optimizemember_pro_stripe_utilities::apply_coupon($attr, $attr['coupon'], 'response', array('affiliates-1px-response'))), $code); $code = preg_replace('/%%coupon_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit($attr['coupon'])), $code); $code = preg_replace('/%%first_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_checkout']['first_name'])), $code); $code = preg_replace('/%%last_name_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_attr(@$_p['optimizemember_pro_stripe_checkout']['last_name'])), $code); $code = preg_replace('/%%email_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['email'])), $code); $code = preg_replace('/%%username_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['username'])), $code); $code = preg_replace('/%%password1_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['password1'])), $code); $code = preg_replace('/%%password2_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['password2'])), $code); $code = preg_replace('/%%custom_fields%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($custom_fields), $code); $code = preg_replace('/%%card_token%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_checkout']['card_token'])), $code); $code = preg_replace('/%%card_token_summary%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(esc_html(@$_p['optimizemember_pro_stripe_checkout']['card_token_summary'])), $code); $code = preg_replace('/%%state_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['state'])), $code); $code = preg_replace('/%%country_options%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($country_options), $code); $code = preg_replace('/%%zip_value%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs(format_to_edit(@$_p['optimizemember_pro_stripe_checkout']['zip'])), $code); $code = preg_replace('/%%captcha%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($captcha), $code); $code = preg_replace('/%%opt_in%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($opt_in), $code); $code = preg_replace('/%%hidden_inputs%%/', c_ws_plugin__optimizemember_utils_strings::esc_refs($hidden_inputs), $code); if (!empty($raw_content)) { $code = preg_replace('/%%submit_button%%/', $raw_content, $code); } else { $button_code = '<button style="padding:15px;" type="submit" id="optimizemember-pro-stripe-checkout-submit" class="optimizemember-pro-stripe-submit optimizemember-pro-stripe-checkout-submit btn btn-primary" tabindex="600">' . esc_html(_x("Submit Form", "s2member-front", "s2member")) . '</button>'; $code = preg_replace('/%%submit_button%%/', $button_code, $code); } foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } $attr['modify'] ? do_action('ws_plugin__optimizemember_pro_during_sc_stripe_modification_form', get_defined_vars()) : do_action('ws_plugin__optimizemember_pro_during_sc_stripe_form', get_defined_vars()); unset($__refs, $__v); // Ditch these temporary vars. } } } } return apply_filters('ws_plugin__optimizemember_pro_sc_stripe_form', $code, get_defined_vars()); }
/** * Shortcode `[optimizeMember-Pro-ClickBank-Button /]`. * * @package optimizeMember\ClickBank * @since 1.5 * * @attaches-to ``add_shortcode("optimizeMember-Pro-ClickBank-Button");`` * * @param array $attr An array of Attributes. * @param str $content Content inside the Shortcode. * @param str $shortcode The actual Shortcode name itself. * @return str The resulting ClickBank® Button Code, HTML markup. */ public static function sc_clickbank_button($attr = FALSE, $content = FALSE, $shortcode = FALSE) { c_ws_plugin__optimizemember_no_cache::no_cache_constants(true); $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); $attr = shortcode_atts(array("cbp" => "0", "cbskin" => "", "cbfid" => "", "cbur" => "", "cbf" => "auto", "ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "custom" => $_SERVER["HTTP_HOST"], "tp" => "0", "tt" => "D", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor"), $attr); $attr["tt"] = strtoupper($attr["tt"]); $attr["rt"] = strtoupper($attr["rt"]); $attr["ccaps"] = strtolower($attr["ccaps"]); $attr["rr"] = $attr["rt"] === "L" ? "0" : $attr["rr"]; $attr["rr"] = $attr["level"] === "*" ? "0" : $attr["rr"]; $attr["desc"] = str_replace("+", "plus", $attr["desc"]); // Workaround for a known bug @ ClickBank®. // ClickBank® will NOT properly parse `+` signs in URLs leading to (and returning from) ClickBank® checkout forms. if ($attr["cbur"] && $attr["cbf"] === "auto" && !empty($_REQUEST["cbf"])) { $attr["cbf"] = esc_html((string) $_REQUEST["cbf"]); } else { if (!$attr["cbur"] || $attr["cbf"] === "auto") { $attr["cbf"] = ""; } } if ($attr["modify"] || $attr["cancel"]) { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-edit-button.png"; $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-cancellation-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } unset($href, $url, $m); } else { if ($attr["sp"]) { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-button.png"; $attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"]; $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-sp-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); $code = preg_replace("/%%item%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code); $code = preg_replace("/%%vendor%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_username"])), $code); $code = preg_replace("/%%invoice%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["sp_ids_exp"])), $code); $code = preg_replace("/%%desc%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["desc"])), $code); $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["custom"])), $code); $code = preg_replace("/%%cbskin%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code); $code = preg_replace("/%%cbfid%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code); $code = preg_replace("/%%cbur%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbur"])), $code); $code = preg_replace("/%%cbf%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbf"])), $code); $code = str_replace(array("&cbskin=&", "&cbfid=&", "&cbur=&", "&cbf=&"), "&", $code); $code = preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code); $code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__optimizemember_utils_strings::esc_ds("&s2_referencing=" . urlencode($referencing)) : "", $code); if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) { $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code); } $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } unset($href, $url, $m); } else { if ($attr["level"] === "*") { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-button.png"; $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-ccaps-checkout-button.php"))); $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); $code = preg_replace("/%%item%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code); $code = preg_replace("/%%vendor%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_username"])), $code); $code = preg_replace("/%%invoice%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["level_ccaps_eotper"])), $code); $code = preg_replace("/%%desc%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["desc"])), $code); $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["custom"])), $code); $code = preg_replace("/%%cbskin%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code); $code = preg_replace("/%%cbfid%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code); $code = preg_replace("/%%cbur%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbur"])), $code); $code = preg_replace("/%%cbf%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbf"])), $code); $code = str_replace(array("&cbskin=&", "&cbfid=&", "&cbur=&", "&cbf=&"), "&", $code); $code = !$attr["rr"] ? preg_replace("/&s2_subscr_id\\=s2-\\<\\?php echo uniqid\\(\\); \\?\\>/", "", $code) : preg_replace("/\\<\\?php echo uniqid\\(\\); \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(uniqid())), $code); $code = preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code); $code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__optimizemember_utils_strings::esc_ds("&s2_referencing=" . urlencode($referencing)) : "", $code); if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) { $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code); } $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } unset($href, $url, $m); } else { $default_image = $GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images/clickbank-button.png"; $attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"]; $attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":"); $code = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-checkout-button.php"))); /* * Custom button */ if (!empty($content)) { $code = preg_replace('/%%button_markup%%/', $content, $code); $code = preg_replace('/%%url%%/', 'http://%%item%%.%%vendor%%.pay.clickbank.net/?cbskin=%%cbskin%%&cbfid=%%cbfid%%&cbur=%%cbur%%&cbf=%%cbf%%&s2_invoice=%%invoice%%&s2_p1=%%p1%%&s2_p3=%%p3%%&s2_desc=%%desc%%&s2_custom=%%custom%%&s2_customer_ip=<?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; ?>&s2_subscr_id=s2-<?php echo uniqid(); ?>%%referencing%%', $code); } else { $code = preg_replace("/%%button_markup%%/", '<a href="http://%%item%%.%%vendor%%.pay.clickbank.net/?cbskin=%%cbskin%%&cbfid=%%cbfid%%&cbur=%%cbur%%&cbf=%%cbf%%&s2_invoice=%%invoice%%&s2_p1=%%p1%%&s2_p3=%%p3%%&s2_desc=%%desc%%&s2_custom=%%custom%%&s2_customer_ip=<?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; ?>&s2_subscr_id=s2-<?php echo uniqid(); ?>%%referencing%%"><img src="%%images%%/clickbank-button.png" style="width:auto; height:auto; border:0;" alt="ClickBank®" /></a>', $code); } $code = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember_pro"]["c"]["dir_url"] . "/images")), $code); $code = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $code); $code = preg_replace("/%%item%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code); $code = preg_replace("/%%vendor%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_username"])), $code); $code = preg_replace("/%%invoice%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["level_ccaps_eotper"])), $code); $code = preg_replace("/%%desc%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["desc"])), $code); $code = preg_replace("/%%p1%%/", $attr["rr"] ? c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["tp"] . " " . $attr["tt"])) : "", $code); $code = preg_replace("/%%p3%%/", $attr["rr"] ? c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["rp"] . " " . $attr["rt"])) : "", $code); $code = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["custom"])), $code); $code = preg_replace("/%%cbskin%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code); $code = preg_replace("/%%cbfid%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code); $code = preg_replace("/%%cbur%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbur"])), $code); $code = preg_replace("/%%cbf%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($attr["cbf"])), $code); $code = str_replace(array("&cbskin=&", "&cbfid=&", "&cbur=&", "&cbf=&"), "&", $code); $code = !$attr["rr"] ? preg_replace("/&s2_subscr_id\\=s2-\\<\\?php echo uniqid\\(\\); \\?\\>/", "", $code) : preg_replace("/\\<\\?php echo uniqid\\(\\); \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode(uniqid())), $code); $code = preg_replace("/\\<\\?php echo OPTIMIZEMEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__optimizemember_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code); $code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__optimizemember_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__optimizemember_utils_strings::esc_ds("&s2_referencing=" . urlencode($referencing)) : "", $code); if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__optimizemember_utils_urls::n_amps($m[1]))) { $code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(c_ws_plugin__optimizemember_utils_urls::add_optimizemember_sig($url))) . '"', $code); } /* * Only when there is no custom button */ if (empty($content)) { $code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code); } /**/ $code = $attr["output"] === "anchor" ? $code : $code; if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) { $code = $url = c_ws_plugin__optimizemember_utils_urls::n_amps($href); } unset($href, $url, $m); } } } return $code; }
/** * Handles the Shortcode for: `[opmStream /]`. * * @package optimizeMember\opmFile * @since 130119 * * @attaches-to ``add_shortcode("opmStream");`` * * @param array $attr An array of Attributes. * @param str $content Content inside the Shortcode. * @param str $shortcode The actual Shortcode name itself. * @return str HTML markup that produces an audio/video stream for a specific player. */ public static function sc_get_stream($attr = FALSE, $content = FALSE, $shortcode = FALSE) { eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_before_sc_get_stream", get_defined_vars()); unset($__refs, $__v); /**/ $attr = c_ws_plugin__optimizemember_utils_strings::trim_qts_deep((array) $attr); /**/ $attr = shortcode_atts(array("download" => "", "download_key" => "", "stream" => "yes", "inline" => "yes", "storage" => "", "remote" => "", "ssl" => "", "rewrite" => "yes", "rewrite_base" => "", "skip_confirmation" => "", "url_to_storage_source" => "yes", "count_against_user" => "yes", "check_user" => "yes", "file_download" => "", "player" => "jwplayer-v6-rtmp", "player_id" => "s2-stream-" . md5(uniqid("", TRUE)), "player_path" => "/jwplayer/jwplayer.js", "player_key" => "", "player_image" => "", "player_title" => "", "player_controls" => "yes", "player_height" => "270", "player_skin" => "", "player_stretching" => "uniform", "player_width" => "480", "player_autostart" => "no", "player_fallback" => "yes", "player_mute" => "no", "player_primary" => "flash", "player_repeat" => "no", "player_startparam" => "", "player_option_blocks" => ""), $attr); $attr["download"] = !empty($attr["file_download"]) ? $attr["file_download"] : $attr["download"]; /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("ws_plugin__optimizemember_before_sc_get_stream_after_shortcode_atts", get_defined_vars()); unset($__refs, $__v); /**/ foreach ($attr as $key => $value) { if (strlen($value) && in_array($key, array("download", "download_key", "stream", "inline", "storage", "remote", "ssl", "rewrite", "rewrite_base"))) { $config["file_" . $key] = $value; } else { if (strlen($value) && !in_array($key, array("file_download", "player")) && strpos($key, "player_") !== 0) { $config[$key] = $value; } } } /**/ unset($key, $value); /**/ if (!empty($config) && isset($config["file_download"])) { $_get = c_ws_plugin__optimizemember_files::create_file_download_url($config, TRUE); /**/ if (is_array($_get) && !empty($_get) && $attr["player"] && file_exists(dirname(dirname(__FILE__)) . "/templates/players/" . $attr["player"] . ".php") && $attr["player_id"] && $attr["player_path"]) { if (strpos($attr["player"], "jwplayer-v6") === 0) { $get = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/players/" . $attr["player"] . ".php"))); /**/ $get = preg_replace("/%%streamer%%/", $_get["streamer"], $get); $get = preg_replace("/%%prefix%%/", $_get["prefix"], $get); $get = preg_replace("/%%file%%/", $_get["file"], $get); $get = preg_replace("/%%url%%/", $_get["url"], $get); /**/ $get = preg_replace("/%%player_id%%/", $attr["player_id"], $get); $get = preg_replace("/%%player_path%%/", $attr["player_path"], $get); $get = preg_replace("/%%player_key%%/", $attr["player_key"], $get); /**/ $get = preg_replace("/%%player_image%%/", $attr["player_image"], $get); $get = preg_replace("/%%player_title%%/", $attr["player_title"], $get); /**/ $get = preg_replace("/%%player_controls%%/", filter_var($attr["player_controls"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get); $get = preg_replace("/%%player_height%%/", (int) $attr["player_height"], $get); $get = preg_replace("/%%player_skin%%/", $attr["player_skin"], $get); $get = preg_replace("/%%player_stretching%%/", $attr["player_stretching"], $get); $get = preg_replace("/%%player_width%%/", (int) $attr["player_width"], $get); /**/ $get = preg_replace("/%%player_autostart%%/", filter_var($attr["player_autostart"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get); $get = preg_replace("/%%player_fallback%%/", filter_var($attr["player_fallback"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get); $get = preg_replace("/%%player_mute%%/", filter_var($attr["player_mute"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get); $get = preg_replace("/%%player_primary%%/", $attr["player_primary"], $get); $get = preg_replace("/%%player_repeat%%/", filter_var($attr["player_repeat"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get); $get = preg_replace("/%%player_startparam%%/", $attr["player_startparam"], $get); /**/ $get = preg_replace("/%%player_option_blocks%%/", strpos($attr["player_option_blocks"], ":") !== false ? $attr["player_option_blocks"] : base64_decode($attr["player_option_blocks"]), $get); } } } return apply_filters("ws_plugin__optimizemember_sc_get_stream", isset($get) ? $get : null, get_defined_vars()); }
public function __construct() { echo '<div class="wrap ws-menu-page op-bsw-wizard op-bsw-content">' . "\n"; /**/ echo '<div class="op-bsw-header">'; echo '<div class="op-logo"><img src="' . $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images/" . 'logo-optimizepress.png" alt="OptimizePress" height="50" class="animated flipInY"></div>'; echo '</div>'; echo '<div class="op-bsw-main-content inline-input-fields">'; echo '<h2>PayPal Buttons</h2>' . "\n"; /**/ echo '<table class="ws-menu-page-table">' . "\n"; echo '<tbody class="ws-menu-page-table-tbody">' . "\n"; echo '<tr class="ws-menu-page-table-tr">' . "\n"; echo '<td class="ws-menu-page-table-l">' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_before_left_sections", get_defined_vars()); /**/ for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); if (($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_level" . $n . "_buttons") && apply_filters($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_levelN_buttons, true, get_defined_vars())) { if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_level" . $n . "_buttons") { do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_levelN_buttons, get_defined_vars()); } /**/ echo '<div class="ws-menu-page-group" title="PayPal Buttons For Level ' . $labelText . ' Access">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-level' . $n . '-buttons-section">' . "\n"; echo '<h3>Button Code Generator For Level ' . $labelText . ' Access</h3>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Button Code). These special PayPal Buttons are customized to work with optimizeMember seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, optimizeMember will automatically terminate their Membership privileges. optimizeMember makes extensive use of the PayPal IPN service. optimizeMember receives updates from PayPal behind-the-scene.</p>' . "\n"; echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back & re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n"; /**/ if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons") { do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons, get_defined_vars()); } /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-level' . $n . '-shortcode">' . "\n"; echo 'Button Code<br />For Level ' . $labelText . ':<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-level' . $n . '-button-prev"></div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p id="ws-plugin--optimizemember-level' . $n . '-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-level' . $n . '-trial-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n"; echo '<p><span id="ws-plugin--optimizemember-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-level' . $n . '-term" class="paypal-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-regular-terms.php"))) . '</select></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-page-style" value="paypal" size="18" class="paypal-buttons-checkout-page-style-input" /> <select id="ws-plugin--optimizemember-level' . $n . '-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_paypalButtonGenerate(\'level' . $n . '\');" class="button-primary" /></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-desc" class="paypal-buttons-description-input" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n"; //echo '<p' . ((is_multisite () && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-ccaps" size="40" /></p>' . "\n"; echo 'Packages: '; if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) { echo '<input type="checkbox" onchange="showSelectedValues(\'ccpchk_' . $n . '\', \'ccaps\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchk_' . $n . '" value="' . $val . '" /> ' . $val . "\n"; } } else { echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>'; } echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-level' . $n . '-ccaps" value="" />' . "\n"; ?> <?php echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons_before_shortcode = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons_before_shortcode") { do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_levelN_buttons_before_shortcode, get_defined_vars()); } /**/ echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($n)), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; /**/ echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n"; echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n"; echo '<textarea id="ws-plugin--optimizemember-level' . $n . '-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">'; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-checkout-button.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($n)), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level_label%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level" . $n . "_label"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s); echo format_to_edit($ws_plugin__optimizemember_temp_s); echo '</textarea><br />' . "\n"; echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n"; echo '</div>' . "\n"; /**/ echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ if ($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_levelN_buttons = "ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_level" . $n . "_buttons") { do_action($ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_levelN_buttons, get_defined_vars()); } } } ?> <script type="text/javascript"> window.showSelectedValues = function(param, elemId, n) { var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map( function () {return this.value;}).get().join(","); jQuery("#ws-plugin--optimizemember-level"+n+"-" + elemId).val(text); } window.showSingleSelectedValues = function(param, elemId, n) { var text = jQuery("input[name=ws_plugin__optimizemember_"+param+"]:checked").map( function () {return this.value;}).get().join(","); jQuery("#ws-plugin--optimizemember-" + elemId + "-ccaps").val(text); } /**/ </script> <?php /**/ if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_modification_buttons", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_modification_buttons", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="PayPal Subscr Modification Buttons">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-modification-buttons-section">' . "\n"; echo '<h3>Button Code Generator For Subscription Modifications</h3>' . "\n"; echo '<p>If you\'d like to give your Members <em>( and/or your Free Subscribers )</em> the ability to modify their billing plan, by switching to a more expensive option, or a less expensive option; generate a new PayPal Modification Button here. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Button available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade Button into your Login Welcome Page, which would up-sell existing Level #1 Members to a more expensive plan that you offer.</p>' . "\n"; echo '<p><em><strong>*Important Note*</strong> Modification Buttons should be displayed to existing Users/Members, and they should be logged-in, BEFORE clicking this Button. Otherwise, post-processing of their transaction will fail to recognize the Customer\'s existing account within WordPress. Please display this Button only to Users/Members that are already logged into their account ( perhaps in your Login Welcome Page for optimizeMember ), or in another location where you can be absolutely sure that a User/Member is logged in. optimizeMember\'s Simple Conditionals could also be used to ensure a User/Member is logged in, by wrapping your Shortcode within a Conditional test. For further details, please see: <code>optimizeMember -> API Scripting -> Simple Conditionals</code>.</em></p>' . "\n"; echo '<p><em><strong>*Modification Process*</strong> When you send a Member to PayPal using a Subscription Modification Button, PayPal will ask them to login. Once they\'re logged in, instead of being able to signup for a new Membership, PayPal will provide them with the ability to upgrade and/or downgrade their existing Membership with you, by allowing them to switch to the Membership Plan that was specified in the Subscription Modification Button. PayPal handles this nicely, and you\'ll be happy to know that optimizeMember has been pre-configured to deal with this scenario as well, so that everything remains automated. Their Membership Access Level will either be promoted, or demoted, based on the actions they took at PayPal during the modification process. Once an existing Member completes their Subscription Modification at PayPal, they\'ll be brought back to their Login Welcome Page, instead of to the registration screen.</em></p>' . "\n"; echo '<p><em><strong>*Also Works For Free Subscribers*</strong> Although a Free Subscriber does not have an existing PayPal Subscription, optimizeMember is capable of adapting to this scenario gracefully. Just make sure that your existing Free Subscribers <em>( the ones who wish to upgrade )</em> pay for their Membership through a Modification Button generated by optimizeMember. That will allow them to continue using their existing account with you. In other words, they can keep their existing Username <em>( and anything already associated with that Username )</em>, rather than being forced to re-register after checkout.</em></p>' . "\n"; echo '<p><em><strong>*Make It More User-Friendly*</strong> You can make the Subscription Modification Process, more user-friendly, by setting up a <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can tell optimizeMember to use that Page Style whenever you generate your Button Code.\'); return false;">Custom Page Style at PayPal</a>, specifically for Subscription Modification Buttons. Use a custom header image, with a brief explanation to the Customer. Something like, "Log into PayPal", "You can Modify your Subscription!".</em></p>' . "\n"; echo '<p><em><strong>*Integrating Conditionals*</strong> Since each Modification Button is configured for a specific Level, you may want to create multiple Modification Buttons, one for each combination you intend to make available. optimizeMember\'s API Conditionals can help you display the proper Button to each Customer, based on the status of their existing account. For further details, see: <code>optimizeMember -> API Scripting</code>.</em></p>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<p><em><strong>*Independent Custom Capabilities*</strong> If you just want to sell an existing Member new Custom Capabilities, without affecting their paid Subscription in any way, please see the next Button Generator: <code>Capability (Buy Now) Buttons</code>. Independent Capability Buttons facilitate Buy Now functionality, specifically for Custom Capabilities, without affecting the Customer\'s primary Subscription and Membership Level Access.</em></p>' . "\n" : ''; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_modification_buttons", get_defined_vars()); /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-modification-shortcode">' . "\n"; echo 'Button Code<br />For Modifications:<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-modification-button-prev"></div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p>Modification: <select id="ws-plugin--optimizemember-modification-level">' . "\n"; /**/ for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<optgroup label="Level ' . $labelText . '">' . "\n"; echo '<option value="upgrade:' . $n . '">↑ Upgrade To Level ' . $labelText . '</option>' . "\n"; echo $n < $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"] ? '<option value="downgrade:' . $n . '">↓ Downgrade To Level ' . $labelText . '</option>' . "\n" : ''; echo '</optgroup>' . "\n"; /**/ echo $n < $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"] ? '<option disabled="disabled"></option>' . "\n" : ''; } /**/ echo '</select></p>' . "\n"; /**/ echo '<p id="ws-plugin--optimizemember-modification-trial-line">I\'ll offer the first <input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--optimizemember-modification-trial-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-trial-amount" value="0.00" size="4" /></p>' . "\n"; echo '<p><span id="ws-plugin--optimizemember-modification-trial-then">Then, </span>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-modification-term" class="paypal-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-regular-terms.php"))) . '</select><span id="ws-plugin--optimizemember-modification-20p-rule"><br /><small>* Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details are <a href="http://www.optimizepress.com/paypal-20p-rule" target="_blank" rel="external">documented here</a>.<br />* <strong>Tip</strong> <a href="' . esc_attr(c_ws_plugin__optimizemember_readmes::parse_readme_value("Pro Module / Prices")) . '" target="_blank" rel="external">optimizeMember Pro Forms</a> are NOT subjected to this ridiculous 20% rule.</small></span></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-page-style" value="paypal" size="18" class="paypal-buttons-checkout-page-style-input" /> <select id="ws-plugin--optimizemember-modification-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-desc" class="paypal-buttons-description-input" value="Description and pricing details here." size="73" /></p>' . "\n"; //echo '<p' . ((is_multisite () && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-modification-ccaps" size="40" /></p>' . "\n"; //echo '<p' . ((is_multisite () && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-level' . $n . '-ccaps" size="40" /></p>' . "\n"; echo 'Packages: '; $n = 1; if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) { echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchksub_' . $n . '\', \'modification\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchksub_' . $n . '" value="' . $val . '" /> ' . $val . "\n"; } } else { echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>'; } echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-modification-ccaps" value="" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_modification_buttons_before_shortcode", get_defined_vars()); echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("1")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level_label%% /", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level1_label"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/\\/]\$/", 'modify="1" /]', $ws_plugin__optimizemember_temp_s); /* Adds modify="1" to the end of the Shortcode. */ echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-modification-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; /**/ echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n"; echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n"; echo '<textarea id="ws-plugin--optimizemember-modification-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">'; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-checkout-button.php"))); $ws_plugin__optimizemember_temp_s = preg_replace('/name\\="modify" value\\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr("1")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%level_label%% /", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["level1_label"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s); echo format_to_edit($ws_plugin__optimizemember_temp_s); echo '</textarea><br />' . "\n"; echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n"; echo '</div>' . "\n"; /**/ echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_modification_buttons", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_ccap_buttons", !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site(), get_defined_vars())) { do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_ccap_buttons", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="PayPal Capability (Buy Now) Buttons">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-ccap-buttons-section">' . "\n"; echo '<h3>Button Code Generator For Independent Custom Capabilities</h3>' . "\n"; echo '<p>This is VERY advanced. For further details, please check your Dashboard: <code>optimizeMember -> API Scripting -> Custom Capabiities</code>.</p>' . "\n"; echo '<p>With optimizeMember, you can sell one or more Custom Capabilities using Buy Now functionality, to "existing" Users/Members, regardless of which Membership Level they have on your site <em>( i.e. you could even sell Independent Custom Capabilities to Users at Membership Level #0, normally referred to as Free Subscribers, if you like )</em>. So this is quite flexible. Independent Custom Capabilities do NOT rely on any specific Membership Level. That\'s why optimizeMember refers to these as `Independent` Custom Capabilities, because you can sell Capabilities this way, through Buy Now functionality, and the Customer\'s Membership Level Access, along with any existing paid Subscription they may already have with you, will remain completely unaffected. That being said, if you intend to charge a recurring fee for Custom Capabilities, please use a <code>Subscr. Modification Button</code> instead; because Independent Custom Capabilities can only be sold through Buy Now functionality.</p>' . "\n"; echo '<p>Independent Custom Capabilities are added to a Customer\'s account immediately after checkout, and the Customer will have the Custom Capabilities for as long as their Membership lasts, based on their primary Subscription with your site, and/or forever, if they have a Lifetime account with you. In other words, Independent Custom Capabilities will exist on the Customer\'s account forever, or until an EOT <em>( End Of Term )</em> occurs on their primary Subscription with you; in which case optimizeMember would demote or delete the Customer\'s account <em>( based on your EOT configuration )</em>, and all Custom Capabilities are removed as well.</p>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each set of Custom Capabilities that you plan to sell. Then press (Generate Button Code). These special PayPal Buttons are customized to work with optimizeMember seamlessly. The Customer will be granted additional access to one or more Custom Capabilities that you specify; while the Customer\'s Membership Level Access and any existing paid Subscription they may already have with you, will remain completely unaffected.</p>' . "\n"; echo '<p><em><strong>*Important Note*</strong> Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button. Otherwise, post-processing of their transaction will fail to recognize the Customer\'s existing account within WordPress. Please display this Button only to Users/Members that are already logged into their account ( perhaps in your Login Welcome Page for optimizeMember ), or in another location where you can be absolutely sure that a User/Member is logged in. optimizeMember\'s Simple Conditionals could also be used to ensure a User/Member is logged in, by wrapping your Shortcode within a Conditional test. For further details, please see: <code>optimizeMember -> API Scripting -> Simple Conditionals</code>.</em></p>' . "\n"; echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your WordPress Editor. If you lose your Button Code, you\'ll need to come back & re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_ccap_buttons", get_defined_vars()); /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-ccap-shortcode">' . "\n"; echo 'Button Code<br />For Capabilities:<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-ccap-button-prev"></div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-ccap-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-ccap-term">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-membership-ccap-terms.php"))) . '</select></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-ccap-page-style" class="paypal-buttons-checkout-page-style-input" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-ccap-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_paypalCcapButtonGenerate();" class="button-primary" /></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-ccap-desc" class="paypal-buttons-description-input" value="Description and pricing details here." size="73" /></p>' . "\n"; //echo '<p>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell optimizeMember to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-ccap-ccaps" size="40" /></p>' . "\n"; echo 'Packages: '; $n = 1; if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) { echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkccaps_' . $n . '\', \'ccap\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkccaps_' . $n . '" value="' . $val . '" /> ' . $val . "\n"; } } else { echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>'; } echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-ccap-ccaps" value="" />' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_ccap_buttons_before_shortcode", get_defined_vars()); echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-ccaps-checkout-button-shortcode.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-ccap-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; /**/ echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n"; echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n"; echo '<textarea id="ws-plugin--optimizemember-ccap-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">'; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-ccaps-checkout-button.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s); echo format_to_edit($ws_plugin__optimizemember_temp_s); echo '</textarea><br />' . "\n"; echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n"; echo '</div>' . "\n"; /**/ echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_ccap_buttons", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_cancellation_buttons", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_cancellation_buttons", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="PayPal Subscr Cancellation Buttons">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-cancellation-buttons-section">' . "\n"; echo '<h3>One Button Does It All For Cancellations ( copy/paste )</h3>' . "\n"; echo '<p>Since all recurring charges are associated with a PayPal Subscription; and every PayPal Subscription is associated with a PayPal Account; your Members will always have a PayPal Account of their own, which is tied to their Membership with you. So... a Member can simply log into their own PayPal account and cancel their Subscription(s) with you at anytime, all on their own. However, some Customers do not realize this. So, if you would like to make it clearer ( easier ) for Members to cancel their own Subscription(s), you can provide this Cancellation Button for them on your Login Welcome Page, or somewhere in the support section of your website. Note... you don\'t have to use this Cancellation Button at all, if you don\'t want to. It\'s completely optional.</p>' . "\n"; echo '<p><em><strong>*Cancellation Process*</strong> Very simple. A Member clicks the Cancellation Button. PayPal asks them to log into their PayPal account. Once they\'re logged in, PayPal will display a list of all active Subscriptions they have with you. They choose which ones they want to cancel, and optimizeMember is notified silently behind-the-scene, through the PayPal IPN service.</em></p>' . "\n"; echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n"; echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through PayPal... but, optimizeMember continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. optimizeMember will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by optimizeMember.</em></p>' . "\n"; echo '<p><em>optimizeMember will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, optimizeMember will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). optimizeMember also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons", get_defined_vars()); /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-cancellation-shortcode">' . "\n"; echo 'Button Code<br />For Cancellations:<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-cancellation-button-prev">' . "\n"; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s); echo preg_replace("/\\<a/", '<a target="_blank"', $ws_plugin__optimizemember_temp_s); echo '</div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td class="align-top">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p>No configuration necessary.</p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons_before_shortcode", get_defined_vars()); echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-cancellation-button-shortcode.php"))); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-cancellation-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; /**/ echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n"; echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n"; echo '<textarea id="ws-plugin--optimizemember-cancellation-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">'; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s); echo format_to_edit($ws_plugin__optimizemember_temp_s); echo '</textarea><br />' . "\n"; echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n"; echo '</div>' . "\n"; /**/ echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_cancellation_buttons", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_reg_links", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_reg_links", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="PayPal Member Registration Access Links">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-reg-links-section">' . "\n"; echo '<h3>Registration Access Link Generator ( for Customer Service )</h3>' . "\n"; echo '<p>optimizeMember automatically generates Registration Access Links for your Customers after checkout, and also sends them a link in a Confirmation Email. However, if you ever need to deal with a Customer Service issue that requires a new Registration Access Link to be created manually, you can use this tool for that. Alternatively, you can create their account yourself/manually by going to <code>optimizeMember -> Add A Member</code>. Either of these methods will work fine.</p>' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_reg_links", get_defined_vars()); /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; echo '<p>Paid Membership Level#: <select id="ws-plugin--optimizemember-reg-link-level" style="min-width:200px;">' . "\n"; for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]; $n++) { $labelText = ws_plugin__optimizemember_getMembershipLabel($n); echo '<option value="' . $n . '">optimizeMember Level ' . $labelText . '</option>' . "\n"; } echo '</select></p>' . "\n"; echo '<p>Paid Subscr. ID: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-reg-link-subscr-id" value="" size="50" /> <a href="#" onclick="alert(\'The Customer\\\'s Paid Subscr. ID ( aka: Recurring Profile ID, Transaction ID ) must be unique. This value can be obtained from inside your PayPal account under the History tab. Each paying Customer MUST be associated with a unique Paid Subscr. ID. If the Customer is NOT associated with a Paid Subscr. ID, you will need to generate a unique value for this field on your own. But keep in mind, optimizeMember will be unable to maintain future communication with the PayPal IPN ( i.e. Notification ) service if this value does not reflect a real Paid Subscr. ID that exists in your PayPal History log.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; echo '<p>Custom String Value: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-reg-link-custom" value="' . esc_attr($_SERVER["HTTP_HOST"]) . '" size="30" /> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\\n' . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(esc_attr($_SERVER["HTTP_HOST"]), 3) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_paypalRegLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-reg-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n"; //echo '<p' . ((is_multisite () && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: optimizeMember -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" maxlength="125" autocomplete="off" id="ws-plugin--optimizemember-reg-link-ccaps" size="40" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^a-z_0-9,]/gi, \'\').toLowerCase ());" /></p>' . "\n"; echo 'Packages: '; $n = 1; if (count($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"]) > 0) { foreach ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["ccp"] as $key => $val) { echo '<input type="checkbox" onchange="showSingleSelectedValues(\'ccpchkreg_' . $n . '\', \'reg-link\', ' . $n . ');" name="ws_plugin__optimizemember_ccpchkreg_' . $n . '" value="' . $val . '" /> ' . $val . "\n"; } } else { echo 'To use packages, enter some first in <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-gen-ops")) . '">Define membership levels and packages section.</a>'; } echo '<input type="hidden" autocomplete="off" name="ws_plugin__optimizemember_security_meta_box_ccaps" id="ws-plugin--optimizemember-reg-link-ccaps" value="" />' . "\n"; echo '<p>Fixed Term Length ( for Buy Now transactions ): <input type="text" autocomplete="off" id="ws-plugin--optimizemember-reg-link-fixed-term" value="" size="10" /> <a href="#" onclick="alert(\'If the Customer purchased Membership through a Buy Now transaction ( i.e. there is no Initial/Trial Period and no recurring charges for ongoing access ), you may configure a Fixed Term Length in this field. This way the Customer\\\'s Membership Access is automatically revoked by optimizeMember at the appropriate time. This will be a numeric value, followed by a space, then a single letter.\\n\\nHere are some examples:\\n\\n1 D ( this means 1 Day )\\n1 W ( this means 1 Week )\\n1 M ( this means 1 Month )\\n1 Y ( this means 1 Year )\\n1 L ( this means 1 Lifetime )\'); return false;">[?]</a></p>' . "\n"; echo '<p id="ws-plugin--optimizemember-reg-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_reg_links", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_sp_buttons", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_sp_buttons", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="PayPal Specific Post/Page (Buy Now) Buttons">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-sp-buttons-section">' . "\n"; echo '<h3>Button Code Generator For Specific Post/Page Buttons</h3>' . "\n"; echo '<p>optimizeMember now supports an additional layer of functionality ( very powerful ), which allows you to sell access to specific Posts/Pages that you\'ve created in WordPress. Specific Post/Page Access works independently from Member Level Access. That is, you can sell an unlimited number of Posts/Pages using "Buy Now" Buttons, and your Customers will NOT be required to have a Membership Account with your site in order to receive access. If they are already a Member, that\'s fine, but they won\'t need to be.</p>' . "\n"; echo '<p>In other words, Customers will NOT need to login, just to receive access to the Specific Post/Page they purchased access to. optimizeMember will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link ( see: <code>optimizeMember -> PayPal Options -> Specific Post/Page Email</code> ). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n"; echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress. A Specific Post/Page that is protected by optimizeMember, might contain a download link for your eBook, access to file & music downloads, access to additional support services, and the list goes on and on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress Post/Page that you\'ve created. To protect Specific Posts/Pages, please see: <code>optimizeMember -> Restriction Options -> Specific Post/Page Access</code>. Once you\'ve configured your Specific Post/Page Restrictions, those Posts/Pages will be available in the menus below.</p>' . "\n"; echo '<p>Very simple. All you do is customize the form fields provided, for each Post/Page that you plan to sell. Then press (Generate Button Code). These special PayPal Buttons are customized to work with optimizeMember seamlessly. You can even Package Additional Posts/Pages together into one transaction.</p>' . "\n"; echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your WordPress Editor. If you lose your Button Code, you\'ll need to come back & re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_sp_buttons", get_defined_vars()); /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<th class="ws-menu-page-th-side">' . "\n"; echo '<label for="ws-plugin--optimizemember-sp-shortcode">' . "\n"; echo 'Button Code<br />Specific Posts/Pages:<br /><br />' . "\n"; echo '<div id="ws-plugin--optimizemember-sp-button-prev"></div>' . "\n"; echo '</label>' . "\n"; echo '</th>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-sp-leading-id">' . "\n"; echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n"; /**/ $ws_plugin__optimizemember_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts"); /**/ foreach ($ws_plugin__optimizemember_temp_a_singulars as $ws_plugin__optimizemember_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n"; echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n"; /**/ foreach ($ws_plugin__optimizemember_temp_a_singulars as $ws_plugin__optimizemember_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p>I want to charge: $<input type="text" autocomplete="off" id="ws-plugin--optimizemember-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--optimizemember-sp-hours" class="paypal-buttons-subscription-select">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-sp-hours.php"))) . '</select></p>' . "\n"; echo '<p>Description: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-sp-desc" class="paypal-buttons-description-input" value="Description and pricing details here." size="68" /></p>' . "\n"; echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal account. PayPal allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by optimizeMember; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" autocomplete="off" id="ws-plugin--optimizemember-sp-page-style" class="paypal-buttons-checkout-page-style-input" value="paypal" size="18" /> <select id="ws-plugin--optimizemember-sp-currency">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__optimizemember_paypalSpButtonGenerate();" class="button-primary" /></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td colspan="2">' . "\n"; echo '<form onsubmit="return false;">' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_sp_buttons_before_shortcode", get_defined_vars()); echo '<strong>WordPress Shortcode:</strong> ( recommended for both the WordPress Visual & HTML Editors )<br />' . "\n"; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-button-shortcode.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); echo '<input type="text" autocomplete="off" id="ws-plugin--optimizemember-sp-shortcode" value="' . format_to_edit($ws_plugin__optimizemember_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n"; /**/ echo '<div' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? ' style="display:none;"' : '') . '><br />' . "\n"; echo '<strong>Resulting PayPal Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n"; echo '<textarea id="ws-plugin--optimizemember-sp-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">'; $ws_plugin__optimizemember_temp_s = trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.php"))); $ws_plugin__optimizemember_temp_s = preg_replace("/%%endpoint%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%paypal_business%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%cancel_return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(home_url("/"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%notify_url%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_notify=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%return%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url("/?optimizemember_paypal_return=1"))), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%custom%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($_SERVER["HTTP_HOST"])), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%images%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"] . "/images")), $ws_plugin__optimizemember_temp_s); $ws_plugin__optimizemember_temp_s = preg_replace("/%%wpurl%%/", c_ws_plugin__optimizemember_utils_strings::esc_ds(esc_attr(site_url())), $ws_plugin__optimizemember_temp_s); echo format_to_edit($ws_plugin__optimizemember_temp_s); echo '</textarea><br />' . "\n"; echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n"; echo '</div>' . "\n"; /**/ echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_sp_buttons", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_sp_links", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_sp_links", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="PayPal Specific Post/Page Access Links">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-sp-links-section">' . "\n"; echo '<h3>Specific Post/Page Link Generator ( for Customer Service )</h3>' . "\n"; echo '<p>optimizeMember automatically generates Specific Post/Page Links for your Customers after checkout, and also sends them a link in a Confirmation Email. However, if you ever need to deal with a Customer Service issue that requires a new Specific Post/Page Link to be created manually, you can use this tool for that.</p>' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_sp_links", get_defined_vars()); /**/ echo '<table class="form-table">' . "\n"; echo '<tbody>' . "\n"; echo '<tr>' . "\n"; /**/ echo '<td>' . "\n"; echo '<form onsubmit="return false;">' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-sp-link-leading-id">' . "\n"; echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n"; /**/ $ws_plugin__optimizemember_temp_a_singulars = c_ws_plugin__optimizemember_utils_gets::get_all_singulars_with_sp("exclude-conflicts"); /**/ foreach ($ws_plugin__optimizemember_temp_a_singulars as $ws_plugin__optimizemember_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\\n\\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n"; echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n"; /**/ foreach ($ws_plugin__optimizemember_temp_a_singulars as $ws_plugin__optimizemember_temp_o) { echo '<option value="' . esc_attr($ws_plugin__optimizemember_temp_o->ID) . '">' . esc_html($ws_plugin__optimizemember_temp_o->post_title) . '</option>' . "\n"; } /**/ echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and optimizeMember generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* optimizeMember sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured optimizeMember for Specific Post/Page Access yet. See: optimizeMember -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n"; /**/ echo '<p><select id="ws-plugin--optimizemember-sp-link-hours">' . trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/options/paypal-sp-hours.php"))) . '</select> <input type="button" value="Generate Access Link" onclick="ws_plugin__optimizemember_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--optimizemember-sp-link-loading" src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n"; echo '<p id="ws-plugin--optimizemember-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n"; echo '</form>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_sp_links", get_defined_vars()); } /**/ if (apply_filters("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_display_shortcode_attrs", true, get_defined_vars())) { do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_before_shortcode_attrs", get_defined_vars()); /**/ echo '<div class="ws-menu-page-group" title="Shortcode Attributes ( Explained )">' . "\n"; /**/ echo '<div class="ws-menu-page-section ws-plugin--optimizemember-shortcode-attrs-section">' . "\n"; echo '<h3>Shortcode Attributes ( Explained In Full Detail )</h3>' . "\n"; echo '<p>When you generate a Button Code, optimizeMember will make a <a href="http://codex.wordpress.org/Shortcode_API#Overview" target="_blank" rel="external">Shortcode</a> available to you. Like most Shortcodes for WordPress, optimizeMember reads Attributes in your Shortcode. These Attributes will be pre-configured by one of optimizeMember\'s Button Generators automatically; so there really is nothing more you need to do. However, many site owners like to know exactly how these Shortcode Attributes work. Below, is a brief overview of each possible Shortcode Attribute.</p>' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_shortcode_attrs", get_defined_vars()); /**/ echo '<table class="form-table" style="margin-top:0;">' . "\n"; echo '<tbody>' . "\n"; echo '<tr style="padding-top:0;">' . "\n"; /**/ echo '<td style="padding-top:0;">' . "\n"; echo '<ul>' . "\n"; echo '<li><code>cancel="0"</code> Cancellation Button. Only valid w/ Membership Level Access. Possible values: <code>0</code> = this is NOT a Cancellation Button, <code>1</code> = this IS a Cancellation Button.</li>' . "\n"; echo '<li><code>cc="USD"</code> 3 character Currency Code. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo !is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site() ? '<li><code>ccaps="music,videos"</code> A comma-delimited list of Custom Capabilities. Only valid w/ Membership Level Access and/or Independent Custom Capabilities.</li>' . "\n" : ''; echo '<li><code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '"</code> must start with your domain. Additional values can be piped in ( ex: <code>custom="' . esc_html($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3|etc"</code> ). Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>desc="Gold Membership"</code> A brief purchase Description. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>dg="0"</code> The Digital Goods directive. optimizeMember will eventually be integrated with <a href="http://www.optimizepress.com/paypal-express-co-digitals" target="_blank" rel="external">Digital Goods</a> for inline Express Checkout. But for now, this should always be <code>0</code>.</li>' . "\n"; echo '<li><code>exp="72"</code> Access Expires ( in hours ). Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n"; echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n"; echo '<li><code>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default PayPal Button, <code>http://...</code> = location of your custom Image.</li>' . "\n"; echo '<li><code>lc=""</code> Optional 2 character Locale Code <em>( i.e. Country Code )</em>. This controls the interface language used at PayPal during checkout. If unspecified, the language is determined by PayPal when possible, defaulting to <code>US</code> <em>english</em> when not possible. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>level="1"</code> Membership Level [1-4] <em>( or, up to the number of configured Levels )</em>. Only valid for Buttons providing paid Membership Level Access.' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' Or, with Independent Custom Capabilities this MUST be set to <code>level="*"</code>, and <code>ccaps=""</code> must NOT be empty <em>( i.e. <code>level="*" ccaps="music,videos"</code> )</em>.') . '</li>' . "\n"; echo '<li><code>modify="0"</code> Modification directive. Only valid w/ Membership Level Access. Possible values: <code>0</code> = allows Customers to only create a new Subscription, <code>1</code> = allows Customers to modify their current Subscription or sign up for a new one, <code>2</code> = allows Customers to only modify their current Subscription.</li>' . "\n"; echo '<li><code>ns="1"</code> The <em>no_shipping</em> directive. Possible values: <code>0</code> = prompt for an address, but do not require one, <code>1</code> = do not prompt for a shipping address, <code>2</code> = prompt for an address, and require one. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>output="button"</code> Output Type. Possible values: <code>button</code> = PayPal Button w/hidden inputs, <code>anchor</code> = PayPal Button ( <a> 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 >= <code>0.01</code>. Not valid when <code>cancel="1"</code>.</li>' . "\n"; echo '<li><code>rp="1"</code> Regular Period. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Must be >= <code>1</code> ( ex: <code>1</code> Week, <code>2</code> Months, <code>1</code> Month, <code>3</code> Days ).</li>' . "\n"; echo '<li><code>rt="M"</code> Regular Term. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years, <code>L</code> = Lifetime.</li>' . "\n"; echo '<li><code>rr="1"</code> Recurring directive. Only valid w/ Membership Level Access' . (is_multisite() && c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' and/or Independent Custom Capabilities') . '. Possible values: <code>0</code> = non-recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>1</code> = recurring "Subscription" with possible Trial Period for free, or at a different Trial Amount; <code>BN</code> = non-recurring "Buy Now" functionality, no Trial Period possible.</li>' . "\n"; echo '<li><code>rrt=""</code> Recurring Times <em>( i.e. a fixed number of installments )</em>. Only valid w/ Membership Level Access. When unspecified, any recurring charges will remain ongoing until cancelled, or until payments start failing. If this is set to <code>1 or higher</code> the regular recurring charges will only continue for X billing cycles, depending on what you specify. This is only valid when <code>rr="1"</code> for recurring "Subscriptions". Please note that a fixed number of installments, also means a fixed period of access. If a Customer\'s billing is monthly, and you set <code>rrt="3"</code>, billing will continue for only 3 monthly installments. After that, billing would stop, and their access to the site would be revoked as well <em>( based on your EOT Behavior setting under: optimizeMember -> PayPal Options )</em>.</li>' . "\n"; echo '<li><code>rra="1"</code> Reattempt failed payments? Possible values: <code>0</code> = do NOT reattempt billing when/if a recurring payment fails; <code>1</code> = yes, DO reattempt billing when/if a recurring payment fails. With PayPal Standard integration, PayPal will retry a maximum of 2 times when you set <code>rra="1"</code>; after that, a Subscription would be terminated due to Max Failed Payments having been reached. PayPal Standard integration does NOT make it possible to configure Max Failed Payments, it simply defaults to a value of <code>2</code> whenever <code>rra="1"</code>, indicating that you DO want to retry failed payments.</li>' . "\n"; echo '<li><code>sp="0"</code> Specific Post/Page Button. Possible values: <code>0</code> = this is NOT a Specific Post/Page Access Button, <code>1</code> = this IS a Specific Post/Page Access Button.</li>' . "\n"; echo '<li><code>ta="0.00"</code> Trial Amount. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n"; echo '<li><code>tp="0"</code> Trial Period. Only valid w/ Membership Level Access. Must be <code>0</code> when <code>rt="L"</code> or when <code>rr="BN"</code>.</li>' . "\n"; echo '<li><code>tt="D"</code> Trial Term. Only valid w/ Membership Level Access. Possible values: <code>D</code> = Days, <code>W</code> = Weeks, <code>M</code> = Months, <code>Y</code> = Years.</li>' . "\n"; do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_during_shortcode_attrs_lis", get_defined_vars()); echo '</ul>' . "\n"; echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; echo '</div>' . "\n"; /**/ echo '</div>' . "\n"; /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_during_left_sections_after_shortcode_attrs", get_defined_vars()); } /**/ do_action("ws_plugin__optimizemember_during_paypal_buttons_page_after_left_sections", get_defined_vars()); /**/ echo '</td>' . "\n"; /**/ echo '<td class="ws-menu-page-table-r">' . "\n"; c_ws_plugin__optimizemember_menu_pages_rs::display(); echo '</td>' . "\n"; /**/ echo '</tr>' . "\n"; echo '</tbody>' . "\n"; echo '</table>' . "\n"; /**/ echo '</div>' . "\n"; echo '</div>' . "\n"; }