Paid Memberships Pro - Version 2.2.4

Version Description

  • 2019-12-20 =
  • BUG FIX: Fixed issue with the update billing page when using the Stripe gateway.
Download this release

Release Info

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

Code changes from version 2.2.2 to 2.2.4

CHANGELOG.txt CHANGED
@@ -1,4 +1,13 @@
1
  == Changelog ==
 
 
 
 
 
 
 
 
 
2
  = 2.2.2 - 2019-11-29 =
3
  * BUG FIX: Fixed issue with member search.
4
  * BUG FIX: Fixed issue with custom columns in the members list. (Thanks, Tim Sparks)
1
  == Changelog ==
2
+ = 2.2.4 - 2019-12-20 =
3
+ * BUG FIX: Fixed issue with the update billing page when using the Stripe gateway.
4
+
5
+ = 2.2.3 - 2019-12-09 =
6
+ * BUG FIX: Fixed issue where Stripe checkout failed for free levels that had their price adjusted through the donations or variable pricing add ons.
7
+ * BUG FIX: Fixed undeclared variables warnings in the members list.
8
+ * BUG FIX: Fixed the edit user links in the email sent to admins when cancelations have errors.
9
+ * REFACTOR: Removed some unused code from the members list class.
10
+
11
  = 2.2.2 - 2019-11-29 =
12
  * BUG FIX: Fixed issue with member search.
13
  * BUG FIX: Fixed issue with custom columns in the members list. (Thanks, Tim Sparks)
classes/class-pmpro-members-list-table.php CHANGED
@@ -197,20 +197,6 @@ class PMPro_Members_List_Table extends WP_List_Table {
197
  );
198
  }
199
 
200
- /**
201
- * Return number of visible columns
202
- *
203
- * @since 2.2.0
204
- *
205
- * @access public
206
- * @return int
207
- */
208
- public function get_column_count() {
209
- list ( $columns, $hidden ) = $this->get_column_info();
210
- $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
211
- return count( $columns ) - count( $hidden );
212
- }
213
-
214
  /**
215
  * Allows you to sort the data by the variables set in the $_GET
216
  *
@@ -252,6 +238,15 @@ class PMPro_Members_List_Table extends WP_List_Table {
252
  * @return void
253
  */
254
  public function no_items() {
 
 
 
 
 
 
 
 
 
255
  ?>
256
  <p>
257
  <?php _e( 'No members found.', 'paid-memberships-pro' ); ?>
@@ -594,6 +589,11 @@ class PMPro_Members_List_Table extends WP_List_Table {
594
  }
595
 
596
  public function get_some_actions() {
 
 
 
 
 
597
  ?>
598
  <ul class="subsubsub">
599
  <li>
197
  );
198
  }
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  /**
201
  * Allows you to sort the data by the variables set in the $_GET
202
  *
238
  * @return void
239
  */
240
  public function no_items() {
241
+ if ( isset( $_REQUEST['l'] ) ) {
242
+ $l = sanitize_text_field( $_REQUEST['l'] );
243
+ } else {
244
+ $l = false;
245
+ }
246
+ if(isset($_REQUEST['s']))
247
+ $s = sanitize_text_field(trim($_REQUEST['s']));
248
+ else
249
+ $s = "";
250
  ?>
251
  <p>
252
  <?php _e( 'No members found.', 'paid-memberships-pro' ); ?>
589
  }
590
 
