myCRED - Version 1.7.9.7

Version Description

FIX Points for clicking on links FIX Point for viewing videos FIX Exchange points from one point type to another point type

Download this release

Release Info

Developer designbymerovingi
Plugin Icon 128x128 myCRED
Version 1.7.9.7
Comparing to
See all releases

Code changes from version 1.7.9.6 to 1.7.9.7

includes/mycred-protect.php CHANGED
@@ -52,7 +52,7 @@ if ( ! class_exists( 'myCRED_Protect' ) ) :
52
  $text = $value;
53
  $ivlen = openssl_cipher_iv_length( $cipher);
54
  $iv = openssl_random_pseudo_bytes($ivlen);
55
- $crypttext = openssl_encrypt( $text, $cipher, $this->skey, 0, $iv );
56
 
57
  return trim( $this->do_safe_b64encode( $crypttext ) );
58
 
@@ -74,7 +74,7 @@ if ( ! class_exists( 'myCRED_Protect' ) ) :
74
  $cipher = "AES-256-CBC";
75
  $iv_size = openssl_cipher_iv_length( $cipher);
76
  $iv = openssl_random_pseudo_bytes($iv_size);
77
- $decrypttext = openssl_decrypt( $crypttext, $cipher, $this->skey, 0, $iv );
78
 
79
  return trim( $decrypttext );
80
  }
@@ -95,7 +95,7 @@ if ( ! class_exists( 'myCRED_Protect' ) ) :
95
  $cipher = "AES-256-CBC";
96
  $iv_size = openssl_cipher_iv_length( $cipher);
97
  $iv = openssl_random_pseudo_bytes($iv_size);
98
- $decrypttext = openssl_decrypt( $crypttext, $cipher, $this->skey, 0, $iv );
99
  $string = trim( $decrypttext );
100
 
101
  parse_str( $string, $output );
52
  $text = $value;
53
  $ivlen = openssl_cipher_iv_length( $cipher);
54
  $iv = openssl_random_pseudo_bytes($ivlen);
55
+ $crypttext = openssl_encrypt( $text, $cipher, $this->skey, 0, 'hkjhsfidfghuqwer' );
56
 
57
  return trim( $this->do_safe_b64encode( $crypttext ) );
58
 
74
  $cipher = "AES-256-CBC";
75
  $iv_size = openssl_cipher_iv_length( $cipher);
76
  $iv = openssl_random_pseudo_bytes($iv_size);
77
+ $decrypttext = openssl_decrypt( $crypttext, $cipher, $this->skey, 0, 'hkjhsfidfghuqwer' );
78
 
79
  return trim( $decrypttext );
80
  }
95
  $cipher = "AES-256-CBC";
96
  $iv_size = openssl_cipher_iv_length( $cipher);
97
  $iv = openssl_random_pseudo_bytes($iv_size);
98
+ $decrypttext = openssl_decrypt( $crypttext, $cipher, $this->skey, 0, 'hkjhsfidfghuqwer' );
99
  $string = trim( $decrypttext );
100
 
101
  parse_str( $string, $output );
includes/shortcodes/mycred_exchange.php CHANGED
@@ -184,6 +184,31 @@ if ( ! function_exists( 'mycred_catch_exchange_requests' ) ) :
184
  $reply = apply_filters( 'mycred_decline_exchange', false, compact( 'from', 'to', 'user_id', 'rate', 'min', 'amount' ) );
185
  if ( $reply === false ) {
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  $mycred_from->add_creds(
188
  'exchange',
189
  $user_id,
@@ -194,21 +219,23 @@ if ( ! function_exists( 'mycred_catch_exchange_requests' ) ) :
194
  $from
195
  );
196
 
197
- $exchanged = $mycred_to->number( ( $amount * $rate ) );
 
 
 
 
 
 
 
 
198
 
199
- $mycred_to->add_creds(
200
- 'exchange',
201
- $user_id,
202
- $exchanged,
203
- sprintf( __( 'Exchange to %s', 'mycred' ), $mycred_to->plural() ),
204
- 0,
205
- array( 'to' => $to, 'rate' => $rate, 'min' => $min ),
206
- $to
207
- );
208
 
209
  $mycred_exchange = array(
210
  'success' => true,
211
- 'message' => sprintf( __( 'You have successfully exchanged %s into %s.', 'mycred' ), $mycred_from->format_creds( $amount ), $mycred_to->format_creds( $exchanged ) )
212
  );
213
 
214
  }
184
  $reply = apply_filters( 'mycred_decline_exchange', false, compact( 'from', 'to', 'user_id', 'rate', 'min', 'amount' ) );
