* (s2Member Pro) **Bug fix**. Some site owners running s2Member Pro, on server configurations with PHP-based output compression enabled, were causing problems with the `success=""` Shortcode Attribute for s2Member Pro Forms. s2Member Pro has been improved in this regard *( i.e. s2Member Pro now makes better attempts to clear output buffers before returning plain text data with it's handlers )*. In addition, calls to `trim()` have also been implemented as an additional line of defense against errors reported in the previous release; which were related to URLs with leading white space, returned by s2Member's core PayPal® IPN processor.
Statistics: Posted by Jason Caldwell — August 29th, 2011, 7:29 pm
Statistics: Posted by svillee — August 28th, 2011, 4:05 pm
svillee wrote:
I did some debugging/tracing of my own, and I think I found the problem. In plugins/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php at line 668, we have this:
- Code:
$ipn["s2member_paypal_proxy_return_url"] = c_ws_plugin__s2member_utils_urls::remote (site_url ("/?s2member_paypal_notify=1" . $ipn_q), $ipn, array ("timeout" => 20));
I verified that after this call, $ipn["s2member_paypal_proxy_return_url"] has the correct url (my success attribute), but with three CR/LF pairs (i.e., "\r\n\r\n\r\n") prepended to it. I don't know exactly where these CR/LF pairs are coming from. But then in line 672 we have this:
- Code:
if ($post_vars["attr"]["success"] && substr ($ipn["s2member_paypal_proxy_return_url"], 0, 2) === substr ($post_vars["attr"]["success"], 0, 2) /* In case the IPN routine returns something weird. */
The substr check is failing, because of the prepended CR/LF pairs. Thus, it ignores the redirect entirely.
For now, I have added a trim() call to line 668, so it now looks like this:
- Code:
$ipn["s2member_paypal_proxy_return_url"] = trim(c_ws_plugin__s2member_utils_urls::remote (site_url ("/?s2member_paypal_notify=1" . $ipn_q), $ipn, array ("timeout" => 20)));
It's working fine with this change.
Statistics: Posted by Jason Caldwell — August 27th, 2011, 1:25 pm
$ipn["s2member_paypal_proxy_return_url"] = c_ws_plugin__s2member_utils_urls::remote (site_url ("/?s2member_paypal_notify=1" . $ipn_q), $ipn, array ("timeout" => 20));
if ($post_vars["attr"]["success"] && substr ($ipn["s2member_paypal_proxy_return_url"], 0, 2) === substr ($post_vars["attr"]["success"], 0, 2) /* In case the IPN routine returns something weird. */
$ipn["s2member_paypal_proxy_return_url"] = trim(c_ws_plugin__s2member_utils_urls::remote (site_url ("/?s2member_paypal_notify=1" . $ipn_q), $ipn, array ("timeout" => 20)));
Statistics: Posted by svillee — August 26th, 2011, 2:31 pm
Statistics: Posted by plymplan — August 26th, 2011, 9:03 am
[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="$9.00 USD / Monthly - 1 Free Credit Every 30 Days" ps="paypal" cc="USD" ns="1" custom="www.mydomain.com" ta="0" tp="0" tt="D" ra="9.00" rp="1" rt="M" rr="1" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" success="http://www.mydomain.com/membership-signup/gha-member-success/" /]
Statistics: Posted by svillee — August 24th, 2011, 9:03 am
Statistics: Posted by Jason Caldwell — August 23rd, 2011, 8:24 pm
exit (((!empty ($paypal["s2member_paypal_proxy_return_url"])) ? $paypal["s2member_paypal_proxy_return_url"] : ""));
Statistics: Posted by svillee — August 23rd, 2011, 4:03 pm
# COMPRESSION FOR SPEED
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/plain
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/rdf+xml application/rss+xml application/atom+xml image/svg+xml
AddOutputFilterByType DEFLATE font/truetype application/x-font-ttf font/opentype application/x-font-otf
</IfModule>
Statistics: Posted by Jason Caldwell — August 20th, 2011, 2:22 pm
WordPress v3.2.1 :: s2Member v110815 :: s2Member Pro v110815
Memory 8.84 MB :: Real Memory 9.25 MB :: Peak Memory 9.00 MB :: Real Peak Memory 9.25 MB
www.mydomain.com/?s2member_paypal_notify=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=pro-emails,subscr-signup-as-subscr-payment&s2member_paypal_proxy_verification=[REDACTED]&s2member_paypal_proxy_return
_url=https%3A%2F%2Fwww.mydomain.com%2Fthankyou
User-Agent: WordPress/3.2.1; http://www.mydomain.com
array (
'txn_type' => 'subscr_signup',
'subscr_id' => '[REDACTED]',
'custom' => 'www.mydomain.com',
'txn_id' => '[REDACTED]',
'period1' => '0 D',
'period3' => '1 M',
'mc_amount1' => '0.00',
'mc_amount3' => '4.95',
'mc_gross' => '4.95',
'mc_currency' => 'USD',
'tax' => '0.00',
'recurring' => '4.95',
'payer_email' => '[REDACTED]',
'first_name' => '[REDACTED]',
'last_name' => '[REDACTED]',
'option_name1' => 'Referencing Customer ID',
'option_selection1' => '[REDACTED]',
'option_name2' => 'Customer IP Address',
'option_selection2' => '[REDACTED]',
'item_name' => '$4.95/month',
'item_number' => '1:my_custom_capability',
'proxy_verified' => 'paypal',
's2member_log' =>
array (
0 => 'IPN received on: Thu Aug 18, 2011 10:00:25 pm UTC',
1 => 's2Member POST vars verified with a Proxy Key',
2 => 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
3 => 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ).',
4 => 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ) w/ update vars.',
5 => 's2Member Level/Capabilities updated w/ advanced update routines.',
6 => 'Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.',
7 => 'Subscr. Return ( `modification=1` ), a Proxy Return URL is ready.',
8 => 'User exists. Handling `payment` for Subscription via ( `subscr-signup-as-subscr-payment` ).',
9 => 'Payment Notification URLs have been processed.',
10 => 'Storing IPN signup vars now. These are associated with a User\'s account record; for future reference.',
),
'subscr_gateway' => 'paypal',
'eotper' => NULL,
'ccaps' => 'my_custom_capability',
'level' => '1',
'ip' => '[REDACTED]',
'initial_term' => '0 D',
'initial' => '4.95',
'regular' => '4.95',
'regular_term' => '1 M',
's2member_paypal_proxy_return_url' => 'https://www.mydomain.com/thankyou',
's2member_paypal_proxy' => 'paypal',
's2member_paypal_proxy_use' => 'pro-emails,subscr-signup-as-subscr-payment',
's2member_paypal_proxy_verification' => '[REDACTED]',
)
[s2Member-Pro-PayPal-Form modify="1" level="1" ccaps="my_custom_capability" desc="$4.95/month" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.mydomain.com" ta="0" tp="0" tt="D" ra="4.95" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" success="https://www.mydomain.com/thankyou" /]
Statistics: Posted by kynatro — August 18th, 2011, 9:18 pm