591
  public function get_some_actions() {
592
+ if ( isset( $_REQUEST['l'] ) ) {
593
+ $l = sanitize_text_field( $_REQUEST['l'] );
594
+ } else {
595
+ $l = false;
596
+ }
597
  ?>
598
  <ul class="subsubsub">
599
  <li>
classes/class.memberorder.php CHANGED
@@ -861,8 +861,8 @@
861
  $pmproemail->data["body"] .= '<p>' . __('Gateway', 'paid-memberships-pro') . ': ' . $this->gateway . '</p>';
862
  $pmproemail->data["body"] .= '<p>' . __('Subscription Transaction ID', 'paid-memberships-pro') . ': ' . $this->subscription_transaction_id . '</p>';
863
  $pmproemail->data["body"] .= '<hr />';
864
- $pmproemail->data["body"] .= '<p>' . __('Edit User', 'paid-memberships-pro') . ': ' . get_edit_user_link( $this->user_id ) . '</p>';
865
- $pmproemail->data["body"] .= '<p>' . __('Edit Order', 'paid-memberships-pro') . ': ' . add_query_arg( array( 'page' => 'pmpro-orders', 'order' => $this->id ), admin_url('admin.php' ) ) . '</p>';
866
  $pmproemail->sendEmail(get_bloginfo("admin_email"));
867
  } else {
868
  //Note: status would have been set to cancelled by the gateway class. So we don't have to update it here.
861
  $pmproemail->data["body"] .= '<p>' . __('Gateway', 'paid-memberships-pro') . ': ' . $this->gateway . '</p>';
862
  $pmproemail->data["body"] .= '<p>' . __('Subscription Transaction ID', 'paid-memberships-pro') . ': ' . $this->subscription_transaction_id . '</p>';
863
  $pmproemail->data["body"] .= '<hr />';
864
+ $pmproemail->data["body"] .= '<p>' . __('Edit User', 'paid-memberships-pro') . ': ' . esc_url( add_query_arg( 'user_id', $this->user_id, self_admin_url( 'user-edit.php' ) ) ) . '</p>';
865
+ $pmproemail->data["body"] .= '<p>' . __('Edit Order', 'paid-memberships-pro') . ': ' . esc_url( add_query_arg( array( 'page' => 'pmpro-orders', 'order' => $this->id ), admin_url('admin.php' ) ) ) . '</p>';
866
  $pmproemail->sendEmail(get_bloginfo("admin_email"));
867
  } else {
868
  //Note: status would have been set to cancelled by the gateway class. So we don't have to update it here.
classes/gateways/class.pmprogateway_stripe.php CHANGED
@@ -160,7 +160,8 @@ class PMProGateway_stripe extends PMProGateway {
160
  $default_gateway = pmpro_getOption( 'gateway' );
161
  $current_gateway = pmpro_getGateway();
162
 
163
- if ( ( $default_gateway == "stripe" || $current_gateway == "stripe" ) && empty( $_REQUEST['review'] ) ) //$_REQUEST['review'] means the PayPal Express review page
 
164
  {
165
  add_action( 'pmpro_after_checkout_preheader', array(
166
  'PMProGateway_stripe',
@@ -361,11 +362,11 @@ class PMProGateway_stripe extends PMProGateway {
361
  */
362
  static function pmpro_checkout_after_preheader( $order ) {
363
 
364
- global $gateway, $pmpro_level, $current_user;
365
 
366
  $default_gateway = pmpro_getOption( "gateway" );
367
 
368
- if ( ( $gateway == "stripe" || $default_gateway == "stripe" ) && ! pmpro_isLevelFree( $pmpro_level ) ) {
369
  //stripe js library
370
  wp_enqueue_script( "stripe", "https://js.stripe.com/v3/", array(), null );
371
 
@@ -377,6 +378,7 @@ class PMProGateway_stripe extends PMProGateway {
377
  'verifyAddress' => apply_filters( 'pmpro_stripe_verify_address', pmpro_getOption( 'stripe_billingaddress' ) ),
378
  'ajaxUrl' => admin_url( "admin-ajax.php" ),
379
  'msgAuthenticationValidated' => __( 'Verification steps confirmed. Your payment is processing.', 'paid-memberships-pro' ),
 
380
  );
381
 
382
  if ( ! empty( $order ) ) {
160
  $default_gateway = pmpro_getOption( 'gateway' );
161
  $current_gateway = pmpro_getGateway();
162
 
163
+ // $_REQUEST['review'] here means the PayPal Express review pag
164
+ if ( ( $default_gateway == "stripe" || $current_gateway == "stripe" ) && empty( $_REQUEST['review'] ) )
165
  {
166
  add_action( 'pmpro_after_checkout_preheader', array(
167
  'PMProGateway_stripe',
362
  */
363
  static function pmpro_checkout_after_preheader( $order ) {
364
 
365
+ global $gateway, $pmpro_level, $current_user, $pmpro_requirebilling;
366
 
367
  $default_gateway = pmpro_getOption( "gateway" );
368
 
369
+ if ( $gateway == "stripe" || $default_gateway == "stripe" ) {
370
  //stripe js library
371
  wp_enqueue_script( "stripe", "https://js.stripe.com/v3/", array(), null );
372
 
378
  'verifyAddress' => apply_filters( 'pmpro_stripe_verify_address', pmpro_getOption( 'stripe_billingaddress' ) ),
379
  'ajaxUrl' => admin_url( "admin-ajax.php" ),
380
  'msgAuthenticationValidated' => __( 'Verification steps confirmed. Your payment is processing.', 'paid-memberships-pro' ),
381
+ 'pmpro_require_billing' => $pmpro_requirebilling,
382
  );
383
 
384
  if ( ! empty( $order ) ) {
includes/adminpages.php CHANGED
@@ -56,7 +56,7 @@ function pmpro_add_pages() {
56
 
57
  // Check License Key for Correct Link Color
58
  $key = get_option( 'pmpro_license_key', '' );
59
- if ( pmpro_license_isValid( $key, NULL, true ) ) {
60
  $span_color = '#33FF00';
61
  } else {
62
  $span_color = '#FF3333';
@@ -210,7 +210,7 @@ function pmpro_admin_bar_menu() {
210
  if ( current_user_can( 'manage_options' ) ) {
211
  // Check License Key for Correct Link Color
212
  $key = get_option( 'pmpro_license_key', '' );
213
- if ( pmpro_license_isValid( $key, NULL, true ) ) {
214
  $span_color = '#33FF00';
215
  } else {
216
  $span_color = '#FF3333';
56
 
57
  // Check License Key for Correct Link Color
58
  $key = get_option( 'pmpro_license_key', '' );
59
+ if ( pmpro_license_isValid( $key, NULL ) ) {
60
  $span_color = '#33FF00';
61
  } else {
62
  $span_color = '#FF3333';
210
  if ( current_user_can( 'manage_options' ) ) {
211
  // Check License Key for Correct Link Color
212
  $key = get_option( 'pmpro_license_key', '' );
213
+ if ( pmpro_license_isValid( $key, NULL ) ) {
214
  $span_color = '#33FF00';
215
  } else {
216
  $span_color = '#FF3333';
js/pmpro-stripe.js CHANGED
@@ -1,3 +1,5 @@
 
 
1
  // Wire up the form for Stripe.
2
  jQuery( document ).ready( function( $ ) {
3
 
@@ -41,6 +43,11 @@ jQuery( document ).ready( function( $ ) {
41
  }
42
  }
43
 
 
 
 
 
 
44
  $( '.pmpro_form' ).submit( function( event ) {
45
  var name, address;
46
 
1
+ var pmpro_require_billing;
2
+
3
  // Wire up the form for Stripe.
4
  jQuery( document ).ready( function( $ ) {
5
 
43
  }
44
  }
45
 
46
+ // Set require billing var if not set yet.
47
+ if ( typeof pmpro_require_billing === 'undefined' ) {
48
+ pmpro_require_billing = pmproStripe.pmpro_require_billing;
49
+ }
50
+
51
  $( '.pmpro_form' ).submit( function( event ) {
52
  var name, address;
53
 
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.2.2
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.2.2' );
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.2.4
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.2.4' );
20
  define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
21
  define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
22
 
preheaders/billing.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
 
3
- global $wpdb, $current_user, $pmpro_msg, $pmpro_msgt;
4
- global $bfirstname, $blastname, $baddress1, $baddress2, $bcity, $bstate, $bzipcode, $bcountry, $bphone, $bemail, $bconfirmemail, $CardType, $AccountNumber, $ExpirationMonth, $ExpirationYear;
5
 
6
  if (! is_user_logged_in()) {
7
  wp_redirect(pmpro_url('levels'));
@@ -31,6 +30,9 @@ if (empty($user_order->gateway)) {
31
  $besecure = pmpro_getOption("use_ssl");
32
  }
33
 
 
 
 
34
  // Set the gateway, ideally using the gateway used to pay for the last order (if it exists)
35
  $gateway = !empty( $user_order->gateway ) ? $user_order->gateway : pmpro_getOption("gateway");
36
 
1
  <?php
2
 
3
+ global $wpdb, $current_user, $pmpro_msg, $pmpro_msgt, $bfirstname, $blastname, $baddress1, $baddress2, $bcity, $bstate, $bzipcode, $bcountry, $bphone, $bemail, $bconfirmemail, $CardType, $AccountNumber, $ExpirationMonth, $ExpirationYear, $pmpro_requirebilling;
 
4
 
5
  if (! is_user_logged_in()) {
6
  wp_redirect(pmpro_url('levels'));
30
  $besecure = pmpro_getOption("use_ssl");
31
  }
32
 
33
+ // this variable is checked sometimes to know if the page should show billing fields
34
+ $pmpro_requirebilling = true;
35
+
36
  // Set the gateway, ideally using the gateway used to pay for the last order (if it exists)
37
  $gateway = !empty( $user_order->gateway ) ? $user_order->gateway : pmpro_getOption("gateway");
38
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: strangerstudios
3
  Tags: membership, memberships, member, members, ecommerce, e-commerce, paypal, stripe, braintree, authorize.net, payflow, restrict access, restrict content, directory
4
  Requires at least: 4
5
  Tested up to: 5.3
6
- Stable tag: 2.2.2
7
 
8
  Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
9
 
@@ -128,6 +128,15 @@ Not sure? You can find out by doing a bit a research.
128
  [View All Screenshots](http://www.paidmembershipspro.com/features/screenshots/)
129
 
130
  == Changelog ==
 
 
 
 
 
 
 
 
 
131
  = 2.2.2 - 2019-11-29 =
132
  * BUG FIX: Fixed issue with member search.
133
  * BUG FIX: Fixed issue with custom columns in the members list. (Thanks, Tim Sparks)
3
  Tags: membership, memberships, member, members, ecommerce, e-commerce, paypal, stripe, braintree, authorize.net, payflow, restrict access, restrict content, directory
4
  Requires at least: 4
5
  Tested up to: 5.3
6
+ Stable tag: 2.2.4
7
 
8
  Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
9
 
128
  [View All Screenshots](http://www.paidmembershipspro.com/features/screenshots/)
129
 
130
  == Changelog ==
131
+ = 2.2.4 - 2019-12-20 =
132
+ * BUG FIX: Fixed issue with the update billing page when using the Stripe gateway.
133
+
134
+ = 2.2.3 - 2019-12-09 =
135
+ * BUG FIX: Fixed issue where Stripe checkout failed for free levels that had their price adjusted through the donations or variable pricing add ons.
136
+ * BUG FIX: Fixed undeclared variables warnings in the members list.
137
+ * BUG FIX: Fixed the edit user links in the email sent to admins when cancelations have errors.
138
+ * REFACTOR: Removed some unused code from the members list class.
139
+
140
  = 2.2.2 - 2019-11-29 =
141
  * BUG FIX: Fixed issue with member search.
142
  * BUG FIX: Fixed issue with custom columns in the members list. (Thanks, Tim Sparks)