I created a hack to set the s2member_auto_EOT_time to a fixed date and added it to /wp-content/mu-plugins/s2-hacks.php. It worked fine initially (a week or two ago). However, it’s no longer working. Seems like it’s no longer being triggered and EOT is now being set according to the time the member registers/updates their account. Here is the function in s2-hacks:
add_action('ws_plugin__s2member_pro_before_sc_paypal_form', 's2_hacks_eot_by_date'); function s2_hacks_eot_by_date($vars = array()) { if(isset($vars["attr"]["years"]) && $_GET['s2p-option']!="" && $_GET['s2member_paypal_xco']=="s2member_pro_paypal_checkout_return" && $_GET['token']!="" && $_GET['PayerID']!="") { $years = $vars["attr"]["years"]; global $current_user; $user = new WP_User($current_user->ID); $expire_half = strtotime ("2016-06-30"); $expire_one = strtotime ("2017-06-30"); $expire_two = strtotime ("2018-06-30"); if($years == '2') {update_user_option($user->ID, 's2member_auto_eot_time', $expire_two);} elseif($years == 'half') {update_user_option($user->ID, 's2member_auto_eot_time', $expire_half);} else {update_user_option($user->ID, 's2member_auto_eot_time', $expire_one);} unset($vars["attr"]["years"]); } return; }
Here is an example of the kind of form members use to register/update:
[s2If current_user_is(s2member_level5)] [s2Member-Pro-PayPal-Form modify="1" ps="paypal" lc="" cc="USD" dg="0" ns="0" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" success="/renewal-success/"] [s2Member-Pro-PayPal-Form level="5" ccaps="" desc="Professional Membership - $75 USD / 1 Year" custom="" ta="0" tp="0" tt="D" ra="75" rp="1" rt="Y" rr="0" rrt="" rra="2" years="1"] [s2Member-Pro-PayPal-Form level="5" ccaps="" desc="Professional Membership - $90 USD / 1 Year (with website link)" custom="" ta="0" tp="0" tt="D" ra="90" rp="1" rt="Y" rr="0" rrt="" rra="2" years="1"] [/s2Member-Pro-PayPal-Form] [/s2If]
Any advice is appreciated - I’m really stumped!