Paid Memberships Pro - Version 2.3.2

Version Description

2020-05-07 = * BUG FIX: Fixed errors calling is_main_query() that came up with certain themes. * BUG FIX: Fixed typo in the pmpro_account_profile_action_links filter. * BUG FIX/ENHANCEMENT: Added a new force parameter to the pmpro_getAllLevels() function. This is used by the Multisite Membership Add On to fix an issue where levels were missing or incorrect on the subsites. * ENHANCEMENT: Removed mention of the ezAdsense plugin, which has been discontinued.

Download this release

Release Info

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

Code changes from version 2.3.1 to 2.3.2

CHANGELOG.txt CHANGED
@@ -1,4 +1,10 @@
1
  == Changelog ==
 
 
 
 
 
 
2
  = 2.3.1 2020-05-01 =
3
  * BUG FIX: Fixed infinite redirect issue if no account page was set. Fixed a few other places where we do is_page() type checks just in case.
4
  * BUG FIX: Fixed issue where all pages were retitled to Welcome when logged in, if no login page was set.
1
  == Changelog ==
2
+ = 2.3.2 2020-05-07 =
3
+ * BUG FIX: Fixed errors calling is_main_query() that came up with certain themes.
4
+ * BUG FIX: Fixed typo in the pmpro_account_profile_action_links filter.
5
+ * BUG FIX/ENHANCEMENT: Added a new force parameter to the pmpro_getAllLevels() function. This is used by the Multisite Membership Add On to fix an issue where levels were missing or incorrect on the subsites.
6
+ * ENHANCEMENT: Removed mention of the ezAdsense plugin, which has been discontinued.
7
+
8
  = 2.3.1 2020-05-01 =
9
  * BUG FIX: Fixed infinite redirect issue if no account page was set. Fixed a few other places where we do is_page() type checks just in case.
10
  * BUG FIX: Fixed issue where all pages were retitled to Welcome when logged in, if no login page was set.
adminpages/advancedsettings.php CHANGED
@@ -341,12 +341,11 @@
341
  <tr id="hideads_explanation" <?php if($hideads < 2) { ?>style="display: none;"<?php } ?>>
342
  <th scope="row" valign="top">&nbsp;</th>
343
  <td>
344
- <p><?php _e('Ads from the following plugins will be automatically turned off', 'paid-memberships-pro' );?>: <em>Easy Adsense</em>, ...</p>
345
  <p><?php _e('To hide ads in your template code, use code like the following', 'paid-memberships-pro' );?>:</p>
346
  <pre lang="PHP">
347
- if ( pmpro_displayAds() ) {
348
- //insert ad code here
349
- }</pre>
350
  </td>
351
  </tr>
352
  <tr id="hideadslevels_tr" <?php if($hideads != 2) { ?>style="display: none;"<?php } ?>>
341
  <tr id="hideads_explanation" <?php if($hideads < 2) { ?>style="display: none;"<?php } ?>>
342
  <th scope="row" valign="top">&nbsp;</th>
343
  <td>
 
344
  <p><?php _e('To hide ads in your template code, use code like the following', 'paid-memberships-pro' );?>:</p>
345
  <pre lang="PHP">
346
+ if ( function_exists( 'pmpro_displayAds' ) && pmpro_displayAds() ) {
347
+ //insert ad code here
348
+ }</pre>
349
  </td>
350
  </tr>
351
  <tr id="hideadslevels_tr" <?php if($hideads != 2) { ?>style="display: none;"<?php } ?>>
