Paid Memberships Pro - Version 1.8.13.1

Version Description

  • BUG: Fixed issue where end dates were being set/saved incorrectly from the edit user/profile page in the dashboard.
  • BUG: Fixed warnings in the Braintree PHP library. (Thanks, Travis Shivers)
  • BUG: Fixed issue where the filtered $mypost object was not being used in the content filter if the post type was "page". (Thanks, James)
  • BUG: Removed the extra class="input" attribute on the CVV field when the Stripe gateway is used. (Thanks, Rafe Colton)
  • BUG/ENHANCEMENT: Changed the number of X placeholders for masked credit cards to 12 (+ the last 4 stored) instead of 13. (Thanks, Rafe Colton)
Download this release

Release Info

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

Code changes from version 1.8.13 to 1.8.13.1

classes/gateways/class.pmprogateway_braintree.php CHANGED
@@ -494,7 +494,7 @@
494
  {
495
  //$order->status = "error";
496
  $order->errorcode = true;
497
- $order->error = "Error: " . $e->getMessage();
498
  $order->shorterror = $order->error;
499
  return false;
500
  }
@@ -669,7 +669,7 @@
669
  }
670
  catch (Exception $e)
671
  {
672
- $order->error = __("Error creating customer record with Braintree:", "pmpro") . " " . $e->getMessage();
673
  $order->shorterror = $order->error;
674
  return false;
675
  }
@@ -769,7 +769,7 @@
769
  }
770
  catch (Exception $e)
771
  {
772
- $order->error = __("Error subscribing customer to plan with Braintree:", "pmpro") . " " . $e->getMessage();
773
  //return error
774
  $order->shorterror = $order->error;
775
  return false;
494
  {
495
  //$order->status = "error";
496
  $order->errorcode = true;
497
+ $order->error = "Error: " . $e->getMessage() . " (" . get_class($e) . ")";
498
  $order->shorterror = $order->error;
499
  return false;
500
  }
669
  }
670
  catch (Exception $e)
671
  {
672
+ $order->error = __("Error creating customer record with Braintree:", "pmpro") . $e->getMessage() . " (" . get_class($e) . ")";
673
  $order->shorterror = $order->error;
674
  return false;
675
  }
769
  }
770
  catch (Exception $e)
771
  {
772
+ $order->error = __("Error subscribing customer to plan with Braintree:", "pmpro") . " " . $e->getMessage() . " (" . get_class($e) . ")";
773
  //return error
774
  $order->shorterror = $order->error;
775
  return false;
classes/gateways/class.pmprogateway_stripe.php CHANGED
@@ -339,7 +339,7 @@
339
  jQuery('#CardType').val(response['card']['brand']);
340
  else
341
  form$.append("<input type='hidden' name='CardType' value='" + response['card']['brand'] + "'/>");
342
- form$.append("<input type='hidden' name='AccountNumber' value='XXXXXXXXXXXXX" + response['card']['last4'] + "'/>");
343
  form$.append("<input type='hidden' name='ExpirationMonth' value='" + ("0" + response['card']['exp_month']).slice(-2) + "'/>");
344
  form$.append("<input type='hidden' name='ExpirationYear' value='" + response['card']['exp_year'] + "'/>");
345
 
@@ -562,7 +562,7 @@
562
  ?>
563
  <div class="pmpro_payment-cvv">
564
  <label for="CVV"><?php _e('CVV', 'pmpro');?></label>
565
- <input class="input" id="CVV" type="text" size="4" value="<?php if(!empty($_REQUEST['CVV'])) { echo esc_attr($_REQUEST['CVV']); }?>" class=" <?php echo pmpro_getClassForField("CVV");?>" /> <small>(<a href="javascript:void(0);" onclick="javascript:window.open('<?php echo pmpro_https_filter(PMPRO_URL)?>/pages/popup-cvv.html','cvv','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=600, height=475');"><?php _e("what's this?", 'pmpro');?></a>)</small>
566
  </div>
567
  <?php
568
  }
339
  jQuery('#CardType').val(response['card']['brand']);
340
  else
341
  form$.append("<input type='hidden' name='CardType' value='" + response['card']['brand'] + "'/>");
342
+ form$.append("<input type='hidden' name='AccountNumber' value='XXXXXXXXXXXX" + response['card']['last4'] + "'/>");
343
  form$.append("<input type='hidden' name='ExpirationMonth' value='" + ("0" + response['card']['exp_month']).slice(-2) + "'/>");
344
  form$.append("<input type='hidden' name='ExpirationYear' value='" + response['card']['exp_year'] + "'/>");
345
 
