Paid Memberships Pro - Version 1.8.6.4

Version Description

  • BUG: Now adding a specific user agent to IPN requests to PayPal (and other gateways) to avoid 403 errors.
  • ENHANCEMENT: Added a constant PMPRO_USER_AGENT used in all outside HTTP requests. The user agent will look like "Paid Memberships Pro v1.8.6.4;http://yourdomain.com".
Download this release

Release Info

Developer strangerstudios
Plugin Icon 128x128 Paid Memberships Pro
Version 1.8.6.4
Comparing to
See all releases

Code changes from version 1.8.6.3 to 1.8.6.4

classes/gateways/class.pmprogateway.php CHANGED
@@ -216,5 +216,4 @@
216
//this looks different for each gateway, but generally an array of some sort
217
return array();
218
}
219
- }
220
- ?>
216
//this looks different for each gateway, but generally an array of some sort
217
return array();
218
}
219
+ }
classes/gateways/class.pmprogateway_authorizenet.php CHANGED
@@ -332,6 +332,7 @@
332
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
333
curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
334
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
335
$post_response = curl_exec($request); // execute curl post and store results in $post_response
336
// additional options may be required depending upon your server configuration
337
// you can find documentation on curl options at http://www.php.net/curl_setopt
@@ -1029,6 +1030,7 @@
1029
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
1030
curl_setopt($ch, CURLOPT_POST, 1);
1031
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
1032
$response = curl_exec($ch);
1033
return $response;
1034
}
332
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
333
curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
334
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
335
+ curl_setopt($request, CURLOPT_USERAGENT, PMPRO_USER_AGENT); // setting the user agent
336
$post_response = curl_exec($request); // execute curl post and store results in $post_response
337
// additional options may be required depending upon your server configuration
338
// you can find documentation on curl options at http://www.php.net/curl_setopt
1030
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
1031
curl_setopt($ch, CURLOPT_POST, 1);
1032
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
1033
+ curl_setopt($ch, CURLOPT_USERAGENT, PMPRO_USER_AGENT); //set user agent
1034
$response = curl_exec($ch);
1035
return $response;
1036
}
classes/gateways/class.pmprogateway_payflowpro.php CHANGED
@@ -594,6 +594,8 @@
594
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
595
curl_setopt($ch, CURLOPT_POST, 1);
596
597
// NVPRequest for submitting to server
598
$nvpreq = "TRXTYPE=" . $methodName_ . "&TENDER=C&PARTNER=" . $PARTNER . "&VENDOR=" . $VENDOR . "&USER=" . $USER . "&PWD=" . $PWD . "&VERBOSITY=medium" . "&BUTTONSOURCE=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
599
594
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
595
curl_setopt($ch, CURLOPT_POST, 1);
596
597
+ curl_setopt($ch, CURLOPT_USERAGENT, PMPRO_USER_AGENT); //set user agent
598
+
599
// NVPRequest for submitting to server
600
$nvpreq = "TRXTYPE=" . $methodName_ . "&TENDER=C&PARTNER=" . $PARTNER . "&VENDOR=" . $VENDOR . "&USER=" . $USER . "&PWD=" . $PWD . "&VERBOSITY=medium" . "&BUTTONSOURCE=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
601
classes/gateways/class.pmprogateway_paypal.php CHANGED
@@ -643,6 +643,8 @@
643
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
644
curl_setopt($ch, CURLOPT_POST, 1);
645
646
// NVPRequest for submitting to server
647
$nvpreq = "METHOD=" . urlencode($methodName_) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . "&BUTTONSOURCE=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
648
643
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
644
curl_setopt($ch, CURLOPT_POST, 1);
645
646
+ curl_setopt($ch, CURLOPT_USERAGENT, PMPRO_USER_AGENT); //set user agent
647
+
648
// NVPRequest for submitting to server
649
$nvpreq = "METHOD=" . urlencode($methodName_) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . "&BUTTONSOURCE=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
650
classes/gateways/class.pmprogateway_paypalexpress.php CHANGED
@@ -854,6 +854,8 @@
854
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
855
curl_setopt($ch, CURLOPT_POST, 1);
856
857
// NVPRequest for submitting to server
858
$nvpreq = "METHOD=" . urlencode($methodName_) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . "&BUTTONSOURCE=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
859
854
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
855
curl_setopt($ch, CURLOPT_POST, 1);
856
857
+ curl_setopt($ch, CURLOPT_USERAGENT, PMPRO_USER_AGENT); //set user agent
858
+
859
// NVPRequest for submitting to server
860
$nvpreq = "METHOD=" . urlencode($methodName_) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . "&BUTTONSOURCE=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
861
classes/gateways/class.pmprogateway_paypalstandard.php CHANGED
@@ -504,6 +504,8 @@
504
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
505
curl_setopt($ch, CURLOPT_POST, 1);
506
507
// NVPRequest for submitting to server
508
$nvpreq = "METHOD=" . urlencode($methodName_) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . "&bn=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
509
504
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
505
curl_setopt($ch, CURLOPT_POST, 1);
506
507
+ curl_setopt($ch, CURLOPT_USERAGENT, PMPRO_USER_AGENT); //set user agent
508
+
509
// NVPRequest for submitting to server
510
$nvpreq = "METHOD=" . urlencode($methodName_) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . "&bn=" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;
511
paid-memberships-pro.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Paid Memberships Pro
4
Plugin URI: http://www.paidmembershipspro.com
5
Description: Plugin to Handle Memberships
6
- Version: 1.8.6.3
7
Author: Stranger Studios
8
Author URI: http://www.strangerstudios.com
9
*/
@@ -13,7 +13,8 @@ Author URI: http://www.strangerstudios.com
13
*/
14
15
//version constant
16
- define("PMPRO_VERSION", "1.8.6.3");
17
18
//if the session has been started yet, start it (ignore if running from command line)
19
if(defined('STDIN') )
3
Plugin Name: Paid Memberships Pro
4
Plugin URI: http://www.paidmembershipspro.com
5
Description: Plugin to Handle Memberships
6
+ Version: 1.8.6.4
7
Author: Stranger Studios
8
Author URI: http://www.strangerstudios.com
9
*/
13
*/
14
15
//version constant
16
+ define("PMPRO_VERSION", "1.8.6.4");
17
+ define("PMPRO_USER_AGENT", "Paid Memberships Pro v" . PMPRO_VERSION . "; " . site_url());
18
19
//if the session has been started yet, start it (ignore if running from command line)
20
if(defined('STDIN') )
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: strangerstudios
3
Tags: memberships, membership, authorize.net, ecommerce, paypal, stripe, braintree, restrict access, restrict content, directory site, payflow
4
Requires at least: 3.5
5
Tested up to: 4.3.1
6
- Stable tag: 1.8.6.3
7
8
A revenue-generating machine for membership sites. Unlimited levels with recurring payment, protected content and member management.
9
@@ -115,6 +115,10 @@ Not sure? You can find out by doing a bit a research.
115
[View All Screenshots](http://www.paidmembershipspro.com/features/screenshots/)
116
117
== Changelog ==
118
= 1.8.6.3 =
119
* SECURITY: No longer showing email addresses in output when cron jobs are processed by non-admins. (Thanks, Daniel Bachhuber)
120
* BUG: Better handling of errors when validating PayPal IPN requests. Added pmpro_ipn_validate filter. PayPal users should read the release notes here: http://www.paidmembershipspro.com/2015/10/pmpro-update-1-8-6-3/
3
Tags: memberships, membership, authorize.net, ecommerce, paypal, stripe, braintree, restrict access, restrict content, directory site, payflow
4
Requires at least: 3.5
5
Tested up to: 4.3.1
6
+ Stable tag: 1.8.6.4
7
8
A revenue-generating machine for membership sites. Unlimited levels with recurring payment, protected content and member management.
9
115
[View All Screenshots](http://www.paidmembershipspro.com/features/screenshots/)
116
117
== Changelog ==
118
+ = 1.8.6.4 =
119
+ * BUG: Now adding a specific user agent to IPN requests to PayPal (and other gateways) to avoid 403 errors.
120
+ * ENHANCEMENT: Added a constant PMPRO_USER_AGENT used in all outside HTTP requests. The user agent will look like "Paid Memberships Pro v1.8.6.4;http://yourdomain.com".
121
+
122
= 1.8.6.3 =
123
* SECURITY: No longer showing email addresses in output when cron jobs are processed by non-admins. (Thanks, Daniel Bachhuber)
124
* BUG: Better handling of errors when validating PayPal IPN requests. Added pmpro_ipn_validate filter. PayPal users should read the release notes here: http://www.paidmembershipspro.com/2015/10/pmpro-update-1-8-6-3/
services/ipnhandler.php CHANGED
@@ -368,9 +368,9 @@
368
//post back to PayPal system to validate
369
$gateway_environment = pmpro_getOption("gateway_environment");
370
if($gateway_environment == "sandbox")
371
- $fp = wp_remote_post('https://www.' . $gateway_environment . '.paypal.com?' . $req, array("httpversion"=>"1.1", "Host"=>"www.paypal.com", "Connection"=>"Close"));
372
else
373
- $fp = wp_remote_post('https://www.paypal.com?' . $req, array("httpversion"=>"1.1", "Host"=>"www.paypal.com", "Connection"=>"Close"));
374
375
//log post vars
376
ipnlog(print_r($_POST, true));
368
//post back to PayPal system to validate
369
$gateway_environment = pmpro_getOption("gateway_environment");
370
if($gateway_environment == "sandbox")
371
+ $fp = wp_remote_post('https://www.' . $gateway_environment . '.paypal.com?' . $req, array("httpversion"=>"1.1", "Host"=>"www.paypal.com", "Connection"=>"Close", "user-agent"=>PMPRO_USER_AGENT));
372
else
373
+ $fp = wp_remote_post('https://www.paypal.com?' . $req, array("httpversion"=>"1.1", "Host"=>"www.paypal.com", "Connection"=>"Close", "user-agent"=>PMPRO_USER_AGENT));
374
375
//log post vars
376
ipnlog(print_r($_POST, true));