classes/class-pmpro-admin-activity-email.php CHANGED
@@ -24,7 +24,7 @@ class PMPro_Admin_Activity_Email extends PMProEmail {
24
  *
25
  * @param string $frequency to send emails at. Determines length of time reported.
26
  */
27
- public function sendAdminActivity( $frequency = '' ) {
28
  global $wpdb, $pmpro_levels;
29
 
30
  if ( ! in_array( $frequency, array( 'day', 'week', 'month', 'never' ), true ) ) {
@@ -400,7 +400,11 @@ class PMPro_Admin_Activity_Email extends PMProEmail {
400
  $admin_activity_email_body .= $content;
401
  }
402
 
403
- $this->email = get_bloginfo( 'admin_email' );
 
 
 
 
404
  $this->subject = sprintf( __( '[%1$s] Paid Memberships Pro Activity for %2$s: %3$s', 'paid-memberships-pro' ), get_bloginfo( 'name' ), ucwords( $term ), $date_range );
405
  $this->template = 'admin_activity_email';
406
  $this->body = $admin_activity_email_body;
24
  *
25
  * @param string $frequency to send emails at. Determines length of time reported.
26
  */
27
+ public function sendAdminActivity( $frequency = '', $recipient = null ) {
28
  global $wpdb, $pmpro_levels;
29
 
30
  if ( ! in_array( $frequency, array( 'day', 'week', 'month', 'never' ), true ) ) {
400
  $admin_activity_email_body .= $content;
401
  }
402
 
403
+ if ( empty( $recipient ) ) {
404
+ $recipient = get_bloginfo( 'admin_email' );
405
+ }
406
+ $this->email = $recipient;
407
+
408
  $this->subject = sprintf( __( '[%1$s] Paid Memberships Pro Activity for %2$s: %3$s', 'paid-memberships-pro' ), get_bloginfo( 'name' ), ucwords( $term ), $date_range );
409
  $this->template = 'admin_activity_email';
410
  $this->body = $admin_activity_email_body;
includes/functions.php CHANGED
@@ -2047,20 +2047,27 @@ function pmpro_getLevel( $level ) {
2047
  Get all PMPro membership levels.
2048
 
2049
  @param bool $include_hidden Include levels marked as hidden/inactive.
2050
- @param bool $force If false, use $pmpro_levels global. If true use other caches.
 
2051
  */
2052
- function pmpro_getAllLevels( $include_hidden = false, $force = false ) {
2053
  global $pmpro_levels, $wpdb;
2054
 
2055
  static $pmpro_all_levels; // every single level
2056
  static $pmpro_visible_levels; // every single level that's not hidden
2057
 
 
 
 
 
 
 
2058
  // just use the $pmpro_levels global
2059
- if ( ! empty( $pmpro_levels ) && ! $force ) {
2060
- return $pmpro_levels;
2061
  }
2062
 
2063
- // For now, if force is true, still check if we have something in a static var.
2064
  if ( $include_hidden && isset( $pmpro_all_levels ) ) {
2065
  return $pmpro_all_levels;
2066
  }
2047
  Get all PMPro membership levels.
2048
 
2049
  @param bool $include_hidden Include levels marked as hidden/inactive.
2050
+ @param bool $use_cache If false, use $pmpro_levels global. If true use other caches.
2051
+ @param bool $force Resets the static var caches as well.
2052
  */
2053
+ function pmpro_getAllLevels( $include_hidden = false, $use_cache = false, $force = false ) {
2054
  global $pmpro_levels, $wpdb;
2055
 
2056
  static $pmpro_all_levels; // every single level
2057
  static $pmpro_visible_levels; // every single level that's not hidden
2058
 
2059
+ if ( $force ) {
2060
+ $pmpro_levels = NULL;
2061
+ $pmpro_all_levels = NULL;
2062
+ $pmpro_visible_levels = NULL;
2063
+ }
2064
+
2065
  // just use the $pmpro_levels global
2066
+ if ( ! empty( $pmpro_levels ) && ! $use_cache ) {
2067
+ return $pmpro_levels;
2068
  }
2069
 
2070
+ // If use_cache is true check if we have something in a static var.
2071
  if ( $include_hidden && isset( $pmpro_all_levels ) ) {
2072
  return $pmpro_all_levels;
2073
  }
includes/login.php CHANGED
@@ -197,13 +197,13 @@ function pmpro_login_form_hidden_field( $html ) {
197
  * @since 2.3
198
  */
199
  function pmpro_login_the_title( $title, $id = NULL ) {
200
- global $pmpro_pages;
201
 
202
  if ( is_admin() ) {
203
  return $title;
204
  }
205
-
206
- if ( ! is_main_query() || ! is_page( $id ) ) {
207
  return $title;
208
  }
209
 
197
  * @since 2.3
198
  */
199
  function pmpro_login_the_title( $title, $id = NULL ) {
200
+ global $pmpro_pages, $wp_query;
201
 
202
  if ( is_admin() ) {
203
  return $title;
204
  }
205
+
206
+ if ( isset( $wp_query ) && ( ! is_main_query() || ! is_page( $id ) ) ) {
207
  return $title;
208
  }
209
 
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.3.1
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.3.1' );
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.3.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.3.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
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.4.1
6
- Stable tag: 2.3.1
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,12 @@ Not sure? You can find out by doing a bit a research.
153
  8. Membership Account page, display all sections or show specific sections using shortcode attributes.
154
 
155
  == Changelog ==
 
 
 
 
 
 
156
  = 2.3.1 2020-05-01 =
157
  * BUG FIX: Fixed infinite redirect issue if no account page was set. Fixed a few other places where we do is_page() type checks just in case.
158
  * BUG FIX: Fixed issue where all pages were retitled to Welcome when logged in, if no login page was set.
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.4.1
6
+ Stable tag: 2.3.2
7
 
8
  Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
9
 
153
  8. Membership Account page, display all sections or show specific sections using shortcode attributes.
154
 
155
  == Changelog ==
156
+ = 2.3.2 2020-05-07 =
157
+ * BUG FIX: Fixed errors calling is_main_query() that came up with certain themes.
158
+ * BUG FIX: Fixed typo in the pmpro_account_profile_action_links filter.
159
+ * BUG FIX/ENHANCEMENT: Added a new force parameter to the pmpro_getAllLevels() function. This is used by the Multisite Membership Add On to fix an issue where levels were missing or incorrect on the subsites.
160
+ * ENHANCEMENT: Removed mention of the ezAdsense plugin, which has been discontinued.
161
+
162
  = 2.3.1 2020-05-01 =
163
  * BUG FIX: Fixed infinite redirect issue if no account page was set. Fixed a few other places where we do is_page() type checks just in case.
164
  * BUG FIX: Fixed issue where all pages were retitled to Welcome when logged in, if no login page was set.
shortcodes/pmpro_account.php CHANGED
@@ -177,7 +177,7 @@ function pmpro_shortcode_account($atts, $content=null, $code="")
177
  $pmpro_profile_action_links['change-password'] = sprintf( '<a id="pmpro_actionlink-change-password" href="%s">%s</a>', esc_url( $change_password_url ), esc_html__( 'Change Password', 'paid-memberships-pro' ) );
178
  $pmpro_profile_action_links['logout'] = sprintf( '<a id="pmpro_actionlink-logout" href="%s">%s</a>', esc_url( wp_logout_url() ), esc_html__( 'Log Out', 'paid-memberships-pro' ) );
179
 
180
- $pmpro_profile_action_links = apply_filters( 'pmpro_account_profile_actionlinks', $pmpro_profile_action_links );
181
 
182
  $allowed_html = array(
183
  'a' => array (
177
  $pmpro_profile_action_links['change-password'] = sprintf( '<a id="pmpro_actionlink-change-password" href="%s">%s</a>', esc_url( $change_password_url ), esc_html__( 'Change Password', 'paid-memberships-pro' ) );
178
  $pmpro_profile_action_links['logout'] = sprintf( '<a id="pmpro_actionlink-logout" href="%s">%s</a>', esc_url( wp_logout_url() ), esc_html__( 'Log Out', 'paid-memberships-pro' ) );
179
 
180
+ $pmpro_profile_action_links = apply_filters( 'pmpro_account_profile_action_links', $pmpro_profile_action_links );
181
 
182
  $allowed_html = array(
183
  'a' => array (