562
  ?>
563
  <div class="pmpro_payment-cvv">
564
  <label for="CVV"><?php _e('CVV', 'pmpro');?></label>
565
+ <input id="CVV" type="text" size="4" value="<?php if(!empty($_REQUEST['CVV'])) { echo esc_attr($_REQUEST['CVV']); }?>" class="input <?php echo pmpro_getClassForField("CVV");?>" /> <small>(<a href="javascript:void(0);" onclick="javascript:window.open('<?php echo pmpro_https_filter(PMPRO_URL)?>/pages/popup-cvv.html','cvv','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=600, height=475');"><?php _e("what's this?", 'pmpro');?></a>)</small>
566
  </div>
567
  <?php
568
  }
includes/content.php CHANGED
@@ -66,7 +66,7 @@ function pmpro_has_membership_access($post_id = NULL, $user_id = NULL, $return_m
66
  else
67
  {
68
  //are any membership levels associated with this page?
69
- $sqlQuery = "SELECT m.id, m.name FROM $wpdb->pmpro_memberships_pages mp LEFT JOIN $wpdb->pmpro_membership_levels m ON mp.membership_id = m.id WHERE mp.page_id = '" . $post_id . "'";
70
  }
71
 
72
 
66
  else
67
  {
68
  //are any membership levels associated with this page?
69
+ $sqlQuery = "SELECT m.id, m.name FROM $wpdb->pmpro_memberships_pages mp LEFT JOIN $wpdb->pmpro_membership_levels m ON mp.membership_id = m.id WHERE mp.page_id = '" . $mypost->ID . "'";
70
  }
71
 
72
 
includes/lib/Braintree/Braintree/Util.php CHANGED
@@ -136,7 +136,9 @@ class Braintree_Util
136
  */
137
  public static function delimiterToCamelCase($string, $delimiter = '[\-\_]')
138
  {
139
- return preg_replace('/' . $delimiter . '(\w)/e', 'strtoupper("$1")',$string);
 
 
140
  }
141
 
142
  /**
@@ -161,7 +163,9 @@ class Braintree_Util
161
  */
162
  public static function camelCaseToDelimiter($string, $delimiter = '-')
163
  {
164
- return preg_replace('/([A-Z])/e', '"' . $delimiter . '" . strtolower("$1")', $string);
 
 
165
  }
166
 
167
  /**
136
  */
137
  public static function delimiterToCamelCase($string, $delimiter = '[\-\_]')
138
  {
139
+ return preg_replace_callback('/' . $delimiter . '(\w)/',function($matches) {
140
+ return strtoupper($matches[1]);
141
+ }, $string);
142
  }
143
 
144
  /**
163
  */
164
  public static function camelCaseToDelimiter($string, $delimiter = '-')
165
  {
166
+ return preg_replace_callback('/([A-Z])/',function($matches) use ($delimiter) {
167
+ return $delimiter.strtolower($matches[1]);
168
+ }, $string);
169
  }
170
 
171
  /**
includes/profile.php CHANGED
@@ -7,8 +7,14 @@ function pmpro_membership_level_profile_fields($user)
7
  {
8
  global $current_user;
9
 
10
- $server_tz = date_default_timezone_get();
11
- date_default_timezone_set( get_option( 'timezone_string' ) );
 
 
 
 
 
 
12
 
13
  $membership_level_capability = apply_filters("pmpro_edit_member_capability", "manage_options");
14
  if(!current_user_can($membership_level_capability))
@@ -89,7 +95,7 @@ function pmpro_membership_level_profile_fields($user)
89
  $end_date = !empty($user->membership_level->enddate); // Returned as UTC timestamp
90
 
91
  // Convert UTC to local time
92
- $user->membership_level->enddate = strtotime( get_option( 'timezone_string' ), $user->membership_level->enddate );
93
 
94
  //some vars for the dates
95
  $current_day = date_i18n("j", current_time('timestamp'));
7
  {
8
  global $current_user;
9
 
10
+ $server_tz = date_default_timezone_get();
11
+ $wp_tz = get_option( 'timezone_string' );
12
+
13
+ //option "timezone_string" is empty if set to UTC+0
14
+ if(empty($wp_tz))
15
+ $wp_tz = 'UTC';
16
+
17
+ date_default_timezone_set($wp_tz);
18
 
19
  $membership_level_capability = apply_filters("pmpro_edit_member_capability", "manage_options");
20
  if(!current_user_can($membership_level_capability))
95
  $end_date = !empty($user->membership_level->enddate); // Returned as UTC timestamp
96
 
97
  // Convert UTC to local time
98
+ $user->membership_level->enddate = strtotime($wp_tz, $user->membership_level->enddate );
99
 
100
  //some vars for the dates
101
  $current_day = date_i18n("j", current_time('timestamp'));
license.txt CHANGED
@@ -1,10 +1,13 @@
1
  Paid Memberships Pro
2
 
3
- Copyright (C) 2015 Stranger Studios, LLC and other contributors
4
 
5
  Paid Memberships Pro uses the same software license as the current version of WordPress: GPLv2. You can get the text of that license in the license.txt file of your root WordPress directory or online at http://wordpress.org/about/gpl/.
6
 
7
- Please read the GPLv2 for full details, but what this means in practice is that you may install this plugin on any site for personal or commercial use. You may redistribute this plugin any way you choose as long as you maintain the GPLv2 license. If you distribute an altered version of this code, we ask that you:
8
 
9
- 1. Give your software a name other than "Paid Memberships Pro" or "PMPro" to avoid confusion.
10
- 2. Notify us of your distributed version so we can potentially promote the distribution if it's a good effort.
 
 
 
1
  Paid Memberships Pro
2
 
3
+ Copyright (C) 2017 Stranger Studios, LLC and other contributors
4
 
5
  Paid Memberships Pro uses the same software license as the current version of WordPress: GPLv2. You can get the text of that license in the license.txt file of your root WordPress directory or online at http://wordpress.org/about/gpl/.
6
 
7
+ Please read the GPLv2 for full details, but what this means in practice is:
8
 
9
+ 1. You may install this plugin on any site for personal or commercial use.
10
+ 2. This plugin is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
+ 3. You may redistribute this plugin any way you choose as long as you maintain the GPLv2 license.
12
+
13
+ If you distribute an altered version of this code, we ask that you (a) Give your software a name other than "Paid Memberships Pro" or "PMPro" to avoid confusion and (b) notify us of your distributed version so we can potentially promote the distribution if it's a good effort.
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.13
7
  Author: Stranger Studios
8
  Author URI: http://www.strangerstudios.com
9
  Text Domain: pmpro
@@ -15,7 +15,7 @@ Domain Path: /languages
15
  */
16
 
17
  //version constant
18
- define("PMPRO_VERSION", "1.8.13");
19
  define("PMPRO_USER_AGENT", "Paid Memberships Pro v" . PMPRO_VERSION . "; " . site_url());
20
 
21
  //if the session has been started yet, start it (ignore if running from command line)
3
  Plugin Name: Paid Memberships Pro
4
  Plugin URI: http://www.paidmembershipspro.com
5
  Description: Plugin to Handle Memberships
6
+ Version: 1.8.13.1
7
  Author: Stranger Studios
8
  Author URI: http://www.strangerstudios.com
9
  Text Domain: pmpro
15
  */
16
 
17
  //version constant
18
+ define("PMPRO_VERSION", "1.8.13.1");
19
  define("PMPRO_USER_AGENT", "Paid Memberships Pro v" . PMPRO_VERSION . "; " . site_url());
20
 
21
  //if the session has been started yet, start it (ignore if running from command line)
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.7
6
- Stable tag: 1.8.13
7
 
8
  A revenue-generating machine for membership sites. Unlimited levels with recurring payment, protected content and member management.
9
 
@@ -115,6 +115,13 @@ 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.13 =
119
  * FEATURE: The Stripe Webhook has been updated to process subscriptions cancelled from Stripe. PMPro will now cancel memberships for these users instead of sending an email to the admin.
120
  * BUG: Fixed various bugs in the PayPal IPN handler.
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.7
6
+ Stable tag: 1.8.13.1
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.13.1 =
119
+ * BUG: Fixed issue where end dates were being set/saved incorrectly from the edit user/profile page in the dashboard.
120
+ * BUG: Fixed warnings in the Braintree PHP library. (Thanks, Travis Shivers)
121
+ * BUG: Fixed issue where the filtered $mypost object was not being used in the content filter if the post type was "page". (Thanks, James)
122
+ * BUG: Removed the extra class="input" attribute on the CVV field when the Stripe gateway is used. (Thanks, Rafe Colton)
123
+ * BUG/ENHANCEMENT: Changed the number of X placeholders for masked credit cards to 12 (+ the last 4 stored) instead of 13. (Thanks, Rafe Colton)
124
+
125
  = 1.8.13 =
126
  * FEATURE: The Stripe Webhook has been updated to process subscriptions cancelled from Stripe. PMPro will now cancel memberships for these users instead of sending an email to the admin.
127
  * BUG: Fixed various bugs in the PayPal IPN handler.