185
  if ( $reply === false ) {
186
 
187
+ // Minimum Amount to be enter
188
+ $min_amount = 1 / $rate;
189
+
190
+ // Make sure user enter greater or equal to minimum amount
191
+ if( $amount < $min_amount ) {
192
+ $mycred_exchange = array(
193
+ 'success' => false,
194
+ 'message' => sprintf( __( 'You must enter minimum %s %s', 'mycred' ), $min_amount, $mycred_from->plural() )
195
+ );
196
+ return;
197
+ }
198
+
199
+ // Possible Amount that can be enter
200
+ $no_of_new_points_float = $amount / $min_amount;
201
+
202
+ // Round up value to send amount to mycred
203
+ $exchanged = $mycred_to->number( $no_of_new_points_float );
204
+
205
+ // Return extra amount
206
+ $amount_to_use = $min_amount * $exchanged;
207
+ $amount_to_return = $amount - $amount_to_use;
208
+
209
+ if( $amount_to_use != $amount )
210
+ $amount = $amount_to_use;
211
+
212
  $mycred_from->add_creds(
213
  'exchange',
214
  $user_id,
219
  $from
220
  );
221
 
222
+ $mycred_to->add_creds(
223
+ 'exchange',
224
+ $user_id,
225
+ $exchanged,
226
+ sprintf( __( 'Exchange to %s', 'mycred' ), $mycred_to->plural() ),
227
+ 0,
228
+ array( 'to' => $to, 'rate' => $rate, 'min' => $min ),
229
+ $to
230
+ );
231
 
232
+ $return_point_msg = '';
233
+ if( !empty( $amount_to_return ) )
234
+ $return_point_msg = '<br> Return %s %s into your balance';
 
 
 
 
 
 
235
 
236
  $mycred_exchange = array(
237
  'success' => true,
238
+ 'message' => sprintf( __( 'You have successfully exchanged %s into %s.'.$return_point_msg, 'mycred' ), $mycred_from->format_creds( $amount ), $mycred_to->format_creds( $exchanged ),$amount_to_return, $mycred_from->plural() )
239
  );
240
 
241
  }
modules/mycred-module-hooks.php CHANGED
@@ -2426,8 +2426,9 @@ if ( ! class_exists( 'myCRED_Hook_Click_Links' ) ) :
2426
  add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
2427
  add_filter( 'mycred_parse_tags_link', array( $this, 'parse_custom_tags' ), 10, 2 );
2428
 
2429
- if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-click-points' && isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-link-points' ) )
2430
  $this->ajax_call_link_points();
 
2431
 
2432
  }
2433
 
2426
  add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
2427
  add_filter( 'mycred_parse_tags_link', array( $this, 'parse_custom_tags' ), 10, 2 );
2428
 
2429
+ if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-click-points' && isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-link-points' ) ){
2430
  $this->ajax_call_link_points();
2431
+ }
2432
 
2433
  }
2434
 
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: 1.7.9.6
7
  * Tags: points, credit, balance, finance, rewards, engagement, woocommerce, bbpress, buddypress
8
  * Author: myCred
9
  * Author URI: https://mycred.me
3
  * Plugin Name: myCRED
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
+ * Version: 1.7.9.7
7
  * Tags: points, credit, balance, finance, rewards, engagement, woocommerce, bbpress, buddypress
8
  * Author: myCred
9
  * Author URI: https://mycred.me
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === myCRED ===
2
  Contributors: mycred ,wpexpertsio
3
  Tags: point, credit, loyalty program, engagement, reward
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
- Stable tag: 1.7.9.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -14,6 +14,7 @@ An adaptive and powerful points management system for WordPress powered websites
14
  myCRED is an adaptive points management system that lets you build a broad range of point related applications for your WordPress powered website.
15
  Store reward systems, community leaderboards, online banking or monetizing your websites content, are a few examples of the ways myCRED is used.
16
 
 
17
 
18
  = Points =
19
 
@@ -118,6 +119,11 @@ Bug fixes.
118
 
119
  == Changelog ==
120
 
 
 
 
 
 
121
  = 1.7.9.6 =
122
  FIX - Version error
123
 
1
+ === myCred - Points, Rewards & Badges | Loyalty Plugin ===
2
  Contributors: mycred ,wpexpertsio
3
  Tags: point, credit, loyalty program, engagement, reward
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
+ Stable tag: 1.7.9.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
14
  myCRED is an adaptive points management system that lets you build a broad range of point related applications for your WordPress powered website.
15
  Store reward systems, community leaderboards, online banking or monetizing your websites content, are a few examples of the ways myCRED is used.
16
 
17
+ **[List your self as beta tester for 1.8 (upcoming version)](https://goo.gl/forms/CMjGFpOEByfse9j52)**
18
 
19
  = Points =
20
 
119
 
120
  == Changelog ==
121
 
122
+ = 1.7.9.7 =
123
+ FIX – Points for clicking on links
124
+ FIX – Point for viewing videos
125
+ FIX – Exchange points from one point type to another point type
126
+
127
  = 1.7.9.6 =
128
  FIX - Version error
129