Paid Memberships Pro - Version 1.8.8.3

Version Description

  • BUG: Fixed issue in pmpro_has_membership_access() that was causing issues on some sites, specifically sites running PMPro Series.
Download this release

Release Info

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

Code changes from version 1.8.8 to 1.8.8.3

classes/class.memberorder.php CHANGED
@@ -576,7 +576,7 @@
576
  '" . esc_sql($this->billing->zip) . "',
577
  '" . esc_sql($this->billing->country) . "',
578
  '" . cleanPhone($this->billing->phone) . "',
579
- '" . $subtotal . "',
580
  '" . $tax . "',
581
  '" . $this->couponamount. "',
582
  " . intval($this->certificate_id) . ",
576
  '" . esc_sql($this->billing->zip) . "',
577
  '" . esc_sql($this->billing->country) . "',
578
  '" . cleanPhone($this->billing->phone) . "',
579
+ '" . $this->subtotal . "',
580
  '" . $tax . "',
581
  '" . $this->couponamount. "',
582
  " . intval($this->certificate_id) . ",
includes/content.php CHANGED
@@ -6,9 +6,16 @@ function pmpro_has_membership_access($post_id = NULL, $user_id = NULL, $return_m
6
  {
7
  global $post, $wpdb, $current_user;
8
 
9
- //use queried object if no value is supplied
10
- $queried_object = get_queried_object();
11
- if(!$post_id && !empty($queried_object) && !empty($queried_object->ID))
 
 
 
 
 
 
 
12
  $post_id = $queried_object->ID;
13
 
14
  //no post, return true (changed from false in version 1.7.2)
@@ -20,8 +27,10 @@ function pmpro_has_membership_access($post_id = NULL, $user_id = NULL, $return_m
20
  $user_id = $current_user->ID;
21
 
22
  //if no post or current_user object, set them up
23
- if( isset($queried_object->ID) && !empty($queried_object->ID) && $post_id == $queried_object->ID)
24
  $mypost = $queried_object;
 
 
25
  else
26
  $mypost = get_post($post_id);
27
 
6
  {
7
  global $post, $wpdb, $current_user;
8
 
9
+ //get queried object in case we check against that
10
+ if(!is_admin())
11
+ $queried_object = get_queried_object();
12
+ else
13
+ $queried_object = NULL;
14
+
15
+ //use post global or queried object if no $post_id was passed in
16
+ if(!$post_id && !empty($post) && !empty($post->ID))
17
+ $post_id = $post->ID;
18
+ elseif(!$post_id && !empty($queried_object) && !empty($queried_object->ID))
19
  $post_id = $queried_object->ID;
20
 
21
  //no post, return true (changed from false in version 1.7.2)
27
  $user_id = $current_user->ID;
28
 
29
  //if no post or current_user object, set them up
30
+ if(isset($queried_object->ID) && !empty($queried_object->ID) && $post_id == $queried_object->ID)
31
  $mypost = $queried_object;
32
+ elseif(isset($post->ID) && !empty($post->ID) && $post_id == $post->ID)
33
+ $mypost = $post;
34
  else
35
  $mypost = get_post($post_id);
36
 
includes/functions.php CHANGED
@@ -188,7 +188,7 @@ function pmpro_isLevelTrial(&$level)
188
 
189
  function pmpro_isLevelExpiring(&$level)
190
  {
191
- if(!empty($level) && !empty($level->expiration_number) && $level->expiration_number > 0)
192
  return true;
193
  else
194
  return false;
@@ -2198,4 +2198,4 @@ function pmpro_generatePages($pages) {
2198
  return wp_schedule_event($timestamp, $recurrence, $hook, $args);
2199
  else
2200
  return false;
2201
- }
188
 
189
  function pmpro_isLevelExpiring(&$level)
190
  {
191
+ if(!empty($level) && (!empty($level->expiration_number) && $level->expiration_number > 0) || !empty($level->enddate))
192
  return true;
193
  else
194
  return false;
2198
  return wp_schedule_event($timestamp, $recurrence, $hook, $args);
2199
  else
2200
  return false;
2201
+ }
includes/updates.php CHANGED
@@ -18,7 +18,7 @@ function pmpro_isUpdateRequired() {
18
  function pmpro_addUpdate($update) {
19
  $updates = get_option('pmpro_updates', array());
20
  $updates[] = $update;
21
- $updates = array_unique($updates);
22
 
23
  update_option('pmpro_updates', $updates, 'no');
24
  }
@@ -36,6 +36,8 @@ function pmpro_removeUpdate($update) {
36
  unset($updates[$key]);
37
  }
38
 
 
 
39
  update_option('pmpro_updates', $updates, 'no');
40
  }
41
 
@@ -54,12 +56,15 @@ add_action('admin_enqueue_scripts', 'pmpro_enqueue_update_js');
54
  */
55
  function pmpro_wp_ajax_pmpro_updates() {
56
  //get updates
57
- $updates = get_option('pmpro_updates', array());
58
 
59
  //run update or let them know we're done
60
- if(!empty($updates)) {
61
  //get the latest one and run it
62
- call_user_func($updates[0]);
 
 
 
63
  echo ". ";
64
  } else {
65
  echo "[done]";
18
  function pmpro_addUpdate($update) {
19
  $updates = get_option('pmpro_updates', array());
20
  $updates[] = $update;
21
+ $updates = array_values(array_unique($updates));
22
 
23
  update_option('pmpro_updates', $updates, 'no');
24
  }
36
  unset($updates[$key]);
37
  }
38
 
39
+ $updates = array_values($updates);
40
+
41
  update_option('pmpro_updates', $updates, 'no');
42
  }
43
 
56
  */
57
  function pmpro_wp_ajax_pmpro_updates() {
58
  //get updates
59
+ $updates = array_values(get_option('pmpro_updates', array()));
60
 
61
  //run update or let them know we're done
62
+ if(!empty($updates)) {
63
  //get the latest one and run it
64
+ if(function_exists($updates[0]))
65
+ call_user_func($updates[0]);
66
+ else
67
+ echo "[error] Function not found: " . $updates[0];
68
  echo ". ";
69
  } else {
70
  echo "[done]";
js/updates.js CHANGED
@@ -7,7 +7,7 @@ jQuery(document).ready(function() {
7
  var $cycles = ['|','/','-','\\'];
8
 
9
  //start updates and update status
10
- if($status.length > 0)
11
  {
12
  $status.html($status.html() + '\n' + 'JavaScript Loaded. Starting updates.\n');
13
 
@@ -23,7 +23,7 @@ jQuery(document).ready(function() {
23
  success: function(responseHTML){
24
  if (responseHTML.indexOf('[error]') > -1)
25
  {
26
- alert('Error with update. Try refreshing.');
27
  document.title = $title;
28
  }
29
  else if(responseHTML.indexOf('[done]') > -1)
@@ -38,7 +38,7 @@ jQuery(document).ready(function() {
38
  $count++;
39
  re = /\[.*\]/;
40
  progress = re.exec(responseHTML);
41
- if(progress.length > 0)
42
  jQuery('#pmpro_updates_progress').html(progress + ' ' + parseInt(eval(progress[0].replace(/\[|\]/ig, ''))*100) + '%');
43
  $status.html($status.html() + responseHTML.replace(re, ''));
44
  document.title = $cycles[$count%4] + ' ' + $title;
7
  var $cycles = ['|','/','-','\\'];
8
 
9
  //start updates and update status
10
+ if($status && $status.length > 0)
11
  {
12
  $status.html($status.html() + '\n' + 'JavaScript Loaded. Starting updates.\n');
13
 
23
  success: function(responseHTML){
24
  if (responseHTML.indexOf('[error]') > -1)
25
  {
26
+ alert('Error while running update: ' + responseHTML + ' Try refreshing. If this error occurs again, seek help on the PMPro member forums.');
27
  document.title = $title;
28
  }
29
  else if(responseHTML.indexOf('[done]') > -1)
38
  $count++;
39
  re = /\[.*\]/;
40
  progress = re.exec(responseHTML);
41
+ if(progress && progress.length > 0)
42
  jQuery('#pmpro_updates_progress').html(progress + ' ' + parseInt(eval(progress[0].replace(/\[|\]/ig, ''))*100) + '%');
43
  $status.html($status.html() + responseHTML.replace(re, ''));
44
  document.title = $cycles[$count%4] + ' ' + $title;
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.8
7
  Author: Stranger Studios
8
  Author URI: http://www.strangerstudios.com
9
  */
@@ -13,7 +13,7 @@ Author URI: http://www.strangerstudios.com
13
  */
14
 
15
  //version constant
16
- define("PMPRO_VERSION", "1.8.8");
17
  define("PMPRO_USER_AGENT", "Paid Memberships Pro v" . PMPRO_VERSION . "; " . site_url());
18
 
19
  //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.8.3
7
  Author: Stranger Studios
8
  Author URI: http://www.strangerstudios.com
9
  */
13
  */
14
 
15
  //version constant
16
+ define("PMPRO_VERSION", "1.8.8.3");
17
  define("PMPRO_USER_AGENT", "Paid Memberships Pro v" . PMPRO_VERSION . "; " . site_url());
18
 
19
  //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.4.2
6
- Stable tag: 1.8.8
7
 
8
  A revenue-generating machine for membership sites. Unlimited levels with recurring payment, protected content and member management.
9
 
@@ -115,6 +115,18 @@ 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.8 =
119
  * BUG: Fixed issue where recurring Stripe orders were being created with $0 totals.
120
  * BUG: Fixed issues in pmpro_has_membership_access() that was affecting some sites with files locked down for members. (Thanks, MannyC on GitHub)
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.4.2
6
+ Stable tag: 1.8.8.3
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.8.3 =
119
+ * BUG: Fixed issue in pmpro_has_membership_access() that was causing issues on some sites, specifically sites running PMPro Series.
120
+
121
+ = 1.8.8.2 =
122
+ * BUG: Fixed bug with new order creation.
123
+
124
+ = 1.8.8.1 =
125
+ * BUG: Fixed issue in pmpro_has_membership_access() that kept member content from being locked down on blog homepages and archive/index pages.
126
+ * BUG: Fixed display of renew button for memberships with an enddate, but no expiration number or period (e.g. if an admin changed the enddate).
127
+ * BUG: Fixed issue where the subtotal was not being recorded properly for some new orders.
128
+ * BUG: Fixed issues some where having running the update scripts.
129
+
130
  = 1.8.8 =
131
  * BUG: Fixed issue where recurring Stripe orders were being created with $0 totals.
132
  * BUG: Fixed issues in pmpro_has_membership_access() that was affecting some sites with files locked down for members. (Thanks, MannyC on GitHub)