myCRED - Version 1.7.9

Version Description

Minor bug fixes.

=

Download this release

Release Info

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

Code changes from version 1.7.8.1 to 1.7.9

addons/badges/includes/mycred-badge-functions.php CHANGED
@@ -201,7 +201,7 @@ endif;
201
  * Display Badge Requirements
202
  * Returns the badge requirements as a string in a readable format.
203
  * @since 1.5
204
- * @version 1.2.1
205
  */
206
  if ( ! function_exists( 'mycred_display_badge_requirement' ) ) :
207
  function mycred_display_badge_requirements( $badge_id = NULL ) {
@@ -247,7 +247,7 @@ if ( ! function_exists( 'mycred_display_badge_requirement' ) ) :
247
  foreach ( $levels as $level => $setup ) {
248
 
249
  $level_label = '<strong>' . sprintf( __( 'Level %s', 'mycred' ), ( $level + 1 ) ) . ':</strong>';
250
- if ( $levels[0]['label'] != '' )
251
  $level_label = '<strong>' . $levels[0]['label'] . ':</strong>';
252
 
253
  // Construct requirements to be used in an unorganized list.
201
  * Display Badge Requirements
202
  * Returns the badge requirements as a string in a readable format.
203
  * @since 1.5
204
+ * @version 1.2.2
205
  */
206
  if ( ! function_exists( 'mycred_display_badge_requirement' ) ) :
207
  function mycred_display_badge_requirements( $badge_id = NULL ) {
247
  foreach ( $levels as $level => $setup ) {
248
 
249
  $level_label = '<strong>' . sprintf( __( 'Level %s', 'mycred' ), ( $level + 1 ) ) . ':</strong>';
250
+ if ( $levels[ $level ]['label'] != '' )
251
  $level_label = '<strong>' . $levels[0]['label'] . ':</strong>';
252
 
253
  // Construct requirements to be used in an unorganized list.
addons/ranks/myCRED-addon-ranks.php CHANGED
@@ -998,17 +998,20 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
998
  * Adjust Rank Sort Order
999
  * Adjusts the wp query when viewing ranks to order by the min. point requirement.
1000
  * @since 1.1.1
1001
- * @version 1.2
1002
  */
1003
  public function adjust_wp_query( $query ) {
1004
 
 
 
1005
  // Front End Queries
1006
  if ( ! is_admin() ) {
1007
 
1008
- if ( ! is_post_type_archive( 'mycred_rank' ) ) return;
 
1009
 
1010
  // By default we want to only show ranks for the main point type
1011
- if ( ! isset( $_GET['ctype'] ) && $query->is_main_query() ) {
1012
  $query->set( 'meta_query', array(
1013
  array(
1014
  'key' => 'ctype',
@@ -1034,6 +1037,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
1034
  // Admin Queries
1035
  else {
1036
 
 
1037
  if ( ! isset( $query->query['post_type'] ) || $query->query['post_type'] != 'mycred_rank' ) return;
1038
 
1039
  // If ctype is set, filter ranks according to it's value
998
  * Adjust Rank Sort Order
999
  * Adjusts the wp query when viewing ranks to order by the min. point requirement.
1000
  * @since 1.1.1
1001
+ * @version 1.2.1
1002
  */
1003
  public function adjust_wp_query( $query ) {
1004
 
1005
+ if ( ! function_exists( 'is_admin' ) ) return;
1006
+
1007
  // Front End Queries
1008
  if ( ! is_admin() ) {
1009
 
1010
+ // Only applicable on the post archive page (if used) and only for the main query
1011
+ if ( ! is_post_type_archive( 'mycred_rank' ) || ! $query->is_main_query() ) return;
1012
 
1013
  // By default we want to only show ranks for the main point type
1014
+ if ( ! isset( $_GET['ctype'] ) ) {
1015
  $query->set( 'meta_query', array(
1016
  array(
1017
  'key' => 'ctype',
1037
  // Admin Queries
1038
  else {
1039
 
1040
+ // Only applicable when we are quering ranks
1041
  if ( ! isset( $query->query['post_type'] ) || $query->query['post_type'] != 'mycred_rank' ) return;
1042
 
1043
  // If ctype is set, filter ranks according to it's value
addons/transfer/includes/mycred-transfer-functions.php CHANGED
@@ -100,7 +100,7 @@ endif;
100
  /**
101
  * New Transfer
102
  * @since 1.7.6
103
- * @version 1.0.1
104
  */
105
  if ( ! function_exists( 'mycred_new_transfer' ) ) :
106
  function mycred_new_transfer( $request = array() ) {
@@ -144,9 +144,6 @@ if ( ! function_exists( 'mycred_new_transfer' ) ) :
144
  if ( $attempt_check === 'limit' )
145
  return 'error_8';
146
 
147
- // Let others play before we execute the transfer
148
- do_action( 'mycred_transfer_ready', $transaction_id, $request, $settings );
149
-
150
  // Prevent Duplicate transactions
151
  if ( $mycred->has_entry( $reference, $recipient_id, $sender_id, $data, $point_type ) )
152
  return 'error_9';
100
  /**
101
  * New Transfer
102
  * @since 1.7.6
103
+ * @version 1.0.2
104
  */
105
  if ( ! function_exists( 'mycred_new_transfer' ) ) :
106
  function mycred_new_transfer( $request = array() ) {
144
  if ( $attempt_check === 'limit' )
145
  return 'error_8';
146
 
 
 
 
147
  // Prevent Duplicate transactions
148
  if ( $mycred->has_entry( $reference, $recipient_id, $sender_id, $data, $point_type ) )
149
  return 'error_9';
assets/css/mycred-admin.css CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * myCRED Admin Styling
3
  * @since 0.1
4
- * @version 1.3.2
5
  */
6
  #myCRED-wrap table th#creds { width: 10%; }
7
  #myCRED-wrap table .alternate { background-color: white; }
@@ -114,6 +114,7 @@ body.version-3-8 #myCRED-wrap #accordion .ui-accordion-header { border-top: 1px
114
  body #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #dedede; border-bottom: none; background-color: transparent; background: none; border-left: none; border-right: none; }
115
  body.version-3-8 #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #fafafa; border-bottom: 1px solid #dedede; }
116
  #myCRED-wrap #accordion .ui-accordion-content .wrapper:after { content: "."; height: 0; visibility: hidden; margin: 0; padding: 0; }
 
117
 
118
  .ui-accordion-content>div.wrapper { display: block; margin: 0; padding: 0; float: none; clear: both; }
119
  .ui-accordion-content>div.wrapper .clear { height: 0; visibility: hidden; display: block; float: none; clear: both; }
@@ -172,8 +173,16 @@ body.version-3-8 #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px
172
  #export-log-history p { margin-bottom: 0; }
173
 
174
  /* Exporter */
175
- .mycred-export-points { background-color:white; z-index: 99; }
176
- .mycred-export-points>div { padding:12px; }
177
- .mycred-export-points .ui-dialog-titlebar { line-height:24px; border-bottom: 1px solid #dedede; }
178
- .mycred-export-points .ui-dialog-titlebar:hover { cursor:move; }
179
- .mycred-export-points .ui-dialog-titlebar-close { float:right; }
 
 
 
 
 
 
 
 
1
  /**
2
  * myCRED Admin Styling
3
  * @since 0.1
4
+ * @version 1.4
5
  */
6
  #myCRED-wrap table th#creds { width: 10%; }
7
  #myCRED-wrap table .alternate { background-color: white; }
114
  body #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #dedede; border-bottom: none; background-color: transparent; background: none; border-left: none; border-right: none; }
115
  body.version-3-8 #myCRED-wrap #accordion .ui-accordion-content { border-top: 1px solid #fafafa; border-bottom: 1px solid #dedede; }
116
  #myCRED-wrap #accordion .ui-accordion-content .wrapper:after { content: "."; height: 0; visibility: hidden; margin: 0; padding: 0; }
117
+ .ui-widget-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: repeat-x scroll 70% 70% #000; opacity: 0.7; overflow: hidden; background: repeat-x scroll 70% 70% #000; z-index: 99; }
118
 
119
  .ui-accordion-content>div.wrapper { display: block; margin: 0; padding: 0; float: none; clear: both; }
120
  .ui-accordion-content>div.wrapper .clear { height: 0; visibility: hidden; display: block; float: none; clear: both; }
173
  #export-log-history p { margin-bottom: 0; }
174
 
175
  /* Exporter */
176
+ #export-points { background-color: #f3f3f3; font-size: 14px; }
177
+ #export-points .form { display: block; padding: 12px; }
178
+ .mycred-export-points { font-family: "Open Sans",sans-serif; background-color: white !important; z-index: 9999 !important; border: none !important; border-radius: 0 !important; background-image: none !important; padding: 0 !important; overflow: visible !important; }
179
+ .mycred-export-points.ui-dialog .ui-dialog-content { padding: 0 0 0 0; }
180
+ .mycred-export-points .ui-widget-header { border: none !important; background: transparent !important; font-weight: normal !important; }
181
+ .mycred-export-points .ui-dialog-titlebar { line-height: 24px !important; border-bottom: 1px solid #ddd !important; border-left: none; border-top: none; border-right: none; padding: 12px !important; border-radius: 0 !important; }
182
+ .mycred-export-points .ui-dialog-titlebar:hover { cursor: move; }
183
+ .mycred-export-points .ui-dialog-titlebar-close { float: right; margin: 0 12px 0 0; background: 0 0; border: none; -webkit-box-shadow: none; box-shadow: none; color: #666; cursor: pointer; display: block; padding: 0; position: absolute; top: 0; right: 0; width: 36px; height: 36px; text-align: center; font-size: 13px; line-height: 26px; vertical-align: top; white-space: nowrap; }
184
+ .mycred-export-points .ui-icon { display: none !important; }
185
+ .mycred-export-points .ui-button:focus, .mycred-export-points .ui-button:active { outline: none !important; }
186
+ .mycred-export-points .ui-button .ui-button-text { display: block; text-indent: 0; }
187
+ .mycred-export-points .ui-dialog-title { font-size: 22px; font-weight: 600; margin: 0 0 0 0; width: auto !important; float: none !important; }
188
+ .mycred-export-points .form-control { width: 100%; margin-bottom: 6px; }
assets/js/mycred-type-management.js CHANGED
@@ -1,10 +1,13 @@
1
  /**
2
  * myCRED Management Scripts
3
  * @since 1.3
4
- * @version 1.3
5
  */
6
  jQuery(function($) {
7
 
 
 
 
8
  /**
9
  * Make sure new point type key is
10
  * correctly formatted. Only lowercase letters and underscores
@@ -122,28 +125,48 @@ jQuery(function($) {
122
 
123
  });
124
 
125
- /**
126
- * Export Balances Modal
127
- */
128
- $( '#export-points' ).dialog({
129
- dialogClass : 'mycred-export-points',
130
- draggable : false,
131
- autoOpen : false,
132
- closeText : myCREDmanage.export_close,
133
- title : myCREDmanage.export_title,
134
- modal : true,
135
- width : 500,
136
- resizable : false,
137
- show : { effect: 'slide', direction: 'up', duration: 250 },
138
- hide : { effect: 'slide', direction: 'up', duration: 250 }
139
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
- /**
142
- * Export balances Modal Trigger
143
- */
144
- $( '#mycred-export-users-points' ).click( function() {
145
 
146
- $( '#export-points' ).dialog( 'open' );
 
 
 
 
147
 
148
  });
149
 
1
  /**
2
  * myCRED Management Scripts
3
  * @since 1.3
4
+ * @version 1.4
5
  */
6
  jQuery(function($) {
7
 
8
+ var wWidth = $(window).width();
9
+ var dWidth = wWidth * 0.75;
10
+
11
  /**
12
  * Make sure new point type key is
13
  * correctly formatted. Only lowercase letters and underscores
125
 
126
  });
127
 
128
+ $(document).ready( function() {
129
+
130
+ if ( dWidth < 250 )
131
+ dWidth = wWidth;
132
+
133
+ if ( dWidth > 960 )
134
+ dWidth = 960;
135
+
136
+ /**
137
+ * Export Balances Modal
138
+ */
139
+ $( '#export-points' ).dialog({
140
+ dialogClass : 'mycred-export-points',
141
+ draggable : true,
142
+ autoOpen : false,
143
+ title : myCREDmanage.export_title,
144
+ closeText : myCREDmanage.export_close,
145
+ modal : true,
146
+ width : dWidth,
147
+ height : 'auto',
148
+ resizable : false,
149
+ position : { my: "center", at: "top+25%", of: window },
150
+ show : {
151
+ effect : 'fadeIn',
152
+ duration : 250
153
+ },
154
+ hide : {
155
+ effect : 'fadeOut',
156
+ duration : 250
157
+ }
158
+ });
159
 
160
+ /**
161
+ * Export balances Modal Trigger
162
+ */
163
+ $( '#mycred-export-users-points' ).click( function() {
164
 
165
+ $(this).blur();
166
+
167
+ $( '#export-points' ).dialog( 'open' );
168
+
169
+ });
170
 
171
  });
172
 
includes/shortcodes/mycred_total_points.php CHANGED
@@ -6,7 +6,7 @@ if ( ! defined( 'myCRED_VERSION' ) ) exit;
6
  * Allows to show total points of a specific point type or add up
7
  * points from the log based on reference, reference id or user id.
8
  * @since 1.6.6
9
- * @version 1.1
10
  */
11
  if ( ! function_exists( 'mycred_render_shortcode_total_points' ) ) :
12
  function mycred_render_shortcode_total_points( $atts ) {
@@ -29,7 +29,7 @@ if ( ! function_exists( 'mycred_render_shortcode_total_points' ) ) :
29
  global $wpdb;
30
 
31
  // Simple
32
- if ( $ref == '' && $ref_id == '' && $user_id == '' && $user_id != 0 ) {
33
 
34
  // Add up all balances
35
  $total = $wpdb->get_var( $wpdb->prepare( "SELECT SUM( meta_value ) FROM {$wpdb->usermeta} WHERE meta_key = %s", mycred_get_meta_key( $type ) ) );
6
  * Allows to show total points of a specific point type or add up
7
  * points from the log based on reference, reference id or user id.
8
  * @since 1.6.6
9
+ * @version 1.1.1
10
  */
11
  if ( ! function_exists( 'mycred_render_shortcode_total_points' ) ) :
12
  function mycred_render_shortcode_total_points( $atts ) {
29
  global $wpdb;
30
 
31
  // Simple
32
+ if ( $ref == '' && $ref_id == '' && $user_id == '' ) {
33
 
34
  // Add up all balances
35
  $total = $wpdb->get_var( $wpdb->prepare( "SELECT SUM( meta_value ) FROM {$wpdb->usermeta} WHERE meta_key = %s", mycred_get_meta_key( $type ) ) );
includes/shortcodes/mycred_total_since.php CHANGED
@@ -5,7 +5,7 @@ if ( ! defined( 'myCRED_VERSION' ) ) exit;
5
  * Total Since
6
  * Shows the total number of points a user has gained / lost in a given timeframe.
7
  * @since 1.7
8
- * @version 1.0
9
  */
10
  if ( ! function_exists( 'mycred_render_shortcode_total_since' ) ) :
11
  function mycred_render_shortcode_total_since( $atts, $content = '' ) {
@@ -28,7 +28,7 @@ if ( ! function_exists( 'mycred_render_shortcode_total_since' ) ) :
28
  $mycred = mycred( $type );
29
  $total = mycred_get_total_by_time( $from, $until, $ref, $user_id, $type );
30
 
31
- if ( $formatted == 1 )
32
  $total = $mycred->format_creds( $total );
33
 
34
  return $total;
5
  * Total Since
6
  * Shows the total number of points a user has gained / lost in a given timeframe.
7
  * @since 1.7
8
+ * @version 1.0.1
9
  */
10
  if ( ! function_exists( 'mycred_render_shortcode_total_since' ) ) :
11
  function mycred_render_shortcode_total_since( $atts, $content = '' ) {
28
  $mycred = mycred( $type );
29
  $total = mycred_get_total_by_time( $from, $until, $ref, $user_id, $type );
30
 
31
+ if ( substr( $total, 0, 7 ) != 'Invalid' && $formatted == 1 )
32
  $total = $mycred->format_creds( $total );
33
 
34
  return $total;
modules/mycred-module-hooks.php CHANGED
@@ -560,7 +560,7 @@ jQuery(function($) {
560
  /**
561
  * AJAX: Save Hook Settings
562
  * @since 1.7
563
- * @version 1.0.2
564
  */
565
  public function ajax_save_hook_prefs() {
566
 
@@ -577,7 +577,7 @@ jQuery(function($) {
577
  if ( $ctype == MYCRED_DEFAULT_TYPE_KEY && array_key_exists( $hook_id, $_POST['mycred_pref_hooks']['hook_prefs'] ) )
578
  $hook_prefs = $_POST['mycred_pref_hooks']['hook_prefs'][ $hook_id ];
579
 
580
- elseif ( array_key_exists( $hook_id, $_POST[ 'mycred_pref_hooks_' . $ctype ]['hook_prefs'] ) )
581
  $hook_prefs = $_POST[ 'mycred_pref_hooks_' . $ctype ]['hook_prefs'][ $hook_id ];
582
 
583
  if ( $hook_prefs === false ) die;
@@ -1963,12 +1963,12 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
1963
  * If comments are approved without moderation, we apply the corresponding method
1964
  * or else we will wait till the appropriate instance.
1965
  * @since 0.1
1966
- * @version 1.2.1
1967
  */
1968
  public function new_comment( $comment_id, $comment_status ) {
1969
 
1970
  // Marked SPAM
1971
- if ( $comment_status == 'spam' )
1972
  $this->comment_transitions( 'spam', 'unapproved', $comment_id );
1973
 
1974
  // Approved comment
560
  /**
561
  * AJAX: Save Hook Settings
562
  * @since 1.7
563
+ * @version 1.0.3
564
  */
565
  public function ajax_save_hook_prefs() {
566
 
577
  if ( $ctype == MYCRED_DEFAULT_TYPE_KEY && array_key_exists( $hook_id, $_POST['mycred_pref_hooks']['hook_prefs'] ) )
578
  $hook_prefs = $_POST['mycred_pref_hooks']['hook_prefs'][ $hook_id ];
579
 
580
+ elseif ( $ctype != MYCRED_DEFAULT_TYPE_KEY && array_key_exists( $hook_id, $_POST[ 'mycred_pref_hooks_' . $ctype ]['hook_prefs'] ) )
581
  $hook_prefs = $_POST[ 'mycred_pref_hooks_' . $ctype ]['hook_prefs'][ $hook_id ];
582
 
583
  if ( $hook_prefs === false ) die;
1963
  * If comments are approved without moderation, we apply the corresponding method
1964
  * or else we will wait till the appropriate instance.
1965
  * @since 0.1
1966
+ * @version 1.2.2
1967
  */
1968
  public function new_comment( $comment_id, $comment_status ) {
1969
 
1970
  // Marked SPAM
1971
+ if ( $comment_status === 'spam' )
1972
  $this->comment_transitions( 'spam', 'unapproved', $comment_id );
1973
 
1974
  // Approved comment
modules/mycred-module-settings.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'myCRED_VERSION' ) ) exit;
4
  /**
5
  * myCRED_Settings_Module class
6
  * @since 0.1
7
- * @version 1.4
8
  */
9
  if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
10
  class myCRED_Settings_Module extends myCRED_Module {
@@ -361,7 +361,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
361
  * Settings Header
362
  * Inserts the export styling
363
  * @since 1.3
364
- * @version 1.2.1
365
  */
366
  public function settings_header() {
367
 
@@ -428,7 +428,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
428
  'confirm_reset' => esc_attr__( 'Warning! All user balances will be set to zero! This can not be undone!', 'mycred' ),
429
  'done' => esc_attr__( 'Done!', 'mycred' ),
430
  'export_close' => esc_attr__( 'Close', 'mycred' ),
431
- 'export_title' => $mycred->template_tags_general( esc_attr__( 'Export users %plural%', 'mycred' ) ),
432
  'decimals' => esc_attr__( 'In order to adjust the number of decimal places you want to use we must update your log. It is highly recommended that you backup your current log before continuing!', 'mycred' )
433
  )
434
  );
@@ -501,7 +501,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
501
  /**
502
  * Admin Page
503
  * @since 0.1
504
- * @version 1.4.1
505
  */
506
  public function admin_page() {
507
 
@@ -708,7 +708,8 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
708
  <div class="form-group">
709
  <label><?php _e( 'Actions', 'mycred' ); ?></label>
710
  <div>
711
- <button type="button" id="mycred-manage-action-reset-accounts" data-type="<?php echo $this->mycred_type; ?>" class="button button-large large <?php if ( $reset_block ) echo '" disabled="disabled'; else echo 'button-primary'; ?>"><?php _e( 'Set all to zero', 'mycred' ); ?></button>
 
712
  </div>
713
  </div>
714
  </div>
@@ -826,10 +827,14 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
826
  <?php do_action( 'mycred_bottom_settings_page' . $action_hook, $this ); ?>
827
 
828
  <div id="export-points" style="display:none;">
829
- <ul>
830
- <li>
831
- <label><?php _e( 'Identify users by', 'mycred' ); ?>:</label><br />
832
- <select id="mycred-export-identify-by">
 
 
 
 
833
  <?php
834
 
835
  // Identify users by...
@@ -843,20 +848,29 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
843
  echo '<option value="' . $id . '">' . $label . '</option>';
844
 
845
  ?>
846
- </select><br />
847
- <span class="description"><?php _e( 'Use ID if you intend to use this export as a backup of your current site while Email is recommended if you want to export to a different site.', 'mycred' ); ?></span>
848
- </li>
849
- <li>
850
- <label><?php _e( 'Import Log Entry', 'mycred' ); ?>:</label><br />
851
- <input type="text" id="mycred-export-log-template" value="" class="regular-text" /><br />
852
- <span class="description"><?php echo sprintf( __( 'Optional log entry to use if you intend to import this file in a different %s installation.', 'mycred' ), mycred_label() ); ?></span>
853
- </li>
854
- <li class="action">
855
- <input type="button" id="mycred-run-exporter" value="<?php _e( 'Export', 'mycred' ); ?>" data-type="<?php echo $this->mycred_type; ?>" class="button button-large button-primary" />
856
- </li>
857
- </ul>
858
- <div class="clear"></div>
 
 
 
 
 
 
 
 
859
  </div>
 
860
  </div>
861
  <?php
862
 
4
  /**
5
  * myCRED_Settings_Module class
6
  * @since 0.1
7
+ * @version 1.4.1
8
  */
9
  if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
10
  class myCRED_Settings_Module extends myCRED_Module {
361
  * Settings Header
362
  * Inserts the export styling
363
  * @since 1.3
364
+ * @version 1.2.2
365
  */
366
  public function settings_header() {
367
 
428
  'confirm_reset' => esc_attr__( 'Warning! All user balances will be set to zero! This can not be undone!', 'mycred' ),
429
  'done' => esc_attr__( 'Done!', 'mycred' ),
430
  'export_close' => esc_attr__( 'Close', 'mycred' ),
431
+ 'export_title' => $mycred->template_tags_general( esc_attr__( 'Export %singular% Balances', 'mycred' ) ),
432
  'decimals' => esc_attr__( 'In order to adjust the number of decimal places you want to use we must update your log. It is highly recommended that you backup your current log before continuing!', 'mycred' )
433
  )
434
  );
501
  /**
502
  * Admin Page
503
  * @since 0.1
504
+ * @version 1.4.2
505
  */
506
  public function admin_page() {
507
 
708
  <div class="form-group">
709
  <label><?php _e( 'Actions', 'mycred' ); ?></label>
710
  <div>
711
+ <button type="button" id="mycred-manage-action-reset-accounts" data-type="<?php echo $this->mycred_type; ?>" class="button button-large large <?php if ( $reset_block ) echo '" disabled="disabled'; else echo 'button-primary'; ?>"><?php _e( 'Set all to zero', 'mycred' ); ?></button>
712
+ <button type="button" id="mycred-export-users-points" data-type="<?php echo $this->mycred_type; ?>" class="button button-large large"><?php _e( 'Export Balances', 'mycred' ); ?></button>
713
  </div>
714
  </div>
715
  </div>
827
  <?php do_action( 'mycred_bottom_settings_page' . $action_hook, $this ); ?>
828
 
829
  <div id="export-points" style="display:none;">
830
+ <div class="mycred-container">
831
+
832
+ <div class="form mycred-metabox">
833
+ <div class="row">
834
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
835
+ <div class="form-group">
836
+ <label><?php _e( 'Identify users by', 'mycred' ); ?></label>
837
+ <select id="mycred-export-identify-by" class="form-control">
838
  <?php
839
 
840
  // Identify users by...
848
  echo '<option value="' . $id . '">' . $label . '</option>';
849
 
850
  ?>
851
+ </select>
852
+ <span class="description"><?php _e( 'Use ID if you intend to use this export as a backup of your current site while Email is recommended if you want to export to a different site.', 'mycred' ); ?></span>
853
+ </div>
854
+ </div>
855
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
856
+ <div class="form-group">
857
+ <label><?php _e( 'Import Log Entry', 'mycred' ); ?></label>
858
+ <input type="text" id="mycred-export-log-template" value="" class="regular-text form-control" />
859
+ <span class="description"><?php echo sprintf( __( 'Optional log entry to use if you intend to import this file in a different %s installation.', 'mycred' ), mycred_label() ); ?></span>
860
+ </div>
861
+ </div>
862
+ </div>
863
+
864
+ <div class="row last">
865
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right">
866
+ <input type="button" id="mycred-run-exporter" value="<?php _e( 'Export', 'mycred' ); ?>" data-type="<?php echo $this->mycred_type; ?>" class="button button-large button-primary" />
867
+ </div>
868
+ </div>
869
+ </div>
870
+
871
+ </div>
872
  </div>
873
+
874
  </div>
875
  <?php
876
 
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.7.8.1
7
  * Tags: points, tokens, credit, management, reward, charge, buddypress, bbpress, jetpack, woocommerce, marketpress, wp e-commerce, gravity forms, simplepress
8
  * Author: Gabriel S Merovingi
9
  * Author URI: http://www.merovingi.com
10
  * Author Email: support@mycred.me
11
  * Requires at least: WP 4.0
12
- * Tested up to: WP 4.7.4
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.7.8.1';
23
 
24
  // Instnace
25
  protected static $_instance = NULL;
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
  * Tags: points, tokens, credit, management, reward, charge, buddypress, bbpress, jetpack, woocommerce, marketpress, wp e-commerce, gravity forms, simplepress
8
  * Author: Gabriel S Merovingi
9
  * Author URI: http://www.merovingi.com
10
  * Author Email: support@mycred.me
11
  * Requires at least: WP 4.0
12
+ * Tested up to: WP 4.8
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.7.9';
23
 
24
  // Instnace
25
  protected static $_instance = NULL;
plugins/mycred-hook-contact-form7.php CHANGED
@@ -87,14 +87,15 @@ function mycred_load_contact_form_seven_hook() {
87
  /**
88
  * Successful Form Submission
89
  * @since 0.1
90
- * @version 1.4
91
  */
92
- public function form_submission( $cf7_form ) {
93
 
94
  // Login is required
95
  if ( ! is_user_logged_in() ) return;
96
 
97
- $form_id = $cf7_form->id;
 
98
  if ( ! isset( $this->prefs[ $form_id ] ) || ! $this->prefs[ $form_id ]['creds'] != 0 ) return;
99
 
100
  // Check for exclusions
87
  /**
88
  * Successful Form Submission
89
  * @since 0.1
90
+ * @version 1.4.1
91
  */
92
+ public function form_submission( $form_object ) {
93
 
94
  // Login is required
95
  if ( ! is_user_logged_in() ) return;
96
 
97
+ $form_id = ( version_compare( WPCF7_VERSION, '4.8', '<' ) ) ? $form_object->id : $form_object->id();
98
+
99
  if ( ! isset( $this->prefs[ $form_id ] ) || ! $this->prefs[ $form_id ]['creds'] != 0 ) return;
100
 
101
  // Check for exclusions
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: designbymerovingi
3
  Tags: point, points, tokens, credit, management, reward, charge, community, contest, buddypress, jetpack, bbpress, simple press, woocommerce, wp e-commerce, contact-form-7
4
  Requires at least: 4.0
5
- Tested up to: 4.7.4
6
- Stable tag: 1.7.8.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -96,7 +96,7 @@ You can find a list of [frequently asked questions](https://mycred.me/about/faq/
96
 
97
  == Upgrade Notice ==
98
 
99
- = 1.7.8.1 =
100
  Minor bug fixes.
101
 
102
 
@@ -121,11 +121,16 @@ Minor bug fixes.
121
 
122
  == Changelog ==
123
 
124
- = 1.7.8.1 =
125
- FIX - Selecting a log entry causes all entries to be selected.
126
- FIX - mycred_get_module() function are returning incorrect details.
127
- FIX - Badge rewards not getting paid out when a badge is automatically assigned.
128
- FIX - The mycred_history shortcode can not render two dates correctly when using the time attribute.
 
 
 
 
 
129
 
130
 
131
  = Previous Versions =
2
  Contributors: designbymerovingi
3
  Tags: point, points, tokens, credit, management, reward, charge, community, contest, buddypress, jetpack, bbpress, simple press, woocommerce, wp e-commerce, contact-form-7
4
  Requires at least: 4.0
5
+ Tested up to: 4.8
6
+ Stable tag: 1.7.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
96
 
97
  == Upgrade Notice ==
98
 
99
+ = 1.7.9 =
100
  Minor bug fixes.
101
 
102
 
121
 
122
  == Changelog ==
123
 
124
+ = 1.7.9 =
125
+ FIX - Incorrect badge level labels are shown in the mycred_badges shortcode.
126
+ FIX - Unapproved comments are sometimes seen as spam by the Points for comments hook. (Thanks thomaslhotta)
127
+ FIX - Fixed minor logic issue in the mycred_total_points shortcode.
128
+ FIX - Balance export option is missing in the Management section (Thanks imago).
129
+ FIX - Removed duplicate usage of the mycred_transfer_ready action.
130
+ FIX - Rank sorting in the front end should only be applied to the main query in the rank archive (if used).
131
+ TWEAK - Updated export balance modal design to 1.7
132
+ TWEAK - Updated the mycred_total_since shortcode to render potential errors when the shortcode is used incorrectly.
133
+ Tested with WordPress 4.8
134
 
135
 
136
  = Previous Versions =