Paid Memberships Pro - Version 1.9.5.2

Version Description

  • 2018-06-26 =
  • BUG FIX: Fixed compatibility with Theme My Login version 7. (Thanks, Jeff Farthing)
  • BUG FIX: Fixed missing $current_user bug in pmpro_ipnhandler_level_extend_memberships function. (Thanks, Anne)
Download this release

Release Info

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

Code changes from version 1.9.5.1 to 1.9.5.2

classes/gateways/class.pmprogateway_stripe.php CHANGED
@@ -1276,14 +1276,26 @@
1276
if(strpos($payment_transaction_id, "ch_") !== false)
1277
{
1278
//charge, look it up
1279
- $charge = Stripe_Charge::retrieve($payment_transaction_id);
1280
if(!empty($charge) && !empty($charge->customer))
1281
$customer_id = $charge->customer;
1282
}
1283
else if(strpos($payment_transaction_id, "in_") !== false)
1284
{
1285
//invoice look it up
1286
- $invoice = Stripe_Invoice::retrieve($payment_transaction_id);
1287
if(!empty($invoice) && !empty($invoice->customer))
1288
$customer_id = $invoice->customer;
1289
}
@@ -2002,4 +2014,4 @@
2002
return false;
2003
}
2004
}
2005
- }
1276
if(strpos($payment_transaction_id, "ch_") !== false)
1277
{
1278
//charge, look it up
1279
+ try {
1280
+ $charge = Stripe_Charge::retrieve($payment_transaction_id);
1281
+ } catch( \Exception $exception ) {
1282
+ $order->error = sprintf( __( 'Error: %s', 'paid-memberships-pro' ), $exception->getMessage() );
1283
+ return false;
1284
+ }
1285
+
1286
if(!empty($charge) && !empty($charge->customer))
1287
$customer_id = $charge->customer;
1288
}
1289
else if(strpos($payment_transaction_id, "in_") !== false)
1290
{
1291
//invoice look it up
1292
+ try {
1293
+ $invoice = Stripe_Invoice::retrieve($payment_transaction_id);
1294
+ } catch( \Exception $exception ) {
1295
+ $order->error = sprintf( __( 'Error: %s', 'paid-memberships-pro' ), $exception->getMessage() );
1296
+ return false;
1297
+ }
1298
+
1299
if(!empty($invoice) && !empty($invoice->customer))
1300
$customer_id = $invoice->customer;
1301
}
2014
return false;
2015
}
2016
}
2017
+ }
includes/filters.php CHANGED
@@ -60,6 +60,7 @@ function pmpro_ipnhandler_level_extend_memberships( $level, $user_id ) {
60
// does this level expire? are they an existing user of this level?
61
if ( ! empty( $level ) && ! empty( $level->expiration_number ) && pmpro_hasMembershipLevel( $level->id, $user_id ) ) {
62
// get the current enddate of their membership
63
$user_level = pmpro_getSpecificMembershipLevelForUser( $current_user->ID, $level->id );
64
65
// bail if their existing level doesn't have an end date
60
// does this level expire? are they an existing user of this level?
61
if ( ! empty( $level ) && ! empty( $level->expiration_number ) && pmpro_hasMembershipLevel( $level->id, $user_id ) ) {
62
// get the current enddate of their membership
63
+ global $current_user;
64
$user_level = pmpro_getSpecificMembershipLevelForUser( $current_user->ID, $level->id );
65
66
// bail if their existing level doesn't have an end date
includes/login.php CHANGED
@@ -54,7 +54,8 @@ function pmpro_login_head()
54
$login_redirect = apply_filters("pmpro_login_redirect", true);
55
56
if((pmpro_is_login_page() || is_page("login") ||
57
- class_exists("Theme_My_Login") && method_exists('Theme_My_Login', 'is_tml_page') && (Theme_My_Login::is_tml_page("register") || Theme_My_Login::is_tml_page("login"))
58
)
59
&& $login_redirect
60
)
@@ -62,7 +63,8 @@ function pmpro_login_head()
62
//redirect registration page to levels page
63
if( isset($_REQUEST['action']) && $_REQUEST['action'] == "register" ||
64
isset($_REQUEST['registration']) && $_REQUEST['registration'] == "disabled" ||
65
- !is_admin() && class_exists("Theme_My_Login") && method_exists('Theme_My_Login', 'is_tml_page') && Theme_My_Login::is_tml_page("register")
66
)
67
{
68
//redirect to levels page unless filter is set.
@@ -122,6 +124,15 @@ function pmpro_login_head()
122
}
123
}
124
}
125
126
//make sure users are only getting to the profile when logged in
127
global $current_user;
54
$login_redirect = apply_filters("pmpro_login_redirect", true);
55
56
if((pmpro_is_login_page() || is_page("login") ||
57
+ class_exists("Theme_My_Login") && method_exists('Theme_My_Login', 'is_tml_page') && (Theme_My_Login::is_tml_page("register") || Theme_My_Login::is_tml_page("login")) ||
58
+ function_exists( 'tml_is_action' ) && ( tml_is_action( 'register' ) || tml_is_action( 'login' ) )
59
)
60
&& $login_redirect
61
)
63
//redirect registration page to levels page
64
if( isset($_REQUEST['action']) && $_REQUEST['action'] == "register" ||
65
isset($_REQUEST['registration']) && $_REQUEST['registration'] == "disabled" ||
66
+ !is_admin() && class_exists("Theme_My_Login") && method_exists('Theme_My_Login', 'is_tml_page') && Theme_My_Login::is_tml_page("register") ||
67
+ function_exists( 'tml_is_action' ) && tml_is_action( 'register' )
68
)
69
{
70
//redirect to levels page unless filter is set.
124
}
125
}
126
}
127
+ elseif ( function_exists( 'tml_is_action' ) && function_exists( 'tml_get_action_url' ) )
128
+ {
129
+ if ( $link = tml_get_action_url( 'login' ) ) {
130
+ if ( ! tml_is_action( 'login' ) ) {
131
+ wp_redirect( $link );
132
+ exit;
133
+ }
134
+ }
135
+ }
136
137
//make sure users are only getting to the profile when logged in
138
global $current_user;
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.9.5.1
7
Author: Stranger Studios
8
Author URI: http://www.strangerstudios.com
9
Text Domain: paid-memberships-pro
@@ -15,7 +15,7 @@ Domain Path: /languages
15
*/
16
17
// version constant.1
18
- define( 'PMPRO_VERSION', '1.9.5' );
19
define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
20
define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
21
3
Plugin Name: Paid Memberships Pro
4
Plugin URI: http://www.paidmembershipspro.com
5
Description: Plugin to Handle Memberships
6
+ Version: 1.9.5.2
7
Author: Stranger Studios
8
Author URI: http://www.strangerstudios.com
9
Text Domain: paid-memberships-pro
15
*/
16
17
// version constant.1
18
+ define( 'PMPRO_VERSION', '1.9.5.2' );
19
define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
20
define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
21
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: 4.9.6
6
- Stable tag: 1.9.5.1
7
8
Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
9
@@ -129,6 +129,10 @@ Not sure? You can find out by doing a bit a research.
129
130
== Changelog ==
131
132
= 1.9.5.1 - 2018-06-08 =
133
* BUG FIX: Fixed issue with the PayPal IPN Handler where existing users checking out for a new level would sometimes have their membership and new subscription cancelled.
134
* BUG FIX: Fixed PayPal IPN Handler to set the status of old levels to 'changed' (instead of 'inactive') when processing checkouts. This will improve the accuracy of reports.
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: 4.9.6
6
+ Stable tag: 1.9.5.2
7
8
Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
9
129
130
== Changelog ==
131
132
+ = 1.9.5.2 - 2018-06-26 =
133
+ * BUG FIX: Fixed compatibility with Theme My Login version 7. (Thanks, Jeff Farthing)
134
+ * BUG FIX: Fixed missing $current_user bug in pmpro_ipnhandler_level_extend_memberships function. (Thanks, Anne)
135
+
136
= 1.9.5.1 - 2018-06-08 =
137
* BUG FIX: Fixed issue with the PayPal IPN Handler where existing users checking out for a new level would sometimes have their membership and new subscription cancelled.
138
* BUG FIX: Fixed PayPal IPN Handler to set the status of old levels to 'changed' (instead of 'inactive') when processing checkouts. This will improve the accuracy of reports.