myCRED - Version 1.8.14

Version Description

Bug fixes release.

=

Download this release

Release Info

Developer wpexpertsio
Plugin Icon 128x128 myCRED
Version 1.8.14
Comparing to
See all releases

Code changes from version 1.8.13.1 to 1.8.14

addons/ranks/myCRED-addon-ranks.php CHANGED
@@ -564,7 +564,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
564
  // Get the total for each user with a balance
565
  foreach ( $users as $user_id ) {
566
 
567
- $total = mycred_query_users_total( $user_id, $point_type );
568
  mycred_update_user_meta( $user_id, $point_type, '_total', $total );
569
  $count ++;
570
 
564
  // Get the total for each user with a balance
565
  foreach ( $users as $user_id ) {
566
 
567
+ $total = mycred_calculate_users_total( $user_id, $point_type );
568
  mycred_update_user_meta( $user_id, $point_type, '_total', $total );
569
  $count ++;
570
 
addons/sell-content/myCRED-addon-sell-content.php CHANGED
@@ -1105,7 +1105,7 @@ if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
1105
  $settings = mycred_sell_content_settings();
1106
 
1107
  // Do not add the metabox unless we set this post type to be "manual"
1108
- if ( $settings['filters'][ $post->post_type ]['by'] !== 'manual' ) return;
1109
 
1110
  add_meta_box(
1111
  'mycred-sell-content-setup',
1105
  $settings = mycred_sell_content_settings();
1106
 
1107
  // Do not add the metabox unless we set this post type to be "manual"
1108
+ if ( empty( $settings['filters'][ $post->post_type ] ) || $settings['filters'][ $post->post_type ]['by'] !== 'manual' ) return;
1109
 
1110
  add_meta_box(
1111
  'mycred-sell-content-setup',
includes/classes/class.query-log.php CHANGED
@@ -1086,14 +1086,14 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1086
 
1087
  global $wp;
1088
 
1089
- if ( isset( $wp->query_vars['page'] ) && $wp->query_vars['page'] != '' )
1090
- $pagenum = absint( $wp->query_vars['page'] );
1091
 
1092
  elseif ( isset( $_REQUEST['paged'] ) )
1093
  $pagenum = absint( $_REQUEST['paged'] );
1094
 
1095
- elseif ( isset( $_REQUEST['page'] ) )
1096
- $pagenum = absint( $_REQUEST['page'] );
1097
 
1098
  else return 1;
1099
 
@@ -1307,7 +1307,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1307
  else {
1308
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1309
  'first-page',
1310
- esc_url( remove_query_arg( 'page', $current_url ) ),
1311
  '&laquo;'
1312
  );
1313
  }
@@ -1317,7 +1317,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1317
  else {
1318
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1319
  'prev-page',
1320
- esc_url( add_query_arg( 'page', max( 1, $current-1 ), $current_url ) ),
1321
  '&lsaquo;'
1322
  );
1323
  }
@@ -1334,7 +1334,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1334
  if ( $i != $current )
1335
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1336
  'mycred-nav',
1337
- esc_url( add_query_arg( 'page', $i, $current_url ) ),
1338
  $i
1339
  );
1340
 
@@ -1348,7 +1348,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1348
  else {
1349
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1350
  'next-page' . $disable_last,
1351
- esc_url( add_query_arg( 'page', min( $total_pages, $current+1 ), $current_url ) ),
1352
  '&rsaquo;'
1353
  );
1354
  }
@@ -1358,7 +1358,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1358
  else {
1359
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1360
  'last-page' . $disable_last,
1361
- esc_url( add_query_arg( 'page', $total_pages, $current_url ) ),
1362
  '&raquo;'
1363
  );
1364
  }
@@ -2295,6 +2295,40 @@ if ( ! function_exists( 'mycred_query_users_total' ) ) :
2295
  }
2296
  endif;
