Version Description
- 2020-10-23 =
- BUG FIX: Fixed issue where the RECAPTCHA library wasn't being loaded early enough to validate at checkout.
- BUG FIX: Fixed issue where code in the Stripe class was unsetting some required fields, even if Stripe was not being used at checkout.
Download this release
Release Info
Developer | strangerstudios |
Plugin | Paid Memberships Pro |
Version | 2.5.2 |
Comparing to | |
See all releases |
Code changes from version 2.5.1 to 2.5.2
- CHANGELOG.txt +4 -0
- classes/gateways/class.pmprogateway_stripe.php +6 -1
- includes/init.php +1 -1
- includes/recaptcha.php +85 -83
- paid-memberships-pro.php +2 -2
- readme.txt +5 -1
CHANGELOG.txt
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
== Changelog ==
|
|
|
|
|
|
|
|
|
2 |
= 2.5.1 - 2020-10-16 =
|
3 |
* SECURITY: Fixed XSS vulnerability on the Members List page of the dashboard. (Thanks, Ron Masas from Checkmarx.com)
|
4 |
* ENHANCEMENT: Add Ukrainian Hryvnia currency. (Thanks, Mirco Babini)
|
1 |
== Changelog ==
|
2 |
+
= 2.5.2 - 2020-10-23 =
|
3 |
+
* BUG FIX: Fixed issue where the RECAPTCHA library wasn't being loaded early enough to validate at checkout.
|
4 |
+
* BUG FIX: Fixed issue where code in the Stripe class was unsetting some required fields, even if Stripe was not being used at checkout.
|
5 |
+
|
6 |
= 2.5.1 - 2020-10-16 =
|
7 |
* SECURITY: Fixed XSS vulnerability on the Members List page of the dashboard. (Thanks, Ron Masas from Checkmarx.com)
|
8 |
* ENHANCEMENT: Add Ukrainian Hryvnia currency. (Thanks, Mirco Babini)
|
classes/gateways/class.pmprogateway_stripe.php
CHANGED
@@ -142,7 +142,12 @@ class PMProGateway_stripe extends PMProGateway {
|
|
142 |
//old global RE showing billing address or not
|
143 |
global $pmpro_stripe_lite;
|
144 |
$pmpro_stripe_lite = apply_filters( "pmpro_stripe_lite", ! pmpro_getOption( "stripe_billingaddress" ) ); //default is oposite of the stripe_billingaddress setting
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
//updates cron
|
148 |
add_action( 'pmpro_cron_stripe_subscription_updates', array(
|
142 |
//old global RE showing billing address or not
|
143 |
global $pmpro_stripe_lite;
|
144 |
$pmpro_stripe_lite = apply_filters( "pmpro_stripe_lite", ! pmpro_getOption( "stripe_billingaddress" ) ); //default is oposite of the stripe_billingaddress setting
|
145 |
+
|
146 |
+
$gateway = pmpro_getGateway();
|
147 |
+
if($gateway == "stripe")
|
148 |
+
{
|
149 |
+
add_filter( 'pmpro_required_billing_fields', array( 'PMProGateway_stripe', 'pmpro_required_billing_fields' ) );
|
150 |
+
}
|
151 |
|
152 |
//updates cron
|
153 |
add_action( 'pmpro_cron_stripe_subscription_updates', array(
|
includes/init.php
CHANGED
@@ -98,7 +98,7 @@ function pmpro_wp()
|
|
98 |
}
|
99 |
}
|
100 |
}
|
101 |
-
add_action("wp", "pmpro_wp",
|
102 |
|
103 |
/*
|
104 |
Add PMPro page names to the BODY class.
|
98 |
}
|
99 |
}
|
100 |
}
|
101 |
+
add_action("wp", "pmpro_wp", 2);
|
102 |
|
103 |
/*
|
104 |
Add PMPro page names to the BODY class.
|
includes/recaptcha.php
CHANGED
@@ -28,91 +28,93 @@ function pmpro_init_recaptcha() {
|
|
28 |
|
29 |
require_once(PMPRO_DIR . '/includes/lib/recaptchalib.php' );
|
30 |
|
31 |
-
|
|
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
81 |
}
|
82 |
-
}
|
83 |
-
});
|
84 |
-
}
|
85 |
-
};
|
86 |
-
|
87 |
-
var pmpro_recaptcha_onloadCallback = function() {
|
88 |
-
// Render on main submit button.
|
89 |
-
grecaptcha.render('pmpro_btn-submit', {
|
90 |
-
'sitekey' : '<?php echo $pubkey;?>',
|
91 |
-
'callback' : pmpro_recaptcha_onSubmit
|
92 |
-
});
|
93 |
-
|
94 |
-
// Update other submit buttons.
|
95 |
-
var submit_buttons = jQuery('.pmpro_btn-submit-checkout');
|
96 |
-
submit_buttons.each(function() {
|
97 |
-
if(jQuery(this).attr('id') != 'pmpro_btn-submit') {
|
98 |
-
jQuery(this).click(function(event) {
|
99 |
-
event.preventDefault();
|
100 |
-
grecaptcha.execute();
|
101 |
});
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
//for templates using the old recaptcha_get_html
|
118 |
if( ! function_exists( 'recaptcha_get_html' ) ) {
|
@@ -125,7 +127,7 @@ function pmpro_init_recaptcha() {
|
|
125 |
$recaptcha_privatekey = pmpro_getOption( 'recaptcha_privatekey' );
|
126 |
}
|
127 |
}
|
128 |
-
add_action( 'wp', 'pmpro_init_recaptcha',
|
129 |
|
130 |
/**
|
131 |
* AJAX Method to Validate a ReCAPTCHA Response Token
|
28 |
|
29 |
require_once(PMPRO_DIR . '/includes/lib/recaptchalib.php' );
|
30 |
|
31 |
+
if ( ! function_exists( 'pmpro_recaptcha_get_html' ) ) {
|
32 |
+
function pmpro_recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) {
|
33 |
|
34 |
+
// Figure out language.
|
35 |
+
$locale = get_locale();
|
36 |
+
if(!empty($locale)) {
|
37 |
+
$parts = explode("_", $locale);
|
38 |
+
$lang = $parts[0];
|
39 |
+
} else {
|
40 |
+
$lang = "en";
|
41 |
+
}
|
42 |
+
$lang = apply_filters( 'pmpro_recaptcha_lang', $lang );
|
43 |
+
|
44 |
+
// Check which version of ReCAPTCHA we are using.
|
45 |
+
$recaptcha_version = pmpro_getOption( 'recaptcha_version' );
|
46 |
+
|
47 |
+
if( $recaptcha_version == '3_invisible' ) { ?>
|
48 |
+
<div class="g-recaptcha" data-sitekey="<?php echo $pubkey;?>" data-size="invisible" data-callback="onSubmit"></div>
|
49 |
+
<script type="text/javascript">
|
50 |
+
var pmpro_recaptcha_validated = false;
|
51 |
+
var pmpro_recaptcha_onSubmit = function(token) {
|
52 |
+
if ( pmpro_recaptcha_validated ) {
|
53 |
+
jQuery('#pmpro_form').submit();
|
54 |
+
return;
|
55 |
+
} else {
|
56 |
+
jQuery.ajax({
|
57 |
+
url: '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>',
|
58 |
+
type: 'GET',
|
59 |
+
timeout: 30000,
|
60 |
+
dataType: 'html',
|
61 |
+
data: {
|
62 |
+
'action': 'pmpro_validate_recaptcha',
|
63 |
+
'g-recaptcha-response': token,
|
64 |
+
},
|
65 |
+
error: function(xml){
|
66 |
+
alert('Error validating ReCAPTCHA.');
|
67 |
+
},
|
68 |
+
success: function(response){
|
69 |
+
if ( response == '1' ) {
|
70 |
+
pmpro_recaptcha_validated = true;
|
71 |
+
|
72 |
+
//get a new token to be submitted with the form
|
73 |
+
grecaptcha.execute();
|
74 |
+
} else {
|
75 |
+
pmpro_recaptcha_validated = false;
|
76 |
+
|
77 |
+
//warn user validation failed
|
78 |
+
alert( 'ReCAPTCHA validation failed. Try again.' );
|
79 |
+
|
80 |
+
//get a new token to be submitted with the form
|
81 |
+
grecaptcha.execute();
|
82 |
+
}
|
83 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
});
|
85 |
+
}
|
86 |
+
};
|
87 |
+
|
88 |
+
var pmpro_recaptcha_onloadCallback = function() {
|
89 |
+
// Render on main submit button.
|
90 |
+
grecaptcha.render('pmpro_btn-submit', {
|
91 |
+
'sitekey' : '<?php echo $pubkey;?>',
|
92 |
+
'callback' : pmpro_recaptcha_onSubmit
|
93 |
+
});
|
94 |
+
|
95 |
+
// Update other submit buttons.
|
96 |
+
var submit_buttons = jQuery('.pmpro_btn-submit-checkout');
|
97 |
+
submit_buttons.each(function() {
|
98 |
+
if(jQuery(this).attr('id') != 'pmpro_btn-submit') {
|
99 |
+
jQuery(this).click(function(event) {
|
100 |
+
event.preventDefault();
|
101 |
+
grecaptcha.execute();
|
102 |
+
});
|
103 |
+
}
|
104 |
+
});
|
105 |
+
};
|
106 |
+
</script>
|
107 |
+
<script type="text/javascript"
|
108 |
+
src="https://www.google.com/recaptcha/api.js?onload=pmpro_recaptcha_onloadCallback&hl=<?php echo $lang;?>&render=explicit" async defer>
|
109 |
+
</script>
|
110 |
+
<?php } else { ?>
|
111 |
+
<div class="g-recaptcha" data-sitekey="<?php echo $pubkey;?>"></div>
|
112 |
+
<script type="text/javascript"
|
113 |
+
src="https://www.google.com/recaptcha/api.js?hl=<?php echo $lang;?>">
|
114 |
+
</script>
|
115 |
+
<?php }
|
116 |
+
}
|
117 |
+
}
|
118 |
|
119 |
//for templates using the old recaptcha_get_html
|
120 |
if( ! function_exists( 'recaptcha_get_html' ) ) {
|
127 |
$recaptcha_privatekey = pmpro_getOption( 'recaptcha_privatekey' );
|
128 |
}
|
129 |
}
|
130 |
+
add_action( 'wp', 'pmpro_init_recaptcha', 1 );
|
131 |
|
132 |
/**
|
133 |
* AJAX Method to Validate a ReCAPTCHA Response Token
|
paid-memberships-pro.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Paid Memberships Pro
|
4 |
* Plugin URI: https://www.paidmembershipspro.com
|
5 |
* Description: The most complete member management and membership subscriptions plugin for WordPress.
|
6 |
-
* Version: 2.5.
|
7 |
* Author: Stranger Studios
|
8 |
* Author URI: https://www.strangerstudios.com
|
9 |
* Text Domain: paid-memberships-pro
|
@@ -16,7 +16,7 @@
|
|
16 |
*/
|
17 |
|
18 |
// version constant
|
19 |
-
define( 'PMPRO_VERSION', '2.5.
|
20 |
define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
|
21 |
define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
|
22 |
|
3 |
* Plugin Name: Paid Memberships Pro
|
4 |
* Plugin URI: https://www.paidmembershipspro.com
|
5 |
* Description: The most complete member management and membership subscriptions plugin for WordPress.
|
6 |
+
* Version: 2.5.2
|
7 |
* Author: Stranger Studios
|
8 |
* Author URI: https://www.strangerstudios.com
|
9 |
* Text Domain: paid-memberships-pro
|
16 |
*/
|
17 |
|
18 |
// version constant
|
19 |
+
define( 'PMPRO_VERSION', '2.5.2' );
|
20 |
define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
|
21 |
define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
|
22 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: strangerstudios, kimannwall, andrewza, dlparker1005, paidmembershi
|
|
3 |
Tags: memberships, members, subscriptions, ecommerce, user registration, member, membership, e-commerce, paypal, stripe, braintree, authorize.net, payflow, restrict access, restrict content, directory
|
4 |
Requires at least: 4
|
5 |
Tested up to: 5.5.3
|
6 |
-
Stable tag: 2.5.
|
7 |
|
8 |
Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
|
9 |
|
@@ -153,6 +153,10 @@ Not sure? You can find out by doing a bit a research.
|
|
153 |
9. Membership Account page, display all sections or show specific sections using shortcode attributes.
|
154 |
|
155 |
== Changelog ==
|
|
|
|
|
|
|
|
|
156 |
= 2.5.1 - 2020-10-16 =
|
157 |
* SECURITY: Fixed XSS vulnerability on the Members List page of the dashboard. (Thanks, Ron Masas from Checkmarx.com)
|
158 |
* ENHANCEMENT: Add Ukrainian Hryvnia currency. (Thanks, Mirco Babini)
|
3 |
Tags: memberships, members, subscriptions, ecommerce, user registration, member, membership, e-commerce, paypal, stripe, braintree, authorize.net, payflow, restrict access, restrict content, directory
|
4 |
Requires at least: 4
|
5 |
Tested up to: 5.5.3
|
6 |
+
Stable tag: 2.5.2
|
7 |
|
8 |
Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
|
9 |
|
153 |
9. Membership Account page, display all sections or show specific sections using shortcode attributes.
|
154 |
|
155 |
== Changelog ==
|
156 |
+
= 2.5.2 - 2020-10-23 =
|
157 |
+
* BUG FIX: Fixed issue where the RECAPTCHA library wasn't being loaded early enough to validate at checkout.
|
158 |
+
* BUG FIX: Fixed issue where code in the Stripe class was unsetting some required fields, even if Stripe was not being used at checkout.
|
159 |
+
|
160 |
= 2.5.1 - 2020-10-16 =
|
161 |
* SECURITY: Fixed XSS vulnerability on the Members List page of the dashboard. (Thanks, Ron Masas from Checkmarx.com)
|
162 |
* ENHANCEMENT: Add Ukrainian Hryvnia currency. (Thanks, Mirco Babini)
|