Source Code Documentation


pro\s2member-pro\includes\menu-pages\clickbank-ops.inc.php


  1. <?php
  2. /**
  3. * Menu page for s2Member Pro (ClickBank® Options page).
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * This WordPress® plugin (s2Member Pro) is comprised of two parts:
  10. *
  11. * o (1) Its PHP code is licensed under the GPL license, as is WordPress®.
  12. * You should have received a copy of the GNU General Public License,
  13. * along with this software. In the main directory, see: /licensing/
  14. * If not, see: {@link http://www.gnu.org/licenses/}.
  15. *
  16. * o (2) All other parts of (s2Member Pro); including, but not limited to:
  17. * the CSS code, some JavaScript code, images, and design;
  18. * are licensed according to the license purchased.
  19. * See: {@link http://www.s2member.com/prices/}
  20. *
  21. * Unless you have our prior written consent, you must NOT directly or indirectly license,
  22. * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module;
  23. * or make an offer to do any of these things. All of these things are strictly
  24. * prohibited with part (2) of the s2Member Pro Module.
  25. *
  26. * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com
  27. * (i.e. new features, bug fixes, updates, improvements); along with full access
  28. * to our video tutorial library: {@link http://www.s2member.com/videos/}
  29. *
  30. * @package s2Member\Menu_Pages
  31. * @since 1.5
  32. */
  33. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  34. exit ("Do not access this file directly.");
  35.  
  36. if (!class_exists ("c_ws_plugin__s2member_pro_menu_page_clickbank_ops"))
  37. {
  38. /**
  39. * Menu page for s2Member Pro (ClickBank® Options page).
  40. *
  41. * @package s2Member\Menu_Pages
  42. * @since 110531
  43. */
  44. class c_ws_plugin__s2member_pro_menu_page_clickbank_ops
  45. {
  46. public function __construct ()
  47. {
  48. echo '<div class="wrap ws-menu-page">' . "\n";
  49.  
  50. echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
  51. echo '<h2>s2Member® Pro / ClickBank® Options</h2>' . "\n";
  52.  
  53. echo '<table class="ws-menu-page-table">' . "\n";
  54. echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
  55. echo '<tr class="ws-menu-page-table-tr">' . "\n";
  56. echo '<td class="ws-menu-page-table-l">' . "\n";
  57.  
  58. echo '<form method="post" name="ws_plugin__s2member_pro_options_form" id="ws-plugin--s2member-pro-options-form">' . "\n";
  59. echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-options-save")) . '" />' . "\n";
  60.  
  61. echo '<div class="ws-menu-page-group" title="ClickBank® Account Details">' . "\n";
  62.  
  63. echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-clickbank-account-details-section">' . "\n";
  64. echo '<h3>ClickBank® Account Details (required)</h3>' . "\n";
  65. echo '<p><a href="http://www.s2member.com/clickbank" target="_blank" rel="external">ClickBank®</a> is a secure online retail outlet for more than 70,000 digital product vendors and 110,000 active affiliate marketers. ClickBank® makes a sale somewhere in the world every three seconds, safely processing more than 27,000 digital transactions a day. They serve more than 200 countries, and are consistently ranked as one of the most highly-trafficked sites on the web.</p>' . "\n";
  66. echo '<p>s2Member has been integrated with ClickBank® for Direct Payments and also for Recurring Billing. In order to take advantage of this integration, you will need to have a ClickBank® Merchant Account. Once you have an account, all of the details below can be generated from inside of your ClickBank® Merchant account. If you need assistance, please check their <a href="http://www.s2member.com/clickbank-help" target="_blank" rel="external">help section</a>.</p>' . "\n";
  67.  
  68. echo '<table class="form-table">' . "\n";
  69. echo '<tbody>' . "\n";
  70. echo '<tr>' . "\n";
  71.  
  72. echo '<th>' . "\n";
  73. echo '<label for="ws-plugin--s2member-pro-clickbank-username">' . "\n";
  74. echo 'ClickBank® Account Username:' . "\n";
  75. echo '</label>' . "\n";
  76. echo '</th>' . "\n";
  77.  
  78. echo '</tr>' . "\n";
  79. echo '<tr>' . "\n";
  80.  
  81. echo '<td>' . "\n";
  82. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_pro_clickbank_username" id="ws-plugin--s2member-pro-clickbank-username" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_username"]) . '" /><br />' . "\n";
  83. echo 'This is provided by ClickBank®. Check your ClickBank® account for this information.' . "\n";
  84. echo '</td>' . "\n";
  85.  
  86. echo '</tr>' . "\n";
  87. echo '<tr>' . "\n";
  88.  
  89. echo '<th>' . "\n";
  90. echo '<label for="ws-plugin--s2member-pro-clickbank-clerk-key">' . "\n";
  91. echo 'ClickBank® Clerk/API Key (Read Access):' . "\n";
  92. echo '</label>' . "\n";
  93. echo '</th>' . "\n";
  94.  
  95. echo '</tr>' . "\n";
  96. echo '<tr>' . "\n";
  97.  
  98. echo '<td>' . "\n";
  99. echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_pro_clickbank_clerk_key" id="ws-plugin--s2member-pro-clickbank-clerk-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_clerk_key"]) . '" /><br />' . "\n";
  100. echo 'This can be generated at ClickBank®. s2Member needs a Clerk Key with "Read Access".' . "\n";
  101. echo '</td>' . "\n";
  102.  
  103. echo '</tr>' . "\n";
  104. echo '<tr>' . "\n";
  105.  
  106. echo '<th>' . "\n";
  107. echo '<label for="ws-plugin--s2member-pro-clickbank-developer-key">' . "\n";
  108. echo 'ClickBank® Developer/API Key:' . "\n";
  109. echo '</label>' . "\n";
  110. echo '</th>' . "\n";
  111.  
  112. echo '</tr>' . "\n";
  113. echo '<tr>' . "\n";
  114.  
  115. echo '<td>' . "\n";
  116. echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_pro_clickbank_developer_key" id="ws-plugin--s2member-pro-clickbank-developer-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_developer_key"]) . '" /><br />' . "\n";
  117. echo 'This can be generated at ClickBank®. Check your ClickBank® account for this Key.' . "\n";
  118. echo '</td>' . "\n";
  119.  
  120. echo '</tr>' . "\n";
  121.  
  122. if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
  123. {
  124. echo '<tr>' . "\n";
  125.  
  126. echo '<th>' . "\n";
  127. echo '<label for="ws-plugin--s2member-gateway-debug-logs">' . "\n";
  128. echo 'Enable Logging Routines?<br />' . "\n";
  129. echo '<small><em class="ws-menu-page-hilite">* This setting applies universally. [ <a href="#" onclick="alert(\'This configuration option may ALSO appear under (s2Member -› PayPal® Options). Feel free to configure it here; but please remember that this setting is applied universally (i.e. SHARED) among all Payment Gateways integrated with s2Member.\'); return false;">?</a> ]</em></small>' . "\n";
  130. echo '</label>' . "\n";
  131. echo '</th>' . "\n";
  132.  
  133. echo '</tr>' . "\n";
  134. echo '<tr>' . "\n";
  135.  
  136. echo '<td>' . "\n";
  137. echo '<input type="radio" name="ws_plugin__s2member_gateway_debug_logs" id="ws-plugin--s2member-gateway-debug-logs-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-gateway-debug-logs-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_gateway_debug_logs" id="ws-plugin--s2member-gateway-debug-logs-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-gateway-debug-logs-1">Yes, enable debugging, with API, IPN &amp; Return Page logging.</label><br />' . "\n";
  138. echo '<em>This enables API, IPN and Return Page logging. The log files are stored here: <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) . '</code></em><br />' . "\n";
  139. echo '<em class="ws-menu-page-hilite">If you have any trouble, please review your s2Member® log files for problems. See: <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")).'">Log Viewer</a></em>'."\n";
  140. echo '</td>' . "\n";
  141.  
  142. echo '</tr>' . "\n";
  143. echo '<tr>'."\n";
  144.  
  145. echo '<td>'."\n";
  146. echo '<div class="ws-menu-page-hilite" style="border-radius:3px; padding:5px;">'."\n";
  147. echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during payment processing. See: <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")).'">Log Files (Debug)</a>.</span></p>'."\n";
  148. echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>'."\n";
  149. echo '</div>'."\n";
  150. echo '</td>'."\n";
  151.  
  152. echo '</tr>'."\n";
  153. }
  154.  
  155. echo '</tbody>' . "\n";
  156. echo '</table>' . "\n";
  157. echo '</div>' . "\n";
  158.  
  159. echo '</div>' . "\n";
  160.  
  161. echo '<div class="ws-menu-page-group" title="ClickBank® IPN v2.1 Integration">' . "\n";
  162.  
  163. echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-clickbank-ipn-section">' . "\n";
  164. echo '<h3>ClickBank® IPN v2.1 / Instant Payment Notifications (required)</h3>' . "\n";
  165. echo '<p>Log into your ClickBank® account and navigate to this section:<br /><code>Account Settings -› My Site -› Advanced Tools</code></p>' . "\n";
  166. echo '<p>Edit your IPN settings &amp; generate a Secret Key.</strong></p>' . "\n";
  167. echo '<p>You\'ll need your IPN v2.1 URL, which is:<br /><code>' . esc_html (site_url ("/?s2member_pro_clickbank_notify=1")) . '</code></p>' . "\n";
  168. echo '<p>Then provide s2Member with your Secret Key in the field below.</strong></p>' . "\n";
  169.  
  170. echo '<table class="form-table">' . "\n";
  171. echo '<tbody>' . "\n";
  172.  
  173. echo '<tr>' . "\n";
  174.  
  175. echo '<th>' . "\n";
  176. echo '<label for="ws-plugin--s2member-pro-clickbank-secret-key">' . "\n";
  177. echo 'ClickBank® IPN/Secret Key:' . "\n";
  178. echo '</label>' . "\n";
  179. echo '</th>' . "\n";
  180.  
  181. echo '</tr>' . "\n";
  182. echo '<tr>' . "\n";
  183.  
  184. echo '<td>' . "\n";
  185. echo '<input type="password" autocomplete="off" name="ws_plugin__s2member_pro_clickbank_secret_key" id="ws-plugin--s2member-pro-clickbank-secret-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_secret_key"]) . '" /><br />' . "\n";
  186. echo 'The Secret Key for IPN service that is configured in your ClickBank® account.' . "\n";
  187. echo '</td>' . "\n";
  188.  
  189. echo '</tr>' . "\n";
  190.  
  191. echo '</tbody>' . "\n";
  192. echo '</table>' . "\n";
  193. echo '</div>' . "\n";
  194.  
  195. echo '</div>' . "\n";
  196.  
  197. echo '<div class="ws-menu-page-group" title="ClickBank® Thank-You Page">' . "\n";
  198.  
  199. echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-clickbank-ipn-section">' . "\n";
  200. echo '<h3>ClickBank® Thank-You Page Integration (required)</h3>' . "\n";
  201. echo '<p>Whenever you create <strong>Products</strong> at ClickBank®, you\'ll be asked to supply a Thank-You Page. This is where a Customer lands after they complete checkout. s2Member handles this dynamically, so you can use the same Thank-You Page for all of your ClickBank® Products. As long as you follow the instructions provided under: <em>s2Member -› ClickBank® Buttons</em>, s2Member will be able to handle Thank-You Page and IPN (Instant Payment Notifications) for you automatically. The integration from ClickBank® -› s2Member is seamless.</p>' . "\n";
  202. echo '<p>You\'ll need the URL for your <a href="' . esc_attr (site_url ("/?s2member_pro_clickbank_return&s2member_paypal_return=1&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">Thank-You Page</a>, which is:<br /><code>' . esc_html (site_url ("/?s2member_pro_clickbank_return=1")) . '</code></p>' . "\n";
  203.  
  204. echo '<div class="ws-menu-page-hr"></div>' . "\n";
  205.  
  206. echo '<h3>Thank-You Page Template (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-pro-clickbank-return-page-template\').toggle(); return false;" class="ws-dotted-link">optional customizations</a>)</h3>' . "\n";
  207. echo '<div id="ws-plugin--s2member-pro-clickbank-return-page-template" style="display:none;">' . "\n";
  208. echo '<p>With s2Member Pro installed, you have the ability to customize your <a href="' . esc_attr (site_url ("/?s2member_pro_clickbank_return&s2member_paypal_return=1&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">Thank-You Page Template</a>. Each of your Customers are returned back to your site immediately after they complete checkout at ClickBank®. Your Thank-You Page displays a message and instructions for the Customer. s2Member may change the message and instructions dynamically, based on what the Customer is actually doing <em>(i.e. based on the type of transaction that is taking place)</em>. So, although we do NOT recommend that you attempt to change the message and instructions presented dynamically by s2Member, you CAN certainly control the Header, and/or the overall appearance of s2Member\'s Thank-You Page Template.</p>' . "\n";
  209. echo '<p>The quickest/easiest way, is to simply add some HTML code in the box below. For instance, you might include an &lt;img&gt; tag with your logo. The box below, allows you to customize the Header section <em>(i.e. the top)</em> of s2Member\'s default Thank-You Page Template. Everything else, including the textual response and other important details that each Customer needs to know about, are already handled dynamically by s2Member <em>(based on the type of transaction that is taking place)</em>. All you need to do is customize the Header with your logo and anything else you feel is important. Although this Header customization is completely optional, we recommend an <a href="http://www.w3schools.com/tags/tag_img.asp" target="_blank" rel="external">&lt;img&gt; tag</a>, with a logo that is around 300px wide. After you "Save All Changes" below, you may <a href="' . esc_attr (site_url ("/?s2member_pro_clickbank_return&s2member_paypal_return=1&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">click this link to see what your Header looks like</a>.</p>' . "\n";
  210.  
  211. echo '<table class="form-table">' . "\n";
  212. echo '<tbody>' . "\n";
  213. echo '<tr>' . "\n";
  214.  
  215. echo '<th>' . "\n";
  216. echo '<label for="ws-plugin--s2member-pro-clickbank-return-template-header">' . "\n";
  217. echo 'Thank-You Page Template Header:' . "\n";
  218. echo '</label>' . "\n";
  219. echo '</th>' . "\n";
  220.  
  221. echo '</tr>' . "\n";
  222. echo '<tr>' . "\n";
  223.  
  224. echo '<td>' . "\n";
  225. echo '<textarea name="ws_plugin__s2member_pro_clickbank_return_template_header" id="ws-plugin--s2member-pro-clickbank-return-template-header" rows="5" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_return_template_header"]) . '</textarea><br />' . "\n";
  226. echo 'Any valid XHTML / JavaScript' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? '' : ' (or even PHP)') . ' code will work just fine here.' . "\n";
  227. echo '</td>' . "\n";
  228.  
  229. echo '</tr>' . "\n";
  230. echo '</tbody>' . "\n";
  231. echo '</table>' . "\n";
  232.  
  233. echo '<div class="ws-menu-page-hr"></div>' . "\n";
  234.  
  235. if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
  236. echo '<p>It is also possible to build your own Thank-You Page Template, if you prefer. If you feel the need to create your own Thank-You Page Template, please make a copy of s2Member\'s default template: <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir"] . "/includes/templates/returns/default-template.php")) . '</code>. Place your copy of this default template, inside your active WordPress® theme directory, and name the file: <code>/clickbank-return.php</code>. s2Member will automatically find your Thank-You Page Template in this location, and s2Member will use your template, instead of the default. Further details are provided inside s2Member\'s default template file. Once your custom template file is in place, you may <a href="' . esc_attr (site_url ("/?s2member_pro_clickbank_return&s2member_paypal_return=1&s2member_paypal_proxy=clickbank&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">click this link to see what it looks like</a>.</p>' . "\n";
  237.  
  238. echo '<p>It is also possible to bypass s2Member\'s Thank-You Page all together, if you prefer. You can take s2Member\'s Thank-You Page URL <em>(shown above)</em>, and add <code>&s2member_pro_clickbank_return_success=http://...</code> where the value can be set to a custom Thank-You Page URL that you prefer. In other words, if you use the <code>&s2member_pro_clickbank_return_success=http://...</code> parameter in your Thank-You Page URL, the initial redirection back to s2Member\'s default handler MUST still occur. However, instead of s2Member displaying its Thank-You Page Template to the Customer, s2Member will silently redirect the Customer to the URL that you specified in the <code>&s2member_pro_clickbank_return_success=http://...</code> parameter, allowing you to take complete control over what happens next. Click for an [ <a href="#" onclick="alert(\'Basic Example (please remember to URL encode the value):\\n' . esc_attr (site_url ("/?s2member_pro_clickbank_return=1&s2member_pro_clickbank_return_success=" . site_url ("/thank-you/"))) . '\\n\\nProper Example (with the URL having been encoded properly):\\n' . esc_attr (site_url ("/?s2member_pro_clickbank_return=1&s2member_pro_clickbank_return_success=" . rawurlencode (site_url ("/thank-you/")))) . '\\n\\n* For help on URL encoding, please see:\\nhttp://www.w3schools.com/tags/ref_urlencode.asp\'); return false;">example</a> ].</p>' . "\n";
  239. echo '</div>' . "\n";
  240.  
  241. echo '</div>' . "\n";
  242.  
  243. echo '</div>' . "\n";
  244.  
  245. echo '<div class="ws-menu-page-group" title="Signup Confirmation Email (Standard)">' . "\n";
  246.  
  247. echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-confirmation-email-section">' . "\n";
  248. echo '<h3>Signup Confirmation Email (required, but the default works fine)</h3>' . "\n";
  249. echo '<p>This email is sent to new Customers after they return from a successful signup at ClickBank®. The <strong>primary</strong> purpose of this email, is to provide the Customer with instructions, along with a link to register a Username for their Membership. You may also customize this further, by providing details that are specifically geared to your site.</p>' . "\n";
  250.  
  251. echo '<p><em class="ws-menu-page-hilite">* This email configuration is universally applied to all Payment Gateway integrations. [ <a href="#" onclick="alert(\'This configuration panel may ALSO appear under (s2Member -› PayPal® Options). Feel free to configure this email here; but please remember that this configuration is applied universally (i.e. SHARED) among all Payment Gateways integrated with s2Member.\'); return false;">?</a> ]</em></p>' . "\n";
  252.  
  253. echo '<table class="form-table">' . "\n";
  254. echo '<tbody>' . "\n";
  255. echo '<tr>' . "\n";
  256.  
  257. echo '<th>' . "\n";
  258. echo '<label for="ws-plugin--s2member-signup-email-recipients">' . "\n";
  259. echo 'Signup Confirmation Recipients:' . "\n";
  260. echo '</label>' . "\n";
  261. echo '</th>' . "\n";
  262.  
  263. echo '</tr>' . "\n";
  264. echo '<tr>' . "\n";
  265.  
  266. echo '<td>' . "\n";
  267. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_signup_email_recipients" id="ws-plugin--s2member-signup-email-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_email_recipients"]) . '" /><br />' . "\n";
  268. echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
  269. echo '<code>"%%full_name%%" &lt;%%payer_email%%&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
  270. echo '</td>' . "\n";
  271.  
  272. echo '</tr>' . "\n";
  273. echo '<tr>' . "\n";
  274.  
  275. echo '<th>' . "\n";
  276. echo '<label for="ws-plugin--s2member-signup-email-subject">' . "\n";
  277. echo 'Signup Confirmation Email Subject:' . "\n";
  278. echo '</label>' . "\n";
  279. echo '</th>' . "\n";
  280.  
  281. echo '</tr>' . "\n";
  282. echo '<tr>' . "\n";
  283.  
  284. echo '<td>' . "\n";
  285. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_signup_email_subject" id="ws-plugin--s2member-signup-email-subject" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_email_subject"]) . '" /><br />' . "\n";
  286. echo 'Subject Line used in the email sent to a Customer after a successful signup has occurred through ClickBank®.' . "\n";
  287. echo '</td>' . "\n";
  288.  
  289. echo '</tr>' . "\n";
  290. echo '<tr>' . "\n";
  291.  
  292. echo '<th>' . "\n";
  293. echo '<label for="ws-plugin--s2member-signup-email-message">' . "\n";
  294. echo 'Signup Confirmation Email Message:' . "\n";
  295. echo '</label>' . "\n";
  296. echo '</th>' . "\n";
  297.  
  298. echo '</tr>' . "\n";
  299. echo '<tr>' . "\n";
  300.  
  301. echo '<td>' . "\n";
  302. echo '<textarea name="ws_plugin__s2member_signup_email_message" id="ws-plugin--s2member-signup-email-message" rows="10">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_email_message"]) . '</textarea><br />' . "\n";
  303. echo 'Message Body used in the email sent to a Customer after a successful signup has occurred through ClickBank®.<br /><br />' . "\n";
  304. echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
  305. echo '<ul>' . "\n";
  306. echo '<li><code>%%registration_url%%</code> = The full URL (generated by s2Member) where the Customer can get registered.</li>' . "\n";
  307. echo '<li><code>%%subscr_id%%</code> = A unique Transaction/Subscription ID (which is sometimes generated by s2Member). [ <a href="#" onclick="alert(\'If you are selling Lifetime or Fixed-Term (non-recurring) access, using Buy Now functionality with ClickBank®; the %%subscr_id%% is actually set to the (ClickBank-generated) Receipt # for the purchase, as opposed to an (s2Member-generated) Subscription ID.\\n\\nJust in case you\\\'re wondering, the reason s2Member generates a unique Subscription ID, is because the Receipt # ClickBank® generates is NOT dynamic enough to handle everything s2Member makes possible. ClickBank® Receipts (by themselves) do NOT allow site owners to track multiple payments with a common Subscription ID. So s2Member makes up for this minor deficiency.\\n\\nFor instance, with Recurring ClickBank® Products, s2Member\\\'s %%subscr_id%% will remain constant throughout all future payments; making things easier to keep track of (on the back-end management side of things).\'); return false;">?</a> ]</li>' . "\n";
  308. echo '<li><code>%%initial%%</code> = The Initial Fee charged during signup. If you offered a 100% Free Trial, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent, whenever they initially signed up, no matter what. If a Customer signs up, under the terms of a 100% Free Trial Period, this will be 0.\'); return false;">?</a> ]</li>' . "\n";
  309. 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";
  310. echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
  311. echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
  312. echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
  313. echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased the Membership Subscription.</li>' . "\n";
  314. echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
  315. echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
  316. echo '<li><code>%%item_number%%</code> = The Item Number (colon separated <code><em>level:custom_capabilities:fixed term</em></code>) that the Subscription is for. [ <a href="#" onclick="alert(\'* To Avoid Confusion *\\nThis is NOT the ClickBank® Product Item #. Instead, this is s2Member\\\'s Item #, which equates to colon separated (level:custom_capabilities:fixed term).\'); return false;">?</a> ]</li>' . "\n";
  317. 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";
  318. 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";
  319. echo '<li><code>%%initial_cycle%%</code> = This is the <code>%%initial_term%%</code> from above, converted to a cycle representation of: <code><em>X days/weeks/months/years</em></code>.</li>' . "\n";
  320. 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";
  321. echo '<li><code>%%regular_cycle%%</code> = This is the <code>%%regular_term%%</code> from above, converted to a cycle representation of: <code><em>[every] X days/weeks/months/years — OR daily, weekly, bi-weekly, monthly, bi-monthly, quarterly, yearly, or lifetime</em></code>. This is a very useful Replacment Code. Its value is dynamic; depending on term length, recurring status, and period/term lengths configured.</li>' . "\n";
  322. echo '<li><code>%%recurring/regular_cycle%%</code> = Example (<code>14.95 / Monthly</code>), or ... (<code>0 / non-recurring</code>); depending on the value of <code>%%recurring%%</code>.</li>' . "\n";
  323. echo '</ul>' . "\n";
  324.  
  325. echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
  326. echo '<ul>' . "\n";
  327. echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
  328. 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";
  329. echo '</ul>' . "\n";
  330. echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
  331. echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
  332. echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
  333.  
  334. echo (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ?
  335. '<div class="ws-menu-page-hr"></div>' . "\n".
  336. '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags — optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$paypal</code> variable is the most important one. It contains all of the <code>$_POST</code> variables received from ClickBank\'s IPN service, which are then translated into a format that s2Member\'s Core PayPal® Processor can understand (e.g. <code>$paypal["item_number"]</code>, <code>$paypal["item_name"]</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>'."\n"
  337. : '';
  338. echo '</td>' . "\n";
  339.  
  340. echo '</tr>' . "\n";
  341. echo '</tbody>' . "\n";
  342. echo '</table>' . "\n";
  343. echo '</div>' . "\n";
  344.  
  345. echo '</div>' . "\n";
  346.  
  347. echo '<div class="ws-menu-page-group" title="Specific Post/Page Confirmation Email (Standard)">' . "\n";
  348.  
  349. echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-confirmation-email-section">' . "\n";
  350. echo '<h3>Specific Post/Page Confirmation Email (required, but the default works fine)</h3>' . "\n";
  351. echo '<p>This email is sent to new Customers after they return from a successful purchase at ClickBank®, for Specific Post/Page Access. (see: <code>s2Member -› Restriction Options -› Specific Post/Page Access</code>). This is NOT used for Membership sales, only for Specific Post/Page Access. The <strong>primary</strong> purpose of this email, is to provide the Customer with instructions, along with a link to access the Specific Post/Page they\'ve purchased access to. If you\'ve created a Specific Post/Page Package (with multiple Posts/Pages bundled together into one transaction), this ONE link (<code>%%sp_access_url%%</code>) will automatically authenticate them for access to ALL of the Posts/Pages included in their transaction. You may customize this email further, by providing details that are specifically geared to your site.</p>' . "\n";
  352.  
  353. echo '<p><em class="ws-menu-page-hilite">* This email configuration is universally applied to all Payment Gateway integrations. [ <a href="#" onclick="alert(\'This configuration panel may ALSO appear under (s2Member -› PayPal® Options). Feel free to configure this email here; but please remember that this configuration is applied universally (i.e. SHARED) among all Payment Gateways integrated with s2Member.\'); return false;">?</a> ]</em></p>' . "\n";
  354.  
  355. echo '<table class="form-table">' . "\n";
  356. echo '<tbody>' . "\n";
  357. echo '<tr>' . "\n";
  358.  
  359. echo '<th>' . "\n";
  360. echo '<label for="ws-plugin--s2member-sp-email-recipients">' . "\n";
  361. echo 'Specific Post/Page Confirmation Recipients:' . "\n";
  362. echo '</label>' . "\n";
  363. echo '</th>' . "\n";
  364.  
  365. echo '</tr>' . "\n";
  366. echo '<tr>' . "\n";
  367.  
  368. echo '<td>' . "\n";
  369. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_sp_email_recipients" id="ws-plugin--s2member-sp-email-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_recipients"]) . '" /><br />' . "\n";
  370. echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
  371. echo '<code>"%%full_name%%" &lt;%%payer_email%%&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
  372. echo '</td>' . "\n";
  373.  
  374. echo '</tr>' . "\n";
  375. echo '<tr>' . "\n";
  376.  
  377. echo '<th>' . "\n";
  378. echo '<label for="ws-plugin--s2member-sp-email-subject">' . "\n";
  379. echo 'Specific Post/Page Confirmation Email Subject:' . "\n";
  380. echo '</label>' . "\n";
  381. echo '</th>' . "\n";
  382.  
  383. echo '</tr>' . "\n";
  384. echo '<tr>' . "\n";
  385.  
  386. echo '<td>' . "\n";
  387. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_sp_email_subject" id="ws-plugin--s2member-sp-email-subject" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_subject"]) . '" /><br />' . "\n";
  388. echo 'Subject Line used in the email sent to a Customer after a successful purchase has occurred through ClickBank®, for Specific Post/Page Access.' . "\n";
  389. echo '</td>' . "\n";
  390.  
  391. echo '</tr>' . "\n";
  392. echo '<tr>' . "\n";
  393.  
  394. echo '<th>' . "\n";
  395. echo '<label for="ws-plugin--s2member-sp-email-message">' . "\n";
  396. echo 'Specific Post/Page Confirmation Email Message:' . "\n";
  397. echo '</label>' . "\n";
  398. echo '</th>' . "\n";
  399.  
  400. echo '</tr>' . "\n";
  401. echo '<tr>' . "\n";
  402.  
  403. echo '<td>' . "\n";
  404. echo '<textarea name="ws_plugin__s2member_sp_email_message" id="ws-plugin--s2member-sp-email-message" rows="10">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_message"]) . '</textarea><br />' . "\n";
  405. echo 'Message Body used in the email sent to a Customer after a successful purchase has occurred through ClickBank®, for Specific Post/Page Access.<br /><br />' . "\n";
  406. echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
  407. echo '<ul>' . "\n";
  408. echo '<li><code>%%sp_access_url%%</code> = The full URL (generated by s2Member) where the Customer can gain access.</li>' . "\n";
  409. 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";
  410. echo '<li><code>%%txn_id%%</code> = A unique Transaction ID for this purchase ( i.e. a ClickBank® Receipt # ). [ <a href="#" onclick="alert(\'This is always the Receipt # generated by ClickBank®.\'); return false;">?</a> ]</li>' . "\n";
  411. echo '<li><code>%%amount%%</code> = The full Amount that you charged for Specific Post/Page Access. This value will <code>always be > 0</code>.</li>' . "\n";
  412. echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
  413. echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
  414. echo '<li><code>%%full_name%%</code> = The Full Name (First &amp; Last) of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
  415. echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased Specific Post/Page Access.</li>' . "\n";
  416. echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
  417. 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>). [ <a href="#" onclick="alert(\'* To Avoid Confusion *\\nThis is NOT the ClickBank® Product Item #. Instead, this is s2Member\\\'s Item #, which equates to colon separated (sp:comma-delimited IDs:expiration hours).\'); return false;">?</a> ]</li>' . "\n";
  418. 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";
  419. echo '</ul>' . "\n";
  420.  
  421. echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
  422. echo '<ul>' . "\n";
  423. echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
  424. 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";
  425. echo '</ul>' . "\n";
  426. echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
  427. echo '<em>(The campaign (i.e. christmas-promo) could be referenced using <code>%%cv1%%</code>)</em><br />' . "\n";
  428. echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
  429.  
  430. echo (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ?
  431. '<div class="ws-menu-page-hr"></div>' . "\n".
  432. '<p style="margin:0;"><strong>PHP Code:</strong> It is also possible to use PHP tags — optional (for developers). If you use PHP tags, please run a test email with <code>&lt;?php print_r(get_defined_vars()); ?&gt;</code>. This will give you a full list of all PHP variables available to you in this email. The <code>$paypal</code> variable is the most important one. It contains all of the <code>$_POST</code> variables received from ClickBank\'s IPN service, which are then translated into a format that s2Member\'s Core PayPal® Processor can understand (e.g. <code>$paypal["item_number"]</code>, <code>$paypal["item_name"]</code>, etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you\'ve included. Also, please remember that emails are sent in plain text format.</p>'."\n"
  433. : '';
  434. echo '</td>' . "\n";
  435.  
  436. echo '</tr>' . "\n";
  437. echo '</tbody>' . "\n";
  438. echo '</table>' . "\n";
  439. echo '</div>' . "\n";
  440.  
  441. echo '</div>' . "\n";
  442.  
  443. echo '<div class="ws-menu-page-group" title="Automatic EOT Behavior">' . "\n";
  444.  
  445. echo '<div class="ws-menu-page-section ws-plugin--s2member-eot-behavior-section">' . "\n";
  446. echo '<h3>ClickBank® EOT Behavior (required, please choose)</h3>' . "\n";
  447. echo '<p>EOT = End Of Term. By default, s2Member will demote a paid Member to a Free Subscriber whenever their Subscription term has ended (i.e. expired), been cancelled, refunded, charged back to you, etc. s2Member demotes them to a Free Subscriber, so they will no longer have Member Level Access to your site. However, in some cases, you may prefer to have Customer accounts deleted completely, instead of just being demoted. This is where you choose which method works best for your site. If you don\'t want s2Member to take ANY action at all, you can disable s2Member\'s EOT System temporarily, or even completely. There are also a few other configurable options here, so please read carefully. These options are all very important.</p>' . "\n";
  448. echo '<p>The ClickBank® IPN service will notify s2Member whenever a refund or chargeback occurs. For example, if you issue a refund to an unhappy Customer through ClickBank®, s2Member will eventually be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically (based on your configuration). ~ Otherwise, under normal circumstances, s2Member will not process an EOT until the User has completely used up the time they paid for.</em></p>' . "\n";
  449.  
  450. echo '<p id="ws-plugin--s2member-auto-eot-system-enabled-via-cron"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? '' : ' style="display:none;"') . '>If you\'d like to run s2Member\'s Auto-EOT System through a more traditional Cron Job; instead of through <code>WP-Cron</code>, you will need to configure a Cron Job through your server control panel; provided by your hosting company. Set the Cron Job to run <code>once about every 10 minutes to an hour</code>. You\'ll want to configure an HTTP Cron Job that loads this URL:<br /><code>' . esc_html (site_url ("/?s2member_auto_eot_system_via_cron=1")) . '</code></p>' . "\n";
  451.  
  452. echo '<p><em class="ws-menu-page-hilite">* These options are universally applied to all Payment Gateway integrations. [ <a href="#" onclick="alert(\'These settings may ALSO appear under (s2Member -› PayPal® Options). Feel free to configure them here; but please remember that these configuration options are applied universally (i.e. they\\\'re SHARED) among all Payment Gateways integrated with s2Member.\'); return false;">?</a> ]</em></p>' . "\n";
  453.  
  454. echo '<table class="form-table">' . "\n";
  455. echo '<tbody>' . "\n";
  456. echo '<tr>' . "\n";
  457.  
  458. echo '<th>' . "\n";
  459. echo '<label for="ws-plugin--s2member-auto-eot-system-enabled">' . "\n";
  460. echo 'Enable s2Member\'s Auto-EOT System?' . "\n";
  461. echo '</label>' . "\n";
  462. echo '</th>' . "\n";
  463.  
  464. echo '</tr>' . "\n";
  465. echo '<tr>' . "\n";
  466.  
  467. echo '<td>' . "\n";
  468. echo '<select name="ws_plugin__s2member_auto_eot_system_enabled" id="ws-plugin--s2member-auto-eot-system-enabled">' . "\n";
  469. // Very advanced conditionals here. If the Auto-EOT System is NOT running, or NOT fully configured, this will indicate that no option is set - as sort of a built-in acknowledgment/warning in the UI panel.
  470. echo (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) || ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (function_exists ("wp_cron") && wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) || (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] && (function_exists ("wp_cron") && wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule")))) ? '<option value=""></option>' . "\n" : '';
  471. echo '<option value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1 && function_exists ("wp_cron") && wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule")) ? ' selected="selected"' : '') . '>Yes (enable the Auto-EOT System through WP-Cron)</option>' . "\n";
  472. echo (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? '<option value="2"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? ' selected="selected"' : '') . '>Yes (but, I\'ll run it with my own Cron Job)</option>' . "\n" : '';
  473. echo '<option value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? ' selected="selected"' : '') . '>No (disable the Auto-EOT System)</option>' . "\n";
  474. echo '</select><br />' . "\n";
  475. echo 'Recommended setting: (<code>Yes / enable via WP-Cron</code>)' . "\n";
  476. echo '</td>' . "\n";
  477.  
  478. echo '</tr>' . "\n";
  479. echo '<tr>' . "\n";
  480.  
  481. echo '<th>' . "\n";
  482. echo '<label for="ws-plugin--s2member-membership-eot-behavior">' . "\n";
  483. echo 'Membership EOT Behavior (Demote or Delete)?' . "\n";
  484. echo '</label>' . "\n";
  485. echo '</th>' . "\n";
  486.  
  487. echo '</tr>' . "\n";
  488. echo '<tr>' . "\n";
  489.  
  490. echo '<td>' . "\n";
  491. echo '<select name="ws_plugin__s2member_membership_eot_behavior" id="ws-plugin--s2member-membership-eot-behavior">' . "\n";
  492. echo '<option value="demote"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "demote") ? ' selected="selected"' : '') . '>Demote (convert them to a Free Subscriber)</option>' . "\n";
  493. echo '<option value="delete"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "delete") ? ' selected="selected"' : '') . '>Delete (erase their account completely)</option>' . "\n";
  494. echo '</select>' . "\n";
  495. echo '</td>' . "\n";
  496.  
  497. echo '</tr>' . "\n";
  498. echo '<tr>'."\n";
  499.  
  500. echo '<th>'."\n";
  501. echo '<label for="ws-plugin--s2member-eots-remove-ccaps">'."\n";
  502. echo 'Membership EOTs also Remove all Custom Capabilities?'."\n";
  503. echo '</label>'."\n";
  504. echo '</th>'."\n";
  505.  
  506. echo '</tr>'."\n";
  507. echo '<tr>'."\n";
  508.  
  509. echo '<td>'."\n";
  510. echo '<select name="ws_plugin__s2member_eots_remove_ccaps" id="ws-plugin--s2member-eots-remove-ccaps">'."\n";
  511. echo '<option value="1"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eots_remove_ccaps"]) ? ' selected="selected"' : '').'>Yes (an EOT also results in the loss of any Custom Capabilities a User/Member may have)</option>'."\n";
  512. echo '<option value="0"'.((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eots_remove_ccaps"]) ? ' selected="selected"' : '').'>No (an EOT has no impact on any Custom Capabilities a User/Member may have)</option>'."\n";
  513. echo '</select><br />'."\n";
  514. echo '<em>NOTE: If Refunds/Reversals trigger an Immediate EOT (see setting below); Custom Capabilities will always be removed when/if a Refund or Reversal occurs. In other words, this setting is ignored for Refunds/Reversals (IF they trigger an Immediate EOT — based on your configuration below). If you prefer to review all Refunds/Reversals for yourself, please choose that option below.</em>'."\n";
  515. echo '</td>'."\n";
  516.  
  517. echo '</tr>'."\n";
  518. echo '<tr>'."\n";
  519.  
  520. echo '<th>'."\n";
  521. echo '<label for="ws-plugin--s2member-eot-grace-time">'."\n";
  522. echo 'EOT Grace Time (in seconds):'."\n";
  523. echo '</label>'."\n";
  524. echo '</th>'."\n";
  525.  
  526. echo '</tr>'."\n";
  527. echo '<tr>'."\n";
  528.  
  529. echo '<td>'."\n";
  530. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_eot_grace_time" id="ws-plugin--s2member-eot-grace-time" value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_grace_time"]).'" /><br />'."\n";
  531. echo '<em>This is represented in seconds. For example, a value of: <code>86400</code> = 1 day. Your EOT Grace Time; is the amount of time you will offer as a grace period (if any). Most site owners will give customers an additional 24 hours of access; just to help avoid any negativity that may result from a customer losing access sooner than they might expect. You can disable EOT Grace Time by setting this to: <code>0</code>. Note: there is NO Grace Time applied when/if a Refund or Reversal occurs. If Refunds/Reversals trigger an Immediate EOT (see setting below); there is never any Grace Time applied in that scenario.</em>'."\n";
  532. echo '</td>'."\n";
  533.  
  534. echo '</tr>'."\n";
  535. echo '<tr>' . "\n";
  536.  
  537. echo '<th>' . "\n";
  538. echo '<label for="ws-plugin--s2member-triggers-immediate-eot">' . "\n";
  539. echo 'Refunds/Reversals (trigger Immediate EOT)?' . "\n";
  540. echo '</label>' . "\n";
  541. echo '</th>' . "\n";
  542.  
  543. echo '</tr>' . "\n";
  544. echo '<tr>' . "\n";
  545.  
  546. echo '<td>' . "\n";
  547. echo '<select name="ws_plugin__s2member_triggers_immediate_eot" id="ws-plugin--s2member-triggers-immediate-eot">' . "\n";
  548. echo '<option value="none"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "none") ? ' selected="selected"' : '') . '>Neither (I\'ll review these two events manually)</option>' . "\n";
  549. echo '<option value="refunds"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "refunds") ? ' selected="selected"' : '') . '>Refunds (refunds ALWAYS trigger an Immediate EOT action)</option>' . "\n";
  550. echo '<option value="reversals"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "reversals") ? ' selected="selected"' : '') . '>Reversals (chargebacks ALWAYS trigger an Immediate EOT action)</option>' . "\n";
  551. echo '<option value="refunds,reversals"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["triggers_immediate_eot"] === "refunds,reversals") ? ' selected="selected"' : '') . '>Refunds/Reversals (ALWAYS trigger an Immediate EOT action)</option>' . "\n";
  552. echo '</select><br />' . "\n";
  553. echo '<em>This setting will <a href="#" onclick="alert(\'A Refund/Reversal Notification will ALWAYS be processed internally by s2Member, even if no action is taken by s2Member. This way you\\\'ll have the full ability to listen for these two events on your own; if you prefer (optional). For more information, check your Dashboard under: `s2Member -› API Notifications -› Refunds/Reversals`.\'); return false;">NOT impact</a> s2Member\'s internal API Notifications for Refund/Reversal events.</em>'."\n";
  554. echo '</td>' . "\n";
  555.  
  556. echo '</tr>' . "\n";
  557. echo '<tr>' . "\n";
  558.  
  559. echo '<th>' . "\n";
  560. echo '<label for="ws-plugin--s2member-eot-time-ext-behavior">' . "\n";
  561. echo 'Fixed-Term Extensions (Auto-Extend)?' . "\n";
  562. echo '</label>' . "\n";
  563. echo '</th>' . "\n";
  564.  
  565. echo '</tr>' . "\n";
  566. echo '<tr>' . "\n";
  567.  
  568. echo '<td>' . "\n";
  569. echo '<select name="ws_plugin__s2member_eot_time_ext_behavior" id="ws-plugin--s2member-eot-time-ext-behavior">' . "\n";
  570. echo '<option value="extend"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_time_ext_behavior"] === "extend") ? ' selected="selected"' : '') . '>Yes (default, automatically extend any existing EOT Time)</option>' . "\n";
  571. echo '<option value="reset"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_time_ext_behavior"] === "reset") ? ' selected="selected"' : '') . '>No (do NOT extend; s2Member should reset EOT Time completely)</option>' . "\n";
  572. echo '</select><br />' . "\n";
  573. echo '<em>This setting will only affect Buy Now transactions for fixed-term lengths. By default, s2Member will automatically extend any existing EOT Time that a Customer may have. For example, if I buy one year of access, and then I buy another year of access (before my first year is totally used up); I end up with everything I paid you for (now over 1 year of access) if this is set to <code>Yes</code>. If this was set to <code>No</code>, the EOT Time would be reset when I make the second purchase; leaving me with only 1 year of access, starting the date of my second purchase.</em>'."\n";
  574. echo '</td>' . "\n";
  575.  
  576. echo '</tr>' . "\n";
  577. echo '</tbody>' . "\n";
  578. echo '</table>' . "\n";
  579. echo '</div>' . "\n";
  580.  
  581. echo '</div>' . "\n";
  582.  
  583. echo '<div class="ws-menu-page-hr"></div>' . "\n";
  584.  
  585. echo '<p class="submit"><input type="submit" class="button-primary" value="Save All Changes" /></p>' . "\n";
  586.  
  587. echo '</form>' . "\n";
  588.  
  589. echo '</td>' . "\n";
  590.  
  591. echo '<td class="ws-menu-page-table-r">' . "\n";
  592. c_ws_plugin__s2member_menu_pages_rs::display ();
  593. echo '</td>' . "\n";
  594.  
  595. echo '</tr>' . "\n";
  596. echo '</tbody>' . "\n";
  597. echo '</table>' . "\n";
  598.  
  599. echo '</div>' . "\n";
  600. }
  601. }
  602. }
  603.  
  604. new c_ws_plugin__s2member_pro_menu_page_clickbank_ops ();
  605. ?>

pro\s2member-pro\includes\menu-pages\clickbank-ops.inc.php

Source Code Documentation