2297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2298
  /**
2299
  * Get All References
2300
  * Returns an array of references currently existing in the log
1086
 
1087
  global $wp;
1088
 
1089
+ if ( isset( $wp->query_vars['pagenum'] ) && $wp->query_vars['pagenum'] != '' )
1090
+ $pagenum = absint( $wp->query_vars['pagenum'] );
1091
 
1092
  elseif ( isset( $_REQUEST['paged'] ) )
1093
  $pagenum = absint( $_REQUEST['paged'] );
1094
 
1095
+ elseif ( isset( $_REQUEST['pagenum'] ) )
1096
+ $pagenum = absint( $_REQUEST['pagenum'] );
1097
 
1098
  else return 1;
1099
 
1307
  else {
1308
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1309
  'first-page',
1310
+ esc_url( remove_query_arg( 'pagenum', $current_url ) ),
1311
  '&laquo;'
1312
  );
1313
  }
1317
  else {
1318
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1319
  'prev-page',
1320
+ esc_url( add_query_arg( 'pagenum', max( 1, $current-1 ), $current_url ) ),
1321
  '&lsaquo;'
1322
  );
1323
  }
1334
  if ( $i != $current )
1335
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1336
  'mycred-nav',
1337
+ esc_url( add_query_arg( 'pagenum', $i, $current_url ) ),
1338
  $i
1339
  );
1340
 
1348
  else {
1349
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1350
  'next-page' . $disable_last,
1351
+ esc_url( add_query_arg( 'pagenum', min( $total_pages, $current+1 ), $current_url ) ),
1352
  '&rsaquo;'
1353
  );
1354
  }
1358
  else {
1359
  $page_links[] = sprintf( '<li><a class="%s" href="%s">%s</a></li>',
1360
  'last-page' . $disable_last,
1361
+ esc_url( add_query_arg( 'pagenum', $total_pages, $current_url ) ),
1362
  '&raquo;'
1363
  );
1364
  }
2295
  }
2296
  endif;
2297
 
2298
+ /**
2299
+ * Calculate Users Total
2300
+ * Query to get users Total from log.
2301
+ *
2302
+ * @param $user_id (int), required user id
2303
+ * @param $type (string), required point type
2304
+ * @since 1.8.14
2305
+ * @version 1.0
2306
+ */
2307
+ if ( ! function_exists( 'mycred_calculate_users_total' ) ) :
2308
+ function mycred_calculate_users_total( $user_id, $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
2309
+
2310
+ if ( ! MYCRED_ENABLE_LOGGING || ! MYCRED_ENABLE_TOTAL_BALANCE ) return 0;
2311
+
2312
+ if ( ! mycred_point_type_exists( $point_type ) )
2313
+ $point_type = MYCRED_DEFAULT_TYPE_KEY;
2314
+
2315
+ global $wpdb, $mycred_log_table;
2316
+
2317
+ $total = $wpdb->get_var( $wpdb->prepare( "
2318
+ SELECT SUM( creds )
2319
+ FROM {$mycred_log_table}
2320
+ WHERE user_id = %d
2321
+ AND ( ( creds > 0 ) OR ( creds < 0 AND ref = 'manual' ) )
2322
+ AND ctype = %s;", $user_id, $point_type ) );
2323
+
2324
+ if ( $total === NULL )
2325
+ $total = 0;
2326
+
2327
+ return apply_filters( 'mycred_calculate_users_total', $total, $user_id, $point_type );
2328
+
2329
+ }
2330
+ endif;
2331
+
2332
  /**
2333
  * Get All References
2334
  * Returns an array of references currently existing in the log
includes/hooks/mycred-hook-comments.php CHANGED
@@ -121,7 +121,7 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
121
  if ( $comment === NULL ) return;
122
 
123
  // Ignore Pingbacks or Trackbacks
124
- if ( $comment->comment_type != '' ) return;
125
 
126
  // Logged out users miss out
127
  if ( $comment->user_id == 0 ) return;
121
  if ( $comment === NULL ) return;
122
 
123
  // Ignore Pingbacks or Trackbacks
124
+ if ( ! in_array( $comment->comment_type, array( '', 'comment' ) ) ) return;
125
 
126
  // Logged out users miss out
127
  if ( $comment->user_id == 0 ) return;
mycred.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: myCred
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
- * Version: 1.8.13.1
7
  * Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
8
  * Author: myCred
9
  * Author URI: https://mycred.me
10
  * Author Email: support@mycred.me
11
  * Requires at least: WP 4.8
12
- * Tested up to: WP 5.4.2
13
  * Text Domain: mycred
14
  * Domain Path: /lang
15
  * License: GPLv2 or later
@@ -19,7 +19,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
19
  final class myCRED_Core {
20
 
21
  // Plugin Version
22
- public $version = '1.8.13.1';
23
 
24
  // Instnace
25
  protected static $_instance = NULL;
@@ -53,14 +53,14 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
53
  * @since 1.7
54
  * @version 1.0
55
  */
56
- public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '1.8.13.1' ); }
57
 
