myCRED - Version 2.3.2

Version Description

Code improvement.

Download this release

Release Info

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

Code changes from version 2.3.1 to 2.3.2

includes/classes/class.mycred-license.php CHANGED
@@ -154,19 +154,9 @@ if ( ! class_exists( 'myCRED_License' ) ) :
154
 
155
  $plugin_info = $this->get_plugin_detail();
156
 
157
- if ( ! empty( $plugin_info ) && ! empty( $plugin_info->new_version ) ) {
158
-
159
- if ( version_compare( $this->version, $plugin_info->new_version, '<' ) ) {
160
- $data->response[ $this->filename ] = $plugin_info;
161
- } else {
162
- $data->no_update[ $this->filename ] = $plugin_info;
163
- }
164
-
165
- }
166
-
167
  if ( empty( $plugin_info->package ) && empty( $plugin_info->expiry ) ) {
168
 
169
- $message = 'License not found for this addon.';
170
 
171
  if ( ! empty( $plugin_info->message ) ) {
172
  $message = $plugin_info->message;
@@ -177,7 +167,7 @@ if ( ! class_exists( 'myCRED_License' ) ) :
177
  }
178
  else {
179
 
180
- $plugin_meta[] = '<strong style="color:green;">Your License Expires in ' . $this->calculate_license_expiry( $plugin_info->expiry ) . '</strong>';
181
 
182
  }
183
 
154
 
155
  $plugin_info = $this->get_plugin_detail();
156
 
 
 
 
 
 
 
 
 
 
 
157
  if ( empty( $plugin_info->package ) && empty( $plugin_info->expiry ) ) {
158
 
159
+ $message = 'License not found.';
160
 
161
  if ( ! empty( $plugin_info->message ) ) {
162
  $message = $plugin_info->message;
167
  }
168
  else {
169
 
170
+ $plugin_meta[] = '<strong style="color:green;">Expires in ' . $this->calculate_license_expiry( $plugin_info->expiry ) . '</strong>';
171
 
172
  }
173
 
includes/hooks/external/mycred-hook-affiliatewp.php CHANGED
@@ -222,6 +222,8 @@ function mycred_load_affiliatewp_hook() {
222
  // Get the user id
223
  $user_id = affwp_get_affiliate_user_id( $referral->affiliate_id );
224
 
 
 
225
  // Check for exclusion
226
  if ( $this->core->exclude_user( $user_id ) ) return;
227
 
222
  // Get the user id
223
  $user_id = affwp_get_affiliate_user_id( $referral->affiliate_id );
224
 
225
+ $this->prefs = apply_filters( 'mycred_affiliate_prefs', $this->prefs, $user_id, $this );
226
+
227
  // Check for exclusion
228
  if ( $this->core->exclude_user( $user_id ) ) return;
229
 
includes/mycred-addons-upgrader.php CHANGED
@@ -36,18 +36,26 @@ if ( ! class_exists( 'myCRED_Addons_Upgrader' ) ) :
36
 
37
  public function mycred_update_notice() {
38
 
39
- $is_upgrade_done = get_option( 'mycred_addons_upgrade' );
40
-
41
- if ( false === $is_upgrade_done ) :?>
42
- <div class="notice notice-warning is-dismissible">
43
- <h2 style="margin-bottom: 8px;">myCred Addons Update Required</h2>
44
- <p style="margin-bottom: 8px;">We have launched myCred version 2.3.1. For your addons to run smoothly, you need to update your myCred addons now! We have also upgraded our license management system to make sure your addons work perfectly after the required update. <br /><a href="https://mycred.me/blog/why-do-you-need-to-update-your-mycred-addons/" target="_blank">Why am I seeing this notice?</a></p>
45
- <a href="<?php echo admin_url('options.php?page=mycred-update'); ?>" class="button button-primary button-large">Update Addons Now</a>
46
- <a class="button button-large" href="<?php echo add_query_arg( 'mycred_addons_upgrader', 'mycred-addons-updated', home_url( $_SERVER['REQUEST_URI'] ) ) ?>">I have already updated</a>
47
- <br>
48
- <br>
49
- </div>
50
- <?php endif;
 
 
 
 
 
 
 
 
51
  }
52
 
53
  public function admin_init() {
36
 
37
  public function mycred_update_notice() {
38
 
39
+ $all_installed_plugins = get_plugins();
40
+ $mycred_installed_addons = $this->get_installed_mycred_addons( $all_installed_plugins );
41
+
42
+ if ( ! empty( $mycred_installed_addons ) ) {
43
+
44
+ $is_upgrade_done = get_option( 'mycred_addons_upgrade' );
45
+
46
+ if ( false === $is_upgrade_done ) :?>
47
+ <div class="notice notice-warning is-dismissible">
48
+ <h2 style="margin-bottom: 8px;">myCred Addons Update Required</h2>
49
+ <p style="margin-bottom: 8px;">From myCred version 2.3.1 and onwards, you will be able to use our latest license management system that allows you to run your add-ons more smoothly. Please update your add-ons immediately for a better experience!<br /><a href="https://mycred.me/blog/why-do-you-need-to-update-your-mycred-addons/" target="_blank">Why am I seeing this notice?</a></p>
50
+ <a href="<?php echo admin_url('options.php?page=mycred-update'); ?>" class="button button-primary button-large">Update Addons Now</a>
51
+ <a class="button button-large" href="<?php echo add_query_arg( 'mycred_addons_upgrader', 'mycred-addons-updated', home_url( $_SERVER['REQUEST_URI'] ) ) ?>">I have already updated</a>
52
+ <br>
53
+ <br>
54
+ </div>
55
+ <?php endif;
56
+
57
+ }
58
+
59
  }
60
 
61
  public function admin_init() {
membership/mycred-connect-membership.php CHANGED
@@ -300,6 +300,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
300
  if( !isset($_POST['mmc_lincense_key']) ) return;
301
 
302
  $license_key = sanitize_text_field( $_POST['mmc_lincense_key'] );
 
303
  if( isset( $license_key ) ) {
304
 
305
  update_option( 'mycred_membership_key', $license_key );
@@ -312,15 +313,30 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
312
 
313
  public function removeLicenseTransients() {
314
 
315
- $addons = apply_filters( 'mycred_license_addons', array() );
 
316
 
317
  foreach ( $addons as $addon ) {
 
 
 
 
 
 
 
 
 
 
 
 
318
 
319
  $transient_key = 'mcl_' . md5( $addon );
320
  delete_site_transient( $transient_key );
321
 
322
  }
323
 
 
 
324
  }
325
 
326
  }
300
  if( !isset($_POST['mmc_lincense_key']) ) return;
301
 
302
  $license_key = sanitize_text_field( $_POST['mmc_lincense_key'] );
303
+
304
  if( isset( $license_key ) ) {
305
 
306
  update_option( 'mycred_membership_key', $license_key );
313
 
314
  public function removeLicenseTransients() {
315
 
316
+ $addons = apply_filters( 'mycred_license_addons', array() );
317
+ $update_data = get_site_transient( 'update_plugins' );
318
 
319
  foreach ( $addons as $addon ) {
320
+
321
+ if ( isset( $update_data->response[ $addon . '/' . $addon . '.php' ] ) ) {
322
+ unset( $update_data->response[ $addon . '/' . $addon . '.php' ] );
323
+ }
324
+
325
+ if ( isset( $update_data->no_update[ $addon . '/' . $addon . '.php' ] ) ) {
326
+ unset( $update_data->no_update[ $addon . '/' . $addon . '.php' ] );
327
+ }
328
+
329
+ if ( isset( $update_data->checked[ $addon . '/' . $addon . '.php' ] ) ) {
330
+ unset( $update_data->checked[ $addon . '/' . $addon . '.php' ] );
331
+ }
332
 
333
  $transient_key = 'mcl_' . md5( $addon );
334
  delete_site_transient( $transient_key );
335
 
336
  }
337
 
338
+ set_site_transient( 'update_plugins', $update_data );
339
+
340
  }
341
 
342
  }
mycred.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: myCred
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
- * Version: 2.3.1
7
  * Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
8
  * Author: myCred
9
  * Author URI: https://mycred.me
@@ -20,7 +20,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
20
  final class myCRED_Core {
21
 
22
  // Plugin Version
23
- public $version = '2.3.1';
24
 
25
  // Instnace
26
  protected static $_instance = NULL;
@@ -54,14 +54,14 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
54
  * @since 1.7
55
  * @version 1.0
56
  */
57
- public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.3' ); }
58
 
59
  /**
60
  * Not allowed
61
  * @since 1.7
62
  * @version 1.0
63
  */
64
- public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.3' ); }
65
 
66
  /**
67
  * Get
@@ -94,7 +94,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
94
  if ( file_exists( $required_file ) )
95
  require_once $required_file;
96
  else
97
- _doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '2.2' );
98
  }
99
 
100
  /**
3
  * Plugin Name: myCred
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
+ * Version: 2.3.2
7
  * Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
8
  * Author: myCred
9
  * Author URI: https://mycred.me
20
  final class myCRED_Core {
21
 
22
  // Plugin Version
23
+ public $version = '2.3.2';
24
 
25
  // Instnace
26
  protected static $_instance = NULL;
54
  * @since 1.7
55
  * @version 1.0
56
  */
57
+ public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.3.2' ); }
58
 
59
  /**
60
  * Not allowed
61
  * @since 1.7
62
  * @version 1.0
63
  */
64
+ public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.3.2' ); }
65
 
66
  /**
67
  * Get
94
  if ( file_exists( $required_file ) )
95
  require_once $required_file;
96
  else
97
+ _doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '2.3.2' );
98
  }
99
 
100
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mycred,wpexpertsio
3
  Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
  Tested up to: 5.8.2
6
- Stable tag: 2.3.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -281,6 +281,9 @@ You can find a list of [frequently asked questions](https://mycred.me/about/faq/
281
 
282
  == Upgrade Notice ==
283
 
 
 
 
284
  = 2.3.1 =
285
  Improve license system.
286
 
@@ -320,6 +323,9 @@ The banking module have been replaced by Central deposite module, and interest r
320
 
321
  == Changelog ==
322
 
 
 
 
323
  = 2.3.1 =
324
  - **TWAEK** - Improve license system.
325
 
3
  Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
  Tested up to: 5.8.2
6
+ Stable tag: 2.3.2
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
281
 
282
  == Upgrade Notice ==
283
 
284
+ = 2.3.2 =
285
+ Code improvement.
286
+
287
  = 2.3.1 =
288
  Improve license system.
289
 
323
 
324
  == Changelog ==
325
 
326
+ = 2.3.2 =
327
+ - **TWAEK** - Code improvement.
328
+
329
  = 2.3.1 =
330
  - **TWAEK** - Improve license system.
331