myCRED - Version 1.8.9

Version Description

Bug fixes release.

=

Download this release

Release Info

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

Code changes from version 1.8.8 to 1.8.9

abstracts/mycred-abstract-hook.php CHANGED
@@ -285,8 +285,13 @@ if ( ! class_exists( 'myCRED_Hook' ) ) :
285
  // Put all wheres together into one string
286
  $wheres = implode( " AND ", $wheres );
287
 
 
 
 
 
 
288
  // Count
289
- $count = $wpdb->get_var( "SELECT COUNT(*) FROM {$mycred_log_table} WHERE {$wheres};" );
290
  if ( $count === NULL ) $count = 0;
291
 
292
  // Existence check has first priority
285
  // Put all wheres together into one string
286
  $wheres = implode( " AND ", $wheres );
287
 
288
+ $query = "SELECT COUNT(*) FROM {$mycred_log_table} WHERE {$wheres};";
289
+
290
+ //Lets play for others
291
+ $query = apply_filters( 'mycred_hook_limit_query', $query, $instance, $reference, $user_id, $ref_id, $wheres, $this );
292
+
293
  // Count
294
+ $count = $wpdb->get_var( $query );
295
  if ( $count === NULL ) $count = 0;
296
 
297
  // Existence check has first priority
addons/badges/myCRED-addon-badges.php CHANGED
@@ -1528,7 +1528,7 @@ jQuery(function($) {
1528
 
1529
  $user_id = bbp_get_displayed_user_id();
1530
  if ( isset( $this->badges['show_all_bb'] ) && $this->badges['show_all_bb'] == 1 )
1531
- mycred_render_my_badges( array(
1532
  'show' => 'all',
1533
  'width' => MYCRED_BADGE_WIDTH,
1534
  'height' => MYCRED_BADGE_HEIGHT,
@@ -1548,10 +1548,11 @@ jQuery(function($) {
1548
  public function insert_into_bbpress_reply() {
1549
 
1550
  $user_id = bbp_get_reply_author_id();
 
1551
  if ( $user_id > 0 ) {
1552
 
1553
  if ( isset( $this->badges['show_all_bb'] ) && $this->badges['show_all_bb'] == 1 )
1554
- mycred_render_my_badges( array(
1555
  'show' => 'all',
1556
  'width' => MYCRED_BADGE_WIDTH,
1557
  'height' => MYCRED_BADGE_HEIGHT,
1528
 
1529
  $user_id = bbp_get_displayed_user_id();
1530
  if ( isset( $this->badges['show_all_bb'] ) && $this->badges['show_all_bb'] == 1 )
1531
+ echo mycred_render_my_badges( array(
1532
  'show' => 'all',
1533
  'width' => MYCRED_BADGE_WIDTH,
1534
  'height' => MYCRED_BADGE_HEIGHT,
1548
  public function insert_into_bbpress_reply() {
1549
 
1550
  $user_id = bbp_get_reply_author_id();
1551
+
1552
  if ( $user_id > 0 ) {
1553
 
1554
  if ( isset( $this->badges['show_all_bb'] ) && $this->badges['show_all_bb'] == 1 )
1555
+ echo mycred_render_my_badges( array(
1556
  'show' => 'all',
1557
  'width' => MYCRED_BADGE_WIDTH,
1558
  'height' => MYCRED_BADGE_HEIGHT,
addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php CHANGED
@@ -90,16 +90,22 @@ if ( ! class_exists( 'myCRED_Payment_Gateway' ) ) :
90
  */
91
  public $redirect_to = '';
92
 
 
 
93
  /**
94
  * Toggle ID
95
  */
96
  public $toggle_id = '';
97
 
 
 
 
 
 
98
  protected $response;
99
  protected $request;
100
  protected $status;
101
 
102
- protected $errors = array();
103
  protected $processing_log = NULL;
104
 
105
  /**
@@ -160,6 +166,8 @@ if ( ! class_exists( 'myCRED_Payment_Gateway' ) ) :
160
  if ( $this->point_type != MYCRED_DEFAULT_TYPE_KEY )
161
  $this->core = mycred( $this->point_type );
162
 
 
 
163
  $this->transaction_id = ( isset( $_REQUEST['revisit'] ) ) ? strtoupper( sanitize_text_field( $_REQUEST['revisit'] ) ) : false;
164
  $this->post_id = ( $this->transaction_id !== false ) ? buycred_get_pending_payment_id( $this->transaction_id ) : false;
165
  $this->buyer_id = $this->current_user_id;
@@ -169,24 +177,34 @@ if ( ! class_exists( 'myCRED_Payment_Gateway' ) ) :
169
  $this->currency = ( isset( $this->prefs['currency'] ) ) ? $this->prefs['currency'] : '';
170
  $this->maximum = -1;
171
 
172
- if ( $this->core->exclude_user( $this->buyer_id ) )
173
  $valid = false;
174
-
 
175
  elseif ( $this->core->exclude_user( $this->recipient_id ) ) {
176
  $valid = false;
177
- $this->errors[] = 'recipient';
178
  }
179
 
180
- elseif ( $this->amount === false || $this->amount == 0 )
181
  $valid = false;
 
 
182
 
183
- elseif ( $this->exceeds_limit() )
184
  $valid = false;
 
 
 
 
 
 
 
185
 
186
  if ( $valid )
187
  $this->populate_transaction();
188
 
189
- if ( ! empty( $this->errors ) )
190
  $valid = false;
191
 
192
  return apply_filters( 'mycred_valid_buycred_request', $valid, $this );
@@ -277,7 +295,6 @@ if ( ! class_exists( 'myCRED_Payment_Gateway' ) ) :
277
  if ( $remaining === 0 ) {
278
 
279
  $exceeds = true;
280
- $this->errors[] = 'maximum';
281
  $this->maximum = 0;
282
 
283
  }
@@ -298,7 +315,6 @@ if ( ! class_exists( 'myCRED_Payment_Gateway' ) ) :
298
 
299
  if ( $remaining < 0 ) {
300
  $exceeds = true;
301
- $this->errors[] = 'maximum';
302
  $this->maximum = 0;
303
  }
304
  else {
@@ -735,8 +751,6 @@ if ( ! class_exists( 'myCRED_Payment_Gateway' ) ) :
735
  /**
736
  * First Comment
737
  * Used to allow a gateway to adjust the first comment with pending payments.
738
- * Used by Zombaio to remove the amount since that we do not know until the user completes
739
- * the payment.
740
  * @since 1.7.3
741
  * @version 1.0
742
  */
@@ -1197,8 +1211,8 @@ if ( ! class_exists( 'myCRED_Payment_Gateway' ) ) :
1197
 
1198
  }
1199
  public function purchase_header( $title = '', $reload = false ) {
1200
- $this->get_page_header( $title, $reload );
1201
- }
1202
 
1203
  /**
1204
  * Payment Page Footer
90
  */
91
  public $redirect_to = '';
92
 
93
+ public $errors = array();
94
+
95
  /**
96
  * Toggle ID
97
  */
98
  public $toggle_id = '';
99
 
100
+ /**
101
+ * Limit Setting
102
+ */
103
+ public $buycred_limit = array();
104
+
105
  protected $response;
106
  protected $request;
107
  protected $status;
108
 
 
109
  protected $processing_log = NULL;
110
 
111
  /**
166
  if ( $this->point_type != MYCRED_DEFAULT_TYPE_KEY )
167
  $this->core = mycred( $this->point_type );
168
 
169
+ $this->buycred_limit = mycred_get_buycred_sale_setup( $this->point_type );
170
+
171
  $this->transaction_id = ( isset( $_REQUEST['revisit'] ) ) ? strtoupper( sanitize_text_field( $_REQUEST['revisit'] ) ) : false;
172
  $this->post_id = ( $this->transaction_id !== false ) ? buycred_get_pending_payment_id( $this->transaction_id ) : false;
173
  $this->buyer_id = $this->current_user_id;
177
  $this->currency = ( isset( $this->prefs['currency'] ) ) ? $this->prefs['currency'] : '';
178
  $this->maximum = -1;
179
 
180
+ if ( $this->core->exclude_user( $this->buyer_id ) ){
181
  $valid = false;
182
+ $this->errors[] = __( 'Buyer is excluded from this point type.', 'mycred' );
183
+ }
184
  elseif ( $this->core->exclude_user( $this->recipient_id ) ) {
185
  $valid = false;
186
+ $this->errors[] = __( 'Recipient is excluded from this point type. ', 'mycred' );
187
  }
188
 
189
+ elseif ( $this->amount === false || $this->amount == 0 ){
190
  $valid = false;
191
+ $this->errors[] = __( 'An amount value is required.', 'mycred' );
192
+ }
193
 
194
+ elseif ( ! empty( $this->buycred_limit['max'] ) && $this->amount > floatval( $this->buycred_limit['max'] ) ){
195
  $valid = false;
196
+ $this->errors[] = sprintf( __( 'The amount must be less than %d.', 'mycred' ), $this->buycred_limit['max'] );
197
+ }
198
+
199
+ elseif ( $this->exceeds_limit() ){
200
+ $valid = false;
201
+ $this->errors[] = __( 'You have exceeded the limit.', 'mycred' );
202
+ }
203
 
204
  if ( $valid )
205
  $this->populate_transaction();
206
 
207
+ if ( ! empty( $this->errors ) )
208
  $valid = false;
209
 
210
  return apply_filters( 'mycred_valid_buycred_request', $valid, $this );
295
  if ( $remaining === 0 ) {
296
 
297
  $exceeds = true;
 
298
  $this->maximum = 0;
299
 
300
  }
315
 
316
  if ( $remaining < 0 ) {
317
  $exceeds = true;
 
318
  $this->maximum = 0;
319
  }
320
  else {
751
  /**
752
  * First Comment
753
  * Used to allow a gateway to adjust the first comment with pending payments.
 
 
754
  * @since 1.7.3
755
  * @version 1.0
756
  */
1211
 
1212
  }
1213
  public function purchase_header( $title = '', $reload = false ) {
1214
+ $this->get_page_header( $title, $reload );
1215
+ }
1216
 
1217
  /**
1218
  * Payment Page Footer
addons/buy-creds/assets/css/checkout.css CHANGED
@@ -36,6 +36,7 @@
36
  #buycred-checkout-wrapper.open .checkout-inside .checkout-wrapper #checkout-box .checkout-body { border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; margin-bottom: 0; }
37
  #buycred-checkout-wrapper.open .checkout-inside .checkout-wrapper #checkout-box .checkout-body.no-header { border-top-left-radius: 6px; border-top-right-radius: 6px; }
38
  #buycred-checkout-wrapper.open .checkout-inside .checkout-wrapper #checkout-box .checkout-footer button { width: 100%; border: none; border-radius: 6px !important; background-color: #dedede; color: #333; }
 
39
 
40
  #cancel-checkout-wrapper { z-index: 9999999; position: fixed; top: -42px; right: 12px; width: 42px; height: 42px; line-height: 42px; text-align: center; transition: top 0.5s; -moz-transition: top 0.5s; -o-transition: top 0.5s; -webkit-transition: top 0.5s; -ms-transition: top 0.5s; }
41
  #cancel-checkout-wrapper.on { top: 12px; transition: top 0.5s; -moz-transition: top 0.5s; -o-transition: top 0.5s; -webkit-transition: top 0.5s; -ms-transition: top 0.5s; }
36
  #buycred-checkout-wrapper.open .checkout-inside .checkout-wrapper #checkout-box .checkout-body { border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; margin-bottom: 0; }
37
  #buycred-checkout-wrapper.open .checkout-inside .checkout-wrapper #checkout-box .checkout-body.no-header { border-top-left-radius: 6px; border-top-right-radius: 6px; }
38
  #buycred-checkout-wrapper.open .checkout-inside .checkout-wrapper #checkout-box .checkout-footer button { width: 100%; border: none; border-radius: 6px !important; background-color: #dedede; color: #333; }
39
+ #buycred-checkout-wrapper.open .error { color: red; }
40
 
41
  #cancel-checkout-wrapper { z-index: 9999999; position: fixed; top: -42px; right: 12px; width: 42px; height: 42px; line-height: 42px; text-align: center; transition: top 0.5s; -moz-transition: top 0.5s; -o-transition: top 0.5s; -webkit-transition: top 0.5s; -ms-transition: top 0.5s; }
42
  #cancel-checkout-wrapper.on { top: 12px; transition: top 0.5s; -moz-transition: top 0.5s; -o-transition: top 0.5s; -webkit-transition: top 0.5s; -ms-transition: top 0.5s; }
addons/buy-creds/assets/js/checkout.js CHANGED
@@ -19,19 +19,20 @@ jQuery(function($){
19
  url : buyCRED.ajaxurl,
20
  success : function( response ) {
21
 
22
- console.log( response );
23
- buyCREDform.slideUp(function(){
24
- buyCREDform.empty().append( response ).slideDown();
25
- });
 
 
 
 
 
 
 
 
 
26
 
27
- },
28
- error : function( jqXHR, textStatus, errorThrown ) {
29
- console.log( textStatus );
30
- console.log( errorThrown );
31
- buyCREDform.slideUp(function(){
32
- buyCREDform.empty().append( '<div class="padded error">' + buyCRED.error + '</div>' ).slideDown();
33
- });
34
- buyCREDcancel.addClass( 'on' );
35
  }
36
  });
37
 
19
  url : buyCRED.ajaxurl,
20
  success : function( response ) {
21
 
22
+ console.log(response);
23
+
24
+ if ( typeof response.validationFail === "undefined" ) {
25
+ buyCREDform.slideUp(function(){
26
+ buyCREDform.empty().append( response ).slideDown();
27
+ });
28
+ }
29
+ else {
30
+ buyCREDform.slideUp(function(){
31
+ buyCREDform.empty().append( '<div class="padded error">' + response.errors[0] + '</div>' ).slideDown();
32
+ });
33
+ buyCREDcancel.addClass( 'on' );
34
+ }
35
 
 
 
 
 
 
 
 
 
36
  }
37
  });
38
 
addons/buy-creds/includes/buycred-functions.php CHANGED
@@ -94,17 +94,6 @@ if ( ! function_exists( 'mycred_get_buycred_gateways' ) ) :
94
  'custom_rate' => true
95
  );
96
 
97
- // Zombaio
98
- $installed['zombaio'] = array(
99
- 'title' => 'Zombaio',
100
- 'callback' => array( 'myCRED_Zombaio' ),
101
- 'documentation' => 'http://codex.mycred.me/chapter-iii/buycred/payment-gateways/zombaio/',
102
- 'icon' => 'dashicons-admin-generic',
103
- 'sandbox' => false,
104
- 'external' => true,
105
- 'custom_rate' => false
106
- );
107
-
108
  // Bank Transfers
109
  $installed['bank'] = array(
110
  'title' => __( 'Bank Transfer', 'mycred' ),
@@ -175,7 +164,6 @@ if ( ! function_exists( 'mycred_get_buycred_gateway_refs' ) ) :
175
  $references = array(
176
  'buy_creds_with_paypal_standard',
177
  'buy_creds_with_skrill',
178
- 'buy_creds_with_zombaio',
179
  'buy_creds_with_netbilling',
180
  'buy_creds_with_bitpay',
181
  'buy_creds_with_bank'
@@ -486,7 +474,7 @@ if ( ! function_exists( 'buycred_add_pending_comment' ) ) :
486
  'comment_author' => $author,
487
  'comment_author_email' => $author_email,
488
  'comment_content' => $comment,
489
- 'comment_type' => 'comment',
490
  'comment_author_IP' => $_SERVER['REMOTE_ADDR'],
491
  'comment_date' => $time,
492
  'comment_approved' => 1,
94
  'custom_rate' => true
95
  );
96
 
 
 
 
 
 
 
 
 
 
 
 
97
  // Bank Transfers
98
  $installed['bank'] = array(
99
  'title' => __( 'Bank Transfer', 'mycred' ),
164
  $references = array(
165
  'buy_creds_with_paypal_standard',
166
  'buy_creds_with_skrill',
 
167
  'buy_creds_with_netbilling',
168
  'buy_creds_with_bitpay',
169
  'buy_creds_with_bank'
474
  'comment_author' => $author,
475
  'comment_author_email' => $author_email,
476
  'comment_content' => $comment,
477
+ 'comment_type' => 'buycred',
478
  'comment_author_IP' => $_SERVER['REMOTE_ADDR'],
479
  'comment_date' => $time,
480
  'comment_approved' => 1,
addons/buy-creds/includes/buycred-shortcodes.php CHANGED
@@ -178,9 +178,9 @@ if ( ! function_exists( 'mycred_render_buy_form_points' ) ) :
178
 
179
  ob_start();
180
 
181
- if ( ! empty( $buycred_instance->errors ) ) {
182
 
183
- foreach ( $buycred_instance->errors as $error )
184
  echo '<div class="alert alert-warnng"><p>' . $error . '</p></div>';
185
 
186
  }
178
 
179
  ob_start();
180
 
181
+ if ( ! empty( $buycred_instance->gateway->errors ) ) {
182
 
183
+ foreach ( $buycred_instance->gateway->errors as $error )
184
  echo '<div class="alert alert-warnng"><p>' . $error . '</p></div>';
185
 
186
  }
addons/buy-creds/modules/buycred-module-core.php CHANGED
@@ -61,6 +61,8 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
61
  add_action( 'mycred_after_core_prefs', array( $this, 'after_general_settings' ) );
62
  add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 90, 3 );
63
 
 
 
64
  }
65
 
66
  /**
@@ -237,9 +239,13 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
237
  }
238
  else {
239
 
240
- if ( ! empty( $buycred_instance->gateway->errors ) )
241
  $buycred_instance->checkout = false;
242
 
 
 
 
 
243
  }
244
 
245
  }
@@ -1384,6 +1390,17 @@ jQuery(function($) {
1384
 
1385
  }
1386
 
 
 
 
 
 
 
 
 
 
 
 
1387
  }
1388
  endif;
1389
 
61
  add_action( 'mycred_after_core_prefs', array( $this, 'after_general_settings' ) );
62
  add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 90, 3 );
63
 
64
+ add_action('pre_get_comments', array( $this, 'hide_buycred_transactions' ) );
65
+
66
  }
67
 
68
  /**
239
  }
240
  else {
241
 
242
+ if ( ! empty( $buycred_instance->gateway->errors ) ) {
243
  $buycred_instance->checkout = false;
244
 
245
+ if ( $buycred_instance->is_ajax )
246
+ die( json_encode( array( 'validationFail' => true , 'errors' => $buycred_instance->gateway->errors ) ) );
247
+ }
248
+
249
  }
250
 
251
  }
1390
 
1391
  }
1392
 
1393
+ /**
1394
+ * Hide Comments
1395
+ * @since 1.8.9
1396
+ * @version 1.0
1397
+ */
1398
+ public function hide_buycred_transactions( $query ) {
1399
+
1400
+ $query->query_vars['type__not_in'] = 'buycred';
1401
+
1402
+ }
1403
+
1404
  }
1405
  endif;
1406
 
addons/buy-creds/myCRED-addon-buy-creds.php CHANGED
@@ -38,7 +38,6 @@ require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'paypal-standard.php';
38
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'bitpay.php';
39
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'netbilling.php';
40
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'skrill.php';
41
- require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'zombaio.php';
42
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'bank-transfer.php';
43
 
44
  do_action( 'mycred_buycred_load_gateways' );
38
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'bitpay.php';
39
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'netbilling.php';
40
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'skrill.php';
 
41
  require_once MYCRED_BUYCRED_GATEWAYS_DIR . 'bank-transfer.php';
42
 
43
  do_action( 'mycred_buycred_load_gateways' );
addons/ranks/includes/mycred-rank-functions.php CHANGED
@@ -629,7 +629,7 @@ endif;
629
  if ( ! function_exists( 'mycred_manual_ranks' ) ) :
630
  function mycred_manual_ranks( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
631
 
632
- $prefs = mycred_get_addon_settings( 'ranks', $point_type );
633
 
634
  $result = false;
635
  if ( $prefs['base'] == 'manual' )
@@ -650,7 +650,7 @@ endif;
650
  if ( ! function_exists( 'mycred_rank_based_on_total' ) ) :
651
  function mycred_rank_based_on_total( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
652
 
653
- $prefs = mycred_get_addon_settings( 'ranks', $point_type );
654
 
655
  $result = false;
656
  if ( $prefs['base'] == 'total' )
@@ -670,7 +670,7 @@ endif;
670
  if ( ! function_exists( 'mycred_show_rank_in_buddypress' ) ) :
671
  function mycred_show_rank_in_buddypress( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
672
 
673
- $prefs = mycred_get_addon_settings( 'ranks', $point_type );
674
 
675
  $result = false;
676
  if ( $prefs['rank']['bb_location'] != '' )
@@ -690,7 +690,7 @@ endif;
690
  if ( ! function_exists( 'mycred_show_rank_in_bbpress' ) ) :
691
  function mycred_show_rank_in_bbpress( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
692
 
693
- $prefs = mycred_get_addon_settings( 'ranks', $point_type );
694
 
695
  $result = false;
696
  if ( $prefs['rank']['bp_location'] != '' )
629
  if ( ! function_exists( 'mycred_manual_ranks' ) ) :
630
  function mycred_manual_ranks( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
631
 
632
+ $prefs = mycred_get_addon_settings( 'rank', $point_type );
633
 
634
  $result = false;
635
  if ( $prefs['base'] == 'manual' )
650
  if ( ! function_exists( 'mycred_rank_based_on_total' ) ) :
651
  function mycred_rank_based_on_total( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
652
 
653
+ $prefs = mycred_get_addon_settings( 'rank', $point_type );
654
 
655
  $result = false;
656
  if ( $prefs['base'] == 'total' )
670
  if ( ! function_exists( 'mycred_show_rank_in_buddypress' ) ) :
671
  function mycred_show_rank_in_buddypress( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
672
 
673
+ $prefs = mycred_get_addon_settings( 'rank', $point_type );
674
 
675
  $result = false;
676
  if ( $prefs['rank']['bb_location'] != '' )
690
  if ( ! function_exists( 'mycred_show_rank_in_bbpress' ) ) :
691
  function mycred_show_rank_in_bbpress( $point_type = MYCRED_DEFAULT_TYPE_KEY ) {
692
 
693
+ $prefs = mycred_get_addon_settings( 'rank', $point_type );
694
 
695
  $result = false;
696
  if ( $prefs['rank']['bp_location'] != '' )
addons/ranks/includes/mycred-rank-shortcodes.php CHANGED
@@ -76,7 +76,7 @@ if ( ! function_exists( 'mycred_render_my_ranks' ) ) :
76
  if ( $user_id == '' && ! is_user_logged_in() ) return;
77
 
78
  $user_id = mycred_get_user_id( $user_id );
79
- if ( $user_id === false ) return;
80
 
81
  $account_object = mycred_get_account( $user_id );
82
  $show = array();
76
  if ( $user_id == '' && ! is_user_logged_in() ) return;
77
 
78
  $user_id = mycred_get_user_id( $user_id );
79
+ if ( $user_id == false ) return;
80
 
81
  $account_object = mycred_get_account( $user_id );
82
  $show = array();
addons/ranks/myCRED-addon-ranks.php CHANGED
@@ -854,6 +854,9 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
854
  // No settings
855
  if ( ! isset( $mycred->rank['bp_location'] ) ) continue;
856
 
 
 
 
857
  // Not shown
858
  if ( ! in_array( $mycred->rank['bp_location'], array( 'reply', 'both' ) ) || $mycred->rank['bp_template'] == '' ) continue;
859
 
@@ -899,6 +902,9 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
899
  // No settings
900
  if ( ! isset( $mycred->rank['bp_location'] ) ) continue;
901
 
 
 
 
902
  // Not shown
903
  if ( ! in_array( $mycred->rank['bp_location'], array( 'profile', 'both' ) ) || $mycred->rank['bp_template'] == '' ) continue;
904
 
854
  // No settings
855
  if ( ! isset( $mycred->rank['bp_location'] ) ) continue;
856
 
857
+ //Nothing to do if we are excluded
858
+ if ( $mycred->exclude_user( $user_id ) ) continue;
859
+
860
  // Not shown
861
  if ( ! in_array( $mycred->rank['bp_location'], array( 'reply', 'both' ) ) || $mycred->rank['bp_template'] == '' ) continue;
862
 
902
  // No settings
903
  if ( ! isset( $mycred->rank['bp_location'] ) ) continue;
904
 
905
+ //Nothing to do if we are excluded
906
+ if ( $mycred->exclude_user( $user_id ) ) continue;
907
+
908
  // Not shown
909
  if ( ! in_array( $mycred->rank['bp_location'], array( 'profile', 'both' ) ) || $mycred->rank['bp_template'] == '' ) continue;
910
 
includes/hooks/mycred-hook-view-content.php CHANGED
@@ -55,6 +55,8 @@ if ( ! class_exists( 'myCRED_Hook_View_Contents' ) ) :
55
  // First instance where we can safely use conditional template tags
56
  add_action( 'template_redirect', array( $this, 'content_loading' ), 999 );
57
 
 
 
58
  }
59
 
60
  /**
@@ -390,5 +392,16 @@ if ( ! class_exists( 'myCRED_Hook_View_Contents' ) ) :
390
 
391
  }
392
 
 
 
 
 
 
 
 
 
 
 
 
393
  }
394
  endif;
55
  // First instance where we can safely use conditional template tags
56
  add_action( 'template_redirect', array( $this, 'content_loading' ), 999 );
57
 
58
+ add_filter( 'mycred_hook_limit_query', array( $this, 'view_content_query' ), 10, 7 );
59
+
60
  }
61
 
62
  /**
392
 
393
  }
394
 
395
+ public function view_content_query( $query, $instance, $reference, $user_id, $ref_id, $wheres ) {
396
+
397
+ global $wpdb, $mycred_log_table;
398
+
399
+ if ( 'view_content' == $reference || 'view_content_author' == $reference ) {
400
+ $query = "SELECT COUNT(l.id) FROM {$mycred_log_table} as l JOIN {$wpdb->prefix}posts as p on l.ref_id = p.ID WHERE p.post_type = '{$instance}' AND {$wheres}";
401
+ }
402
+
403
+ return $query;
404
+ }
405
+
406
  }
407
  endif;
includes/mycred-functions.php CHANGED
@@ -1448,7 +1448,11 @@ if ( ! class_exists( 'myCRED_Settings' ) ) :
1448
  // Update total balance (if enabled)
1449
  if ( MYCRED_ENABLE_TOTAL_BALANCE && MYCRED_ENABLE_LOGGING && ( $run_this['amount'] > 0 || ( $run_this['amount'] < 0 && $run_this['ref'] == 'manual' ) ) ) {
1450
 
1451
- $this->update_users_total_balance( (int) $run_this['user_id'], $run_this['amount'], $run_this['type'] );
 
 
 
 
1452
 
1453
  }
1454
 
1448
  // Update total balance (if enabled)
1449
  if ( MYCRED_ENABLE_TOTAL_BALANCE && MYCRED_ENABLE_LOGGING && ( $run_this['amount'] > 0 || ( $run_this['amount'] < 0 && $run_this['ref'] == 'manual' ) ) ) {
1450
 
1451
+ $is_update_total_balance = apply_filters( 'mycred_update_total_balance', true, $run_this );
1452
+
1453
+ if ( $is_update_total_balance ) {
1454
+ $this->update_users_total_balance( (int) $run_this['user_id'], $run_this['amount'], $run_this['type'] );
1455
+ }
1456
 
1457
  }
1458
 
membership/mycred-connect-membership.php CHANGED
@@ -53,7 +53,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
53
  <div class="mmc_title"><?php _e( 'Welcome to myCRED Membership Club', 'mycred' ); ?></div>
54
  <input type="text" name="mmc_lincense_key" class="mmc_lincense_key" placeholder="<?php _e( 'Add Your Membership License', 'mycred' ); ?>" value="<?php echo $membership_key?>">
55
  <input type="submit" class="mmc_save_license button-primary" value="Save"/>
56
- <div class="mmc_license_link"><a href="https://mycred.me/redirect-to-membership/" target="_blank"><span class="dashicons dashicons-editor-help"></span><?php _e('Click here to get your Membership License','mycred') ?></a></div>
57
  </form>
58
  </div>
59
  </div>
53
  <div class="mmc_title"><?php _e( 'Welcome to myCRED Membership Club', 'mycred' ); ?></div>
54
  <input type="text" name="mmc_lincense_key" class="mmc_lincense_key" placeholder="<?php _e( 'Add Your Membership License', 'mycred' ); ?>" value="<?php echo $membership_key?>">
55
  <input type="submit" class="mmc_save_license button-primary" value="Save"/>
56
+ <div class="mmc_license_link"><a href="#"><span class="dashicons dashicons-editor-help"></span><?php _e('Click here to get your Membership License','mycred') ?></a></div>
57
  </form>
58
  </div>
59
  </div>
mycred.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  /**
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.8
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.3.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.8';
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.8' ); }
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.8' ); }
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.7' );
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.8' );
97
  }
98
 
99
  /**
1
  <?php
2
  /**
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.9
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
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.9';
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.9' ); }
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.9' ); }
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.9' );
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.9' );
97
  }
98
 
99
  /**
readme.txt CHANGED
@@ -1,13 +1,15 @@
1
  === myCred - Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin ===
2
  Contributors: mycred,wpexpertsio
3
- Tags: points, badges, rewards, loyalty, gamification, loyalty points, user engagement, user credit
4
  Requires at least: 4.8
5
- Tested up to: 5.3
6
- Stable tag: 1.8.8
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
 
 
11
  == Description ==
12
 
13
  myCred is an intelligent and adaptive **points management system** that allows you to build and manage a broad range of digital rewards including points, ranks and, badges on your WordPress/WooCommerce powered website.
@@ -144,6 +146,7 @@ myCred is integrated with a large number of popular learning management systems,
144
 
145
  - [Stripe – buyCred Gateway](https://www.mycred.me/store/buycred-stripe/)
146
  - [Easy Digital Downloads – myCred Gateway](https://www.mycred.me/store/mycred-for-easy-digital-downloads/)
 
147
  - [myCred Dokan](https://www.mycred.me/store/mycred-dokan/)
148
  - [myCred WCVendors](https://www.mycred.me/store/mycred-wc-vendors/)
149
  - [myCred Learndash](https://www.mycred.me/store/mycred-learndash/)
@@ -159,6 +162,9 @@ myCred is integrated with a large number of popular learning management systems,
159
  = MYCRED’S ENHANCEMENT PLUGINS: =
160
 
161
  - [myCred WooCommerce Plus](https://www.mycred.me/store/mycred-woocommerce-plus/)
 
 
 
162
  - [myCred Level Cred](https://www.mycred.me/store/mycred-level-cred/)
163
  - [myCred Social Proof](https://www.mycred.me/store/mycred-social-proof/)
164
  - [myCred SMS Payments – Twilio Transfers](https://www.mycred.me/store/sms-payments/)
@@ -193,7 +199,7 @@ If you’re facing a problem that is not described in our technical documentatio
193
 
194
  == Installation ==
195
 
196
- = myCred Guides =
197
 
198
  [Chapter I - Introduction](http://codex.mycred.me/chapter-i/)
199
 
@@ -259,11 +265,16 @@ Bug fixes release.
259
  = 1.8.8 =
260
  Bug fixes release.
261
 
 
 
 
 
262
  == Other Notes ==
263
 
264
  = Requirements =
265
  * WordPress 4.8 or greater
266
- * PHP version 7.0 or greater
 
267
  * MySQL version 5.0 or greater
268
 
269
  = Language Contributors =
@@ -279,6 +290,17 @@ Bug fixes release.
279
 
280
  == Changelog ==
281
 
 
 
 
 
 
 
 
 
 
 
 
282
  = 1.8.8 =
283
  NEW - Introduced myCred membership.
284
  NEW - Added support in badge for specific link click and gravity form.
1
  === myCred - Points, Rewards, Gamification, Ranks, Badges & Loyalty Plugin ===
2
  Contributors: mycred,wpexpertsio
3
+ Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
+ Tested up to: 5.4
6
+ Stable tag: 1.8.9
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ An adaptive and powerful points management system for WordPress powered websites.
12
+
13
  == Description ==
14
 
15
  myCred is an intelligent and adaptive **points management system** that allows you to build and manage a broad range of digital rewards including points, ranks and, badges on your WordPress/WooCommerce powered website.
146
 
147
  - [Stripe – buyCred Gateway](https://www.mycred.me/store/buycred-stripe/)
148
  - [Easy Digital Downloads – myCred Gateway](https://www.mycred.me/store/mycred-for-easy-digital-downloads/)
149
+ - [myCred Zapier Addon](https://mycred.me/store/mycred-zapier-addon/)
150
  - [myCred Dokan](https://www.mycred.me/store/mycred-dokan/)
151
  - [myCred WCVendors](https://www.mycred.me/store/mycred-wc-vendors/)
152
  - [myCred Learndash](https://www.mycred.me/store/mycred-learndash/)
162
  = MYCRED’S ENHANCEMENT PLUGINS: =
163
 
164
  - [myCred WooCommerce Plus](https://www.mycred.me/store/mycred-woocommerce-plus/)
165
+ - [myCred Email Digest](https://mycred.me/store/mycred-email-digest/)
166
+ - [myCred Progress Map](https://mycred.me/store/mycred-progress-map/)
167
+ - [myCred Points Cap](https://mycred.me/store/mycred-points-cap/)
168
  - [myCred Level Cred](https://www.mycred.me/store/mycred-level-cred/)
169
  - [myCred Social Proof](https://www.mycred.me/store/mycred-social-proof/)
170
  - [myCred SMS Payments – Twilio Transfers](https://www.mycred.me/store/sms-payments/)
199
 
200
  == Installation ==
201
 
202
+ = myCRED Guides =
203
 
204
  [Chapter I - Introduction](http://codex.mycred.me/chapter-i/)
205
 
265
  = 1.8.8 =
266
  Bug fixes release.
267
 
268
+ = 1.8.9 =
269
+ Bug fixes release.
270
+
271
+
272
  == Other Notes ==
273
 
274
  = Requirements =
275
  * WordPress 4.8 or greater
276
+ * PHP version 5.6 or greater
277
+ * PHP mcrypt library enabled
278
  * MySQL version 5.0 or greater
279
 
280
  = Language Contributors =
290
 
291
  == Changelog ==
292
 
293
+ = 1.8.9 =
294
+ NEW - Introduce a new filter mycred_update_total_balance.
295
+ FIX - Rank display setting issues.
296
+ FIX - View content hook limit not working properly.
297
+ FIX - Buycred maximum limit not working.
298
+ FIX - myCred ranks show in BBPress profile and topic post even the user is excluded from the point type.
299
+ FIX - Badges not displaying in BBPress profile even check show all badges.
300
+ FIX - BuyCred Payment transactions visible in recent comments section.
301
+ TWEAK - Improvement in mycred_my_ranks shortcode.
302
+ TWEAK - Buycred shows proper error messages.
303
+
304
  = 1.8.8 =
305
  NEW - Introduced myCred membership.
306
  NEW - Added support in badge for specific link click and gravity form.