58
  /**
59
  * Not allowed
60
  * @since 1.7
61
  * @version 1.0
62
  */
63
- public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '1.8.13.1' ); }
64
 
65
  /**
66
  * Get
@@ -81,7 +81,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
81
  if ( ! defined( $name ) )
82
  define( $name, $value );
83
  elseif ( ! $definable && defined( $name ) )
84
- _doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '1.8.11' );
85
  }
86
 
87
  /**
@@ -93,7 +93,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
93
  if ( file_exists( $required_file ) )
94
  require_once $required_file;
95
  else
96
- _doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '1.8.13.1' );
97
  }
98
 
99
  /**
3
  * Plugin Name: myCred
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
+ * Version: 1.8.14
7
  * Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
8
  * Author: myCred
9
  * Author URI: https://mycred.me
10
  * Author Email: support@mycred.me
11
  * Requires at least: WP 4.8
12
+ * Tested up to: WP 5.5.1
13
  * Text Domain: mycred
14
  * Domain Path: /lang
15
  * License: GPLv2 or later
19
  final class myCRED_Core {
20
 
21
  // Plugin Version
22
+ public $version = '1.8.14';
23
 
24
  // Instnace
25
  protected static $_instance = NULL;
53
  * @since 1.7
54
  * @version 1.0
55
  */
56
+ public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '1.8.14' ); }
57
 
58
  /**
59
  * Not allowed
60
  * @since 1.7
61
  * @version 1.0
62
  */
63
+ public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '1.8.14' ); }
64
 
65
  /**
66
  * Get
81
  if ( ! defined( $name ) )
82
  define( $name, $value );
83
  elseif ( ! $definable && defined( $name ) )
84
+ _doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '1.8.14' );
85
  }
86
 
87
  /**
93
  if ( file_exists( $required_file ) )
94
  require_once $required_file;
95
  else
96
+ _doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '1.8.14' );
97
  }
98
 
99
  /**
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: mycred,wpexpertsio
3
  Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
- Tested up to: 5.5
6
- Stable tag: 1.8.13.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -280,6 +280,9 @@ Bug fixes release.
280
  = 1.8.13.1 =
281
  Bug fixes release.
282
 
 
 
 
283
  == Other Notes ==
284
 
285
  = Requirements =
@@ -301,6 +304,12 @@ Bug fixes release.
301
 
302
  == Changelog ==
303
 
 
 
 
 
 
 
304
  = 1.8.13.1 =
305
  - **FIX** - Site menu broken issue on frontend
306
  - **FIX** - Style glitches on some themes
@@ -492,5 +501,6 @@ IMPROVEMENT - Added check for existing logs getting disappeared.
492
  - **TWEAK** - issue related to email not getting send on transfer in and out triggers in transfer addon
493
  - **TWEAK** - Rank excerpt fix
494
 
 
495
  = Previous Versions =
496
  https://mycred.me/support/changelog/
2
  Contributors: mycred,wpexpertsio
3
  Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
+ Tested up to: 5.5.1
6
+ Stable tag: 1.8.14
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
280
  = 1.8.13.1 =
281
  Bug fixes release.
282
 
283
+ = 1.8.14 =
284
+ Bug fixes release.
285
+
286
  == Other Notes ==
287
 
288
  = Requirements =
304
 
305
  == Changelog ==
306
 
307
+ = 1.8.14 =
308
+ - **FIX** - Comments hooks not working.
309
+ - **FIX** - Warnings in myCred Sell Content.
310
+ - **FIX** - Ranks recalculate totals not working.
311
+ - **FIX** - mycred_history shortcode pagination not working.
312
+
313
  = 1.8.13.1 =
314
  - **FIX** - Site menu broken issue on frontend
315
  - **FIX** - Style glitches on some themes
501
  - **TWEAK** - issue related to email not getting send on transfer in and out triggers in transfer addon
502
  - **TWEAK** - Rank excerpt fix
503
 
504
+
505
  = Previous Versions =
506
  https://mycred.me/support/changelog/