myCRED - Version 2.4.6

Version Description

New features and Bug fixes.

Download this release

Release Info

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

Code changes from version 2.4.5.4 to 2.4.6

Files changed (98) hide show
  1. addons/badges/includes/mycred-badge-shortcodes.php +111 -68
  2. addons/badges/myCRED-addon-badges.php +55 -40
  3. addons/banking/assets/js/central-deposit-admin.js +4 -0
  4. addons/banking/assets/js/central-deposit-emails.js +24 -0
  5. addons/banking/myCRED-addon-banking.php +14 -1
  6. addons/banking/services/mycred-service-central.php +11 -4
  7. addons/banking/services/mycred-service-schedule-deposit.php +327 -0
  8. addons/buy-creds/gateways/netbilling.php +23 -7
  9. addons/buy-creds/gateways/paypal-standard.php +24 -7
  10. addons/buy-creds/gateways/skrill.php +24 -7
  11. addons/buy-creds/includes/buycred-functions.php +17 -4
  12. addons/buy-creds/includes/buycred-reward-hook.php +1 -1
  13. addons/buy-creds/includes/buycred-shortcodes.php +20 -20
  14. addons/buy-creds/modules/buycred-module-core.php +88 -61
  15. addons/buy-creds/modules/buycred-module-pending.php +25 -25
  16. addons/cash-creds/abstracts/cashcred-abstract-payment-gateway.php +33 -11
  17. addons/cash-creds/gateways/bank-transfer.php +10 -10
  18. addons/cash-creds/includes/cashcred-functions.php +5 -5
  19. addons/cash-creds/includes/cashcred-shortcodes.php +87 -59
  20. addons/cash-creds/modules/cashcred-module-core.php +34 -34
  21. addons/cash-creds/modules/cashcred-module-withdrawal.php +53 -54
  22. addons/coupons/myCRED-addon-coupons.php +123 -42
  23. addons/email-notices/myCRED-addon-email-notices.php +54 -33
  24. addons/gateway/carts/mycred-woocommerce.php +12 -12
  25. addons/gateway/carts/mycred-wpecommerce.php +8 -8
  26. addons/gateway/event-booking/mycred-eventespresso3.php +17 -15
  27. addons/gateway/event-booking/mycred-eventsmanager.php +13 -13
  28. addons/ranks/myCRED-addon-ranks.php +13 -4
  29. addons/stats/includes/mycred-stats-object.php +1 -1
  30. addons/stats/myCRED-addon-stats.php +12 -12
  31. addons/stats/widgets/mycred-stats-widget-circulation.php +29 -29
  32. addons/stats/widgets/mycred-stats-widget-daily-gains.php +12 -12
  33. addons/stats/widgets/mycred-stats-widget-daily-loses.php +12 -12
  34. addons/transfer/assets/js/mycred-transfer.js +1 -1
  35. addons/transfer/includes/mycred-transfer-object.php +59 -11
  36. addons/transfer/myCRED-addon-transfer.php +11 -2
  37. assets/css/mycred-admin.css +4 -0
  38. assets/css/mycred-front.css +7 -0
  39. includes/classes/class.mycred-license.php +2 -2
  40. includes/classes/class.query-export.php +3 -3
  41. includes/classes/class.query-log.php +127 -30
  42. includes/hooks/external/mycred-hook-affiliatewp.php +27 -2
  43. includes/hooks/external/mycred-hook-badgeOS.php +8 -8
  44. includes/hooks/external/mycred-hook-bbPress.php +117 -17
  45. includes/hooks/external/mycred-hook-buddypress-media.php +111 -36
  46. includes/hooks/external/mycred-hook-buddypress.php +580 -155
  47. includes/hooks/external/mycred-hook-contact-form7.php +34 -9
  48. includes/hooks/external/mycred-hook-events-manager-light.php +37 -12
  49. includes/hooks/external/mycred-hook-gravityforms.php +34 -9
  50. includes/hooks/external/mycred-hook-invite-anyone.php +64 -14
  51. includes/hooks/external/mycred-hook-jetpack.php +12 -12
  52. includes/hooks/external/mycred-hook-simplepress.php +75 -25
  53. includes/hooks/external/mycred-hook-woocommerce.php +104 -13
  54. includes/hooks/external/mycred-hook-wp-favorite-posts.php +74 -24
  55. includes/hooks/external/mycred-hook-wp-polls.php +9 -7
  56. includes/hooks/external/mycred-hook-wp-postratings.php +66 -16
  57. includes/hooks/mycred-hook-anniversary.php +1 -1
  58. includes/hooks/mycred-hook-comments.php +29 -29
  59. includes/hooks/mycred-hook-delete-content.php +97 -22
  60. includes/hooks/mycred-hook-link-clicks.php +10 -10
  61. includes/hooks/mycred-hook-logins.php +32 -7
  62. includes/hooks/mycred-hook-publishing-content.php +97 -22
  63. includes/hooks/mycred-hook-referrals.php +117 -39
  64. includes/hooks/mycred-hook-registrations.php +5 -5
  65. includes/hooks/mycred-hook-site-visits.php +5 -5
  66. includes/hooks/mycred-hook-view-content.php +193 -43
  67. includes/hooks/mycred-hook-watching-video.php +30 -30
  68. includes/importers/mycred-balances.php +17 -16
  69. includes/importers/mycred-cubepoints.php +9 -8
  70. includes/importers/mycred-log-entries.php +14 -13
  71. includes/mycred-about.php +28 -27
  72. includes/mycred-blocks/mycred-blocks.php +2 -1
  73. includes/mycred-install.php +1 -1
  74. includes/mycred-nav-menu.php +9 -9
  75. includes/mycred-overview.php +4 -4
  76. includes/mycred-remote.php +6 -6
  77. includes/shortcodes/mycred_exchange.php +13 -11
  78. includes/shortcodes/mycred_hook_table.php +77 -47
  79. includes/shortcodes/mycred_send.php +5 -5
  80. includes/shortcodes/mycred_show_if.php +0 -6
  81. includes/shortcodes/mycred_video.php +1 -1
  82. includes/widgets/mycred-widget-balance.php +12 -12
  83. includes/widgets/mycred-widget-leaderboard.php +7 -7
  84. includes/widgets/mycred-widget-wallet.php +9 -9
  85. membership/mycred-connect-membership.php +9 -13
  86. membership/subscription-functions.php +1 -1
  87. modules/mycred-module-addons.php +25 -25
  88. modules/mycred-module-br-social-share.php +8 -8
  89. modules/mycred-module-buddypress.php +106 -32
  90. modules/mycred-module-caching.php +15 -15
  91. modules/mycred-module-export.php +17 -17
  92. modules/mycred-module-hooks.php +18 -18
  93. modules/mycred-module-log.php +27 -22
  94. modules/mycred-module-management.php +2 -2
  95. modules/mycred-module-network.php +7 -7
  96. modules/mycred-module-settings.php +106 -44
  97. mycred.php +7 -7
  98. readme.txt +42 -2
addons/badges/includes/mycred-badge-shortcodes.php CHANGED
@@ -1,44 +1,103 @@
1
  <?php
2
  if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
 
4
- /**
5
- * Shortcode: mycred_my_badges
6
- * Allows you to show the current users earned badges.
7
- * @since 1.5
8
- * @version 1.2.1
9
- */
10
- if ( ! function_exists( 'mycred_render_my_badges' ) ) :
11
- function mycred_render_my_badges( $atts, $content = '' ) {
12
-
13
- extract( shortcode_atts( array(
14
- 'show' => 'earned',
15
- 'width' => MYCRED_BADGE_WIDTH,
16
- 'height' => MYCRED_BADGE_HEIGHT,
17
- 'user_id' => 'current',
18
- 'title' => '',
19
- 'post_excerpt' => ''
20
- ), $atts, MYCRED_SLUG . '_my_badges' ) );
21
-
22
- if ( ! is_user_logged_in() && $user_id == 'current' )
23
  return $content;
 
24
 
25
- $user_id = mycred_get_user_id( $user_id );
 
 
 
26
 
27
  ob_start();
28
 
29
  echo '<div class="row" id="mycred-users-badges"><div class="col-xs-12">';
30
 
31
  // Show only badges that we have earned
32
- if ( $show == 'earned' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- mycred_display_users_badges( $user_id, $width, $height );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  }
37
 
38
  // Show all badges highlighting the ones we earned
39
- elseif ( $show == 'all' ) {
40
 
41
- $users_badges = mycred_get_users_badges( $user_id );
42
  $all_badges = mycred_get_badge_ids();
43
 
44
  foreach ( $all_badges as $badge_id ) {
@@ -46,82 +105,70 @@ if ( ! function_exists( 'mycred_render_my_badges' ) ) :
46
  echo '<div class="the-badge">';
47
 
48
  // User has not earned badge
49
- if ( ! array_key_exists( $badge_id, $users_badges ) ) {
50
-
51
- $badge = mycred_get_badge( $badge_id );
52
-
53
- $page_id = get_page( $badge_id);
54
 
55
-
 
56
  $badge->image_width = $width;
57
  $badge->image_height = $height;
58
-
59
  $badge_title = $badge->title;
60
  $badge_img = $badge->main_image;
61
 
62
- if ( $badge->main_image !== false ) {
63
 
64
  echo '<div class="demo-badge-image">' . wp_kses_post( $badge_img ) . '</div>';
65
 
66
- if( $title == 'show' ) {
67
 
68
- echo '<div class="demo-badge-title">' . esc_html( $badge_title ) . '</div>';
69
 
70
- }
71
- else {
72
 
73
- echo '<div class="demo-badge-title" style="display:none;">' . esc_html( $badge_title ) . '</div>';
74
 
75
  }
76
 
77
- if( $post_excerpt == 'show' ) {
78
 
79
- echo '<div class="page-excerpt">' . esc_html( $page_id->post_excerpt ) . '</div>';
80
 
81
- }
82
- else {
83
-
84
- echo '<div class="page-excerpt" style="display:none;">' . esc_html( $page_id->post_excerpt ) . '</div>';
85
-
86
  }
87
 
88
  }
89
 
90
  }
 
91
  // User has earned badge
92
  else {
93
 
94
  $level = $users_badges[ $badge_id ];
95
- $badge = mycred_get_badge( $badge_id, $level );
96
  $badge->image_width = $width;
97
  $badge->image_height = $height;
 
98
 
99
- $badge_page_id = get_page( $badge_id);
100
-
101
- if ( $badge->level_image !== false ) {
102
 
103
- echo '<div class="demo-badge-image">' . wp_kses_post( $badge->get_image( $level ) ) . '</div>';
104
 
105
- if( $title == 'show' ) {
106
-
107
- echo '<div class="demo-badge-title">' . esc_html( $badge->title ) . '</div>';
108
 
109
  }
110
- else {
111
 
112
- echo '<div class="demo-badge-title" style="display:none;">' . esc_html( $badge->title ) . '</div>';
 
113
 
114
  }
115
 
116
- if( $post_excerpt == 'show' ) {
117
-
118
- echo '<div class="page-excerpt">' . esc_html( $badge_page_id->post_excerpt ) . '</div>';
119
 
120
- }
121
- else {
122
-
123
- echo '<div class="page-excerpt" style="display:none;">' . esc_html( $badge_page_id->post_excerpt ) . '</div>';
124
-
125
  }
126
 
127
  }
@@ -130,15 +177,11 @@ if ( ! function_exists( 'mycred_render_my_badges' ) ) :
130
 
131
  echo '</div>';
132
 
133
- if( $title == 'show' || $post_excerpt == 'show' ) {
134
-
135
  echo '<hr class="badge-line">';
136
-
137
  }
138
  else {
139
-
140
  echo '';
141
-
142
  }
143
  }
144
 
@@ -148,7 +191,7 @@ if ( ! function_exists( 'mycred_render_my_badges' ) ) :
148
  $output = ob_get_contents();
149
  ob_end_clean();
150
 
151
- return apply_filters( 'mycred_my_badges', $output, $user_id );
152
 
153
  }
154
  endif;
1
  <?php
2
  if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
 
4
+ if (! function_exists('mycred_render_my_badges') ) :
5
+ function mycred_render_my_badges( $atts, $content = '' )
6
+ {
7
+
8
+ extract(
9
+ shortcode_atts(
10
+ array(
11
+ 'show' => 'earned',
12
+ 'width' => MYCRED_BADGE_WIDTH,
13
+ 'height' => MYCRED_BADGE_HEIGHT,
14
+ 'user_id' => 'current',
15
+ 'title' => '',
16
+ 'post_excerpt' => ''
17
+ ), $atts, MYCRED_SLUG . '_my_badges'
18
+ )
19
+ );
20
+
21
+ if (! is_user_logged_in() && $user_id == 'current' ) {
 
22
  return $content;
23
+ }
24
 
25
+ $all_badges = mycred_get_badge_ids();
26
+ $profile_user_id = mycred_get_user_id($user_id);
27
+ $users_badges = mycred_get_users_badges( $profile_user_id, true );
28
+ $user_id = mycred_get_user_id($user_id);
29
 
30
  ob_start();
31
 
32
  echo '<div class="row" id="mycred-users-badges"><div class="col-xs-12">';
33
 
34
  // Show only badges that we have earned
35
+ if ($show == 'earned' ) {
36
+
37
+ foreach ( $all_badges as $badge_id ) {
38
+ echo '<div class="the-badge">';
39
+ $page_id = get_page($badge_id);
40
+
41
+
42
+ $badge_id = absint( $badge_id );
43
+ $has_earned = mycred_get_badge( $badge_id );
44
+ $badge = mycred_get_badge( $badge_id );
45
+
46
+ $users_badges = mycred_get_users_badges($profile_user_id );
47
+ $mycred = mycred();
48
+
49
+ if ( array_key_exists( $badge_id, $users_badges ) ) {
50
+ $earned = 1;
51
+ $earned_level = $users_badges[ $badge_id ];
52
+ $badge_image = $badge->get_image( $earned_level );
53
+
54
+
55
+ }
56
+
57
+
58
+ if($has_earned ) {
59
+
60
+
61
+ $badge_title = $has_earned->title;
62
+ $badge_img = $has_earned->main_image;
63
+ $level_image = $has_earned->level_image;
64
+ $show_img = $has_earned->user_has_badge( $profile_user_id );
65
+
66
+
67
+ if($show_img) {
68
+
69
+ echo '<div class="demo-badge-image">' . wp_kses_post( $badge_img ) . '</div>';
70
+
71
+ if($title == 'show') {
72
+
73
+ echo '<div class="demo-badge-title">' . esc_html( $badge_title ) . ' '.'</div>';
74
+
75
+ } else {
76
+
77
+ echo '<div class="demo-badge-title" style="display:none;">' . esc_html( $badge_title ) . ' '.'</div>';
78
 
79
+ }
80
+
81
+ if($post_excerpt == 'show') {
82
+
83
+ echo '<div class="page-excerpt">' . wp_kses_post( $page_id->post_excerpt ) . ' '.'</div>';
84
+
85
+ } else {
86
+ echo '<div class="page-excerpt" style="display:none;">' . wp_kses_post( $page_id->post_excerpt ) . ' '.'</div>';
87
+ }
88
+
89
+ }
90
+
91
+ }
92
+
93
+ }
94
 
95
  }
96
 
97
  // Show all badges highlighting the ones we earned
98
+ elseif ($show == 'all' ) {
99
 
100
+ $users_badges = mycred_get_users_badges($user_id);
101
  $all_badges = mycred_get_badge_ids();
102
 
103
  foreach ( $all_badges as $badge_id ) {
105
  echo '<div class="the-badge">';
106
 
107
  // User has not earned badge
108
+ if (! array_key_exists($badge_id, $users_badges) ) {
 
 
 
 
109
 
110
+ $badge = mycred_get_badge($badge_id);
111
+ $page_id = get_page($badge_id);
112
  $badge->image_width = $width;
113
  $badge->image_height = $height;
 
114
  $badge_title = $badge->title;
115
  $badge_img = $badge->main_image;
116
 
117
+ if ($badge->main_image !== false ) {
118
 
119
  echo '<div class="demo-badge-image">' . wp_kses_post( $badge_img ) . '</div>';
120
 
121
+ if($title == 'show') {
122
 
123
+ echo '<div class="demo-badge-title">' . esc_html( $badge_title ) . ' '.'</div>';
124
 
125
+ } else {
 
126
 
127
+ echo '<div class="demo-badge-title" style="display:none;">' . esc_html( $badge_title ) . ' '.'</div>';
128
 
129
  }
130
 
131
+ if($post_excerpt == 'show') {
132
 
133
+ echo '<div class="page-excerpt">' . wp_kses_post( $page_id->post_excerpt ) . ' '.'</div>';
134
 
135
+ } else {
136
+ echo '<div class="page-excerpt" style="display:none;">' . wp_kses_post( $page_id->post_excerpt ) . ' '.'</div>';
 
 
 
137
  }
138
 
139
  }
140
 
141
  }
142
+
143
  // User has earned badge
144
  else {
145
 
146
  $level = $users_badges[ $badge_id ];
147
+ $badge = mycred_get_badge($badge_id, $level);
148
  $badge->image_width = $width;
149
  $badge->image_height = $height;
150
+ $badge_page_id = get_page($badge_id);
151
 
152
+ if ($badge->level_image !== false ) {
 
 
153
 
154
+ echo '<div class="demo-badge-image">' . wp_kses_post( $badge->get_image($level) ) . '</div>';
155
 
156
+ if($title == 'show') {
157
+ echo '<div class="demo-badge-title">' . esc_html( $badge->title ) . ' '.'</div>';
 
158
 
159
  }
 
160
 
161
+ else {
162
+ echo '<div class="demo-badge-title" style="display:none;">' . esc_html( $badge->title ) . ' '.'</div>';
163
 
164
  }
165
 
166
+ if($post_excerpt == 'show') {
167
+
168
+ echo '<div class="page-excerpt">' . wp_kses_post( $badge_page_id->post_excerpt ) . ' '.'</div>';
169
 
170
+ } else {
171
+ echo '<div class="page-excerpt" style="display:none;">' . wp_kses_post( $badge_page_id->post_excerpt ) . ' '.'</div>';;
 
 
 
172
  }
173
 
174
  }
177
 
178
  echo '</div>';
179
 
180
+ if($title == 'show' || $post_excerpt == 'show') {
 
181
  echo '<hr class="badge-line">';
 
182
  }
183
  else {
 
184
  echo '';
 
185
  }
186
  }
187
 
191
  $output = ob_get_contents();
192
  ob_end_clean();
193
 
194
+ return apply_filters('mycred_my_badges', $output, $user_id);
195
 
196
  }
197
  endif;
addons/badges/myCRED-addon-badges.php CHANGED
@@ -1099,41 +1099,56 @@ th#badge-users { width: 10%; }
1099
  <div id="badge-levels">
1100
  <?php
1101
 
1102
- $esc_param = array(
1103
- 'div' => array(
1104
- 'class' => array(),
1105
- 'id' => array(),
1106
- 'data-level' => array(),
1107
- 'style' => array(),
1108
- ),
1109
- 'button' => array(
1110
- 'type' => array(),
1111
- 'class' => array(),
1112
- 'id' => array(),
1113
- ),
1114
- 'img' => array(
1115
- 'alt' => array(),
1116
- 'class' => array(),
1117
- 'height' => array(),
1118
- 'src' => array(),
1119
- 'width' => array(),
1120
- ),
1121
- 'input' => array(
1122
- 'type' => array(),
1123
- 'name' => array(),
1124
- 'value' => array(),
1125
- 'placeholder' => array(),
1126
- 'class' => array(),
1127
- ),
1128
- 'select' => array(
1129
- 'name' => array(),
1130
- 'class' => array(),
1131
- 'data_row' => array(),
1132
- ),
1133
- 'option' => array(
1134
- 'value' => array()
1135
- ),
1136
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1137
 
1138
  // Loop through each badge level
1139
  $level_counter = 0;
@@ -1311,7 +1326,7 @@ th#badge-users { width: 10%; }
1311
 
1312
  $js_level = str_replace( '{{rewards}}', $rewards, $js_level );
1313
 
1314
- echo $template;
1315
 
1316
  $level_counter++;
1317
 
@@ -1322,9 +1337,9 @@ th#badge-users { width: 10%; }
1322
  ?>
1323
  </div>
1324
  <script type="text/javascript">
1325
- var BadgeLevel = '<?php echo wp_kses( $js_level, $esc_param ); ?>';
1326
- var BadgeNewRequrement = '<?php echo wp_kses( $js_requirement, $esc_param ); ?>';
1327
- var BadgeRequirement = '<?php echo wp_kses( $js_requirement_clone, $esc_param ); ?>';
1328
  </script>
1329
  <?php
1330
 
@@ -1873,7 +1888,7 @@ th#badge-users { width: 10%; }
1873
 
1874
  if ( isset( $_POST['mycred_badge_manual']['token'] ) ) {
1875
 
1876
- if ( wp_verify_nonce( $_POST['mycred_badge_manual']['token'], 'mycred-manual-badges' . $user_id ) ) {
1877
 
1878
  $added = $removed = $updated = 0;
1879
  $users_badges = mycred_get_users_badges( $user_id );
1099
  <div id="badge-levels">
1100
  <?php
1101
 
1102
+ $esc_param = array(
1103
+ 'div' => array(
1104
+ 'class' => array(),
1105
+ 'id' => array(),
1106
+ 'data-level' => array(),
1107
+ 'style' => array(),
1108
+ 'data-row' => array()
1109
+ ),
1110
+ 'button' => array(
1111
+ 'type' => array(),
1112
+ 'class' => array(),
1113
+ 'id' => array(),
1114
+ 'data-req' => array(),
1115
+ 'data-level' => array()
1116
+ ),
1117
+ 'img' => array(
1118
+ 'alt' => array(),
1119
+ 'class' => array(),
1120
+ 'height' => array(),
1121
+ 'src' => array(),
1122
+ 'width' => array(),
1123
+ ),
1124
+ 'input' => array(
1125
+ 'type' => array(),
1126
+ 'name' => array(),
1127
+ 'value' => array(),
1128
+ 'placeholder' => array(),
1129
+ 'class' => array(),
1130
+ 'size' => array(),
1131
+ 'data-row' => array()
1132
+ ),
1133
+ 'select' => array(
1134
+ 'name' => array(),
1135
+ 'class' => array(),
1136
+ 'data-row' => array(),
1137
+ ),
1138
+ 'option' => array(
1139
+ 'value' => array()
1140
+ ),
1141
+ 'p' => array(
1142
+ 'class' => array(),
1143
+ 'style' => array()
1144
+ ),
1145
+ 'a' => array(
1146
+ 'class' => array(),
1147
+ 'href' => array(),
1148
+ 'data-do' => array(),
1149
+ 'style' => array()
1150
+ )
1151
+ );
1152
 
1153
  // Loop through each badge level
1154
  $level_counter = 0;
1326
 
1327
  $js_level = str_replace( '{{rewards}}', $rewards, $js_level );
1328
 
1329
+ echo wp_kses( $template, $esc_param );
1330
 
1331
  $level_counter++;
1332
 
1337
  ?>
1338
  </div>
1339
  <script type="text/javascript">
1340
+ var BadgeLevel = '<?php echo wp_kses( $js_level, $esc_param );?>';
1341
+ var BadgeNewRequrement = '<?php echo wp_kses( $js_requirement, $esc_param );?>';
1342
+ var BadgeRequirement = '<?php echo wp_kses( $js_requirement_clone, $esc_param );?>';
1343
  </script>
1344
  <?php
1345
 
1888
 
1889
  if ( isset( $_POST['mycred_badge_manual']['token'] ) ) {
1890
 
1891
+ if ( wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['mycred_badge_manual']['token'] ) ), 'mycred-manual-badges' . $user_id ) ) {
1892
 
1893
  $added = $removed = $updated = 0;
1894
  $users_badges = mycred_get_users_badges( $user_id );
addons/banking/assets/js/central-deposit-admin.js CHANGED
@@ -1,5 +1,7 @@
1
  jQuery(function($) {
 
2
  $(document).ready(function() {
 
3
  $('.mycred_bank_id_select2').select2({
4
  minimumInputLength: 1,
5
  placeholder: "Select a user",
@@ -34,5 +36,7 @@ jQuery(function($) {
34
  cache: true
35
  }
36
  });
 
37
  });
 
38
  } );
1
  jQuery(function($) {
2
+
3
  $(document).ready(function() {
4
+
5
  $('.mycred_bank_id_select2').select2({
6
  minimumInputLength: 1,
7
  placeholder: "Select a user",
36
  cache: true
37
  }
38
  });
39
+
40
  });
41
+
42
  } );
addons/banking/assets/js/central-deposit-emails.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function($){
2
+
3
+ $(document).ready(function(){
4
+
5
+ $( 'select#mycred-email-instance' ).change(function(e){
6
+
7
+ var selectedevent = $(this).find( ':selected' );
8
+
9
+ if ( selectedevent.val() == 'central_min_balance' ) {
10
+
11
+ $( '#areference-selection' ).show();
12
+
13
+ }
14
+ else {
15
+
16
+ $( '#areference-selection' ).hide();
17
+
18
+ }
19
+
20
+ });
21
+
22
+ });
23
+
24
+ });
addons/banking/myCRED-addon-banking.php CHANGED
@@ -17,6 +17,7 @@ require_once myCRED_BANK_ABSTRACT_DIR . 'mycred-abstract-service.php';
17
  require_once myCRED_BANK_INCLUDES_DIR . 'mycred-banking-functions.php';
18
 
19
  require_once myCRED_BANK_SERVICES_DIR . 'mycred-service-central.php';
 
20
 
21
  /**
22
  * myCRED_Banking_Module class
@@ -143,6 +144,14 @@ if ( ! class_exists( 'myCRED_Banking_Module' ) ) :
143
  'callback' => array( 'myCRED_Banking_Service_Central' )
144
  );
145
 
 
 
 
 
 
 
 
 
146
  $services = apply_filters( 'mycred_setup_banking', $services );
147
 
148
  if ( $save === true && $this->core->user_is_point_admin() ) {
@@ -151,6 +160,7 @@ if ( ! class_exists( 'myCRED_Banking_Module' ) ) :
151
  'services' => $services,
152
  'service_prefs' => $this->service_prefs
153
  );
 
154
  mycred_update_option( $this->option_id, $new_data );
155
  }
156
 
@@ -171,7 +181,7 @@ if ( ! class_exists( 'myCRED_Banking_Module' ) ) :
171
  wp_enqueue_style( 'mycred-bootstrap-grid' );
172
  wp_enqueue_style( 'mycred-forms' );
173
  wp_enqueue_style( 'mycred-select2-style' );
174
-
175
  wp_register_script( 'mycred-central-deposit-admin', plugins_url( 'assets/js/central-deposit-admin.js', myCRED_BANK ), array( 'jquery', 'mycred-select2-script' ), myCRED_VERSION );
176
 
177
  wp_enqueue_script( 'mycred-central-deposit-admin' );
@@ -257,6 +267,9 @@ if ( ! class_exists( 'myCRED_Banking_Module' ) ) :
257
  */
258
  public function sanitize_settings( $post ) {
259
 
 
 
 
260
  $installed = $this->get();
261
 
262
  // Construct new settings
17
  require_once myCRED_BANK_INCLUDES_DIR . 'mycred-banking-functions.php';
18
 
19
  require_once myCRED_BANK_SERVICES_DIR . 'mycred-service-central.php';
20
+ require_once myCRED_BANK_SERVICES_DIR . 'mycred-service-schedule-deposit.php';
21
 
22
  /**
23
  * myCRED_Banking_Module class
144
  'callback' => array( 'myCRED_Banking_Service_Central' )
145
  );
146
 
147
+ $services['schedule_deposit'] = array(
148
+ 'title' => __( 'Schedule Deposit', 'mycred' ),
149
+ 'description' => __( 'The admin can schedule the points deposit to the central account automatically after the specified interval.', 'mycred' ),
150
+ 'cron' => false,
151
+ 'icon' => 'dashicons-admin-site',
152
+ 'callback' => array( 'myCRED_Banking_Service_Schedule_Deposit' )
153
+ );
154
+
155
  $services = apply_filters( 'mycred_setup_banking', $services );
156
 
157
  if ( $save === true && $this->core->user_is_point_admin() ) {
160
  'services' => $services,
161
  'service_prefs' => $this->service_prefs
162
  );
163
+
164
  mycred_update_option( $this->option_id, $new_data );
165
  }
166
 
181
  wp_enqueue_style( 'mycred-bootstrap-grid' );
182
  wp_enqueue_style( 'mycred-forms' );
183
  wp_enqueue_style( 'mycred-select2-style' );
184
+ wp_enqueue_style( MYCRED_SLUG . '-buttons' );
185
  wp_register_script( 'mycred-central-deposit-admin', plugins_url( 'assets/js/central-deposit-admin.js', myCRED_BANK ), array( 'jquery', 'mycred-select2-script' ), myCRED_VERSION );
186
 
187
  wp_enqueue_script( 'mycred-central-deposit-admin' );
267
  */
268
  public function sanitize_settings( $post ) {
269
 
270
+ // added do_action in 2.2.4
271
+ $post = apply_filters( 'mycred_banking_settings_save', $post, $this );
272
+
273
  $installed = $this->get();
274
 
275
  // Construct new settings
addons/banking/services/mycred-service-central.php CHANGED
@@ -46,8 +46,11 @@ if ( ! class_exists( 'myCRED_Banking_Service_Central' ) ) :
46
  // Make sure we are in the correct point type
47
  if ( $this->mycred_type != $mycred->cred_id || $reply === false ) return $reply;
48
 
 
 
 
49
  // Check manual
50
- if ( isset( $this->prefs['ignore_manual'] ) && $this->prefs['ignore_manual'] == 0 && $request['ref'] == 'manual' ) return $reply;
51
 
52
  // Instances to ignore
53
  if ( in_array( $request['ref'], apply_filters( 'mycred_central_banking_ignore', array( 'interest', 'recurring_payout', 'transfer' ), $this ) ) ) return $reply;
@@ -55,7 +58,7 @@ if ( ! class_exists( 'myCRED_Banking_Service_Central' ) ) :
55
  extract( $request );
56
 
57
  // Make sure that the request is not for our bank account
58
- //if ( $user_id == $this->prefs['bank_id'] ) return $reply;
59
 
60
  // Get the banks balance
61
  $bank_balance = $mycred->get_users_balance( $this->prefs['bank_id'], $this->mycred_type );
@@ -104,6 +107,8 @@ if ( ! class_exists( 'myCRED_Banking_Service_Central' ) ) :
104
 
105
  if ( ! empty( $this->prefs['bank_id'] ) )
106
  $user = get_userdata( $this->prefs['bank_id'] );
 
 
107
  ?>
108
  <div class="row">
109
  <div class="col-xs-12">
@@ -135,7 +140,9 @@ if ( ! class_exists( 'myCRED_Banking_Service_Central' ) ) :
135
  </div>
136
  <?php
137
 
138
- do_action( 'mycred_banking_central', $this );
 
 
139
 
140
  }
141
 
@@ -175,7 +182,7 @@ if ( ! class_exists( 'myCRED_Banking_Service_Central' ) ) :
175
  ),
176
  'fields' => array( 'ID', 'display_name', 'user_email' ),
177
  'number' => 10,
178
- 'offset' => ( $page_no - 1 ) * 10,
179
  'orderby' => 'display_name'
180
  ) );
181
  $users = $users_query->get_results();
46
  // Make sure we are in the correct point type
47
  if ( $this->mycred_type != $mycred->cred_id || $reply === false ) return $reply;
48
 
49
+ // added filter in 2.2.4 for schedule deposit
50
+ if( apply_filters( 'mycred_check_schedule_deposite_entry', false, $reply, $request, $mycred ) ) return $reply;
51
+
52
  // Check manual
53
+ if ( isset( $this->prefs['ignore_manual'] ) && $this->prefs['ignore_manual'] == 1 && $request['ref'] == 'manual' ) return $reply;
54
 
55
  // Instances to ignore
56
  if ( in_array( $request['ref'], apply_filters( 'mycred_central_banking_ignore', array( 'interest', 'recurring_payout', 'transfer' ), $this ) ) ) return $reply;
58
  extract( $request );
59
 
60
  // Make sure that the request is not for our bank account
61
+ if ( $user_id == $this->prefs['bank_id'] ) return $reply;
62
 
63
  // Get the banks balance
64
  $bank_balance = $mycred->get_users_balance( $this->prefs['bank_id'], $this->mycred_type );
107
 
108
  if ( ! empty( $this->prefs['bank_id'] ) )
109
  $user = get_userdata( $this->prefs['bank_id'] );
110
+
111
+ if( ! empty( mycred_get_option('mycred_pref_bank')['active'] ) && in_array( 'central', mycred_get_option('mycred_pref_bank')['active'] ) ) {
112
  ?>
113
  <div class="row">
114
  <div class="col-xs-12">
140
  </div>
141
  <?php
142
 
143
+ do_action( 'mycred_banking_central', $this );
144
+
145
+ }
146
 
147
  }
148
 
182
  ),
183
  'fields' => array( 'ID', 'display_name', 'user_email' ),
184
  'number' => 10,
185
+ 'offset' => ( intval( $page_no ) - 1 ) * 10,
186
  'orderby' => 'display_name'
187
  ) );
188
  $users = $users_query->get_results();
addons/banking/services/mycred-service-schedule-deposit.php ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'myCRED_VERSION' ) ) exit;
3
+
4
+ /**
5
+ * myCRED Bank Service - Schedule Deposit
6
+ * @since 1.5.2
7
+ * @version 1.0.1
8
+ */
9
+ if ( ! class_exists( 'myCRED_Banking_Service_Schedule_Deposit' ) ) :
10
+ class myCRED_Banking_Service_Schedule_Deposit extends myCRED_Service {
11
+
12
+ /**
13
+ * Construct
14
+ */
15
+ function __construct( $service_prefs, $type = MYCRED_DEFAULT_TYPE_KEY ) {
16
+
17
+ parent::__construct( array(
18
+ 'id' => 'schedule_deposit',
19
+ 'defaults' => array(
20
+ 'schedule' => 0,
21
+ 'points' => 0,
22
+ 'recurring' => 'off'
23
+ )
24
+ ), $service_prefs, $type );
25
+
26
+ if ( ! empty( $service_prefs['central']['bank_id'] ) )
27
+ $this->prefs['bank_id'] = absint( $service_prefs['central']['bank_id'] );
28
+
29
+ }
30
+
31
+ /**
32
+ * Run
33
+ * @since 1.5.2
34
+ * @version 1.0
35
+ */
36
+ public function run() {
37
+
38
+ if( class_exists( 'myCRED_Banking_Module' ) && class_exists( 'myCRED_Email_Notice_Module' ) ) {
39
+
40
+ add_filter( 'mycred_email_instances', array( $this, 'mycred_email_banking_instances_func' ) );
41
+ add_action( 'mycred_after_email_triggers', array( $this, 'mycred_after_email_banking_triggers' ) );
42
+ add_action( 'mycred_save_email_notice', array( $this, 'mycred_save_banking_email_notice' ), 10, 2 );
43
+ add_filter( 'mycred_add_finished', array( $this, 'mycred_notice_banking_email_check' ), 10, 3 );
44
+
45
+ }
46
+
47
+ add_action( 'mycred_schedule_deposit_event', array( $this, 'scheduled_event' ) );
48
+ add_filter( 'mycred_check_schedule_deposite_entry', array( $this, 'mycred_check_schedule_deposite' ), 10, 4 );
49
+ add_action( 'mycred_banking_settings_save', array( $this, 'mycred_save_banking_setting' ), 10, 2 );
50
+
51
+ }
52
+
53
+ // check if amount is deposit through schedule
54
+ public function mycred_check_schedule_deposite( $con, $reply, $request, $mycred ) {
55
+
56
+ if( $request['ref'] == 'central_schedule_amount' || $request['ref'] == 'central_recurring_schedule_amount' )
57
+ $con = true;
58
+
59
+ return $con;
60
+
61
+ }
62
+
63
+ // when will cron work and to save all setting of central deposit schedule
64
+ public function mycred_save_banking_setting( $post, $obj ) {
65
+
66
+ if ( in_array( 'central', (array) $obj->active ) && ! in_array( 'central', $post['active'] ) ) {
67
+
68
+ $post['active'] = array();
69
+
70
+ }
71
+
72
+ if( isset( $post['active'][1] ) && $post['active'][1] == 'schedule_deposit' ){
73
+
74
+ if( ! wp_next_scheduled( 'mycred_schedule_deposit_event' ) ) {
75
+
76
+ wp_schedule_event( time(), 'daily', 'mycred_schedule_deposit_event' );
77
+
78
+ }
79
+
80
+ }
81
+ else {
82
+
83
+ wp_clear_scheduled_hook( 'mycred_schedule_deposit_event' );
84
+
85
+ }
86
+
87
+ return $post;
88
+
89
+ }
90
+
91
+ public function scheduled_event() {
92
+
93
+ $prefs = $this->prefs;
94
+ $start_from = isset( $prefs['start_from'] ) ? $prefs['start_from'] : '';
95
+ $interval_days = isset( $prefs['schedule'] ) ? absint( $prefs['schedule'] ) : 0;
96
+ $points = ! empty( $prefs['points'] ) ? $prefs['points'] : 0;
97
+
98
+ if( empty( $start_from ) || empty( $interval_days ) ) return;
99
+
100
+ $scheduled_date = date( 'Y-m-d', strtotime( "{$start_from} +{$interval_days} days" ) );
101
+
102
+ // when the schedule date has arrived
103
+ if( date( 'Y-m-d' ) >= $scheduled_date ) {
104
+
105
+ $mycred = mycred( $this->mycred_type );
106
+
107
+ $mycred->add_creds(
108
+ 'central_schedule_amount',
109
+ $prefs['bank_id'],
110
+ $points,
111
+ '%plural% for Schedule amount',
112
+ $this->id
113
+ );
114
+
115
+ $settings = mycred_get_option('mycred_pref_bank');
116
+
117
+ if( ! empty( $prefs['recurring'] ) && $prefs['recurring'] == 'on' ) {
118
+
119
+ $settings['service_prefs']['schedule_deposit']['start_from'] = $scheduled_date;
120
+
121
+ }
122
+ else {
123
+
124
+ $settings['active'] = array( 'central' );
125
+
126
+ }
127
+
128
+ mycred_update_option( 'mycred_pref_bank', $settings );
129
+
130
+ }
131
+
132
+ }
133
+
134
+ /**
135
+ * Preference for Central Bank
136
+ * @since 1.5.2
137
+ * @version 1.1
138
+ */
139
+ public function preferences() {
140
+
141
+ $prefs = $this->prefs;
142
+
143
+ if( ! empty( mycred_get_option('mycred_pref_bank')['active'] ) && in_array( 'schedule_deposit', mycred_get_option('mycred_pref_bank')['active'] ) ) {
144
+ ?>
145
+ <div class="row">
146
+ <div class="col-xs-12">
147
+ <div class="row">
148
+ <div class="col-sm-4">
149
+ <div class="row">
150
+ <div class="col-sm-6">
151
+ <div class="form-group">
152
+ <label for="<?php echo esc_attr( $this->field_id( 'start_from' ) ); ?>"><?php esc_html_e( 'Starting from', 'mycred' ); ?></label>
153
+
154
+ <input type="date" name="<?php echo esc_attr( $this->field_name( 'start_from' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'start_from' ) ); ?>" value="<?php echo ! empty( $prefs['start_from'] ) ? esc_attr( $prefs['start_from'] ) : ''; ?>" class="mycred-input-date">
155
+ </div>
156
+ <p>
157
+ <span class="description"><?php esc_html_e( 'Enter the start date for schedule.', 'mycred' ); ?></span>
158
+ </p>
159
+ </div>
160
+ <div class="col-sm-6">
161
+ <div class="form-group">
162
+ <label for="<?php echo esc_attr( $this->field_id( 'schedule' ) ); ?>"><?php esc_html_e( 'Interval (in days)', 'mycred' ); ?></label>
163
+ <input type="number" name="<?php echo esc_attr( $this->field_name( 'schedule' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'schedule' ) ); ?>" value="<?php echo ! empty( $prefs['schedule'] ) ? esc_attr( $prefs['schedule'] ) : ''; ?>" min="1">
164
+ </div>
165
+ <p>
166
+ <span class="description"><?php esc_html_e( 'Deposit points after x days interval.', 'mycred' ); ?></span>
167
+ </p>
168
+ </div>
169
+ </div>
170
+ </div>
171
+ <div class="col-sm-3">
172
+ <div class="form-group">
173
+ <label for="<?php echo esc_attr( $this->field_id( 'points' ) ); ?>"><?php esc_html_e( 'Amount', 'mycred' ); ?></label>
174
+
175
+ <input type="number" name="<?php echo esc_attr( $this->field_name( 'points' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'points' ) ); ?>" value="<?php echo ! empty( $prefs['points'] ) ? esc_attr( $prefs['points'] ) : ''; ?>" min="1">
176
+ </div>
177
+ <p>
178
+ <span class="description"><?php esc_html_e( 'The amount of points to be scheduled.', 'mycred' ); ?></span>
179
+ </p>
180
+ </div>
181
+ <div class="col-sm-5">
182
+ <div class="form-group">
183
+ <label for="<?php echo esc_attr( $this->field_id( 'recurring' ) ); ?>"><?php esc_html_e( 'Recurring', 'mycred' ); ?></label>
184
+ <label class="mycred-switch1">
185
+ <input type="checkbox" id="<?php echo esc_attr( $this->field_id( 'recurring' ) ); ?>" name="<?php echo esc_attr( $this->field_name( 'recurring' ) ); ?>" <?php echo $prefs['recurring'] == 'on' ? 'checked' : '';?>>
186
+ <span class="slider round"></span>
187
+ </label>
188
+ </div>
189
+ <label><?php esc_html_e( 'Enabling this options will deposit the amount recursively after the defined interval.', 'mycred' ); ?> </label>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ <?php
195
+ }
196
+
197
+ }
198
+
199
+ //Register email instance
200
+ public function mycred_email_banking_instances_func( $instances ) {
201
+
202
+ if( class_exists( 'myCRED_Banking_Module' ) && class_exists( 'myCRED_Email_Notice_Module' ) ) {
203
+
204
+ wp_register_script( 'mycred-central-deposit-email', plugins_url( 'assets/js/central-deposit-emails.js', myCRED_BANK ), array( 'jquery' ), myCRED_VERSION );
205
+ wp_enqueue_script( 'mycred-central-deposit-email' );
206
+
207
+ }
208
+
209
+ if ( class_exists( 'myCRED_Email_Notice_Module' ) ) {
210
+
211
+ $instances['central_min_balance'] = __( 'min balance for central deposit', 'mycred' );
212
+ $instances['central_no_balance'] = __( 'no balance left for central deposit', 'mycred' );
213
+
214
+ return $instances;
215
+ }
216
+
217
+ }
218
+
219
+ public function mycred_after_email_banking_triggers($post) {
220
+
221
+ // Get trigger
222
+ $email = mycred_get_email_notice( $post->ID );
223
+ $trigger = $email->get_trigger();
224
+
225
+ $get_central_amount = mycred_get_post_meta( $post->ID, 'mycred_central_min_amount', true );
226
+ $instances = mycred_get_email_instances();
227
+ $uses_generic = ( $trigger == 'central_min_balance' && array_key_exists( $trigger, $instances ) ) ? true : false; ?>
228
+
229
+ <div id="areference-selection" style="display: <?php if ( $uses_generic ) echo 'block'; else echo 'none'; ?>;">
230
+ <label for="mycred-email-ctype"><?php esc_html_e( 'Minimum Balance Left', 'mycred' ); ?></label>
231
+ <input type="text" name="mycred_email[min_balance]" placeholder="<?php esc_html_e( '0', 'mycred' ); ?>" id="mycred-email-central-min" class="form-control" value="<?php echo ! empty( $get_central_amount ) ? esc_attr( $get_central_amount ) : ''; ?>" />
232
+ </div><?php
233
+
234
+ }
235
+
236
+ public function mycred_save_banking_email_notice( $post_id ) {
237
+
238
+ if( array_key_exists( 'min_balance', $_POST['mycred_email'] ) &&
239
+ ! empty( $_POST['mycred_email']['min_balance'] ) ) {
240
+
241
+ $central_min_amount = floatval( $_POST['mycred_email']['min_balance'] );
242
+ mycred_update_post_meta( $post_id, 'mycred_central_min_amount', $central_min_amount );
243
+
244
+ }
245
+
246
+ }
247
+
248
+ public function deactivate() {
249
+
250
+ wp_clear_scheduled_hook( 'mycred_schedule_deposit_event' );
251
+
252
+
253
+
254
+ }
255
+
256
+ public function mycred_notice_banking_email_check( $emailnotice, $request, $mycred ) {
257
+
258
+ $user_bank_id = mycred_get_option('mycred_pref_bank')['service_prefs']['central']['bank_id'];
259
+ $point_type = $mycred->get_point_type_key();
260
+ $min_balance_emails = mycred_get_event_emails( $point_type, 'generic', 'central_min_balance' );
261
+ $no_balance_emails = mycred_get_event_emails( $point_type, 'generic', 'central_no_balance' );
262
+
263
+ $emails = array_merge( $min_balance_emails, $no_balance_emails );
264
+ $balance = $mycred->get_users_balance( $user_bank_id );
265
+
266
+ foreach ( $emails as $notice_id ) {
267
+
268
+ $email = mycred_get_email_notice( $notice_id );
269
+ $trigger = $email->get_trigger();
270
+ $get_central_amount = intval( mycred_get_post_meta( $notice_id, 'mycred_central_min_amount', true ) );
271
+
272
+ if ( $trigger == 'central_min_balance' && $balance <= $get_central_amount ) {
273
+
274
+ $request = array(
275
+ 'ref' => 'central_min_balance',
276
+ 'user_id' => $user_bank_id,
277
+ 'amount' => $request['amount'],
278
+ 'entry' => 'central_min_balance',
279
+ 'ref_id' => $notice_id,
280
+ 'data' => array( 'ref_type' => 'post' ),
281
+ 'type' => $point_type,
282
+ 'new' => $balance,
283
+ 'old' => $balance
284
+ );
285
+
286
+ if ( mycred_user_wants_email( $user_bank_id, $notice_id ) ) {
287
+
288
+ mycred_send_new_email( $notice_id, $request, $point_type );
289
+
290
+ }
291
+
292
+ }
293
+
294
+ if ( $trigger == 'central_no_balance' && $balance <= 0 ) {
295
+
296
+ $request = array(
297
+ 'ref' => 'central_no_balance',
298
+ 'user_id' => $user_bank_id,
299
+ 'amount' => $request['amount'],
300
+ 'entry' => 'central_no_balance',
301
+ 'ref_id' => $notice_id,
302
+ 'data' => array( 'ref_type' => 'post' ),
303
+ 'type' => $point_type,
304
+ 'new' => $balance,
305
+ 'old' => $balance
306
+ );
307
+
308
+ if ( mycred_user_wants_email( $user_bank_id, $notice_id ) ) {
309
+
310
+ mycred_send_new_email( $notice_id, $request, $point_type );
311
+
312
+ }
313
+
314
+ }
315
+
316
+ }
317
+
318
+ if ( empty( $emails ) ) return;
319
+
320
+ return $emailnotice;
321
+ }
322
+
323
+ }
324
+
325
+ endif;
326
+
327
+
addons/buy-creds/gateways/netbilling.php CHANGED
@@ -201,13 +201,29 @@ if ( ! class_exists( 'myCRED_NETbilling' ) ) :
201
  */
202
  public function checkout_page_body() {
203
 
204
- echo $this->checkout_header();
205
- echo $this->checkout_logo( false );
206
-
207
- echo $this->checkout_order();
208
- echo $this->checkout_cancel();
209
-
210
- echo $this->checkout_footer();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
  }
213
 
201
  */
202
  public function checkout_page_body() {
203
 
204
+ echo wp_kses_post( $this->checkout_header() );
205
+ echo wp_kses_post( $this->checkout_logo( false ) );
206
+ echo wp_kses_post( $this->checkout_order() );
207
+ echo wp_kses_post( $this->checkout_cancel() );
208
+
209
+ echo wp_kses(
210
+ $this->checkout_footer(),
211
+ array(
212
+ 'div' => array( 'class' => array() ),
213
+ 'button' => array(
214
+ 'type' => array(),
215
+ 'id' => array(),
216
+ 'data-act' => array(),
217
+ 'data-value' => array(),
218
+ 'class' => array(),
219
+ ),
220
+ 'input' => array(
221
+ 'type' => array(),
222
+ 'name' => array(),
223
+ 'value' => array()
224
+ )
225
+ )
226
+ );
227
 
228
  }
229
 
addons/buy-creds/gateways/paypal-standard.php CHANGED
@@ -261,13 +261,30 @@ if ( ! class_exists( 'myCRED_PayPal_Standard' ) ) :
261
  */
262
  public function checkout_page_body() {
263
 
264
- echo $this->checkout_header();
265
- echo $this->checkout_logo( false );
266
-
267
- echo $this->checkout_order();
268
- echo $this->checkout_cancel();
269
-
270
- echo $this->checkout_footer();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
 
272
  }
273
 
261
  */
262
  public function checkout_page_body() {
263
 
264
+ echo wp_kses_post( $this->checkout_header() );
265
+ echo wp_kses_post( $this->checkout_logo( false ) );
266
+
267
+ echo wp_kses_post( $this->checkout_order() );
268
+ echo wp_kses_post( $this->checkout_cancel() );
269
+
270
+ echo wp_kses(
271
+ $this->checkout_footer(),
272
+ array(
273
+ 'div' => array( 'class' => array() ),
274
+ 'button' => array(
275
+ 'type' => array(),
276
+ 'id' => array(),
277
+ 'data-act' => array(),
278
+ 'data-value' => array(),
279
+ 'class' => array(),
280
+ ),
281
+ 'input' => array(
282
+ 'type' => array(),
283
+ 'name' => array(),
284
+ 'value' => array()
285
+ )
286
+ )
287
+ );
288
 
289
  }
290
 
addons/buy-creds/gateways/skrill.php CHANGED
@@ -232,13 +232,30 @@ if ( ! class_exists( 'myCRED_Skrill' ) ) :
232
  */
233
  public function checkout_page_body() {
234
 
235
- echo $this->checkout_header();
236
- echo $this->checkout_logo( false );
237
-
238
- echo $this->checkout_order();
239
- echo $this->checkout_cancel();
240
-
241
- echo $this->checkout_footer();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
  }
244
 
232
  */
233
  public function checkout_page_body() {
234
 
235
+ echo wp_kses_post( $this->checkout_header() );
236
+ echo wp_kses_post( $this->checkout_logo( false ) );
237
+
238
+ echo wp_kses_post( $this->checkout_order() );
239
+ echo wp_kses_post( $this->checkout_cancel() );
240
+
241
+ echo wp_kses(
242
+ $this->checkout_footer(),
243
+ array(
244
+ 'div' => array( 'class' => array() ),
245
+ 'button' => array(
246
+ 'type' => array(),
247
+ 'id' => array(),
248
+ 'data-act' => array(),
249
+ 'data-value' => array(),
250
+ 'class' => array(),
251
+ ),
252
+ 'input' => array(
253
+ 'type' => array(),
254
+ 'name' => array(),
255
+ 'value' => array()
256
+ )
257
+ )
258
+ );
259
 
260
  }
261
 
addons/buy-creds/includes/buycred-functions.php CHANGED
@@ -197,7 +197,20 @@ if ( ! function_exists( 'mycred_purchase_limit_dropdown' ) ) :
197
  }
198
  $output .= '</select>';
199
 
200
- echo $output;
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
  }
203
  endif;
@@ -433,7 +446,7 @@ if ( ! function_exists( 'buycred_get_pending_payment' ) ) :
433
  'amount' => $pending_payment->amount,
434
  'revisit' => $payment_id,
435
  'token' => wp_create_nonce( 'mycred-buy-creds' )
436
- ), set_url_scheme( sanitize_url( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ) );
437
 
438
  }
439
 
@@ -511,8 +524,8 @@ if ( ! function_exists( 'buycred_get_cancel_transaction_url' ) ) :
511
  }
512
 
513
  // Override
514
- if ( isset( $_REQUEST['return_to'] ) && esc_url_raw( $_REQUEST['return_to'] ) != '' )
515
- $base = esc_url_raw( $_REQUEST['return_to'] );
516
 
517
  if ( $transaction_id !== NULL )
518
  $url = add_query_arg( array( 'buycred-cancel' => $transaction_id, '_token' => wp_create_nonce( 'buycred-cancel-pending-payment' ) ), $base );
197
  }
198
  $output .= '</select>';
199
 
200
+ echo wp_kses(
201
+ $output,
202
+ array(
203
+ 'select' => array(
204
+ 'name' => array(),
205
+ 'id' => array(),
206
+ 'class' => array()
207
+ ),
208
+ 'option' => array(
209
+ 'value' => array(),
210
+ 'selected' => array()
211
+ )
212
+ )
213
+ );
214
 
215
  }
216
  endif;
446
  'amount' => $pending_payment->amount,
447
  'revisit' => $payment_id,
448
  'token' => wp_create_nonce( 'mycred-buy-creds' )
449
+ ), set_url_scheme( esc_url_raw( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ) );
450
 
451
  }
452
 
524
  }
525
 
526
  // Override
527
+ if ( ! empty( $_REQUEST['return_to'] ) )
528
+ $base = esc_url_raw( wp_unslash( $_REQUEST['return_to'] ) );
529
 
530
  if ( $transaction_id !== NULL )
531
  $url = add_query_arg( array( 'buycred-cancel' => $transaction_id, '_token' => wp_create_nonce( 'buycred-cancel-pending-payment' ) ), $base );
addons/buy-creds/includes/buycred-reward-hook.php CHANGED
@@ -173,7 +173,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Reward_Hook' ) ) :
173
  <div class="form-group">
174
  <label><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
175
  <input type="text" name="<?php echo esc_attr( $this->name( $this->mycred_type, 'log' ) ); ?>" placeholder="<?php esc_html_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $hook['log'] ); ?>" class="form-control buycred-reward-log" />
176
- <span class="description"><?php echo esc_attr( $this->available_template_tags( array( 'general' ) ) ); ?></span>
177
  </div>
178
  </div>
179
  </div>
173
  <div class="form-group">
174
  <label><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
175
  <input type="text" name="<?php echo esc_attr( $this->name( $this->mycred_type, 'log' ) ); ?>" placeholder="<?php esc_html_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $hook['log'] ); ?>" class="form-control buycred-reward-log" />
176
+ <span class="description"><?php echo esc_html( $this->available_template_tags( array( 'general' ) ) ); ?></span>
177
  </div>
178
  </div>
179
  </div>
addons/buy-creds/includes/buycred-shortcodes.php CHANGED
@@ -210,8 +210,8 @@ if ( ! function_exists( 'mycred_render_buy_form_points' ) ) :
210
  ?>
211
  <div class="row">
212
  <div class="col-xs-12">
213
- <form method="post" class="form<?php if ( $inline == 1 ) echo '-inline'; ?> <?php echo implode( ' ', $classes ); ?>" action="">
214
- <input type="hidden" name="token" value="<?php echo wp_create_nonce( 'mycred-buy-creds' ); ?>" />
215
  <?php
216
  if( count( $point_types ) > 1 ){ ?>
217
  <select name="ctype" class="mycred-change-pointtypes">
@@ -235,7 +235,7 @@ if ( ! function_exists( 'mycred_render_buy_form_points' ) ) :
235
  if ( count( $amounts ) == 0 ) {
236
 
237
  ?>
238
- <input type="text" name="amount" class="form-control" placeholder="<?php echo $mycred->format_creds( $minimum ); ?>" min="<?php echo $minimum; ?>" value="" />
239
  <?php
240
 
241
  }
@@ -244,7 +244,7 @@ if ( ! function_exists( 'mycred_render_buy_form_points' ) ) :
244
  elseif ( count( $amounts ) == 1 ) {
245
 
246
  ?>
247
- <p class="form-control-static"><?php echo $mycred->format_creds( $amounts[0] ); ?></p>
248
  <input type="hidden" name="amount" value="<?php echo esc_attr( $amounts[0] ); ?>" />
249
  <?php
250
 
@@ -265,7 +265,7 @@ if ( ! function_exists( 'mycred_render_buy_form_points' ) ) :
265
  // disable the option
266
  if ( $remaining !== true && $remaining < $amount ) echo ' disabled="disabled"';
267
 
268
- echo '>' . $mycred->format_creds( $amount ) . '</option>';
269
 
270
  }
271
 
@@ -327,7 +327,7 @@ if ( ! function_exists( 'mycred_render_buy_form_points' ) ) :
327
  </div>
328
 
329
  <div class="form-group">
330
- <button class="button btn btn-block btn-lg" ><?php echo $button_label; ?></button>
331
  </div>
332
 
333
  </form>
@@ -371,7 +371,7 @@ if ( ! function_exists( 'mycred_render_pending_purchases' ) ) :
371
  ob_start();
372
 
373
  ?>
374
- <div id="pending-buycred-payments-<?php echo $ctype; ?>">
375
  <table class="table">
376
  <thead>
377
  <tr>
@@ -399,16 +399,16 @@ if ( ! function_exists( 'mycred_render_pending_purchases' ) ) :
399
 
400
  ?>
401
  <tr>
402
- <td class="column-transaction-id"><?php echo esc_attr( $entry->public_id ); ?></td>
403
- <td class="column-gateway"><?php echo $buycred->adjust_column_content( 'gateway', $entry->payment_id ); ?></td>
404
- <td class="column-amount"><?php echo $buycred->adjust_column_content( 'amount', $entry->payment_id ); ?></td>
405
- <td class="column-cost"><?php echo $buycred->adjust_column_content( 'cost', $entry->payment_id ); ?></td>
406
- <td class="column-ctype"><?php echo mycred_get_point_type_name( $entry->point_type, false ); ?></td>
407
  <td class="column-actions">
408
  <?php if( $entry->gateway_id != 'bank' ):?>
409
- <a href="<?php echo esc_url( $entry->pay_now_url ); ?>"><?php echo $pay_now; ?></a> &bull;
410
  <?php endif; ?>
411
- <a href="<?php echo esc_url( $entry->cancel_url ); ?>"><?php echo $cancel; ?></a>
412
  </td>
413
  </tr>
414
  <?php
@@ -426,15 +426,15 @@ if ( ! function_exists( 'mycred_render_pending_purchases' ) ) :
426
 
427
  ?>
428
  <tr>
429
- <td class="column-transaction-id"><?php echo esc_attr( $entry->public_id ); ?></td>
430
- <td class="column-gateway"><?php echo $buycred->adjust_column_content( 'gateway', $entry->payment_id ); ?></td>
431
- <td class="column-amount"><?php echo $buycred->adjust_column_content( 'amount', $entry->payment_id ); ?></td>
432
- <td class="column-cost"><?php echo $buycred->adjust_column_content( 'cost', $entry->payment_id ); ?></td>
433
  <td class="column-actions">
434
  <?php if( $entry->gateway_id != 'bank' ):?>
435
- <a href="<?php echo esc_url( $entry->pay_now_url ); ?>"><?php echo $pay_now; ?></a> &bull;
436
  <?php endif; ?>
437
- <a href="<?php echo esc_url( $entry->cancel_url ); ?>"><?php echo $cancel; ?></a>
438
  </td>
439
  </tr>
440
  <?php
210
  ?>
211
  <div class="row">
212
  <div class="col-xs-12">
213
+ <form method="post" class="form<?php if ( $inline == 1 ) echo esc_attr( '-inline' ); ?> <?php echo esc_attr( implode( ' ', $classes ) ); ?>" action="">
214
+ <input type="hidden" name="token" value="<?php echo esc_attr( wp_create_nonce( 'mycred-buy-creds' ) ); ?>" />
215
  <?php
216
  if( count( $point_types ) > 1 ){ ?>
217
  <select name="ctype" class="mycred-change-pointtypes">
235
  if ( count( $amounts ) == 0 ) {
236
 
237
  ?>
238
+ <input type="text" name="amount" class="form-control" placeholder="<?php echo esc_attr( $mycred->format_creds( $minimum ) ); ?>" min="<?php echo esc_attr( $minimum );?>" value="" />
239
  <?php
240
 
241
  }
244
  elseif ( count( $amounts ) == 1 ) {
245
 
246
  ?>
247
+ <p class="form-control-static"><?php echo esc_html( $mycred->format_creds( $amounts[0] ) ); ?></p>
248
  <input type="hidden" name="amount" value="<?php echo esc_attr( $amounts[0] ); ?>" />
249
  <?php
250
 
265
  // disable the option
266
  if ( $remaining !== true && $remaining < $amount ) echo ' disabled="disabled"';
267
 
268
+ echo '>' . esc_html( $mycred->format_creds( $amount ) ) . '</option>';
269
 
270
  }
271
 
327
  </div>
328
 
329
  <div class="form-group">
330
+ <button class="button btn btn-block btn-lg" ><?php echo esc_html( $button_label ); ?></button>
331
  </div>
332
 
333
  </form>
371
  ob_start();
372
 
373
  ?>
374
+ <div id="pending-buycred-payments-<?php echo esc_attr( $ctype ); ?>">
375
  <table class="table">
376
  <thead>
377
  <tr>
399
 
400
  ?>
401
  <tr>
402
+ <td class="column-transaction-id"><?php echo esc_html( $entry->public_id ); ?></td>
403
+ <td class="column-gateway"><?php echo esc_html( $buycred->adjust_column_content( 'gateway', $entry->payment_id ) ); ?></td>
404
+ <td class="column-amount"><?php echo esc_html( $buycred->adjust_column_content( 'amount', $entry->payment_id ) ); ?></td>
405
+ <td class="column-cost"><?php echo esc_html( $buycred->adjust_column_content( 'cost', $entry->payment_id ) ); ?></td>
406
+ <td class="column-ctype"><?php echo esc_html( mycred_get_point_type_name( $entry->point_type, false ) ); ?></td>
407
  <td class="column-actions">
408
  <?php if( $entry->gateway_id != 'bank' ):?>
409
+ <a href="<?php echo esc_url( $entry->pay_now_url ); ?>"><?php echo esc_html( $pay_now ); ?></a> &bull;
410
  <?php endif; ?>
411
+ <a href="<?php echo esc_url( $entry->cancel_url ); ?>"><?php echo esc_html( $cancel ); ?></a>
412
  </td>
413
  </tr>
414
  <?php
426
 
427
  ?>
428
  <tr>
429
+ <td class="column-transaction-id"><?php echo esc_html( $entry->public_id ); ?></td>
430
+ <td class="column-gateway"><?php echo esc_html( $buycred->adjust_column_content( 'gateway', $entry->payment_id ) ); ?></td>
431
+ <td class="column-amount"><?php echo esc_html( $buycred->adjust_column_content( 'amount', $entry->payment_id ) ); ?></td>
432
+ <td class="column-cost"><?php echo esc_html( $buycred->adjust_column_content( 'cost', $entry->payment_id ) ); ?></td>
433
  <td class="column-actions">
434
  <?php if( $entry->gateway_id != 'bank' ):?>
435
+ <a href="<?php echo esc_url( $entry->pay_now_url ); ?>"><?php echo esc_html( $pay_now ); ?></a> &bull;
436
  <?php endif; ?>
437
+ <a href="<?php echo esc_url( $entry->cancel_url ); ?>"><?php echo esc_html( $cancel ); ?></a>
438
  </td>
439
  </tr>
440
  <?php
addons/buy-creds/modules/buycred-module-core.php CHANGED
@@ -252,8 +252,8 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
252
  global $wp;
253
  echo "
254
  <script>
255
- alert('".$error."');
256
- location.replace( '".home_url( $wp->request )."' );
257
  </script>
258
  ";
259
  }
@@ -401,7 +401,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
401
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
402
 
403
  <div class="form-group">
404
- <label for="buycred-type-<?php echo esc_attr( $type_id ); ?>-enabled"><?php echo $mycred->plural(); ?></label>
405
  <div class="checkbox" style="padding-top: 4px;">
406
  <label for="buycred-type-<?php echo esc_attr( $type_id ); ?>-enabled"><input type="checkbox" name="mycred_pref_core[buy_creds][types][<?php echo esc_attr( $type_id ); ?>][enabled]" id="buycred-type-<?php echo esc_attr( $type_id ); ?>-enabled"<?php if ( in_array( $type_id, $settings['types'] ) ) echo ' checked="checked"'; ?> value="<?php echo esc_attr( $type_id ); ?>" /> <?php esc_html_e( 'Enable', 'mycred' ); ?></label>
407
  </div>
@@ -412,7 +412,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
412
 
413
  <div class="form-group">
414
  <label for="buycred-type-<?php echo esc_attr( $type_id ); ?>-min"><?php esc_html_e( 'Minimum Amount', 'mycred' ); ?></label>
415
- <input type="text" name="mycred_pref_core[buy_creds][types][<?php echo esc_attr( $type_id ); ?>][min]" id="buycred-type-<?php echo esc_attr( $type_id ); ?>-min" class="form-control" placeholder="<?php echo $mycred->get_lowest_value(); ?>" value="<?php echo esc_attr( $sale_setup['min'] ); ?>" />
416
  </div>
417
 
418
  </div>
@@ -440,7 +440,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
440
  <hr />
441
  <div class="form-group">
442
  <div class="checkbox">
443
- <label for="<?php echo $this->field_id( 'custom_log' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'custom_log' ); ?>" id="<?php echo $this->field_id( 'custom_log' ); ?>"<?php checked( $settings['custom_log'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Create a dedicated log for purchases.', 'mycred' ) ); ?></label>
444
  </div>
445
  </div>
446
  </div>
@@ -451,15 +451,15 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
451
 
452
  <div class="row">
453
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-center">
454
- <label for="<?php echo $this->field_id( 'checkout-full' ); ?>">
455
- <img src="<?php echo plugins_url( 'assets/images/checkout-full.png', MYCRED_PURCHASE ); ?>" alt="" style="max-width: 100%; height: auto;" />
456
- <input type="radio" name="<?php echo $this->field_name( 'checkout' ); ?>"<?php checked( $settings['checkout'], 'page' ); ?> id="<?php echo $this->field_id( 'checkout-full' ); ?>" value="page" /> Full Page
457
  </label>
458
  </div>
459
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-center">
460
- <label for="<?php echo $this->field_id( 'checkout-popup' ); ?>">
461
- <img src="<?php echo plugins_url( 'assets/images/checkout-popup.png', MYCRED_PURCHASE ); ?>" alt="" style="max-width: 100%; height: auto;" />
462
- <input type="radio" name="<?php echo $this->field_name( 'checkout' ); ?>"<?php checked( $settings['checkout'], 'popup' ); ?> id="<?php echo $this->field_id( 'checkout-popup' ); ?>" value="popup" /> Popup
463
  </label>
464
  </div>
465
  </div>
@@ -477,7 +477,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
477
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'Where should users be redirected to upon successfully completing a purchase. You can nominate a specific URL or a page.', 'mycred' ); ?></span></p>
478
  </div>
479
  <div class="form-group">
480
- <label for="<?php echo $this->field_id( array( 'thankyou' => 'page' ) ); ?>"><?php esc_html_e( 'Redirect to Page', 'mycred' ); ?></label>
481
  <?php
482
 
483
  // Thank you page dropdown
@@ -486,15 +486,29 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
486
  'id' => $this->field_id( array( 'thankyou' => 'page' ) ) . '-id',
487
  'selected' => $settings['thankyou']['page'],
488
  'show_option_none' => __( 'Select', 'mycred' ),
489
- 'class' => 'form-control'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
490
  );
491
- wp_dropdown_pages( $thankyou_args );
492
 
493
  ?>
494
  </div>
495
  <div class="form-group">
496
- <label for="<?php echo $this->field_id( array( 'thankyou' => 'custom' ) ); ?>"><?php esc_html_e( 'Redirect to URL', 'mycred' ); ?></label>
497
- <input type="text" name="<?php echo $this->field_name( array( 'thankyou' => 'custom' ) ); ?>" id="<?php echo $this->field_id( array( 'thankyou' => 'custom' ) ); ?>" placeholder="https://" class="form-control" value="<?php echo esc_attr( $settings['thankyou']['custom'] ); ?>" />
498
  </div>
499
  <?php if ( $uses_buddypress ) : ?>
500
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'You can use %profile% for the base URL of the users profile.', 'mycred' ); ?></span></p>
@@ -507,7 +521,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
507
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'Where should users be redirected to if they cancel a transaction. You can nominate a specific URL or a page.', 'mycred' ); ?></span></p>
508
  </div>
509
  <div class="form-group">
510
- <label for="<?php echo $this->field_id( array( 'cancelled' => 'page' ) ); ?>"><?php esc_html_e( 'Redirect to Page', 'mycred' ); ?></label>
511
  <?php
512
 
513
  // Thank you page dropdown
@@ -516,15 +530,29 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
516
  'id' => $this->field_id( array( 'cancelled' => 'page' ) ) . '-id',
517
  'selected' => $settings['cancelled']['page'],
518
  'show_option_none' => __( 'Select', 'mycred' ),
519
- 'class' => 'form-control'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  );
521
- wp_dropdown_pages( $thankyou_args );
522
 
523
  ?>
524
  </div>
525
  <div class="form-group">
526
- <label for="<?php echo $this->field_id( array( 'cancelled' => 'custom' ) ); ?>"><?php esc_html_e( 'Redirect to URL', 'mycred' ); ?></label>
527
- <input type="text" name="<?php echo $this->field_name( array( 'cancelled' => 'custom' ) ); ?>" id="<?php echo $this->field_id( array( 'cancelled' => 'custom' ) ); ?>" placeholder="https://" class="form-control" value="<?php echo esc_attr( $settings['cancelled']['custom'] ); ?>" />
528
  </div>
529
  <?php if ( $uses_buddypress ) : ?>
530
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'You can use %profile% for the base URL of the users profile.', 'mycred' ); ?></span></p>
@@ -538,8 +566,8 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
538
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
539
 
540
  <div class="form-group">
541
- <label for="<?php echo $this->field_id( 'login' ); ?>"><?php esc_html_e( 'Login Message', 'mycred' ); ?></label>
542
- <input type="text" name="<?php echo $this->field_name( 'login' ); ?>" id="<?php echo $this->field_id( 'login' ); ?>" class="form-control" value="<?php echo esc_attr( $settings['login'] ); ?>" />
543
  <p><span class="description"><?php esc_html_e( 'Message to show in shortcodes when viewed by someone who is not logged in.', 'mycred' ); ?></span></p>
544
  </div>
545
 
@@ -547,9 +575,9 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
547
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
548
 
549
  <div class="form-group">
550
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
551
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $settings['log'] ); ?>" />
552
- <p><span class="description"><?php echo $this->core->available_template_tags( array( 'general' ), '%gateway%' ); ?></span></p>
553
  </div>
554
 
555
  </div>
@@ -561,10 +589,10 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
561
 
562
  <div class="form-group">
563
  <div class="checkbox">
564
- <label for="<?php echo $this->field_id( array( 'gifting' => 'members' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'gifting' => 'members' ) ); ?>" id="<?php echo $this->field_id( array( 'gifting' => 'members' ) ); ?>"<?php checked( $settings['gifting']['members'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Allow users to buy %_plural% for other users.', 'mycred' ) ); ?></label>
565
  </div>
566
  <div class="checkbox">
567
- <label for="<?php echo $this->field_id( array( 'gifting' => 'authors' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'gifting' => 'authors' ) ); ?>" id="<?php echo $this->field_id( array( 'gifting' => 'authors' ) ); ?>"<?php checked( $settings['gifting']['authors'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Allow users to buy %_plural% for content authors.', 'mycred' ) ); ?></label>
568
  </div>
569
  </div>
570
 
@@ -572,9 +600,9 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
572
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
573
 
574
  <div class="form-group">
575
- <label for="<?php echo $this->field_id( array( 'gifting' => 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
576
- <input type="text" name="<?php echo $this->field_name( array( 'gifting' => 'log' ) ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $settings['gifting']['log'] ); ?>" />
577
- <p><span class="description"><?php echo $this->core->available_template_tags( array( 'general', 'user' ) ); ?></span></p>
578
  </div>
579
 
580
  </div>
@@ -745,7 +773,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
745
 
746
  // Updated settings
747
  if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] == true )
748
- echo '<div class="updated settings-error"><p>' . __( 'Settings Updated', 'mycred' ) . '</p></div>';
749
 
750
  ?>
751
  <form method="post" action="options.php" class="form">
@@ -774,21 +802,21 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
774
  $column_class = 'col-lg-4 col-md-4 col-sm-12 col-xs-12';
775
 
776
  ?>
777
- <h4><span class="dashicons <?php echo $data['icon']; ?><?php if ( $this->is_active( $key ) ) { if ( $sandbox_mode ) echo ' debug'; else echo ' active'; } else echo ' static'; ?>"></span><?php echo $this->core->template_tags_general( $data['title'] ); ?></h4>
778
  <div class="body" style="display: none;">
779
 
780
  <div class="row">
781
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
782
  <div class="form-group">
783
  <div>&nbsp;</div>
784
- <label for="buycred-gateway-<?php echo $key; ?>"><input type="checkbox" name="mycred_pref_buycreds[active][]" id="buycred-gateway-<?php echo $key; ?>" value="<?php echo $key; ?>"<?php if ( $this->is_active( $key ) ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Enable', 'mycred' ); ?></label>
785
  </div>
786
  </div>
787
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
788
  <?php if ( $has_test_mode ) : ?>
789
  <div class="form-group">
790
  <div>&nbsp;</div>
791
- <label for="buycred-gateway-<?php echo $key; ?>-sandbox"><input type="checkbox" name="mycred_pref_buycreds[gateway_prefs][<?php echo $key; ?>][sandbox]" id="buycred-gateway-<?php echo $key; ?>-sandbox" value="<?php echo $key; ?>"<?php if ( $sandbox_mode ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Sandbox Mode', 'mycred' ); ?></label>
792
  </div>
793
  <?php endif; ?>
794
  </div>
@@ -796,7 +824,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
796
  <?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && $has_documentation ) : ?>
797
  <div class="form-group">
798
  <div>&nbsp;</div>
799
- <a href="<?php echo $has_documentation; ?>" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a>
800
  </div>
801
  <?php endif; ?>
802
  </div>
@@ -805,7 +833,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
805
 
806
  <?php $this->call( 'preferences', $data['callback'] ); ?>
807
 
808
- <input type="hidden" name="mycred_pref_buycreds[installed]" value="<?php echo $key; ?>" />
809
  </div>
810
  <?php
811
 
@@ -865,7 +893,7 @@ if ( ! class_exists( 'myCRED_buyCRED_Module' ) ) :
865
  <div class='body' style='display:none; padding: 0px; border: none;'>
866
  </div>";
867
 
868
- echo $content;
869
  }
870
  }
871
  ?>
@@ -930,7 +958,7 @@ jQuery(function($) {
930
 
931
  if ( empty( $this->purchase_log ) ) return;
932
 
933
- $meta_key = 'mycred_payments_' . str_replace( MYCRED_SLUG . '-purchases-', '', $_GET['page'] );
934
 
935
  if ( isset( $_REQUEST['wp_screen_options']['option'] ) && isset( $_REQUEST['wp_screen_options']['value'] ) ) {
936
 
@@ -959,7 +987,7 @@ jQuery(function($) {
959
  */
960
  public function purchase_log_page() {
961
 
962
- $point_type = str_replace( 'mycred-purchases-', '', sanitize_key( $_GET['page'] ) );
963
  $installed = $this->get();
964
 
965
  $mycred = $this->core;
@@ -1005,17 +1033,17 @@ jQuery(function($) {
1005
  <?php $log->filter_dates( esc_url( $filter_url ) ); ?>
1006
 
1007
  <form method="get" action="" name="mycred-buycred-form" novalidate>
1008
- <input type="hidden" name="page" value="<?php echo esc_attr( $_GET['page'] ); ?>" />
1009
  <?php
1010
 
1011
  if ( array_key_exists( 's', $search_args ) )
1012
  echo '<input type="hidden" name="s" value="' . esc_attr( $search_args['s'] ) . '" />';
1013
 
1014
  if ( isset( $_GET['ref'] ) )
1015
- echo '<input type="hidden" name="show" value="' . esc_attr( $_GET['ref'] ) . '" />';
1016
 
1017
  if ( isset( $_GET['show'] ) )
1018
- echo '<input type="hidden" name="show" value="' . esc_attr( $_GET['show'] ) . '" />';
1019
 
1020
  if ( array_key_exists( 'order', $search_args ) )
1021
  echo '<input type="hidden" name="order" value="' . esc_attr( $search_args['order'] ) . '" />';
@@ -1040,7 +1068,7 @@ jQuery(function($) {
1040
  <?php
1041
 
1042
  foreach ( $log->headers as $col_id => $col_title )
1043
- echo '<th scope="col" id="' . str_replace( 'column-', '', $col_id ) . '" class="manage-column ' . $col_id . '">' . $col_title . '</th>';
1044
 
1045
  ?>
1046
  </tr>
@@ -1050,8 +1078,7 @@ jQuery(function($) {
1050
  <?php
1051
 
1052
  foreach ( $log->headers as $col_id => $col_title )
1053
- echo '<th scope="col" class="manage-column ' . $col_id . '">' . $col_title . '</th>';
1054
-
1055
  ?>
1056
  </tr>
1057
  </tfoot>
@@ -1095,12 +1122,12 @@ jQuery(function($) {
1095
  elseif ( substr( $log_entry->entry, 0, 4 ) == 'TEST' )
1096
  $style = ' style="color:orange;"';
1097
 
1098
- echo '<tr class="myCRED-log-row' . $class . '" id="mycred-log-entry-' . $log_entry->id . '">';
1099
 
1100
  // Run though columns
1101
  foreach ( $log->headers as $column_id => $column_name ) {
1102
 
1103
- echo '<td class="' . $column_id . '"' . $style . '>';
1104
 
1105
  switch ( $column_id ) {
1106
 
@@ -1108,7 +1135,7 @@ jQuery(function($) {
1108
  case 'column-gateway' :
1109
 
1110
  $gateway = str_replace( array( '-', '_' ), ' ', $gateway_name );
1111
- echo ucwords( $gateway );
1112
 
1113
  break;
1114
 
@@ -1117,23 +1144,23 @@ jQuery(function($) {
1117
 
1118
  $user = get_userdata( $log_entry->user_id );
1119
  if ( $user === false )
1120
- echo 'ID: ' . $log_entry->user_id;
1121
  else
1122
- echo $user->display_name . ' <em><small>(ID: ' . $log_entry->user_id . ')</small></em>';
1123
 
1124
  break;
1125
 
1126
  // Date & Time Column
1127
  case 'column-date' :
1128
 
1129
- echo date( $date_format, $log_entry->time );
1130
 
1131
  break;
1132
 
1133
  // Amount Column
1134
  case 'column-amount' :
1135
 
1136
- echo $mycred->format_creds( $log_entry->creds );
1137
 
1138
  break;
1139
 
@@ -1161,7 +1188,7 @@ jQuery(function($) {
1161
  $rendered_cost = apply_filters( 'mycred_buycred_display_cost', $cost . ' ' . $currency, $sales_data, $log_entry, $gateway_name );
1162
  $rendered_cost = apply_filters( 'mycred_buycred_display_cost_' . $gateway_name, $rendered_cost, $sales_data, $log_entry );
1163
 
1164
- echo $rendered_cost;
1165
 
1166
  }
1167
 
@@ -1179,7 +1206,7 @@ jQuery(function($) {
1179
  elseif ( isset( $saved_data['transaction_id'] ) )
1180
  $transaction_id = $saved_data['transaction_id'];
1181
 
1182
- echo $transaction_id;
1183
 
1184
  break;
1185
 
@@ -1205,7 +1232,7 @@ jQuery(function($) {
1205
  // No log entry
1206
  else {
1207
 
1208
- echo '<tr><td colspan="' . count( $log->headers ) . '" class="no-entries">' . __( 'No purchases found', 'mycred' ) . '</td></tr>';
1209
 
1210
  }
1211
 
@@ -1348,7 +1375,7 @@ jQuery(function($) {
1348
 
1349
  ?>
1350
  <div class="mycred-wrapper buycred-wrapper disabled-option color-option">
1351
- <div><?php printf( _x( 'Buying %s', 'Points Name', 'mycred' ), $data['name'] ); ?></div>
1352
  <div class="balance-row">
1353
  <div class="balance-view"><?php esc_html_e( 'Disabled', 'mycred' ); ?></div>
1354
  <div class="balance-desc"><em><?php esc_html_e( 'This point type is not for sale.', 'mycred' ); ?></em></div>
@@ -1363,10 +1390,10 @@ jQuery(function($) {
1363
 
1364
  ?>
1365
  <div class="mycred-wrapper buycred-wrapper excluded-option color-option">
1366
- <div><?php printf( _x( 'Buying %s', 'Buying Points', 'mycred' ), $data['name'] ); ?></div>
1367
  <div class="balance-row">
1368
  <div class="balance-view"><?php esc_html_e( 'Excluded', 'mycred' ); ?></div>
1369
- <div class="balance-desc"><em><?php printf( _x( 'User can not buy %s', 'Points Name', 'mycred' ), $data['name'] ); ?></em></div>
1370
  </div>
1371
  </div>
1372
  <?php
@@ -1378,9 +1405,9 @@ jQuery(function($) {
1378
 
1379
  ?>
1380
  <div class="mycred-wrapper buycred-wrapper color-option selected">
1381
- <div><?php printf( _x( 'Buying %s', 'Buying Points', 'mycred' ), $data['name'] ); ?></div>
1382
  <div class="balance-row">
1383
- <div class="balance-view"><?php echo $data['before']; ?><input type="text" name="mycred_adjust_users_buyrates[<?php echo $type_id; ?>][<?php echo $gateway_id; ?>]" placeholder="<?php echo $data['default']; ?>" value="<?php if ( $data['override'] ) echo esc_attr( $data['custom'] ); ?>" class="short" size="8" /><?php echo ' ' . $setup['currency']; ?></div>
1384
  <div class="balance-desc"><em><?php esc_html_e( 'Leave empty to use the default rate.', 'mycred' ); ?></em></div>
1385
  </div>
1386
  </div>
252
  global $wp;
253
  echo "
254
  <script>
255
+ alert('" . esc_js( $error ) . "');
256
+ location.replace( '" . esc_js( home_url( $wp->request ) ) . "' );
257
  </script>
258
  ";
259
  }
401
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
402
 
403
  <div class="form-group">
404
+ <label for="buycred-type-<?php echo esc_attr( $type_id ); ?>-enabled"><?php echo esc_html( $mycred->plural() ); ?></label>
405
  <div class="checkbox" style="padding-top: 4px;">
406
  <label for="buycred-type-<?php echo esc_attr( $type_id ); ?>-enabled"><input type="checkbox" name="mycred_pref_core[buy_creds][types][<?php echo esc_attr( $type_id ); ?>][enabled]" id="buycred-type-<?php echo esc_attr( $type_id ); ?>-enabled"<?php if ( in_array( $type_id, $settings['types'] ) ) echo ' checked="checked"'; ?> value="<?php echo esc_attr( $type_id ); ?>" /> <?php esc_html_e( 'Enable', 'mycred' ); ?></label>
407
  </div>
412
 
413
  <div class="form-group">
414
  <label for="buycred-type-<?php echo esc_attr( $type_id ); ?>-min"><?php esc_html_e( 'Minimum Amount', 'mycred' ); ?></label>
415
+ <input type="text" name="mycred_pref_core[buy_creds][types][<?php echo esc_attr( $type_id ); ?>][min]" id="buycred-type-<?php echo esc_attr( $type_id ); ?>-min" class="form-control" placeholder="<?php echo esc_attr( $mycred->get_lowest_value() ); ?>" value="<?php echo esc_attr( $sale_setup['min'] ); ?>" />
416
  </div>
417
 
418
  </div>
440
  <hr />
441
  <div class="form-group">
442
  <div class="checkbox">
443
+ <label for="<?php echo esc_attr( $this->field_id( 'custom_log' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'custom_log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'custom_log' ) ); ?>"<?php checked( $settings['custom_log'], 1 ); ?> value="1" /> <?php echo esc_html( $this->core->template_tags_general( __( 'Create a dedicated log for purchases.', 'mycred' ) ) ); ?></label>
444
  </div>
445
  </div>
446
  </div>
451
 
452
  <div class="row">
453
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-center">
454
+ <label for="<?php echo esc_attr( $this->field_id( 'checkout-full' ) ); ?>">
455
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/checkout-full.png', MYCRED_PURCHASE ) ); ?>" alt="" style="max-width: 100%; height: auto;" />
456
+ <input type="radio" name="<?php echo esc_attr( $this->field_name( 'checkout' ) ); ?>"<?php checked( $settings['checkout'], 'page' ); ?> id="<?php echo esc_attr( $this->field_id( 'checkout-full' ) ); ?>" value="page" /> Full Page
457
  </label>
458
  </div>
459
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-center">
460
+ <label for="<?php echo esc_attr( $this->field_id( 'checkout-popup' ) ); ?>">
461
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/checkout-popup.png', MYCRED_PURCHASE ) ); ?>" alt="" style="max-width: 100%; height: auto;" />
462
+ <input type="radio" name="<?php echo esc_attr( $this->field_name( 'checkout' ) ); ?>"<?php checked( $settings['checkout'], 'popup' ); ?> id="<?php echo esc_attr( $this->field_id( 'checkout-popup' ) ); ?>" value="popup" /> Popup
463
  </label>
464
  </div>
465
  </div>
477
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'Where should users be redirected to upon successfully completing a purchase. You can nominate a specific URL or a page.', 'mycred' ); ?></span></p>
478
  </div>
479
  <div class="form-group">
480
+ <label for="<?php echo esc_attr( $this->field_id( array( 'thankyou' => 'page' ) ) ); ?>"><?php esc_html_e( 'Redirect to Page', 'mycred' ); ?></label>
481
  <?php
482
 
483
  // Thank you page dropdown
486
  'id' => $this->field_id( array( 'thankyou' => 'page' ) ) . '-id',
487
  'selected' => $settings['thankyou']['page'],
488
  'show_option_none' => __( 'Select', 'mycred' ),
489
+ 'class' => 'form-control',
490
+ 'echo' => 0
491
+ );
492
+ echo wp_kses(
493
+ wp_dropdown_pages( $thankyou_args ),
494
+ array(
495
+ 'select' => array(
496
+ 'id' => array(),
497
+ 'name' => array(),
498
+ 'class' => array()
499
+ ),
500
+ 'option' => array(
501
+ 'value' => array(),
502
+ 'selected' => array()
503
+ )
504
+ )
505
  );
 
506
 
507
  ?>
508
  </div>
509
  <div class="form-group">
510
+ <label for="<?php echo esc_attr( $this->field_id( array( 'thankyou' => 'custom' ) ) ); ?>"><?php esc_html_e( 'Redirect to URL', 'mycred' ); ?></label>
511
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'thankyou' => 'custom' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'thankyou' => 'custom' ) ) ); ?>" placeholder="https://" class="form-control" value="<?php echo esc_attr( $settings['thankyou']['custom'] ); ?>" />
512
  </div>
513
  <?php if ( $uses_buddypress ) : ?>
514
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'You can use %profile% for the base URL of the users profile.', 'mycred' ); ?></span></p>
521
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'Where should users be redirected to if they cancel a transaction. You can nominate a specific URL or a page.', 'mycred' ); ?></span></p>
522
  </div>
523
  <div class="form-group">
524
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cancelled' => 'page' ) ) ); ?>"><?php esc_html_e( 'Redirect to Page', 'mycred' ); ?></label>
525
  <?php
526
 
527
  // Thank you page dropdown
530
  'id' => $this->field_id( array( 'cancelled' => 'page' ) ) . '-id',
531
  'selected' => $settings['cancelled']['page'],
532
  'show_option_none' => __( 'Select', 'mycred' ),
533
+ 'class' => 'form-control',
534
+ 'echo' => 0
535
+ );
536
+ echo wp_kses(
537
+ wp_dropdown_pages( $thankyou_args ),
538
+ array(
539
+ 'select' => array(
540
+ 'id' => array(),
541
+ 'name' => array(),
542
+ 'class' => array()
543
+ ),
544
+ 'option' => array(
545
+ 'value' => array(),
546
+ 'selected' => array()
547
+ )
548
+ )
549
  );
 
550
 
551
  ?>
552
  </div>
553
  <div class="form-group">
554
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cancelled' => 'custom' ) ) ); ?>"><?php esc_html_e( 'Redirect to URL', 'mycred' ); ?></label>
555
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'cancelled' => 'custom' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'cancelled' => 'custom' ) ) ); ?>" placeholder="https://" class="form-control" value="<?php echo esc_attr( $settings['cancelled']['custom'] ); ?>" />
556
  </div>
557
  <?php if ( $uses_buddypress ) : ?>
558
  <p style="margin-top: 0;"><span class="description"><?php esc_html_e( 'You can use %profile% for the base URL of the users profile.', 'mycred' ); ?></span></p>
566
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
567
 
568
  <div class="form-group">
569
+ <label for="<?php echo esc_attr( $this->field_id( 'login' ) ); ?>"><?php esc_html_e( 'Login Message', 'mycred' ); ?></label>
570
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'login' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'login' ) ); ?>" class="form-control" value="<?php echo esc_attr( $settings['login'] ); ?>" />
571
  <p><span class="description"><?php esc_html_e( 'Message to show in shortcodes when viewed by someone who is not logged in.', 'mycred' ); ?></span></p>
572
  </div>
573
 
575
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
576
 
577
  <div class="form-group">
578
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
579
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $settings['log'] ); ?>" />
580
+ <p><span class="description"><?php echo wp_kses_post( $this->core->available_template_tags( array( 'general' ), '%gateway%' ) ); ?></span></p>
581
  </div>
582
 
583
  </div>
589
 
590
  <div class="form-group">
591
  <div class="checkbox">
592
+ <label for="<?php echo esc_attr( $this->field_id( array( 'gifting' => 'members' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'gifting' => 'members' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'gifting' => 'members' ) ) ); ?>"<?php checked( $settings['gifting']['members'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Allow users to buy %_plural% for other users.', 'mycred' ) ) ); ?></label>
593
  </div>
594
  <div class="checkbox">
595
+ <label for="<?php echo esc_attr( $this->field_id( array( 'gifting' => 'authors' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'gifting' => 'authors' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'gifting' => 'authors' ) ) ); ?>"<?php checked( $settings['gifting']['authors'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Allow users to buy %_plural% for content authors.', 'mycred' ) ) ); ?></label>
596
  </div>
597
  </div>
598
 
600
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
601
 
602
  <div class="form-group">
603
+ <label for="<?php echo esc_attr( $this->field_id( array( 'gifting' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
604
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'gifting' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $settings['gifting']['log'] ); ?>" />
605
+ <p><span class="description"><?php echo wp_kses_post( $this->core->available_template_tags( array( 'general', 'user' ) ) ); ?></span></p>
606
  </div>
607
 
608
  </div>
773
 
774
  // Updated settings
775
  if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] == true )
776
+ echo wp_kses_post( '<div class="updated settings-error"><p>' . __( 'Settings Updated', 'mycred' ) . '</p></div>' );
777
 
778
  ?>
779
  <form method="post" action="options.php" class="form">
802
  $column_class = 'col-lg-4 col-md-4 col-sm-12 col-xs-12';
803
 
804
  ?>
805
+ <h4><span class="dashicons <?php echo esc_attr( $data['icon'] ); ?><?php if ( $this->is_active( $key ) ) { if ( $sandbox_mode ) echo ' debug'; else echo ' active'; } else echo ' static'; ?>"></span><?php echo esc_html( $this->core->template_tags_general( $data['title'] ) ); ?></h4>
806
  <div class="body" style="display: none;">
807
 
808
  <div class="row">
809
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
810
  <div class="form-group">
811
  <div>&nbsp;</div>
812
+ <label for="buycred-gateway-<?php echo esc_attr( $key ); ?>"><input type="checkbox" name="mycred_pref_buycreds[active][]" id="buycred-gateway-<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $key ); ?>"<?php if ( $this->is_active( $key ) ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Enable', 'mycred' ); ?></label>
813
  </div>
814
  </div>
815
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
816
  <?php if ( $has_test_mode ) : ?>
817
  <div class="form-group">
818
  <div>&nbsp;</div>
819
+ <label for="buycred-gateway-<?php echo esc_attr( $key ); ?>-sandbox"><input type="checkbox" name="mycred_pref_buycreds[gateway_prefs][<?php echo esc_attr( $key ); ?>][sandbox]" id="buycred-gateway-<?php echo esc_attr( $key ); ?>-sandbox" value="<?php echo esc_attr( $key ); ?>"<?php if ( $sandbox_mode ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Sandbox Mode', 'mycred' ); ?></label>
820
  </div>
821
  <?php endif; ?>
822
  </div>
824
  <?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && $has_documentation ) : ?>
825
  <div class="form-group">
826
  <div>&nbsp;</div>
827
+ <a href="<?php echo esc_url( $has_documentation ); ?>" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a>
828
  </div>
829
  <?php endif; ?>
830
  </div>
833
 
834
  <?php $this->call( 'preferences', $data['callback'] ); ?>
835
 
836
+ <input type="hidden" name="mycred_pref_buycreds[installed]" value="<?php echo esc_attr( $key ); ?>" />
837
  </div>
838
  <?php
839
 
893
  <div class='body' style='display:none; padding: 0px; border: none;'>
894
  </div>";
895
 
896
+ echo wp_kses_post( $content );
897
  }
898
  }
899
  ?>
958
 
959
  if ( empty( $this->purchase_log ) ) return;
960
 
961
+ $meta_key = 'mycred_payments_' . str_replace( MYCRED_SLUG . '-purchases-', '', ( isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '' ) );
962
 
963
  if ( isset( $_REQUEST['wp_screen_options']['option'] ) && isset( $_REQUEST['wp_screen_options']['value'] ) ) {
964
 
987
  */
988
  public function purchase_log_page() {
989
 
990
+ $point_type = str_replace( 'mycred-purchases-', '', ( isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '' ) );
991
  $installed = $this->get();
992
 
993
  $mycred = $this->core;
1033
  <?php $log->filter_dates( esc_url( $filter_url ) ); ?>
1034
 
1035
  <form method="get" action="" name="mycred-buycred-form" novalidate>
1036
+ <input type="hidden" name="page" value="<?php echo esc_attr( sanitize_key( wp_unslash( $_GET['page'] ) ) ); ?>" />
1037
  <?php
1038
 
1039
  if ( array_key_exists( 's', $search_args ) )
1040
  echo '<input type="hidden" name="s" value="' . esc_attr( $search_args['s'] ) . '" />';
1041
 
1042
  if ( isset( $_GET['ref'] ) )
1043
+ echo '<input type="hidden" name="show" value="' . esc_attr( sanitize_key( wp_unslash( $_GET['ref'] ) ) ) . '" />';
1044
 
1045
  if ( isset( $_GET['show'] ) )
1046
+ echo '<input type="hidden" name="show" value="' . esc_attr( sanitize_key( wp_unslash( $_GET['show'] ) ) ) . '" />';
1047
 
1048
  if ( array_key_exists( 'order', $search_args ) )
1049
  echo '<input type="hidden" name="order" value="' . esc_attr( $search_args['order'] ) . '" />';
1068
  <?php
1069
 
1070
  foreach ( $log->headers as $col_id => $col_title )
1071
+ echo '<th scope="col" id="' . esc_attr( str_replace( 'column-', '', $col_id ) ) . '" class="manage-column ' . esc_attr( $col_id ) . '">' . esc_html( $col_title ) . '</th>';
1072
 
1073
  ?>
1074
  </tr>
1078
  <?php
1079
 
1080
  foreach ( $log->headers as $col_id => $col_title )
1081
+ echo '<th scope="col" class="manage-column ' . esc_attr( $col_id ) . '">' . esc_html( $col_title ) . '</th>';
 
1082
  ?>
1083
  </tr>
1084
  </tfoot>
1122
  elseif ( substr( $log_entry->entry, 0, 4 ) == 'TEST' )
1123
  $style = ' style="color:orange;"';
1124
 
1125
+ echo '<tr class="myCRED-log-row' . esc_attr( $class ) . '" id="mycred-log-entry-' . esc_attr( $log_entry->id ) . '">';
1126
 
1127
  // Run though columns
1128
  foreach ( $log->headers as $column_id => $column_name ) {
1129
 
1130
+ echo '<td class="' . esc_attr( $column_id ) . '"' . wp_kses_post( $style ) . '>';
1131
 
1132
  switch ( $column_id ) {
1133
 
1135
  case 'column-gateway' :
1136
 
1137
  $gateway = str_replace( array( '-', '_' ), ' ', $gateway_name );
1138
+ echo esc_html( ucwords( $gateway ) );
1139
 
1140
  break;
1141
 
1144
 
1145
  $user = get_userdata( $log_entry->user_id );
1146
  if ( $user === false )
1147
+ echo esc_html( 'ID: ' . $log_entry->user_id );
1148
  else
1149
+ echo wp_kses_post( $user->display_name . ' <em><small>(ID: ' . $log_entry->user_id . ')</small></em>' );
1150
 
1151
  break;
1152
 
1153
  // Date & Time Column
1154
  case 'column-date' :
1155
 
1156
+ echo esc_html( date( $date_format, $log_entry->time ) );
1157
 
1158
  break;
1159
 
1160
  // Amount Column
1161
  case 'column-amount' :
1162
 
1163
+ echo esc_html( $mycred->format_creds( $log_entry->creds ) );
1164
 
1165
  break;
1166
 
1188
  $rendered_cost = apply_filters( 'mycred_buycred_display_cost', $cost . ' ' . $currency, $sales_data, $log_entry, $gateway_name );
1189
  $rendered_cost = apply_filters( 'mycred_buycred_display_cost_' . $gateway_name, $rendered_cost, $sales_data, $log_entry );
1190
 
1191
+ echo esc_html( $rendered_cost );
1192
 
1193
  }
1194
 
1206
  elseif ( isset( $saved_data['transaction_id'] ) )
1207
  $transaction_id = $saved_data['transaction_id'];
1208
 
1209
+ echo esc_html( $transaction_id );
1210
 
1211
  break;
1212
 
1232
  // No log entry
1233
  else {
1234
 
1235
+ echo '<tr><td colspan="' . esc_attr( count( $log->headers ) ) . '" class="no-entries">' . esc_html__( 'No purchases found', 'mycred' ) . '</td></tr>';
1236
 
1237
  }
1238
 
1375
 
1376
  ?>
1377
  <div class="mycred-wrapper buycred-wrapper disabled-option color-option">
1378
+ <div><?php printf( esc_html_x( 'Buying %s', 'Points Name', 'mycred' ), esc_html( $data['name'] ) ); ?></div>
1379
  <div class="balance-row">
1380
  <div class="balance-view"><?php esc_html_e( 'Disabled', 'mycred' ); ?></div>
1381
  <div class="balance-desc"><em><?php esc_html_e( 'This point type is not for sale.', 'mycred' ); ?></em></div>
1390
 
1391
  ?>
1392
  <div class="mycred-wrapper buycred-wrapper excluded-option color-option">
1393
+ <div><?php printf( esc_html_x( 'Buying %s', 'Buying Points', 'mycred' ), esc_html( $data['name'] ) ); ?></div>
1394
  <div class="balance-row">
1395
  <div class="balance-view"><?php esc_html_e( 'Excluded', 'mycred' ); ?></div>
1396
+ <div class="balance-desc"><em><?php printf( esc_html_x( 'User can not buy %s', 'Points Name', 'mycred' ), esc_html( $data['name'] ) ); ?></em></div>
1397
  </div>
1398
  </div>
1399
  <?php
1405
 
1406
  ?>
1407
  <div class="mycred-wrapper buycred-wrapper color-option selected">
1408
+ <div><?php printf( esc_html_x( 'Buying %s', 'Buying Points', 'mycred' ), esc_html( $data['name'] ) ); ?></div>
1409
  <div class="balance-row">
1410
+ <div class="balance-view"><?php echo esc_html( $data['before'] ); ?><input type="text" name="mycred_adjust_users_buyrates[<?php echo esc_attr( $type_id ); ?>][<?php echo esc_attr( $gateway_id ); ?>]" placeholder="<?php echo esc_attr( $data['default'] ); ?>" value="<?php if ( $data['override'] ) echo esc_attr( $data['custom'] ); ?>" class="short" size="8" /><?php echo esc_html( ' ' . $setup['currency'] ); ?></div>
1411
  <div class="balance-desc"><em><?php esc_html_e( 'Leave empty to use the default rate.', 'mycred' ); ?></em></div>
1412
  </div>
1413
  </div>
addons/buy-creds/modules/buycred-module-pending.php CHANGED
@@ -65,10 +65,10 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
65
  global $buycred_instance;
66
 
67
  // Intercept payment cancellations
68
- if ( isset( $_REQUEST['buycred-cancel'] ) && isset( $_REQUEST['_token'] ) && wp_verify_nonce( $_REQUEST['_token'], 'buycred-cancel-pending-payment' ) ) {
69
 
70
  // Get pending payment object
71
- $pending_payment_id = sanitize_text_field( $_REQUEST['buycred-cancel'] );
72
 
73
  // Move item to trash
74
  buycred_trash_pending_payment( $pending_payment_id );
@@ -118,7 +118,7 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
118
  add_action( 'save_post_' . MYCRED_BUY_KEY, array( $this, 'save_pending_payment' ), 10, 2 );
119
 
120
  // Intercept payment completions
121
- if ( isset( $_GET['credit'] ) && isset( $_GET['token'] ) && wp_verify_nonce( $_GET['token'], 'buycred-payout-pending' ) ) {
122
 
123
  $pending_id = absint( $_GET['credit'] );
124
 
@@ -229,10 +229,10 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
229
  if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_BUY_KEY && isset( $_GET['credited'] ) ) {
230
 
231
  if ( $_GET['credited'] == 1 )
232
- echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Pending payment successfully credited to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
233
 
234
  elseif ( $_GET['credited'] == 0 )
235
- echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Failed to credit the pending payment to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
236
 
237
  }
238
 
@@ -263,7 +263,7 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
263
 
264
  global $pagenow;
265
 
266
- if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_BUY_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
267
  return MYCRED_MAIN_SLUG;
268
 
269
  return $parent;
@@ -285,7 +285,7 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
285
 
286
  }
287
 
288
- elseif ( $pagenow == 'post.php' && isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_BUY_KEY ) {
289
 
290
  return 'edit.php?post_type=' . MYCRED_BUY_KEY;
291
 
@@ -332,9 +332,9 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
332
  $user = get_userdata( $from );
333
 
334
  if ( isset( $user->display_name ) )
335
- echo '<a href="' . add_query_arg( array( 'user_id' => $user->ID ), admin_url( 'user-edit.php' ) ) . '">' . $user->display_name . '</a>';
336
  else
337
- echo 'ID: ' . $from;
338
 
339
  break;
340
  case 'amount';
@@ -343,7 +343,7 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
343
  $amount = mycred_get_post_meta( $post_id, 'amount', true );
344
  $mycred = mycred( $type );
345
 
346
- echo $mycred->format_creds( $amount );
347
 
348
  break;
349
  case 'cost';
@@ -351,7 +351,7 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
351
  $cost = mycred_get_post_meta( $post_id, 'cost', true );
352
  $currency = mycred_get_post_meta( $post_id, 'currency', true );
353
 
354
- echo $cost . ' ' . $currency;
355
 
356
  break;
357
  case 'gateway';
@@ -360,9 +360,9 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
360
  $installed = $mycred_modules['solo']['buycred']->get();
361
 
362
  if ( isset( $installed[ $gateway ] ) )
363
- echo $installed[ $gateway ]['title'];
364
  else
365
- echo $gateway;
366
 
367
  break;
368
  case 'ctype';
@@ -370,9 +370,9 @@ if ( ! class_exists( 'buyCRED_Pending_Payments' ) ) :
370
  $type = mycred_get_post_meta( $post_id, 'point_type', true );
371
 
372
  if ( isset( $this->point_types[ $type ] ) )
373
- echo $this->point_types[ $type ];
374
  else
375
- echo $type;
376
 
377
  break;
378
  }
@@ -538,8 +538,8 @@ jQuery(function($){
538
 
539
  <div id="minor-publishing-actions">
540
 
541
- <div><a href="<?php echo $payout_url; ?>" class="button button-secondary button-block"><?php esc_html_e( 'Pay Out', 'mycred' ); ?></a></div>
542
- <div><a href="<?php echo $delete_url; ?>" class="button button-secondary button-block"><?php esc_html_e( 'Trash', 'mycred' ); ?></a></div>
543
 
544
  </div>
545
 
@@ -624,8 +624,8 @@ jQuery(function($){
624
  if ( count( $this->core->buy_creds['types'] ) == 1 ) {
625
 
626
  ?>
627
- <p class="form-control-static"><?php echo strip_tags( $mycred->plural() ); ?></p>
628
- <input type="hidden" name="buycred_pending_payment[point_type]" value="<?php echo $pending_payment->point_type; ?>" />
629
  <?php
630
 
631
  }
@@ -639,9 +639,9 @@ jQuery(function($){
639
 
640
  foreach ( $this->core->buy_creds['types'] as $point_type ) {
641
 
642
- echo '<option value="' . $point_type . '"';
643
  if ( $pending_payment->point_type == $point_type ) echo ' selected="selected"';
644
- echo '>' . mycred_get_point_type_name( $point_type, false ) . '</option>';
645
 
646
  }
647
 
@@ -662,10 +662,10 @@ jQuery(function($){
662
 
663
  foreach ( $mycred_modules['solo']['buycred']->get() as $gateway_id => $info ) {
664
 
665
- echo '<option value="' . $gateway_id . '"';
666
  if ( $pending_payment->gateway_id == $gateway_id ) echo ' selected="selected"';
667
  if ( ! $mycred_modules['solo']['buycred']->is_active( $gateway_id ) ) echo ' disabled="disabled"';
668
- echo '>' . $info['title'] . '</option>';
669
 
670
  }
671
 
@@ -676,7 +676,7 @@ jQuery(function($){
676
  <div class="col-md-2 col-sm-6">
677
  <div class="form-group">
678
  <label for="buycred-pending-payment-amount"><?php esc_html_e( 'Amount', 'mycred' ); ?></label>
679
- <input type="text" name="buycred_pending_payment[amount]" id="buycred-pending-payment-amount" class="form-control" value="<?php echo $mycred->number( $pending_payment->amount ); ?>" />
680
  </div>
681
  </div>
682
  <div class="col-md-2 col-sm-6">
@@ -727,7 +727,7 @@ jQuery(function($){
727
 
728
  foreach ( $comments as $comment ) {
729
 
730
- echo '<li><time>' . $comment->comment_date . '</time><p>' . $comment->comment_content . '</p></li>';
731
 
732
  }
733
 
65
  global $buycred_instance;
66
 
67
  // Intercept payment cancellations
68
+ if ( isset( $_REQUEST['buycred-cancel'] ) && isset( $_REQUEST['_token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_token'] ) ), 'buycred-cancel-pending-payment' ) ) {
69
 
70
  // Get pending payment object
71
+ $pending_payment_id = sanitize_text_field( wp_unslash( $_REQUEST['buycred-cancel'] ) );
72
 
73
  // Move item to trash
74
  buycred_trash_pending_payment( $pending_payment_id );
118
  add_action( 'save_post_' . MYCRED_BUY_KEY, array( $this, 'save_pending_payment' ), 10, 2 );
119
 
120
  // Intercept payment completions
121
+ if ( isset( $_GET['credit'] ) && isset( $_GET['token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['token'] ) ), 'buycred-payout-pending' ) ) {
122
 
123
  $pending_id = absint( $_GET['credit'] );
124
 
229
  if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_BUY_KEY && isset( $_GET['credited'] ) ) {
230
 
231
  if ( $_GET['credited'] == 1 )
232
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . esc_html__( 'Pending payment successfully credited to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
233
 
234
  elseif ( $_GET['credited'] == 0 )
235
+ echo '<div id="message" class="error notice is-dismissible"><p>' . esc_html__( 'Failed to credit the pending payment to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
236
 
237
  }
238
 
263
 
264
  global $pagenow;
265
 
266
+ if ( isset( $_GET['post'] ) && mycred_get_post_type( absint( $_GET['post'] ) ) == MYCRED_BUY_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
267
  return MYCRED_MAIN_SLUG;
268
 
269
  return $parent;
285
 
286
  }
287
 
288
+ elseif ( $pagenow == 'post.php' && isset( $_GET['post'] ) && mycred_get_post_type( absint( $_GET['post'] ) ) == MYCRED_BUY_KEY ) {
289
 
290
  return 'edit.php?post_type=' . MYCRED_BUY_KEY;
291
 
332
  $user = get_userdata( $from );
333
 
334
  if ( isset( $user->display_name ) )
335
+ echo '<a href="' . esc_url( add_query_arg( array( 'user_id' => $user->ID ), admin_url( 'user-edit.php' ) ) ) . '">' . esc_html( $user->display_name ) . '</a>';
336
  else
337
+ echo 'ID: ' . esc_html( $from );
338
 
339
  break;
340
  case 'amount';
343
  $amount = mycred_get_post_meta( $post_id, 'amount', true );
344
  $mycred = mycred( $type );
345
 
346
+ echo esc_html( $mycred->format_creds( $amount ) );
347
 
348
  break;
349
  case 'cost';
351
  $cost = mycred_get_post_meta( $post_id, 'cost', true );
352
  $currency = mycred_get_post_meta( $post_id, 'currency', true );
353
 
354
+ echo esc_html( $cost . ' ' . $currency );
355
 
356
  break;
357
  case 'gateway';
360
  $installed = $mycred_modules['solo']['buycred']->get();
361
 
362
  if ( isset( $installed[ $gateway ] ) )
363
+ echo esc_html( $installed[ $gateway ]['title'] );
364
  else
365
+ echo esc_html( $gateway );
366
 
367
  break;
368
  case 'ctype';
370
  $type = mycred_get_post_meta( $post_id, 'point_type', true );
371
 
372
  if ( isset( $this->point_types[ $type ] ) )
373
+ echo esc_html( $this->point_types[ $type ] );
374
  else
375
+ echo esc_html( $type );
376
 
377
  break;
378
  }
538
 
539
  <div id="minor-publishing-actions">
540
 
541
+ <div><a href="<?php echo esc_url( $payout_url ); ?>" class="button button-secondary button-block"><?php esc_html_e( 'Pay Out', 'mycred' ); ?></a></div>
542
+ <div><a href="<?php echo esc_url( $delete_url ); ?>" class="button button-secondary button-block"><?php esc_html_e( 'Trash', 'mycred' ); ?></a></div>
543
 
544
  </div>
545
 
624
  if ( count( $this->core->buy_creds['types'] ) == 1 ) {
625
 
626
  ?>
627
+ <p class="form-control-static"><?php echo esc_html( $mycred->plural() ); ?></p>
628
+ <input type="hidden" name="buycred_pending_payment[point_type]" value="<?php echo esc_attr( $pending_payment->point_type ); ?>" />
629
  <?php
630
 
631
  }
639
 
640
  foreach ( $this->core->buy_creds['types'] as $point_type ) {
641
 
642
+ echo '<option value="' . esc_attr( $point_type ) . '"';
643
  if ( $pending_payment->point_type == $point_type ) echo ' selected="selected"';
644
+ echo '>' . esc_html( mycred_get_point_type_name( $point_type, false ) ) . '</option>';
645
 
646
  }
647
 
662
 
663
  foreach ( $mycred_modules['solo']['buycred']->get() as $gateway_id => $info ) {
664
 
665
+ echo '<option value="' . esc_attr( $gateway_id ) . '"';
666
  if ( $pending_payment->gateway_id == $gateway_id ) echo ' selected="selected"';
667
  if ( ! $mycred_modules['solo']['buycred']->is_active( $gateway_id ) ) echo ' disabled="disabled"';
668
+ echo '>' . esc_html( $info['title'] ) . '</option>';
669
 
670
  }
671
 
676
  <div class="col-md-2 col-sm-6">
677
  <div class="form-group">
678
  <label for="buycred-pending-payment-amount"><?php esc_html_e( 'Amount', 'mycred' ); ?></label>
679
+ <input type="text" name="buycred_pending_payment[amount]" id="buycred-pending-payment-amount" class="form-control" value="<?php echo esc_attr( $mycred->number( $pending_payment->amount ) ); ?>" />
680
  </div>
681
  </div>
682
  <div class="col-md-2 col-sm-6">
727
 
728
  foreach ( $comments as $comment ) {
729
 
730
+ echo '<li><time>' . esc_html( $comment->comment_date ) . '</time><p>' . esc_html( $comment->comment_content ) . '</p></li>';
731
 
732
  }
733
 
addons/cash-creds/abstracts/cashcred-abstract-payment-gateway.php CHANGED
@@ -156,8 +156,30 @@ if ( ! class_exists( 'myCRED_Cash_Payment_Gateway' ) ) :
156
  </table>';
157
 
158
  }
159
-
160
- echo apply_filters( 'mycred_cashcred_exchange_rate_field', $content, $default, $this );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  }
163
 
@@ -237,7 +259,7 @@ if ( ! class_exists( 'myCRED_Cash_Payment_Gateway' ) ) :
237
  $errors[] = $error_message;
238
 
239
  ?>
240
- <div class="gateway-error"><?php echo implode( '<br />', $errors ); ?></div>
241
  <?php
242
 
243
  }
@@ -283,12 +305,12 @@ if ( ! class_exists( 'myCRED_Cash_Payment_Gateway' ) ) :
283
  if ( $js != '' )
284
  $js = ' data-update="' . $js . '"';
285
 
286
- echo '<select name="' . $this->field_name( $name ) . '" id="' . $this->field_id( $name ) . '" class="currency form-control"' . $js . '>';
287
- echo '<option value="">' . __( 'Select', 'mycred' ) . '</option>';
288
  foreach ( $currencies as $code => $cname ) {
289
- echo '<option value="' . $code . '"';
290
  if ( isset( $this->prefs[ $name ] ) && $this->prefs[ $name ] == $code ) echo ' selected="selected"';
291
- echo '>' . $cname . '</option>';
292
  }
293
  echo '</select>';
294
 
@@ -308,12 +330,12 @@ if ( ! class_exists( 'myCRED_Cash_Payment_Gateway' ) ) :
308
  );
309
  $types = apply_filters( 'mycred_dropdown_item_types', $types );
310
 
311
- echo '<select name="' . $this->field_name( $name ) . '" id="' . $this->field_id( $name ) . '">';
312
- echo '<option value="">' . __( 'Select', 'mycred' ) . '</option>';
313
  foreach ( $types as $code => $cname ) {
314
- echo '<option value="' . $code . '"';
315
  if ( isset( $this->prefs[ $name ] ) && $this->prefs[ $name ] == $code ) echo ' selected="selected"';
316
- echo '>' . $cname . '</option>';
317
  }
318
  echo '</select>';
319
 
156
  </table>';
157
 
158
  }
159
+ $allowed_html =
160
+ array(
161
+ 'input' => array(
162
+ 'type' => array(),
163
+ 'value' => array(),
164
+ 'name' => array(),
165
+ 'id' => array(),
166
+ 'size' => array()
167
+ ),
168
+ 'table' => array(),
169
+ 'tr' => array(),
170
+ 'td' => array(
171
+ 'style' => array()
172
+ ),
173
+ 'div' => array(
174
+ 'class' => array()
175
+ ),
176
+ 'span' => array(
177
+ 'class' => array()
178
+ ),
179
+
180
+ );
181
+
182
+ echo wp_kses( apply_filters( 'mycred_cashcred_exchange_rate_field', $content, $default, $this ), $allowed_html );
183
 
184
  }
185
 
259
  $errors[] = $error_message;
260
 
261
  ?>
262
+ <div class="gateway-error"><?php echo implode( '<br />', esc_html( $errors ) ); ?></div>
263
  <?php
264
 
265
  }
305
  if ( $js != '' )
306
  $js = ' data-update="' . $js . '"';
307
 
308
+ echo '<select name="' . esc_attr( $this->field_name( $name ) ) . '" id="' . esc_attr( $this->field_id( $name ) ) . '" class="currency form-control"' . wp_kses_post( $js ) . '>';
309
+ echo '<option value="">' . esc_html__( 'Select', 'mycred' ) . '</option>';
310
  foreach ( $currencies as $code => $cname ) {
311
+ echo '<option value="' . esc_attr( $code ) . '"';
312
  if ( isset( $this->prefs[ $name ] ) && $this->prefs[ $name ] == $code ) echo ' selected="selected"';
313
+ echo '>' . esc_html( $cname ) . '</option>';
314
  }
315
  echo '</select>';
316
 
330
  );
331
  $types = apply_filters( 'mycred_dropdown_item_types', $types );
332
 
333
+ echo '<select name="' . esc_attr( $this->field_name( $name ) ) . '" id="' . esc_attr( $this->field_id( $name ) ) . '">';
334
+ echo '<option value="">' . esc_html__( 'Select', 'mycred' ) . '</option>';
335
  foreach ( $types as $code => $cname ) {
336
+ echo '<option value="' . esc_attr( $code ) . '"';
337
  if ( isset( $this->prefs[ $name ] ) && $this->prefs[ $name ] == $code ) echo ' selected="selected"';
338
+ echo '>' . esc_html( $cname ) . '</option>';
339
  }
340
  echo '</select>';
341
 
addons/cash-creds/gateways/bank-transfer.php CHANGED
@@ -108,17 +108,17 @@ if ( ! class_exists( 'myCRED_cashcred_Bank_Transfer' ) ) :
108
  <h3><?php esc_html_e( 'Details', 'mycred' ); ?></h3>
109
 
110
  <div class="form-group">
111
- <label for="<?php echo $this->field_id( 'minimum_amount' ); ?>"><?php esc_html_e( 'Minimum Points Withdrawal', 'mycred' ); ?></label>
112
- <input type="number" name="<?php echo $this->field_name( 'minimum_amount' ); ?>" id="<?php echo $this->field_id( 'minimum_amount' ); ?>" min="1" value="<?php echo esc_attr( $prefs['minimum_amount'] ); ?>" class="form-control" />
113
  </div>
114
 
115
  <div class="form-group">
116
- <label for="<?php echo $this->field_id( 'maximum_amount' ); ?>"><?php esc_html_e( 'Maximum Points Withdrawal', 'mycred' ); ?></label>
117
- <input type="number" name="<?php echo $this->field_name( 'maximum_amount' ); ?>" id="<?php echo $this->field_id( 'maximum_amount' ); ?>" value="<?php echo esc_attr( $prefs['maximum_amount'] ); ?>" class="form-control" />
118
  </div>
119
 
120
  <div class="form-group">
121
- <label for="<?php echo $this->field_id( 'enable_additional_notes' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_additional_notes' ); ?>" id="<?php echo $this->field_id( 'enable_additional_notes' ); ?>" value="1"<?php checked( $prefs['enable_additional_notes'], 1 ); ?> /> <?php esc_html_e( 'Enable Additional Notes', 'mycred' ); ?></label>
122
  </div>
123
 
124
  </div>
@@ -126,8 +126,8 @@ if ( ! class_exists( 'myCRED_cashcred_Bank_Transfer' ) ) :
126
  <h3><?php esc_html_e( 'Setup', 'mycred' ); ?></h3>
127
 
128
  <div class="form-group">
129
- <label for="<?php echo $this->field_id( 'currency' ); ?>"><?php esc_html_e( 'Currency', 'mycred' ); ?></label>
130
- <input type="text" name="<?php echo $this->field_name( 'currency' ); ?>" id="<?php echo $this->field_id( 'currency' ); ?>" value="<?php echo esc_attr( $prefs['currency'] ); ?>" class="form-control" />
131
  </div>
132
 
133
  <div class="form-group">
@@ -193,13 +193,13 @@ if ( ! class_exists( 'myCRED_cashcred_Bank_Transfer' ) ) :
193
  $bank_form = new CashCred_Gateway_Fields( $data, $fields );
194
 
195
  ?>
196
- <div id="panel_<?php echo $data;?>" class="cashcred_panel">
197
 
198
- <h3><?php echo apply_filters( 'mycred_cashcred_bank_transfer_title', __( 'Bank account details', 'mycred' ) ); ?></h3>
199
 
200
  <?php if( isset( $mycred_pref_cashcreds["gateway_prefs"]["bank"]["enable_additional_notes"] ) ): ?>
201
  <div class="form-group">
202
- <p><?php echo $mycred_pref_cashcreds["gateway_prefs"]["bank"]["additional_notes"]; ?></p>
203
  </div>
204
  <?php endif;?>
205
 
108
  <h3><?php esc_html_e( 'Details', 'mycred' ); ?></h3>
109
 
110
  <div class="form-group">
111
+ <label for="<?php echo esc_attr( $this->field_id( 'minimum_amount' ) ); ?>"><?php esc_html_e( 'Minimum Points Withdrawal', 'mycred' ); ?></label>
112
+ <input type="number" name="<?php echo esc_attr( $this->field_name( 'minimum_amount' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'minimum_amount' ) ); ?>" min="1" value="<?php echo esc_attr( $prefs['minimum_amount'] ); ?>" class="form-control" />
113
  </div>
114
 
115
  <div class="form-group">
116
+ <label for="<?php echo esc_attr( $this->field_id( 'maximum_amount' ) ); ?>"><?php esc_html_e( 'Maximum Points Withdrawal', 'mycred' ); ?></label>
117
+ <input type="number" name="<?php echo esc_attr( $this->field_name( 'maximum_amount' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'maximum_amount' ) ); ?>" value="<?php echo esc_attr( $prefs['maximum_amount'] ); ?>" class="form-control" />
118
  </div>
119
 
120
  <div class="form-group">
121
+ <label for="<?php echo esc_attr( $this->field_id( 'enable_additional_notes' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'enable_additional_notes' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'enable_additional_notes' ) ); ?>" value="1"<?php checked( $prefs['enable_additional_notes'], 1 ); ?> /> <?php esc_html_e( 'Enable Additional Notes', 'mycred' ); ?></label>
122
  </div>
123
 
124
  </div>
126
  <h3><?php esc_html_e( 'Setup', 'mycred' ); ?></h3>
127
 
128
  <div class="form-group">
129
+ <label for="<?php echo esc_attr( $this->field_id( 'currency' ) ); ?>"><?php esc_html_e( 'Currency', 'mycred' ); ?></label>
130
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'currency' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'currency' ) ); ?>" value="<?php echo esc_attr( $prefs['currency'] ); ?>" class="form-control" />
131
  </div>
132
 
133
  <div class="form-group">
193
  $bank_form = new CashCred_Gateway_Fields( $data, $fields );
194
 
195
  ?>
196
+ <div id="panel_<?php echo esc_attr( $data );?>" class="cashcred_panel">
197
 
198
+ <h3><?php echo esc_html( apply_filters( 'mycred_cashcred_bank_transfer_title', __( 'Bank account details', 'mycred' ) ) ); ?></h3>
199
 
200
  <?php if( isset( $mycred_pref_cashcreds["gateway_prefs"]["bank"]["enable_additional_notes"] ) ): ?>
201
  <div class="form-group">
202
+ <p><?php echo esc_html( $mycred_pref_cashcreds["gateway_prefs"]["bank"]["additional_notes"] ); ?></p>
203
  </div>
204
  <?php endif;?>
205
 
addons/cash-creds/includes/cashcred-functions.php CHANGED
@@ -38,7 +38,7 @@ if ( ! function_exists( 'cashcred_get_requested_gateway_id' ) ) :
38
  $gateway_id = false;
39
 
40
  if ( isset( $_REQUEST['cashcred_pay_method'] ) && is_user_logged_in() )
41
- $gateway_id = trim( $_REQUEST['cashcred_pay_method'] );
42
 
43
  return apply_filters( 'mycred_gateway_id', $gateway_id );
44
 
@@ -81,7 +81,7 @@ if ( ! function_exists( 'cashcred_display_message' ) ) :
81
 
82
  if( ! empty( $cashcred_notice ) ) {?>
83
  <p class="cashcred-notice">
84
- <?php echo $cashcred_notice; ?>
85
  </p>
86
  <?php
87
 
@@ -345,7 +345,7 @@ if ( ! function_exists( 'cashcred_add_comment' ) ) :
345
  'comment_author_email' => $author_email,
346
  'comment_content' => $comment,
347
  'comment_type' => 'cashcred',
348
- 'comment_author_IP' => $_SERVER['REMOTE_ADDR'],
349
  'comment_date' => $time,
350
  'comment_approved' => 1,
351
  'user_id' => 0
@@ -441,8 +441,8 @@ if ( ! class_exists( 'CashCred_Gateway_Fields' ) ) :
441
  foreach ( $this->gateway_fields as $gateway_field_id => $gateway_field_data ): ?>
442
 
443
  <div class="form-group">
444
- <label><?php echo $gateway_field_data['lable']; ?></label>
445
- <input type="text" name="<?php echo $this->field_name( $gateway_field_id );?>" class="<?php echo $gateway_field_data['classes']; ?>" placeholder="<?php echo $gateway_field_data['placeholder']; ?>" value="<?php echo $this->{$gateway_field_id};?>">
446
  </div>
447
 
448
  <?php
38
  $gateway_id = false;
39
 
40
  if ( isset( $_REQUEST['cashcred_pay_method'] ) && is_user_logged_in() )
41
+ $gateway_id = trim( sanitize_text_field( wp_unslash( $_REQUEST['cashcred_pay_method'] ) ) );
42
 
43
  return apply_filters( 'mycred_gateway_id', $gateway_id );
44
 
81
 
82
  if( ! empty( $cashcred_notice ) ) {?>
83
  <p class="cashcred-notice">
84
+ <?php echo esc_html( $cashcred_notice ); ?>
85
  </p>
86
  <?php
87
 
345
  'comment_author_email' => $author_email,
346
  'comment_content' => $comment,
347
  'comment_type' => 'cashcred',
348
+ 'comment_author_IP' => isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '',
349
  'comment_date' => $time,
350
  'comment_approved' => 1,
351
  'user_id' => 0
441
  foreach ( $this->gateway_fields as $gateway_field_id => $gateway_field_data ): ?>
442
 
443
  <div class="form-group">
444
+ <label><?php echo esc_html( $gateway_field_data['lable'] ); ?></label>
445
+ <input type="text" name="<?php echo esc_attr( $this->field_name( $gateway_field_id ) );?>" class="<?php echo esc_attr( $gateway_field_data['classes'] ); ?>" placeholder="<?php echo esc_attr( $gateway_field_data['placeholder'] ); ?>" value="<?php echo esc_attr( $this->{$gateway_field_id} );?>">
446
  </div>
447
 
448
  <?php
addons/cash-creds/includes/cashcred-shortcodes.php CHANGED
@@ -16,10 +16,11 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
16
  'gateways' => '',
17
  'types' => '',
18
  'amount' => '',
19
- 'excluded' => 'You have excluded from this point type.',
20
- 'insufficient' => 'Insufficient Points for Withdrawal.'
21
  ), $atts, MYCRED_SLUG . '_cashcred' ) );
22
 
 
23
  // If we are not logged in
24
  if ( ! is_user_logged_in() ) return $content;
25
 
@@ -54,6 +55,8 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
54
  ob_start();
55
 
56
  $pending_withdrawal = cashcred_get_withdraw_requests('Pending');
 
 
57
  ?>
58
  <div id="cashcred">
59
  <ul class="cashcred-nav-tabs">
@@ -66,32 +69,41 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
66
  <!--------First tab--------->
67
  <div id="tab1c" class="cashcred-tab">
68
  <?php cashcred_display_message(); ?>
 
69
 
70
  <?php if( count( $pending_withdrawal ) > 0 ){ ?>
71
- <h4><?php echo "You have pending withdrawal"; ?></h4>
72
  <table>
73
- <thead>
74
  <tr>
75
- <th><span class="nobr">ID</span></th>
76
- <th><span class="nobr">Points</span></th>
77
  <?php
78
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
79
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
80
- <th><span class="nobr">Fee</span></th><?php
81
  }
82
  }?>
83
- <th><span class="nobr">Amount</span></th>
84
- <th><span class="nobr">Point Type</span></th>
85
- <th><span class="nobr">Gateway</span></th>
86
- <th><span class="nobr">Date</span></th>
 
 
 
 
 
87
  </tr>
88
  </thead>
89
- <tbody>
90
  <?php foreach( $pending_withdrawal as $post ):?>
91
- <tr>
92
- <td><?php echo $post->post_name; ?></td>
93
- <td><?php echo get_post_meta($post->ID,'points',true);?></td>
 
 
94
  <?php
 
95
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
96
 
97
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
@@ -113,25 +125,28 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
113
  if( $type_data['max_cap'] != 0 && $fee > $type_data['max_cap'] )
114
  $fee = $type_data['max_cap'];
115
 
116
- echo $fee; ?>
117
  </td><?php
118
  }
119
  }?>
120
  <td>
121
- <?php echo get_post_meta($post->ID,'currency',true). " " .get_post_meta($post->ID,'points',true) * get_post_meta($post->ID,'cost',true); ?>
 
122
  </td>
123
- <td><?php echo mycred_get_types()[get_post_meta($post->ID,'point_type',true)];?></td>
124
  <td>
125
  <?php
126
  $gateway = get_post_meta($post->ID,'gateway',true);
127
  $installed = $mycred_modules['solo']['cashcred']->get();
128
  if ( isset( $installed[ $gateway ] ) )
129
- echo $installed[ $gateway ]['title'];
130
  else
131
- echo $gateway;
132
  ?>
133
  </td>
134
- <td><?php echo $post->post_date; ?></td>
 
 
135
  </tr>
136
  <?php endforeach;?>
137
  </tbody>
@@ -152,7 +167,7 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
152
  <select id="cashcred_point_type" name="cashcred_point_type" class="form-control">
153
  <?php
154
  foreach( $point_types as $point_type_id => $point_type_obj ) {
155
- echo '<option value="' . $point_type_id . '">' . esc_html( $point_type_obj->plural() ) . '</option>';
156
  }
157
  ?>
158
  </select>
@@ -177,12 +192,12 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
177
  <?php } ?>
178
 
179
  <div class="form-group">
180
- <label><?php echo sprintf( __('Withdraw %s value', 'mycred'), $point_types[ current(array_keys($point_types)) ]->plural() ); ?></label>
181
  <?php
182
  $amount = ! empty( $amount ) ? floatval( $amount ) : 0;
183
  ?>
184
- <input type="number" id="withdraw_points" name="points" class="form-control" placeholder="0" value="<?php echo ! empty($amount) ? $amount : 0; ?>" required />
185
- <p class="cashcred-min"><?php echo __('Minimum Amount: ');?><span></span></p>
186
 
187
  <?php
188
 
@@ -190,7 +205,7 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
190
 
191
  if( $cashcred_setting['fees']['use'] == 1 ) { ?>
192
 
193
- <p class="cashcred-fee" ><?php echo __('Fee : '); ?>
194
 
195
  <span></span>
196
 
@@ -216,13 +231,15 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
216
  <div class="mycred-cashcred-withdraw-form-footer">
217
  <div id="cashcred_total" class="form-group">
218
  <strong>
219
- <span class="amount_label">Amount:&nbsp;</span>
 
 
220
  <span id="cashcred_currency_symbol"></span>
221
  <span id="cashcred_total_amount"></span>
222
  </strong>
223
  </div>
224
  <div id="submit_button" class="form-group">
225
- <input type="submit" class="button" value="<?php echo $button_label; ?>" />
226
  </div>
227
  <div class="mycred-clearfix"></div>
228
  </div>
@@ -240,25 +257,30 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
240
  <table>
241
  <thead>
242
  <tr>
243
- <th><span class="nobr">ID</span></th>
244
- <th><span class="nobr">Points</span></th>
245
  <?php
246
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
247
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
248
  <th><span class="nobr">Fee</span></th><?php
249
  }
250
  }?>
251
- <th><span class="nobr">Amount</span></th>
252
- <th><span class="nobr">Point Type</span></th>
253
- <th><span class="nobr">Gateway</span></th>
254
- <th><span class="nobr">Date</span></th>
 
 
255
  </tr>
256
  </thead>
257
  <tbody>
258
- <?php foreach($posts as $post) {?>
 
 
 
259
  <tr>
260
- <td><?php echo $post->post_name; ?></td>
261
- <td><?php echo get_post_meta($post->ID,'points',true);?></td>
262
  <?php
263
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
264
 
@@ -281,25 +303,25 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
281
  if( $type_data['max_cap'] != 0 && $fee > $type_data['max_cap'] )
282
  $fee = $type_data['max_cap'];
283
 
284
- echo $fee; ?>
285
  </td><?php
286
  }
287
  }?>
288
  <td>
289
- <?php echo get_post_meta($post->ID,'currency',true). " " .get_post_meta($post->ID,'points',true) * get_post_meta($post->ID,'cost',true);?>
290
  </td>
291
- <td><?php echo mycred_get_types()[get_post_meta($post->ID,'point_type',true)]; ?></td>
292
  <td>
293
  <?php
294
  $gateway = get_post_meta($post->ID,'gateway',true);
295
  $installed = $mycred_modules['solo']['cashcred']->get();
296
  if ( isset( $installed[ $gateway ] ) )
297
- echo $installed[ $gateway ]['title'];
298
  else
299
- echo $gateway;
300
  ?>
301
  </td>
302
- <td><?php echo $post->post_date; ?></td>
303
  </tr>
304
  <?php } ?>
305
  </tbody>
@@ -313,29 +335,35 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
313
  <?php
314
  $posts = cashcred_get_withdraw_requests('Cancelled');
315
  ?>
 
316
  <table>
317
  <thead>
318
  <tr>
319
- <th><span class="nobr">ID</span></th>
320
- <th><span class="nobr">Points</span></th>
321
  <?php
322
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
323
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
324
  <th><span class="nobr">Fee</span></th><?php
325
  }
326
  }?>
327
- <th><span class="nobr">Amount</span></th>
328
- <th><span class="nobr">Point Type</span></th>
329
- <th><span class="nobr">Gateway</span></th>
330
- <th><span class="nobr">Date</span></th>
 
331
  </tr>
332
  </thead>
333
  <tbody>
334
- <?php foreach($posts as $post) {?>
 
 
 
 
335
  <tr>
336
- <td><?php echo $post->post_name; ?></td>
337
 
338
- <td><?php echo get_post_meta($post->ID,'points',true);?></td>
339
  <?php
340
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
341
 
@@ -358,25 +386,25 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
358
  if( $type_data['max_cap'] != 0 && $fee > $type_data['max_cap'] )
359
  $fee = $type_data['max_cap'];
360
 
361
- echo $fee; ?>
362
  </td><?php
363
  }
364
  }?>
365
  <td>
366
- <?php echo get_post_meta($post->ID,'currency',true). " " .get_post_meta($post->ID,'points',true) * get_post_meta($post->ID,'cost',true);?>
367
  </td>
368
- <td><?php echo mycred_get_types()[get_post_meta($post->ID,'point_type',true)];?></td>
369
  <td>
370
  <?php
371
  $gateway = get_post_meta($post->ID,'gateway',true);
372
  $installed = $mycred_modules['solo']['cashcred']->get();
373
  if ( isset( $installed[ $gateway ] ) )
374
- echo $installed[ $gateway ]['title'];
375
  else
376
- echo $gateway;
377
  ?>
378
  </td>
379
- <td><?php echo $post->post_date; ?></td>
380
  </tr>
381
  <?php } ?>
382
  </tbody>
@@ -391,7 +419,7 @@ if ( ! function_exists( 'mycred_render_cashcred' ) ) :
391
  <select class="form-control" name="cashcred_save_settings" id="cashcred_save_settings">
392
  <?php
393
  foreach ( $gateways as $key => $active_gateways_value ) {
394
- echo '<option value="' . $key . '"> '. $active_gateways_value['title'] .' </option>';
395
  }
396
  ?>
397
  </select>
16
  'gateways' => '',
17
  'types' => '',
18
  'amount' => '',
19
+ 'excluded' => __( 'You have excluded from this point type', 'mycred' ),
20
+ 'insufficient' => __( 'Insufficient Points for Withdrawal', 'mycred' )
21
  ), $atts, MYCRED_SLUG . '_cashcred' ) );
22
 
23
+
24
  // If we are not logged in
25
  if ( ! is_user_logged_in() ) return $content;
26
 
55
  ob_start();
56
 
57
  $pending_withdrawal = cashcred_get_withdraw_requests('Pending');
58
+
59
+
60
  ?>
61
  <div id="cashcred">
62
  <ul class="cashcred-nav-tabs">
69
  <!--------First tab--------->
70
  <div id="tab1c" class="cashcred-tab">
71
  <?php cashcred_display_message(); ?>
72
+
73
 
74
  <?php if( count( $pending_withdrawal ) > 0 ){ ?>
75
+ <h4><?php esc_html_e( 'You have pending withdrawal', 'mycred' ); ?></h4>
76
  <table>
77
+ <thead class="cashcred-table-heading">
78
  <tr>
79
+ <th>ID</th>
80
+ <th>Points</th>
81
  <?php
82
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
83
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
84
+ <th><span class="nobr"><?php esc_html_e( 'Fee', 'mycred' ) ?></span></th><?php
85
  }
86
  }?>
87
+
88
+
89
+
90
+ <th><?php esc_html_e( 'Amount', 'mycred' ) ?></th>
91
+ <th><?php esc_html_e( 'Point Type', 'mycred' ) ?></th>
92
+ <th><?php esc_html_e( apply_filters( 'mycred_change_gateway_text', 'Gateway' ), 'mycred' ); ?></th>
93
+
94
+
95
+ <th class="date-heading">Date</th>
96
  </tr>
97
  </thead>
98
+ <tbody class="cashcred-table-content">
99
  <?php foreach( $pending_withdrawal as $post ):?>
100
+
101
+ <?php $post->post_date = date('F d, Y, h:i A'); ?>
102
+ <tr class="cashcred-table-content">
103
+ <td><?php echo esc_html( $post->post_name ); ?></td>
104
+ <td><?php echo esc_html( get_post_meta($post->ID,'points',true) );?></td>
105
  <?php
106
+
107
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
108
 
109
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
125
  if( $type_data['max_cap'] != 0 && $fee > $type_data['max_cap'] )
126
  $fee = $type_data['max_cap'];
127
 
128
+ echo esc_html( $fee ); ?>
129
  </td><?php
130
  }
131
  }?>
132
  <td>
133
+
134
+ <?php echo esc_html( get_post_meta($post->ID,'currency',true). " " .get_post_meta($post->ID,'points',true) * get_post_meta($post->ID,'cost',true) ); ?>
135
  </td>
136
+ <td><?php echo esc_html( mycred_get_types()[get_post_meta($post->ID,'point_type',true)] );?></td>
137
  <td>
138
  <?php
139
  $gateway = get_post_meta($post->ID,'gateway',true);
140
  $installed = $mycred_modules['solo']['cashcred']->get();
141
  if ( isset( $installed[ $gateway ] ) )
142
+ echo esc_html( $installed[ $gateway ]['title'] );
143
  else
144
+ echo esc_html( $gateway );
145
  ?>
146
  </td>
147
+ <td class="date-format"><?php echo esc_html( $post->post_date ); ?>
148
+
149
+ </td>
150
  </tr>
151
  <?php endforeach;?>
152
  </tbody>
167
  <select id="cashcred_point_type" name="cashcred_point_type" class="form-control">
168
  <?php
169
  foreach( $point_types as $point_type_id => $point_type_obj ) {
170
+ echo '<option value="' . esc_attr( $point_type_id ) . '">' . esc_html( $point_type_obj->plural() ) . '</option>';
171
  }
172
  ?>
173
  </select>
192
  <?php } ?>
193
 
194
  <div class="form-group">
195
+ <label><?php echo sprintf( esc_html__('Withdraw %s value', 'mycred'), esc_html( $point_types[ current(array_keys($point_types)) ]->plural() ) ); ?></label>
196
  <?php
197
  $amount = ! empty( $amount ) ? floatval( $amount ) : 0;
198
  ?>
199
+ <input type="number" id="withdraw_points" name="points" class="form-control" placeholder="0" value="<?php echo ! empty($amount) ? esc_attr( $amount ) : 0; ?>" required />
200
+ <p class="cashcred-min"><?php echo esc_html__('Minimum Amount: ', 'mycred');?><span></span></p>
201
 
202
  <?php
203
 
205
 
206
  if( $cashcred_setting['fees']['use'] == 1 ) { ?>
207
 
208
+ <p class="cashcred-fee" ><?php echo esc_html__('Fee : ', 'mycred'); ?>
209
 
210
  <span></span>
211
 
231
  <div class="mycred-cashcred-withdraw-form-footer">
232
  <div id="cashcred_total" class="form-group">
233
  <strong>
234
+
235
+
236
+ <span class="amount_label"><?php echo esc_html__( 'Amount:', 'mycred' ) . '&nbsp'; ?></span>
237
  <span id="cashcred_currency_symbol"></span>
238
  <span id="cashcred_total_amount"></span>
239
  </strong>
240
  </div>
241
  <div id="submit_button" class="form-group">
242
+ <input type="submit" class="button" value="<?php echo esc_attr( $button_label ); ?>" />
243
  </div>
244
  <div class="mycred-clearfix"></div>
245
  </div>
257
  <table>
258
  <thead>
259
  <tr>
260
+ <th>ID</th>
261
+ <th>Points</th>
262
  <?php
263
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
264
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
265
  <th><span class="nobr">Fee</span></th><?php
266
  }
267
  }?>
268
+ <th><?php esc_html_e( 'Amount', 'mycred' ) ?></th>
269
+ <th><?php esc_html_e( 'Point Type', 'mycred' ) ?></th>
270
+ <th><?php esc_html_e(apply_filters( 'mycred_change_gateway_text', 'Gateway' ),'mycred'); ?></th>
271
+ <th>Date</th>
272
+
273
+
274
  </tr>
275
  </thead>
276
  <tbody>
277
+ <?php foreach($posts as $post) {
278
+
279
+ $post->post_date = date('F d, Y, h:i A');
280
+ ?>
281
  <tr>
282
+ <td><?php echo esc_html( $post->post_name ); ?></td>
283
+ <td><?php echo esc_html( get_post_meta($post->ID,'points',true) );?></td>
284
  <?php
285
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
286
 
303
  if( $type_data['max_cap'] != 0 && $fee > $type_data['max_cap'] )
304
  $fee = $type_data['max_cap'];
305
 
306
+ echo esc_html( $fee ); ?>
307
  </td><?php
308
  }
309
  }?>
310
  <td>
311
+ <?php echo esc_html( get_post_meta($post->ID,'currency',true). " " .get_post_meta($post->ID,'points',true) * get_post_meta($post->ID,'cost',true) );?>
312
  </td>
313
+ <td><?php echo esc_html( mycred_get_types()[get_post_meta($post->ID,'point_type',true)] ); ?></td>
314
  <td>
315
  <?php
316
  $gateway = get_post_meta($post->ID,'gateway',true);
317
  $installed = $mycred_modules['solo']['cashcred']->get();
318
  if ( isset( $installed[ $gateway ] ) )
319
+ echo esc_html( $installed[ $gateway ]['title'] );
320
  else
321
+ echo esc_html( $gateway );
322
  ?>
323
  </td>
324
+ <td><?php echo esc_html( $post->post_date ); ?></td>
325
  </tr>
326
  <?php } ?>
327
  </tbody>
335
  <?php
336
  $posts = cashcred_get_withdraw_requests('Cancelled');
337
  ?>
338
+
339
  <table>
340
  <thead>
341
  <tr>
342
+ <th><span class="nobr"><?php esc_html_e( 'ID', 'mycred' ) ?></span></th>
343
+ <th><span class="nobr"><?php esc_html_e( 'Points', 'mycred' ) ?></span></th>
344
  <?php
345
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
346
  if ( $cashcred_setting['fees']['use'] == 1 ) { ?>
347
  <th><span class="nobr">Fee</span></th><?php
348
  }
349
  }?>
350
+ <th><?php esc_html_e( 'Amount', 'mycred' ) ?></th>
351
+ <th><?php esc_html_e( 'Point Type', 'mycred' ) ?></th>
352
+ <th><?php esc_html_e( apply_filters( 'mycred_change_gateway_text', 'Gateway' ), 'mycred' ); ?></th>
353
+ <th><?php esc_html_e( 'Date', 'mycred' ) ?></th>
354
+
355
  </tr>
356
  </thead>
357
  <tbody>
358
+ <?php foreach($posts as $post) {
359
+
360
+ $post->post_date = date('F d, Y, h:i A');
361
+
362
+ ?>
363
  <tr>
364
+ <td><?php echo esc_html( $post->post_name ); ?></td>
365
 
366
+ <td><?php echo esc_html( get_post_meta($post->ID,'points',true ) );?></td>
367
  <?php
368
  if ( ! empty( $cashcred_setting['fees']['types'] ) ) {
369
 
386
  if( $type_data['max_cap'] != 0 && $fee > $type_data['max_cap'] )
387
  $fee = $type_data['max_cap'];
388
 
389
+ echo esc_html( $fee ); ?>
390
  </td><?php
391
  }
392
  }?>
393
  <td>
394
+ <?php echo esc_html( get_post_meta($post->ID,'currency',true). " " .get_post_meta($post->ID,'points',true) * get_post_meta($post->ID,'cost',true) );?>
395
  </td>
396
+ <td><?php echo esc_html( mycred_get_types()[get_post_meta($post->ID,'point_type',true)] );?></td>
397
  <td>
398
  <?php
399
  $gateway = get_post_meta($post->ID,'gateway',true);
400
  $installed = $mycred_modules['solo']['cashcred']->get();
401
  if ( isset( $installed[ $gateway ] ) )
402
+ echo esc_html( $installed[ $gateway ]['title'] );
403
  else
404
+ echo esc_html( $gateway );
405
  ?>
406
  </td>
407
+ <td><?php echo esc_html( $post->post_date ); ?></td>
408
  </tr>
409
  <?php } ?>
410
  </tbody>
419
  <select class="form-control" name="cashcred_save_settings" id="cashcred_save_settings">
420
  <?php
421
  foreach ( $gateways as $key => $active_gateways_value ) {
422
+ echo '<option value="' . esc_attr( $key ). '"> '. esc_html( $active_gateways_value['title'] ) .' </option>';
423
  }
424
  ?>
425
  </select>
addons/cash-creds/modules/cashcred-module-core.php CHANGED
@@ -144,7 +144,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
144
  $payment_response = array();
145
 
146
  if( empty( $post_id ) && ! empty( $_POST['post_ID'] ) ) {
147
- $post_id = $_POST['post_ID'];
148
  }
149
 
150
  if ( empty( $post_id ) ) {
@@ -154,7 +154,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
154
  $this->post_ID = $post_id;
155
 
156
  if( ! empty( $_POST['cashcred_pay_method'] ) ) {
157
- $cashcred_pay_method = $_POST['cashcred_pay_method'];
158
  }
159
  else {
160
  return $this->response( false, array( 'message' => 'Invalid Payment Gateway' ), $auto );
@@ -342,7 +342,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
342
  $format = '%s payment credited';
343
  $entry = sprintf($format, $gateway_name->label);
344
 
345
- mycred_subtract( 'cashcred_withdrawal', $user_id, -$points, $entry, $post_id , $log_data, $point_type );
346
 
347
  if($manual == true) {
348
  update_post_meta( $post_id, 'manual', 'Auto' );
@@ -358,7 +358,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
358
  'comment_author_email' => $author_email,
359
  'comment_content' => $comment,
360
  'comment_type' => 'cashcred',
361
- 'comment_author_IP' => $_SERVER['REMOTE_ADDR'],
362
  'comment_date' => $time,
363
  'comment_approved' => 1,
364
  'user_id' => 0
@@ -449,10 +449,10 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
449
 
450
  global $wp;
451
 
452
- $requested_url = home_url( $wp->request ) . $_SERVER['REQUEST_URI'];
453
- $point_type = sanitize_text_field( $_POST['cashcred_point_type'] );
454
- $cashcred_pay_method = sanitize_text_field( $_POST['cashcred_pay_method'] );
455
- $points = sanitize_text_field( $_POST['points'] );
456
 
457
  $mycred_pref_cashcreds = mycred_get_option( 'mycred_pref_cashcreds' , false );
458
 
@@ -519,7 +519,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
519
  if ( $post_id !== NULL && ! is_wp_error( $post_id ) ) {
520
 
521
  wp_update_post( array( 'ID' => $post_id, 'post_title' => $post_id ) );
522
-
523
  //Will store post meta by checking multisite and current blog, Will store in current blog's table
524
  check_site_add_post_meta( $post_id, 'point_type', $point_type, true );
525
  check_site_add_post_meta( $post_id, 'gateway', $cashcred_pay_method , true );
@@ -528,7 +528,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
528
  check_site_add_post_meta( $post_id, 'cost', $cost, true );
529
  check_site_add_post_meta( $post_id, 'currency', $currency, true );
530
  check_site_add_post_meta( $post_id, 'from', get_current_user_id(), true );
531
- check_site_add_post_meta( $post_id, 'user_ip', $_SERVER['REMOTE_ADDR'], true );
532
  check_site_add_post_meta( $post_id, 'manual', 'Manual', true );
533
 
534
  if( isset( $mycred_pref_cashcreds['gateway_prefs'][ $cashcred_pay_method ]["allow_auto_withdrawal"] ) &&
@@ -561,7 +561,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
561
  ! empty( $_POST['cashcred_point_type'] ) &&
562
  ! empty( $_POST['cashcred_pay_method'] ) &&
563
  ! empty( $_POST['cashcred_withdraw_wpnonce'] ) &&
564
- wp_verify_nonce( $_POST['cashcred_withdraw_wpnonce'], 'cashCred-withdraw-request' )
565
  ) {
566
  $response = true;
567
  }
@@ -577,7 +577,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
577
  if( isset( $_POST['cashcred_save_settings'] ) &&
578
  ! empty( $_POST['cashcred_user_settings'] ) &&
579
  ! empty( $_POST['cashcred_settings_wpnonce'] ) &&
580
- wp_verify_nonce( $_POST['cashcred_settings_wpnonce'], 'cashCred-payment-settings' )
581
  ) {
582
  $response = true;
583
  }
@@ -758,7 +758,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
758
 
759
  // Updated settings
760
  if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] == true )
761
- echo '<div class="updated settings-error"><p>' . __( 'Settings Updated', 'mycred' ) . '</p></div>';
762
 
763
  ?>
764
  <form method="post" action="options.php" class="form">
@@ -787,21 +787,21 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
787
  $column_class = 'col-lg-4 col-md-4 col-sm-12 col-xs-12';
788
 
789
  ?>
790
- <h4><span class="dashicons <?php echo $data['icon']; ?><?php if ( $this->is_active( $key ) ) { if ( $sandbox_mode ) echo ' debug'; else echo ' active'; } else echo ' static'; ?>"></span><?php echo $this->core->template_tags_general( $data['title'] ); ?></h4>
791
  <div class="body" style="display: none;">
792
 
793
  <div class="row">
794
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
795
  <div class="form-group">
796
  <div>&nbsp;</div>
797
- <label for="cashcred-gateway-<?php echo $key; ?>"><input type="checkbox" name="mycred_pref_cashcreds[active][]" id="cashcred-gateway-<?php echo $key; ?>" value="<?php echo $key; ?>"<?php if ( $this->is_active( $key ) ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Enable', 'mycred' ); ?></label>
798
  </div>
799
  </div>
800
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
801
  <?php if ( $has_test_mode ) : ?>
802
  <div class="form-group">
803
  <div>&nbsp;</div>
804
- <label for="cashcred-gateway-<?php echo $key; ?>-sandbox"><input type="checkbox" name="mycred_pref_cashcreds[gateway_prefs][<?php echo $key; ?>][sandbox]" id="cashcred-gateway-<?php echo $key; ?>-sandbox" value="<?php echo $key; ?>"<?php if ( $sandbox_mode ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Sandbox Mode', 'mycred' ); ?></label>
805
  </div>
806
  <?php endif; ?>
807
  </div>
@@ -809,7 +809,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
809
  <?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && $has_documentation ) : ?>
810
  <div class="form-group">
811
  <div>&nbsp;</div>
812
- <a href="<?php echo $has_documentation; ?>" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a>
813
  </div>
814
  <?php endif; ?>
815
  </div>
@@ -818,7 +818,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
818
 
819
  <?php $this->call( 'preferences', $data['callback'] ); ?>
820
 
821
- <input type="hidden" name="mycred_pref_cashcreds[installed]" value="<?php echo $key; ?>" />
822
  </div>
823
  <?php
824
 
@@ -886,7 +886,7 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
886
  <div class='body' style='display:none; padding: 0px; border: none;'>
887
  </div>";
888
 
889
- echo $content;
890
  }
891
  }
892
 
@@ -974,13 +974,13 @@ jQuery(function($) {
974
  <div class="row">
975
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
976
  <div class="form-group">
977
- <label for="<?php echo $this->field_id( array( 'fees' => 'use' ) ); ?>"><input type="checkbox" name="mycred_pref_core[cashcreds][fees][use]" id="<?php echo $this->field_id( array( 'fees' => 'use' ) ); ?>"<?php checked( $cashcred_prefs['fees']['use'], 1 ); ?> value="1" /> <?php esc_html_e( 'Enable this feature', 'mycred' ); ?></label>
978
  </div>
979
  </div>
980
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
981
  <div class="form-group">
982
- <label for="<?php echo $this->field_id( array( 'fees' => 'account' ) ); ?>"><?php esc_html_e( 'Fee Account', 'mycred' ); ?></label>
983
- <input type="text" class="form-control" name="mycred_pref_core[cashcreds][fees][account]" id="<?php echo $this->field_id( array( 'fees' => 'account' ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['account'] ); ?>" />
984
  <p><span class="description"><?php esc_html_e( 'Option to deposit transfer fees into a specific users account. Use zero to disable.', 'mycred' ); ?></span></p>
985
  </div>
986
  </div>
@@ -1002,22 +1002,22 @@ jQuery(function($) {
1002
  ?>
1003
  <div class="row">
1004
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1005
- <h3><?php printf( __( '%s Transfer Fee', 'mycred' ), $mycred->plural() ); ?></h3>
1006
  </div>
1007
  </div>
1008
  <div class="row">
1009
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1010
  <div class="form-group">
1011
- <label for="<?php echo $this->field_id( array( 'fees', 'types', $key, 'amount' ) ); ?>"><?php esc_html_e( 'The Fee', 'mycred' ); ?></label>
1012
  <div>
1013
- <input type="text" size="8" name="mycred_pref_core[cashcreds][fees][types][<?php echo $key; ?>][amount]" id="<?php echo $this->field_id( array( 'fees', 'types', $key, 'amount' ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['amount'] ); ?>" />
1014
- <select name="mycred_pref_core[cashcreds][fees][types][<?php echo $key; ?>][by]" id="<?php echo $this->field_id( array( 'fees', 'types', $key, 'by' ) ); ?>"><?php
1015
 
1016
  $options = array( 'percent' => __( 'Percent', 'mycred' ), 'sum' => $mycred->plural() );
1017
  foreach ( $options as $value => $label ) {
1018
- echo '<option value="' . $value . '"';
1019
  if ( $cashcred_prefs['fees']['types'][ $key ]['by'] == $value ) echo ' selected="selected"';
1020
- echo '>' . $label . '</option>';
1021
  }
1022
 
1023
  ?></select>
@@ -1027,15 +1027,15 @@ jQuery(function($) {
1027
  </div>
1028
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1029
  <div class="form-group">
1030
- <label for="<?php echo $this->field_id( array( 'fees', 'types', $key, 'min_cap' ) ); ?>"><?php esc_html_e( 'Minimum Charge', 'mycred' ); ?></label>
1031
- <div><input type="text" size="8" name="mycred_pref_core[cashcreds][fees][types][<?php echo $key; ?>][min_cap]" id="<?php echo $this->field_id( array( 'fees', 'types', $key, 'min_cap' ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['min_cap'] ); ?>" /> <?php echo $mycred->plural(); ?></div>
1032
  <p><span class="description"><?php esc_html_e( 'Option to set a minimum charge. If set, this amount is added on top of the fee. Example 2% fee + 1.30 points. Use zero to disable.', 'mycred' ); ?></span></p>
1033
  </div>
1034
  </div>
1035
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1036
  <div class="form-group">
1037
- <label for="<?php echo $this->field_id( array( 'fees', 'types', $key, 'max_cap' ) ); ?>"><?php esc_html_e( 'Maximum Cap', 'mycred' ); ?></label>
1038
- <div><input type="text" size="8" name="mycred_pref_core[cashcreds][fees][types][<?php echo $key; ?>][max_cap]" id="<?php echo $this->field_id( array( 'fees', 'types', $key, 'max_cap' ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['max_cap'] ); ?>" /> <?php echo $mycred->plural(); ?></div>
1039
  <p><span class="description"><?php esc_html_e( 'Optional maximum cap for transfer fees. Use zero to disable.', 'mycred' ); ?></span></p>
1040
  </div>
1041
  </div>
@@ -1043,8 +1043,8 @@ jQuery(function($) {
1043
  <div class="row">
1044
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1045
  <div class="form-group">
1046
- <label for="<?php echo $this->field_id( array( 'fees', 'types', $key, 'presentation' ) ); ?>"><?php esc_html_e( 'Presentation', 'mycred' ); ?></label>
1047
- <input type="text" class="form-control" name="mycred_pref_core[cashcreds][fees][types][<?php echo $key; ?>][presentation]" id="<?php echo $this->field_id( array( 'fees', 'types', $key, 'presentation' ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['presentation'] ); ?>" />
1048
  <p><span class="description"><?php esc_html_e( 'Option to set how fees are displayed to your users. Available template tags are: %fee%, %min% and %max% = %total%', 'mycred' ); ?></span></p>
1049
  </div>
1050
  </div>
144
  $payment_response = array();
145
 
146
  if( empty( $post_id ) && ! empty( $_POST['post_ID'] ) ) {
147
+ $post_id = sanitize_text_field( wp_unslash( $_POST['post_ID'] ) );
148
  }
149
 
150
  if ( empty( $post_id ) ) {
154
  $this->post_ID = $post_id;
155
 
156
  if( ! empty( $_POST['cashcred_pay_method'] ) ) {
157
+ $cashcred_pay_method = sanitize_text_field( wp_unslash( $_POST['cashcred_pay_method'] ) );
158
  }
159
  else {
160
  return $this->response( false, array( 'message' => 'Invalid Payment Gateway' ), $auto );
342
  $format = '%s payment credited';
343
  $entry = sprintf($format, $gateway_name->label);
344
 
345
+ mycred_subtract( 'cashcred_withdrawal', $user_id, -$points, apply_filters( 'cashcred_withdraw_request_entry', $entry ), $post_id , $log_data, $point_type );
346
 
347
  if($manual == true) {
348
  update_post_meta( $post_id, 'manual', 'Auto' );
358
  'comment_author_email' => $author_email,
359
  'comment_content' => $comment,
360
  'comment_type' => 'cashcred',
361
+ 'comment_author_IP' => isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '',
362
  'comment_date' => $time,
363
  'comment_approved' => 1,
364
  'user_id' => 0
449
 
450
  global $wp;
451
 
452
+ $requested_url = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_url( wp_unslash( home_url( $wp->request ) ) ) . sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
453
+ $point_type = isset( $_POST['cashcred_point_type'] ) ? sanitize_text_field( wp_unslash( $_POST['cashcred_point_type'] ) ) : '';
454
+ $cashcred_pay_method = isset( $_POST['cashcred_pay_method'] ) ? sanitize_text_field( wp_unslash( $_POST['cashcred_pay_method'] ) ) : '';
455
+ $points = isset( $_POST['points'] ) ? sanitize_text_field( wp_unslash( $_POST['points'] ) ) : "";
456
 
457
  $mycred_pref_cashcreds = mycred_get_option( 'mycred_pref_cashcreds' , false );
458
 
519
  if ( $post_id !== NULL && ! is_wp_error( $post_id ) ) {
520
 
521
  wp_update_post( array( 'ID' => $post_id, 'post_title' => $post_id ) );
522
+ $remote_addr = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '';
523
  //Will store post meta by checking multisite and current blog, Will store in current blog's table
524
  check_site_add_post_meta( $post_id, 'point_type', $point_type, true );
525
  check_site_add_post_meta( $post_id, 'gateway', $cashcred_pay_method , true );
528
  check_site_add_post_meta( $post_id, 'cost', $cost, true );
529
  check_site_add_post_meta( $post_id, 'currency', $currency, true );
530
  check_site_add_post_meta( $post_id, 'from', get_current_user_id(), true );
531
+ check_site_add_post_meta( $post_id, 'user_ip', $remote_addr, true );
532
  check_site_add_post_meta( $post_id, 'manual', 'Manual', true );
533
 
534
  if( isset( $mycred_pref_cashcreds['gateway_prefs'][ $cashcred_pay_method ]["allow_auto_withdrawal"] ) &&
561
  ! empty( $_POST['cashcred_point_type'] ) &&
562
  ! empty( $_POST['cashcred_pay_method'] ) &&
563
  ! empty( $_POST['cashcred_withdraw_wpnonce'] ) &&
564
+ wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cashcred_withdraw_wpnonce'] ) ), 'cashCred-withdraw-request' )
565
  ) {
566
  $response = true;
567
  }
577
  if( isset( $_POST['cashcred_save_settings'] ) &&
578
  ! empty( $_POST['cashcred_user_settings'] ) &&
579
  ! empty( $_POST['cashcred_settings_wpnonce'] ) &&
580
+ wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cashcred_settings_wpnonce'] ) ), 'cashCred-payment-settings' )
581
  ) {
582
  $response = true;
583
  }
758
 
759
  // Updated settings
760
  if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] == true )
761
+ echo '<div class="updated settings-error"><p>' . esc_html__( 'Settings Updated', 'mycred' ) . '</p></div>';
762
 
763
  ?>
764
  <form method="post" action="options.php" class="form">
787
  $column_class = 'col-lg-4 col-md-4 col-sm-12 col-xs-12';
788
 
789
  ?>
790
+ <h4><span class="dashicons <?php echo esc_attr( $data['icon'] ); ?><?php if ( $this->is_active( $key ) ) { if ( $sandbox_mode ) echo ' debug'; else echo ' active'; } else echo ' static'; ?>"></span><?php echo wp_kses_post( $this->core->template_tags_general( $data['title'] ) ); ?></h4>
791
  <div class="body" style="display: none;">
792
 
793
  <div class="row">
794
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
795
  <div class="form-group">
796
  <div>&nbsp;</div>
797
+ <label for="cashcred-gateway-<?php echo esc_attr( $key ); ?>"><input type="checkbox" name="mycred_pref_cashcreds[active][]" id="cashcred-gateway-<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $key ); ?>"<?php if ( $this->is_active( $key ) ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Enable', 'mycred' ); ?></label>
798
  </div>
799
  </div>
800
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
801
  <?php if ( $has_test_mode ) : ?>
802
  <div class="form-group">
803
  <div>&nbsp;</div>
804
+ <label for="cashcred-gateway-<?php echo esc_attr( $key ); ?>-sandbox"><input type="checkbox" name="mycred_pref_cashcreds[gateway_prefs][<?php echo esc_attr( $key ); ?>][sandbox]" id="cashcred-gateway-<?php echo esc_attr( $key ); ?>-sandbox" value="<?php echo esc_attr( $key ); ?>"<?php if ( $sandbox_mode ) echo ' checked="checked"'; ?> /> <?php esc_html_e( 'Sandbox Mode', 'mycred' ); ?></label>
805
  </div>
806
  <?php endif; ?>
807
  </div>
809
  <?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && $has_documentation ) : ?>
810
  <div class="form-group">
811
  <div>&nbsp;</div>
812
+ <a href="<?php echo esc_url( $has_documentation ); ?>" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a>
813
  </div>
814
  <?php endif; ?>
815
  </div>
818
 
819
  <?php $this->call( 'preferences', $data['callback'] ); ?>
820
 
821
+ <input type="hidden" name="mycred_pref_cashcreds[installed]" value="<?php echo esc_attr( $key ); ?>" />
822
  </div>
823
  <?php
824
 
886
  <div class='body' style='display:none; padding: 0px; border: none;'>
887
  </div>";
888
 
889
+ echo wp_kses_post( $content );
890
  }
891
  }
892
 
974
  <div class="row">
975
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
976
  <div class="form-group">
977
+ <label for="<?php echo esc_attr( $this->field_id( array( 'fees' => 'use' ) ) ); ?>"><input type="checkbox" name="mycred_pref_core[cashcreds][fees][use]" id="<?php echo esc_attr( $this->field_id( array( 'fees' => 'use' ) ) ); ?>"<?php checked( $cashcred_prefs['fees']['use'], 1 ); ?> value="1" /> <?php esc_html_e( 'Enable this feature', 'mycred' ); ?></label>
978
  </div>
979
  </div>
980
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
981
  <div class="form-group">
982
+ <label for="<?php echo esc_attr( $this->field_id( array( 'fees' => 'account' ) ) ); ?>"><?php esc_html_e( 'Fee Account', 'mycred' ); ?></label>
983
+ <input type="text" class="form-control" name="mycred_pref_core[cashcreds][fees][account]" id="<?php echo esc_attr( $this->field_id( array( 'fees' => 'account' ) ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['account'] ); ?>" />
984
  <p><span class="description"><?php esc_html_e( 'Option to deposit transfer fees into a specific users account. Use zero to disable.', 'mycred' ); ?></span></p>
985
  </div>
986
  </div>
1002
  ?>
1003
  <div class="row">
1004
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1005
+ <h3><?php printf( esc_html__( '%s Transfer Fee', 'mycred' ), esc_html( $mycred->plural() ) ); ?></h3>
1006
  </div>
1007
  </div>
1008
  <div class="row">
1009
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1010
  <div class="form-group">
1011
+ <label for="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'amount' ) ) ); ?>"><?php esc_html_e( 'The Fee', 'mycred' ); ?></label>
1012
  <div>
1013
+ <input type="text" size="8" name="mycred_pref_core[cashcreds][fees][types][<?php echo esc_attr( $key ); ?>][amount]" id="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'amount' ) ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['amount'] ); ?>" />
1014
+ <select name="mycred_pref_core[cashcreds][fees][types][<?php echo esc_attr( $key ); ?>][by]" id="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'by' ) ) ); ?>"><?php
1015
 
1016
  $options = array( 'percent' => __( 'Percent', 'mycred' ), 'sum' => $mycred->plural() );
1017
  foreach ( $options as $value => $label ) {
1018
+ echo '<option value="' . esc_html( $value ) . '"';
1019
  if ( $cashcred_prefs['fees']['types'][ $key ]['by'] == $value ) echo ' selected="selected"';
1020
+ echo '>' . esc_html( $label ) . '</option>';
1021
  }
1022
 
1023
  ?></select>
1027
  </div>
1028
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1029
  <div class="form-group">
1030
+ <label for="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'min_cap' ) ) ); ?>"><?php esc_html_e( 'Minimum Charge', 'mycred' ); ?></label>
1031
+ <div><input type="text" size="8" name="mycred_pref_core[cashcreds][fees][types][<?php echo esc_attr( $key ); ?>][min_cap]" id="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'min_cap' ) ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['min_cap'] ); ?>" /> <?php echo esc_html( $mycred->plural() ); ?></div>
1032
  <p><span class="description"><?php esc_html_e( 'Option to set a minimum charge. If set, this amount is added on top of the fee. Example 2% fee + 1.30 points. Use zero to disable.', 'mycred' ); ?></span></p>
1033
  </div>
1034
  </div>
1035
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1036
  <div class="form-group">
1037
+ <label for="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'max_cap' ) ) ); ?>"><?php esc_html_e( 'Maximum Cap', 'mycred' ); ?></label>
1038
+ <div><input type="text" size="8" name="mycred_pref_core[cashcreds][fees][types][<?php echo esc_attr( $key ); ?>][max_cap]" id="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'max_cap' ) ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['max_cap'] ); ?>" /> <?php echo esc_html( $mycred->plural() ); ?></div>
1039
  <p><span class="description"><?php esc_html_e( 'Optional maximum cap for transfer fees. Use zero to disable.', 'mycred' ); ?></span></p>
1040
  </div>
1041
  </div>
1043
  <div class="row">
1044
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1045
  <div class="form-group">
1046
+ <label for="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'presentation' ) ) ); ?>"><?php esc_html_e( 'Presentation', 'mycred' ); ?></label>
1047
+ <input type="text" class="form-control" name="mycred_pref_core[cashcreds][fees][types][<?php echo esc_attr( $key ); ?>][presentation]" id="<?php echo esc_attr( $this->field_id( array( 'fees', 'types', $key, 'presentation' ) ) ); ?>" value="<?php echo esc_attr( $cashcred_prefs['fees']['types'][ $key ]['presentation'] ); ?>" />
1048
  <p><span class="description"><?php esc_html_e( 'Option to set how fees are displayed to your users. Available template tags are: %fee%, %min% and %max% = %total%', 'mycred' ); ?></span></p>
1049
  </div>
1050
  </div>
addons/cash-creds/modules/cashcred-module-withdrawal.php CHANGED
@@ -160,14 +160,14 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
160
  global $pagenow;
161
  $meta_query = array();
162
 
163
- $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : '';
164
 
165
  /* Gateway filter */
166
  if ( is_admin() && $pagenow=='edit.php' && $post_type == 'cashcred_withdrawal' && isset( $_GET['gateway'] ) && $_GET['gateway'] !='all' ) {
167
 
168
  $meta_query[] = array(
169
  'key' => 'gateway',
170
- 'value' => $_GET['gateway'],
171
  'compare' => '='
172
  );
173
  }
@@ -177,7 +177,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
177
 
178
  $meta_query[] = array(
179
  'key' => 'Status',
180
- 'value' => $_GET['Status'],
181
  'compare' => '='
182
  );
183
 
@@ -188,7 +188,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
188
 
189
  $meta_query[] = array(
190
  'key' => 'from',
191
- 'value' => $_GET['user_id'],
192
  'compare' => '='
193
  );
194
  }
@@ -285,10 +285,10 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
285
  if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_CASHCRED_KEY && isset( $_GET['credited'] ) ) {
286
 
287
  if ( $_GET['credited'] == 1 )
288
- echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Pending payment successfully credited to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
289
 
290
  elseif ( $_GET['credited'] == 0 )
291
- echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Failed to credit the pending payment to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
292
 
293
  }
294
 
@@ -323,7 +323,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
323
 
324
  global $pagenow;
325
 
326
- if ( isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_CASHCRED_KEY && isset( $_GET['action'] ) && $_GET['action'] == 'edit' )
327
  return MYCRED_MAIN_SLUG;
328
 
329
  return $parent;
@@ -345,7 +345,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
345
 
346
  }
347
 
348
- elseif ( $pagenow == 'post.php' && isset( $_GET['post'] ) && mycred_get_post_type( $_GET['post'] ) == MYCRED_CASHCRED_KEY ) {
349
 
350
  return 'edit.php?post_type=' . MYCRED_CASHCRED_KEY;
351
 
@@ -389,14 +389,13 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
389
  switch ( $column_name ) {
390
  case 'User' :
391
 
392
- $from = (int) check_site_get_post_meta( $post_id, 'from', true );
393
  $from = (int) check_site_get_post_meta( $post_id, 'from', true );
394
  $user = get_userdata( $from );
395
 
396
  if ( isset( $user->display_name ) )
397
- echo '<a href="' . esc_url( admin_url( add_query_arg( array( 'post_type' => MYCRED_CASHCRED_KEY . '&user_id='.$user->ID ), 'edit.php' ) ) ) . '">' . $user->display_name . '</a>';
398
  else
399
- echo 'ID: ' . $from;
400
 
401
  break;
402
  case 'Points';
@@ -405,14 +404,14 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
405
  $points = check_site_get_post_meta( $post_id, 'points', true );
406
  $mycred = mycred( $type );
407
 
408
- echo $mycred->format_creds( $points );
409
 
410
  break;
411
  case 'cost';
412
 
413
  $cost = check_site_get_post_meta( $post_id, 'cost', true );
414
  $currency = check_site_get_post_meta( $post_id, 'currency', true );
415
- echo $cost . ' ' . $currency;
416
 
417
  break;
418
  case 'amount';
@@ -420,7 +419,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
420
  $points = check_site_get_post_meta( $post_id, 'points', true );
421
  $cost = check_site_get_post_meta( $post_id, 'cost', true );
422
  $currency = check_site_get_post_meta( $post_id, 'currency', true );
423
- echo $currency .' ' . $points * $cost;
424
 
425
  break;
426
  case 'gateway';
@@ -429,9 +428,9 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
429
  $installed = $mycred_modules['solo']['cashcred']->get();
430
 
431
  if ( isset( $installed[ $gateway ] ) )
432
- echo $installed[ $gateway ]['title'];
433
  else
434
- echo $gateway;
435
 
436
  break;
437
  case 'ctype';
@@ -439,14 +438,14 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
439
  $type = check_site_get_post_meta( $post_id, 'point_type', true );
440
 
441
  if ( isset( $this->point_types[ $type ] ) )
442
- echo $this->point_types[ $type ];
443
  else
444
- echo $type;
445
 
446
  break;
447
  case 'status';
448
  $status = check_site_get_post_meta( $post_id, 'status', true );
449
- echo "<div class='cashcred_bages'><span class='cashcred_" . $status . "'>" . $status . "</span></div>";
450
 
451
  break;
452
 
@@ -583,8 +582,8 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
583
  $payment_log = mycred_get_post_meta( get_the_ID(), 'cashcred_log_' . $orderdesc, true );
584
 
585
  echo "<pre>";
586
- echo "<b>Date Time: </b>".$payment_log['datetime']."<br>";
587
- echo "<b>Payment Gateway: </b>".$payment_log['payment_gateway']."<br>";
588
  print_r( json_decode( $payment_log["response"] ) );
589
  echo "</pre>";
590
 
@@ -630,7 +629,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
630
  <div class="form-group"><strong>Amount Transfer :</strong></div>
631
  </div>
632
  <div class="type-cashcred_withdrawal col-md-4 col-sm-12">
633
- <div class="form-group"><span class="cashcred_<?php echo $status; ?>"><?php echo $status; ?></span></div>
634
  </div>
635
  </div>
636
 
@@ -643,8 +642,8 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
643
  <?php
644
  foreach ( $mycred_modules['solo']['cashcred']->get() as $gateway_id => $info ) {
645
  if($get_payment_settings->gateway_id == $gateway_id ){
646
- echo $info['title'];
647
- ?><input type="hidden" name="cashcred_pay_method" value="<?php echo $gateway_id;?>"><?php
648
  }
649
  }
650
  ?>
@@ -658,7 +657,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
658
  </div>
659
 
660
  <div class="col-md-4 col-sm-12">
661
- <div class="form-group"><?php echo $get_payment_settings->currency ." ". $get_payment_settings->points * $get_payment_settings->cost;?></div>
662
  </div>
663
  </div>
664
 
@@ -672,7 +671,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
672
  <span class="entry-date">
673
  <?php
674
  if($transfer_date){
675
- echo date( 'Y-m-d H:i:s', strtotime( $transfer_date ) );
676
  }else{
677
  echo "-";
678
  }
@@ -688,7 +687,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
688
  </div>
689
 
690
  <div class="col-md-4 col-sm-12">
691
- <div class="form-group"><?php echo $manual; ?></div>
692
  </div>
693
  </div>
694
  <br>
@@ -700,8 +699,8 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
700
  $disabled = 'disabled';
701
 
702
  ?>
703
- <input type="hidden" name="cashcred_create_nonce" value="<?php echo wp_create_nonce( 'cashcred_create_nonce' ); ?>">
704
- <button type="button" id="cashcred_paynow" <?php echo $disabled; ?> class="button button-secondary btn-lg btn-block">
705
  <div class="spinner"></div>
706
  <span class="cashcred_paynow_text">Pay Now</span>
707
  </button>
@@ -726,7 +725,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
726
 
727
  jQuery.ajax({
728
  type: 'POST',
729
- url: "<?php echo admin_url( 'admin-ajax.php' );?>",
730
  data: data,
731
  dataType: "json",
732
  beforeSend: function() {
@@ -810,7 +809,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
810
  </div>
811
 
812
  <div class="col-md-4 col-sm-12">
813
- <div class="form-group"> <?php echo $user_id ?> </div>
814
  </div>
815
 
816
  </div>
@@ -821,7 +820,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
821
  <div class="form-group"> <strong>User Name :</strong> </div>
822
  </div>
823
  <div class="col-md-4 col-sm-12">
824
- <div class="form-group"> <?php echo $user_obj->data->display_name;?></div>
825
  </div>
826
 
827
  </div>
@@ -832,7 +831,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
832
  <div class="form-group"> <strong>User Email :</strong> </div>
833
  </div>
834
  <div class="col-md-4 col-sm-12">
835
- <div class="form-group"> <?php echo $user_obj->data->user_email;?></div>
836
  </div>
837
 
838
  </div>
@@ -843,7 +842,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
843
  <div class="form-group"> <strong>User IP :</strong> </div>
844
  </div>
845
  <div class="col-md-4 col-sm-12">
846
- <div class="form-group"> <?php echo get_post_meta( get_the_ID(), 'user_ip', true );?></div>
847
  </div>
848
 
849
  </div>
@@ -857,7 +856,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
857
  <div class="col-md-4 col-sm-12">
858
  <div class="form-group" id="user_total_cashcred"><?php
859
  if(get_user_meta( $user_id, 'cashcred_total', true )){
860
- echo $get_payment_settings->currency .' '. get_user_meta( $user_id, 'cashcred_total', true );
861
  }else{
862
  echo 0;
863
  }
@@ -869,12 +868,12 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
869
  <div class="row">
870
 
871
  <div class="col-md-12 col-sm-12">
872
- <div class="form-group"> <strong><a target="_blank" href="edit.php?post_type=cashcred_withdrawal&user_id=<?php echo $user_id ?>">View user all withdrawal request.</a></strong> </div>
873
  </div>
874
 
875
 
876
  </div>
877
- <input type="hidden" name="user_id" value="<?php echo $user_id ?>">
878
 
879
  <style>
880
  #cashcred-user-info .row,#cashcred-payment-status .row{
@@ -936,7 +935,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
936
  </div>
937
 
938
  <div>
939
- <a href="<?php echo $delete_url; ?>" class="button button-secondary button-block"><?php esc_html_e( 'Trash', 'mycred' ); ?></a>
940
  </div>
941
 
942
  </div>
@@ -1017,14 +1016,14 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1017
  <div class="form-group">
1018
  <label for="cashcred-pending-payment-point_type"><?php esc_html_e( 'Point Type', 'mycred' ); ?></label>
1019
 
1020
- <select name="cashcred_pending_payment[point_type]" <?php echo $disabled; ?> id="cashcred-pending-payment-point_type" class="form-control disabled_fields">
1021
  <?php
1022
 
1023
  foreach ( mycred_get_types() as $key => $point_type ) {
1024
 
1025
- echo '<option value="' . $key . '"';
1026
  if ( $pending_payment->point_type == $key ) echo ' selected="selected"';
1027
- echo '>' . mycred_get_point_type_name( $key, false ) . '</option>';
1028
 
1029
  }
1030
 
@@ -1036,15 +1035,15 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1036
  <div class="col-md-2 col-sm-6">
1037
  <div class="form-group">
1038
  <label for="cashcred-pending-payment-gateway"><?php esc_html_e( 'Gateway', 'mycred' ); ?></label>
1039
- <select name="cashcred_pending_payment[gateway]" <?php echo $disabled; ?> id="cashcred-pending-payment-gateway" class="form-control disabled_fields">
1040
  <?php
1041
 
1042
  foreach ( $mycred_modules['solo']['cashcred']->get() as $gateway_id => $info ) {
1043
 
1044
- echo '<option value="' . $gateway_id . '"';
1045
  if ( $pending_payment->gateway_id == $gateway_id ) echo ' selected="selected"';
1046
  if ( ! $mycred_modules['solo']['cashcred']->is_active( $gateway_id ) ) echo ' disabled="disabled"';
1047
- echo '>' . $info['title'] . '</option>';
1048
 
1049
  }
1050
 
@@ -1055,7 +1054,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1055
  <div class="<?php echo $cashcred_setting['fees']['use'] == 1 ? 'col-md-1 col-sm-5' : 'col-md-2 col-sm-6' ?>">
1056
  <div class="form-group">
1057
  <label for="cashcred-pending-payment-points"><?php esc_html_e( 'Points', 'mycred' ); ?></label>
1058
- <input type="text" <?php echo $readonly; ?> name="cashcred_pending_payment[points]" id="cashcred-pending-payment-points" class="form-control readonly_fields" value="<?php echo $mycred->number( $pending_payment->points ); ?>" />
1059
  </div>
1060
  </div>
1061
  <?php
@@ -1065,7 +1064,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1065
  <div class="col-md-1 col-sm-5">
1066
  <div class="form-group">
1067
  <label for="cashcred-pending-payment-fee"><?php esc_html_e( 'Fee', 'mycred' ); ?></label>
1068
- <input type="text" <?php echo $readonly; ?> name="cashcred_pending_payment[fee]" id="cashcred-pending-payment-fee" class="form-control readonly_fields" value="<?php echo esc_attr( $fee ); ?>" readonly/>
1069
  </div>
1070
  </div><?php
1071
  }
@@ -1074,13 +1073,13 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1074
  <div class="<?php echo $cashcred_setting['fees']['use'] == 1 ? 'col-md-1 col-sm-5' : 'col-md-2 col-sm-6'; ?>">
1075
  <div class="form-group">
1076
  <label for="cashcred-pending-payment-cost"><?php esc_html_e( 'Cost', 'mycred' ); ?></label>
1077
- <input type="text" <?php echo $readonly; ?> name="cashcred_pending_payment[cost]" id="cashcred-pending-payment-cost" class="form-control readonly_fields" value="<?php echo esc_attr( $pending_payment->cost ); ?>" />
1078
  </div>
1079
  </div>
1080
  <div class="<?php echo $cashcred_setting['fees']['use'] == 1 ? 'col-md-1 col-sm-5' : 'col-md-2 col-sm-6'; ?>">
1081
  <div class="form-group">
1082
  <label for="cashcred-pending-payment-currency"><?php esc_html_e( 'Currency', 'mycred' ); ?></label>
1083
- <input type="text" <?php echo $readonly; ?> name="cashcred_pending_payment[currency]" id="cashcred-pending-payment-currency" class="form-control readonly_fields" value="<?php echo esc_attr( $pending_payment->currency ); ?>" />
1084
  </div>
1085
  </div>
1086
  </div>
@@ -1117,7 +1116,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1117
 
1118
  $comment_date = isset( $comment->comment_date_gmt ) ? $comment->comment_date_gmt : $post->post_date;
1119
 
1120
- echo '<li><time>' . $comment_date . '</time><p>' . $comment->comment_content . '</p></li>';
1121
 
1122
  }
1123
 
@@ -1137,11 +1136,11 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1137
  $pending_payment = $_POST['cashcred_pending_payment'];
1138
 
1139
  $old_status = mycred_get_post_meta( $post_id, 'status', true );
1140
- $new_status = sanitize_text_field( $_POST['status'] );
1141
-
1142
- $user_settings = mycred_get_user_meta( $_POST['user_id'], cashcred_get_user_settings(), '', true );
1143
  $updated_user_settings = $_POST['cashcred_user_settings'];
1144
-
1145
  $changed_fields = array();
1146
 
1147
  $withdraw_request_messages = array(
@@ -1154,7 +1153,7 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
1154
 
1155
  mycred_cashcred_update_status( $post_id, 'status', $new_status );
1156
 
1157
- mycred_update_user_meta( $_POST['user_id'], cashcred_get_user_settings(), '', $updated_user_settings );
1158
 
1159
  foreach ( $pending_payment as $meta_key => $meta_value ) {
1160
 
160
  global $pagenow;
161
  $meta_query = array();
162
 
163
+ $post_type = isset( $_GET['post_type'] ) ? sanitize_text_field( wp_unslash( $_GET['post_type'] ) ) : '';
164
 
165
  /* Gateway filter */
166
  if ( is_admin() && $pagenow=='edit.php' && $post_type == 'cashcred_withdrawal' && isset( $_GET['gateway'] ) && $_GET['gateway'] !='all' ) {
167
 
168
  $meta_query[] = array(
169
  'key' => 'gateway',
170
+ 'value' => sanitize_key( $_GET['gateway'] ),
171
  'compare' => '='
172
  );
173
  }
177
 
178
  $meta_query[] = array(
179
  'key' => 'Status',
180
+ 'value' => sanitize_key( $_GET['Status'] ),
181
  'compare' => '='
182
  );
183
 
188
 
189
  $meta_query[] = array(
190
  'key' => 'from',
191
+ 'value' => sanitize_key( $_GET['user_id'] ),
192
  'compare' => '='
193
  );
194
  }
285
  if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == MYCRED_CASHCRED_KEY && isset( $_GET['credited'] ) ) {
286
 
287
  if ( $_GET['credited'] == 1 )
288
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . esc_html__( 'Pending payment successfully credited to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
289
 
290
  elseif ( $_GET['credited'] == 0 )
291
+ echo '<div id="message" class="error notice is-dismissible"><p>' . esc_html__( 'Failed to credit the pending payment to account.', 'mycred' ) . '</p><button type="button" class="notice-dismiss"></button></div>';
292
 
293
  }
294
 
323
 
324
  global $pagenow;
325
 
326
+ if ( isset( $_GET['post'] ) && mycred_get_post_type( intval( $_GET['post'] ) ) == MYCRED_CASHCRED_KEY && isset( $_GET['action'] ) && sanitize_text_field( wp_unslash( $_GET['action'] ) ) == 'edit' )
327
  return MYCRED_MAIN_SLUG;
328
 
329
  return $parent;
345
 
346
  }
347
 
348
+ elseif ( $pagenow == 'post.php' && isset( $_GET['post'] ) && mycred_get_post_type( intval( $_GET['post'] ) ) == MYCRED_CASHCRED_KEY ) {
349
 
350
  return 'edit.php?post_type=' . MYCRED_CASHCRED_KEY;
351
 
389
  switch ( $column_name ) {
390
  case 'User' :
391
 
 
392
  $from = (int) check_site_get_post_meta( $post_id, 'from', true );
393
  $user = get_userdata( $from );
394
 
395
  if ( isset( $user->display_name ) )
396
+ echo '<a href="' . esc_url( admin_url( add_query_arg( array( 'post_type' => MYCRED_CASHCRED_KEY . '&user_id='.$user->ID ), 'edit.php' ) ) ) . '">' . esc_html( $user->display_name ) . '</a>';
397
  else
398
+ echo 'ID: ' . esc_html( $from );
399
 
400
  break;
401
  case 'Points';
404
  $points = check_site_get_post_meta( $post_id, 'points', true );
405
  $mycred = mycred( $type );
406
 
407
+ echo esc_html( $mycred->format_creds( $points ) );
408
 
409
  break;
410
  case 'cost';
411
 
412
  $cost = check_site_get_post_meta( $post_id, 'cost', true );
413
  $currency = check_site_get_post_meta( $post_id, 'currency', true );
414
+ echo esc_html( $cost ) . ' ' . esc_html( $currency );
415
 
416
  break;
417
  case 'amount';
419
  $points = check_site_get_post_meta( $post_id, 'points', true );
420
  $cost = check_site_get_post_meta( $post_id, 'cost', true );
421
  $currency = check_site_get_post_meta( $post_id, 'currency', true );
422
+ echo esc_html( $currency ) .' ' . esc_html( $points * $cost );
423
 
424
  break;
425
  case 'gateway';
428
  $installed = $mycred_modules['solo']['cashcred']->get();
429
 
430
  if ( isset( $installed[ $gateway ] ) )
431
+ echo esc_html( $installed[ $gateway ]['title'] );
432
  else
433
+ echo esc_html( $gateway );
434
 
435
  break;
436
  case 'ctype';
438
  $type = check_site_get_post_meta( $post_id, 'point_type', true );
439
 
440
  if ( isset( $this->point_types[ $type ] ) )
441
+ echo esc_html( $this->point_types[ $type ] );
442
  else
443
+ echo esc_html( $type );
444
 
445
  break;
446
  case 'status';
447
  $status = check_site_get_post_meta( $post_id, 'status', true );
448
+ echo "<div class='cashcred_bages'><span class='cashcred_" . esc_attr( $status ) . "'>" . esc_html( $status ) . "</span></div>";
449
 
450
  break;
451
 
582
  $payment_log = mycred_get_post_meta( get_the_ID(), 'cashcred_log_' . $orderdesc, true );
583
 
584
  echo "<pre>";
585
+ echo "<b>Date Time: </b>".esc_html( $payment_log['datetime'] )."<br>";
586
+ echo "<b>Payment Gateway: </b>".esc_html( $payment_log['payment_gateway'] )."<br>";
587
  print_r( json_decode( $payment_log["response"] ) );
588
  echo "</pre>";
589
 
629
  <div class="form-group"><strong>Amount Transfer :</strong></div>
630
  </div>
631
  <div class="type-cashcred_withdrawal col-md-4 col-sm-12">
632
+ <div class="form-group"><span class="cashcred_<?php echo esc_attr( $status ); ?>"><?php echo esc_html( $status ); ?></span></div>
633
  </div>
634
  </div>
635
 
642
  <?php
643
  foreach ( $mycred_modules['solo']['cashcred']->get() as $gateway_id => $info ) {
644
  if($get_payment_settings->gateway_id == $gateway_id ){
645
+ echo esc_html( $info['title'] );
646
+ ?><input type="hidden" name="cashcred_pay_method" value="<?php echo esc_attr( $gateway_id );?>"><?php
647
  }
648
  }
649
  ?>
657
  </div>
658
 
659
  <div class="col-md-4 col-sm-12">
660
+ <div class="form-group"><?php echo esc_html( $get_payment_settings->currency ) ." ". esc_html( $get_payment_settings->points * $get_payment_settings->cost );?></div>
661
  </div>
662
  </div>
663
 
671
  <span class="entry-date">
672
  <?php
673
  if($transfer_date){
674
+ echo esc_html( date( 'Y-m-d H:i:s', strtotime( $transfer_date ) ) );
675
  }else{
676
  echo "-";
677
  }
687
  </div>
688
 
689
  <div class="col-md-4 col-sm-12">
690
+ <div class="form-group"><?php echo esc_html( $manual ); ?></div>
691
  </div>
692
  </div>
693
  <br>
699
  $disabled = 'disabled';
700
 
701
  ?>
702
+ <input type="hidden" name="cashcred_create_nonce" value="<?php echo esc_attr( wp_create_nonce( 'cashcred_create_nonce' ) ); ?>">
703
+ <button type="button" id="cashcred_paynow" <?php echo esc_attr( $disabled ); ?> class="button button-secondary btn-lg btn-block">
704
  <div class="spinner"></div>
705
  <span class="cashcred_paynow_text">Pay Now</span>
706
  </button>
725
 
726
  jQuery.ajax({
727
  type: 'POST',
728
+ url: "<?php echo esc_js( admin_url( 'admin-ajax.php' ) );?>",
729
  data: data,
730
  dataType: "json",
731
  beforeSend: function() {
809
  </div>
810
 
811
  <div class="col-md-4 col-sm-12">
812
+ <div class="form-group"> <?php echo esc_html( $user_id ); ?> </div>
813
  </div>
814
 
815
  </div>
820
  <div class="form-group"> <strong>User Name :</strong> </div>
821
  </div>
822
  <div class="col-md-4 col-sm-12">
823
+ <div class="form-group"> <?php echo esc_html( $user_obj->data->display_name );?></div>
824
  </div>
825
 
826
  </div>
831
  <div class="form-group"> <strong>User Email :</strong> </div>
832
  </div>
833
  <div class="col-md-4 col-sm-12">
834
+ <div class="form-group"> <?php echo esc_html( $user_obj->data->user_email );?></div>
835
  </div>
836
 
837
  </div>
842
  <div class="form-group"> <strong>User IP :</strong> </div>
843
  </div>
844
  <div class="col-md-4 col-sm-12">
845
+ <div class="form-group"> <?php echo esc_html( get_post_meta( get_the_ID(), 'user_ip', true ) );?></div>
846
  </div>
847
 
848
  </div>
856
  <div class="col-md-4 col-sm-12">
857
  <div class="form-group" id="user_total_cashcred"><?php
858
  if(get_user_meta( $user_id, 'cashcred_total', true )){
859
+ echo esc_html( $get_payment_settings->currency ) .' '. esc_html( get_user_meta( $user_id, 'cashcred_total', true ) );
860
  }else{
861
  echo 0;
862
  }
868
  <div class="row">
869
 
870
  <div class="col-md-12 col-sm-12">
871
+ <div class="form-group"> <strong><a target="_blank" href="edit.php?post_type=cashcred_withdrawal&user_id=<?php echo intval( $user_id ) ?>">View user all withdrawal request.</a></strong> </div>
872
  </div>
873
 
874
 
875
  </div>
876
+ <input type="hidden" name="user_id" value="<?php echo esc_attr( $user_id ); ?>">
877
 
878
  <style>
879
  #cashcred-user-info .row,#cashcred-payment-status .row{
935
  </div>
936
 
937
  <div>
938
+ <a href="<?php echo esc_url( $delete_url ); ?>" class="button button-secondary button-block"><?php esc_html_e( 'Trash', 'mycred' ); ?></a>
939
  </div>
940
 
941
  </div>
1016
  <div class="form-group">
1017
  <label for="cashcred-pending-payment-point_type"><?php esc_html_e( 'Point Type', 'mycred' ); ?></label>
1018
 
1019
+ <select name="cashcred_pending_payment[point_type]" <?php echo esc_attr( $disabled ); ?> id="cashcred-pending-payment-point_type" class="form-control disabled_fields">
1020
  <?php
1021
 
1022
  foreach ( mycred_get_types() as $key => $point_type ) {
1023
 
1024
+ echo '<option value="' . esc_attr( $key ) . '"';
1025
  if ( $pending_payment->point_type == $key ) echo ' selected="selected"';
1026
+ echo '>' . esc_html( mycred_get_point_type_name( $key, false ) ) . '</option>';
1027
 
1028
  }
1029
 
1035
  <div class="col-md-2 col-sm-6">
1036
  <div class="form-group">
1037
  <label for="cashcred-pending-payment-gateway"><?php esc_html_e( 'Gateway', 'mycred' ); ?></label>
1038
+ <select name="cashcred_pending_payment[gateway]" <?php echo esc_attr( $disabled ); ?> id="cashcred-pending-payment-gateway" class="form-control disabled_fields">
1039
  <?php
1040
 
1041
  foreach ( $mycred_modules['solo']['cashcred']->get() as $gateway_id => $info ) {
1042
 
1043
+ echo '<option value="' . esc_attr( $gateway_id ) . '"';
1044
  if ( $pending_payment->gateway_id == $gateway_id ) echo ' selected="selected"';
1045
  if ( ! $mycred_modules['solo']['cashcred']->is_active( $gateway_id ) ) echo ' disabled="disabled"';
1046
+ echo '>' . esc_html( $info['title'] ) . '</option>';
1047
 
1048
  }
1049
 
1054
  <div class="<?php echo $cashcred_setting['fees']['use'] == 1 ? 'col-md-1 col-sm-5' : 'col-md-2 col-sm-6' ?>">
1055
  <div class="form-group">
1056
  <label for="cashcred-pending-payment-points"><?php esc_html_e( 'Points', 'mycred' ); ?></label>
1057
+ <input type="text" <?php echo esc_attr( $readonly ); ?> name="cashcred_pending_payment[points]" id="cashcred-pending-payment-points" class="form-control readonly_fields" value="<?php echo esc_attr( $mycred->number( $pending_payment->points ) ); ?>" />
1058
  </div>
1059
  </div>
1060
  <?php
1064
  <div class="col-md-1 col-sm-5">
1065
  <div class="form-group">
1066
  <label for="cashcred-pending-payment-fee"><?php esc_html_e( 'Fee', 'mycred' ); ?></label>
1067
+ <input type="text" <?php echo esc_attr( $readonly ); ?> name="cashcred_pending_payment[fee]" id="cashcred-pending-payment-fee" class="form-control readonly_fields" value="<?php echo esc_attr( $fee ); ?>" readonly/>
1068
  </div>
1069
  </div><?php
1070
  }
1073
  <div class="<?php echo $cashcred_setting['fees']['use'] == 1 ? 'col-md-1 col-sm-5' : 'col-md-2 col-sm-6'; ?>">
1074
  <div class="form-group">
1075
  <label for="cashcred-pending-payment-cost"><?php esc_html_e( 'Cost', 'mycred' ); ?></label>
1076
+ <input type="text" <?php echo esc_attr( $readonly ); ?> name="cashcred_pending_payment[cost]" id="cashcred-pending-payment-cost" class="form-control readonly_fields" value="<?php echo esc_attr( $pending_payment->cost ); ?>" />
1077
  </div>
1078
  </div>
1079
  <div class="<?php echo $cashcred_setting['fees']['use'] == 1 ? 'col-md-1 col-sm-5' : 'col-md-2 col-sm-6'; ?>">
1080
  <div class="form-group">
1081
  <label for="cashcred-pending-payment-currency"><?php esc_html_e( 'Currency', 'mycred' ); ?></label>
1082
+ <input type="text" <?php echo esc_attr( $readonly ); ?> name="cashcred_pending_payment[currency]" id="cashcred-pending-payment-currency" class="form-control readonly_fields" value="<?php echo esc_attr( $pending_payment->currency ); ?>" />
1083
  </div>
1084
  </div>
1085
  </div>
1116
 
1117
  $comment_date = isset( $comment->comment_date_gmt ) ? $comment->comment_date_gmt : $post->post_date;
1118
 
1119
+ echo '<li><time>' . esc_html( $comment_date ) . '</time><p>' . esc_html( $comment->comment_content ) . '</p></li>';
1120
 
1121
  }
1122
 
1136
  $pending_payment = $_POST['cashcred_pending_payment'];
1137
 
1138
  $old_status = mycred_get_post_meta( $post_id, 'status', true );
1139
+ $new_status = isset( $_POST['status'] ) ? sanitize_text_field( wp_unslash( $_POST['status'] ) ) : '';
1140
+ $user_id = isset( $_POST['user_id'] ) ? absint( $_POST['user_id'] ) : 0;
1141
+ $user_settings = mycred_get_user_meta( $user_id, cashcred_get_user_settings(), '', true );
1142
  $updated_user_settings = $_POST['cashcred_user_settings'];
1143
+
1144
  $changed_fields = array();
1145
 
1146
  $withdraw_request_messages = array(
1153
 
1154
  mycred_cashcred_update_status( $post_id, 'status', $new_status );
1155
 
1156
+ mycred_update_user_meta( $user_id, cashcred_get_user_settings(), '', $updated_user_settings );
1157
 
1158
  foreach ( $pending_payment as $meta_key => $meta_value ) {
1159
 
addons/coupons/myCRED-addon-coupons.php CHANGED
@@ -511,6 +511,23 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
511
  else
512
  $mycred = $this->core;
513
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  ?>
515
  <div class="form">
516
  <div class="row">
@@ -526,7 +543,7 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
526
  <label for=""><?php esc_html_e( 'Point Type', 'mycred' ); ?></label>
527
  <?php if ( count( $this->point_types ) > 1 ) : ?>
528
 
529
- <?php mycred_types_select_from_dropdown( 'mycred_coupon[type]', 'mycred-coupon-type', $coupon->point_type, false, ' class="form-control"' ); ?><br />
530
  <span class="description"><?php esc_html_e( 'Select the point type that this coupon is applied.', 'mycred' ); ?></span>
531
 
532
  <?php else : ?>
@@ -564,6 +581,12 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
564
  else
565
  $mycred = $this->core;
566
 
 
 
 
 
 
 
567
  ?>
568
  <div class="form">
569
  <div class="row">
@@ -571,7 +594,16 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
571
  <div class="form-group">
572
  <label for="mycred-coupon-global"><?php esc_html_e( 'Global Maximum', 'mycred' ); ?></label>
573
  <input type="text" name="mycred_coupon[global]" class="form-control" id="mycred-coupon-global" value="<?php echo absint( $coupon->max_global ); ?>" />
574
- <span class="description"><?php esc_html_e( 'The maximum number of times this coupon can be used in total. Once this is reached, the coupon is automatically trashed. If 0 is selected then the coupon will not work and will automatically expire. For more info please read the <a href="https://codex.mycred.me/chapter-iii/coupons/creating-coupons/">Description</a>', 'mycred' ); ?></span>
 
 
 
 
 
 
 
 
 
575
  </div>
576
  </div>
577
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -596,6 +628,24 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
596
 
597
  $coupon = mycred_get_coupon( $post->ID );
598
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
  if ( $coupon->point_type != $this->core->cred_id )
600
  $mycred = mycred( $coupon->point_type );
601
  else
@@ -609,7 +659,8 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
609
  <label for="mycred-coupon-min_balance"><?php esc_html_e( 'Minimum Balance', 'mycred' ); ?></label>
610
  <div>
611
  <input type="text" name="mycred_coupon[min_balance]" <?php if ( count( $this->point_types ) > 1 ) echo 'size="8"'; else echo ' style="width: 99%;"'; ?> id="mycred-coupon-min_balance" value="<?php echo esc_attr( $mycred->number( $coupon->requires_min['value'] ) ); ?>" />
612
- <?php echo mycred_types_select_from_dropdown( 'mycred_coupon[min_balance_type]', 'mycred-coupon-min_balance_type', $coupon->requires_min_type, true, ' style="vertical-align: top;"' ); ?>
 
613
  </div>
614
  <span class="description"><?php esc_html_e( 'Optional minimum balance a user must have in order to use this coupon. Use zero to disable.', 'mycred' ); ?></span>
615
  </div>
@@ -620,8 +671,8 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
620
  <div class="form-group">
621
  <label for="mycred-coupon-max_balance"><?php esc_html_e( 'Maximum Balance', 'mycred' ); ?></label>
622
  <div>
623
- <input type="text" name="mycred_coupon[max_balance]" <?php if ( count( $this->point_types ) > 1 ) echo 'size="8"'; else echo ' style="width: 99%;"'; ?> id="mycred-coupon-max_balance" value="<?php echo $mycred->number( $coupon->requires_max['value'] ); ?>" />
624
- <?php echo mycred_types_select_from_dropdown( 'mycred_coupon[max_balance_type]', 'mycred-coupon-max_balance_type', $coupon->requires_max_type, true, ' style="vertical-align: top;"' ); ?>
625
  </div>
626
  <span class="description"><?php esc_html_e( 'Optional maximum balance a user can have in order to use this coupon. Use zero to disable.', 'mycred' ); ?></span>
627
  </div>
@@ -654,6 +705,41 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
654
  $ranks = mycred_get_ranks();
655
  $manual_rank = mycred_manual_ranks( $coupon->point_type );
656
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  ob_start(); ?>
658
  <div class="mycred-border" >
659
  <div class="row">
@@ -720,14 +806,13 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
720
  <label class="mycred-rank-msg">
721
  <strong><?php esc_html_e( 'You can only assign Ranks when Ranks are set to Manual Mode.: ', 'mycred' ); ?></strong>
722
  </label><?php
723
-
724
  if( ! empty( $types_ids ) ) {
725
  foreach ( $types_ids[0] as $keys => $values ) {
726
- echo $this->mycred_coupon_badge_rank_html( $values['types'], $values['ids'], $manual_rank );
727
  }
728
  }
729
  else {
730
- echo $html;
731
  }?>
732
 
733
  <div><button type="button" class="mycred-addmore-button button-secondary">Add More</button></div>
@@ -806,12 +891,12 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
806
  if( $selected_type == 'badge' ){
807
  foreach ($badge_id as $key => $value) {
808
  $badges = mycred_get_badge( $value );?>
809
- <option value="<?php echo $value ?>" <?php echo $ids == $value ? 'selected="selected"' : ''; ?>><?php esc_html_e( $badges->title ) ?></option><?php
810
  }
811
  }elseif( $selected_type == 'rank' ) {
812
 
813
  foreach ( $ranks as $key => $value ) { ?>
814
- <option value="<?php echo $value->post_id ?>" <?php echo $ids == $value->post_id ? 'selected="selected"' : ''; ?>><?php esc_html_e( $value->post->post_title ) ?></option><?php
815
  }
816
  }
817
  ?>
@@ -831,7 +916,7 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
831
 
832
  public function mycred_change_dropdown_ajax_handler() {
833
 
834
- $value = sanitize_text_field( $_POST['value'] );
835
 
836
  if( class_exists( 'myCRED_Badge' ) ) {
837
  $badge_id = mycred_get_badge_ids();
@@ -852,9 +937,7 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
852
 
853
  }
854
 
855
- $ids_title = json_encode( $ids_title );
856
-
857
- echo $ids_title;
858
  wp_die();
859
  }
860
 
@@ -869,9 +952,7 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
869
 
870
  }
871
 
872
- $ids_title = json_encode( $ids_title );
873
-
874
- echo $ids_title;
875
  wp_die();
876
  }
877
 
@@ -897,7 +978,7 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
897
  $page .= '_' . $set_type;
898
 
899
  $url = add_query_arg( array( 'page' => $page, 'ref' => 'coupon', 'data' => $post->post_title ), admin_url( 'admin.php' ) );
900
- echo '<a href="' . esc_url( $url ) . '">' . sprintf( _n( '1 time', '%d times', $count, 'mycred' ), $count ) . '</a>';
901
 
902
  }
903
 
@@ -978,64 +1059,64 @@ if ( ! class_exists( 'myCRED_Coupons_Module' ) ) :
978
  <div class="row">
979
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
980
  <div class="form-group">
981
- <label for="<?php echo $this->field_id( 'invalid' ); ?>"><?php esc_html_e( 'Invalid Coupon Message', 'mycred' ); ?></label>
982
- <input type="text" name="<?php echo $this->field_name( 'invalid' ); ?>" id="<?php echo $this->field_id( 'invalid' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['invalid'] ); ?>" />
983
- <p><span class="description"><?php printf( '%s %s', __( 'Message to show when users try to use a coupon that does not exists.', 'mycred' ), $this->available_template_tags( array( 'general' ) ) ); ?></span></p>
984
  </div>
985
  </div>
986
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
987
  <div class="form-group">
988
- <label for="<?php echo $this->field_id( 'expired' ); ?>"><?php esc_html_e( 'Expired Coupon Message', 'mycred' ); ?></label>
989
- <input type="text" name="<?php echo $this->field_name( 'expired' ); ?>" id="<?php echo $this->field_id( 'expired' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['expired'] ); ?>" />
990
- <p><span class="description"><?php printf( '%s %s', __( 'Message to show when users try to use that has expired.', 'mycred' ), $this->available_template_tags( array( 'general' ) ) ); ?></span></p>
991
  </div>
992
  </div>
993
  </div>
994
  <div class="row">
995
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
996
  <div class="form-group">
997
- <label for="<?php echo $this->field_id( 'min' ); ?>"><?php esc_html_e( 'Minimum Balance Message', 'mycred' ); ?></label>
998
- <input type="text" name="<?php echo $this->field_name( 'min' ); ?>" id="<?php echo $this->field_id( 'min' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['min'] ); ?>" />
999
- <p><span class="description"><?php printf( '%s %s', __( 'Message to show when a user does not meet the minimum balance requirement. (if used)', 'mycred' ), $this->available_template_tags( array( 'general' ) ) ); ?></span></p>
1000
  </div>
1001
  </div>
1002
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1003
  <div class="form-group">
1004
- <label for="<?php echo $this->field_id( 'max' ); ?>"><?php esc_html_e( 'Maximum Balance Message', 'mycred' ); ?></label>
1005
- <input type="text" name="<?php echo $this->field_name( 'max' ); ?>" id="<?php echo $this->field_id( 'max' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['max'] ); ?>" />
1006
- <p><span class="description"><?php printf( '%s %s', __( 'Message to show when a user does not meet the maximum balance requirement. (if used)', 'mycred' ), $this->available_template_tags( array( 'general' ) ) ); ?></span></p>
1007
  </div>
1008
  </div>
1009
  </div>
1010
  <div class="row">
1011
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1012
  <div class="form-group">
1013
- <label for="<?php echo $this->field_id( 'user_limit' ); ?>"><?php esc_html_e( 'User Limit Message', 'mycred' ); ?></label>
1014
- <input type="text" name="<?php echo $this->field_name( 'user_limit' ); ?>" id="<?php echo $this->field_id( 'user_limit' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['user_limit'] ); ?>" />
1015
- <p><span class="description"><?php printf( '%s %s', __( 'Message to show when the user limit has been reached for the coupon.', 'mycred' ), $this->available_template_tags( array( 'general' ) ) ); ?></span></p>
1016
  </div>
1017
  </div>
1018
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1019
  <div class="form-group">
1020
- <label for="<?php echo $this->field_id( 'excluded' ); ?>"><?php esc_html_e( 'Excluded Message', 'mycred' ); ?></label>
1021
- <input type="text" name="<?php echo $this->field_name( 'excluded' ); ?>" id="<?php echo $this->field_id( 'excluded' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['excluded'] ); ?>" />
1022
- <p><span class="description"><?php printf( '%s %s', __( 'Message to show when a user is excluded from the point type the coupon gives.', 'mycred' ), $this->available_template_tags( array( 'general' ) ) ); ?></span></p>
1023
  </div>
1024
  </div>
1025
  </div>
1026
  <div class="row">
1027
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1028
  <div class="form-group">
1029
- <label for="<?php echo $this->field_id( 'success' ); ?>"><?php esc_html_e( 'Success Message', 'mycred' ); ?></label>
1030
- <input type="text" name="<?php echo $this->field_name( 'success' ); ?>" id="<?php echo $this->field_id( 'success' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['success'] ); ?>" />
1031
- <p><span class="description"><?php printf( '%s %s', __( 'Message to show when a coupon was successfully deposited to a users account.', 'mycred' ), $this->available_template_tags( array( 'general', 'amount' ) ) ); ?></span></p>
1032
  </div>
1033
  </div>
1034
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1035
  <div class="form-group">
1036
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
1037
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" />
1038
- <p><span class="description"><?php printf( '%s %s', __( 'Log entry for successful coupon redemption. Use %coupon% to show the coupon code.', 'mycred' ), $this->available_template_tags( array( 'general', 'amount' ) ) ); ?></span></p>
1039
  </div>
1040
  </div>
1041
  </div>
511
  else
512
  $mycred = $this->core;
513
 
514
+ $allowed_html = array(
515
+ 'input' => array(
516
+ 'type' => array(),
517
+ 'value' => array(),
518
+ 'name' => array()
519
+ ),
520
+ 'select' => array(
521
+ 'name' => array(),
522
+ 'id' => array(),
523
+ 'style' => array(),
524
+ ),
525
+ 'option' => array(
526
+ 'value' => array(),
527
+ 'selected' => array()
528
+ )
529
+ );
530
+
531
  ?>
532
  <div class="form">
533
  <div class="row">
543
  <label for=""><?php esc_html_e( 'Point Type', 'mycred' ); ?></label>
544
  <?php if ( count( $this->point_types ) > 1 ) : ?>
545
 
546
+ <?php wp_kses( mycred_types_select_from_dropdown( 'mycred_coupon[type]', 'mycred-coupon-type', $coupon->point_type, false, ' class="form-control"' ), $allowed_html ); ?><br />
547
  <span class="description"><?php esc_html_e( 'Select the point type that this coupon is applied.', 'mycred' ); ?></span>
548
 
549
  <?php else : ?>
581
  else
582
  $mycred = $this->core;
583
 
584
+ $allowed_html = array(
585
+ 'a' => array(
586
+ 'href' => array(),
587
+ )
588
+ );
589
+
590
  ?>
591
  <div class="form">
592
  <div class="row">
594
  <div class="form-group">
595
  <label for="mycred-coupon-global"><?php esc_html_e( 'Global Maximum', 'mycred' ); ?></label>
596
  <input type="text" name="mycred_coupon[global]" class="form-control" id="mycred-coupon-global" value="<?php echo absint( $coupon->max_global ); ?>" />
597
+ <span class="description">
598
+ <?php
599
+ printf(
600
+ '%s <a href="%s">%s</a>' ,
601
+ esc_html__( 'The maximum number of times this coupon can be used in total. Once this is reached, the coupon is automatically trashed. If 0 is selected then the coupon will not work and will automatically expire. For more info please read the', 'mycred' ),
602
+ esc_url( 'https://codex.mycred.me/chapter-iii/coupons/creating-coupons/' ),
603
+ esc_html__( 'Description', 'mycred' )
604
+ );
605
+ ?>
606
+ </span>
607
  </div>
608
  </div>
609
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
628
 
629
  $coupon = mycred_get_coupon( $post->ID );
630
 
631
+ $allowed_html =
632
+ array(
633
+ 'input' => array(
634
+ 'type' => array(),
635
+ 'value' => array(),
636
+ 'name' => array()
637
+ ),
638
+ 'select' => array(
639
+ 'name' => array(),
640
+ 'id' => array(),
641
+ 'style' => array(),
642
+ ),
643
+ 'option' => array(
644
+ 'value' => array(),
645
+ 'selected' => array()
646
+ )
647
+ );
648
+
649
  if ( $coupon->point_type != $this->core->cred_id )
650
  $mycred = mycred( $coupon->point_type );
651
  else
659
  <label for="mycred-coupon-min_balance"><?php esc_html_e( 'Minimum Balance', 'mycred' ); ?></label>
660
  <div>
661
  <input type="text" name="mycred_coupon[min_balance]" <?php if ( count( $this->point_types ) > 1 ) echo 'size="8"'; else echo ' style="width: 99%;"'; ?> id="mycred-coupon-min_balance" value="<?php echo esc_attr( $mycred->number( $coupon->requires_min['value'] ) ); ?>" />
662
+ <?php echo wp_kses( mycred_types_select_from_dropdown( 'mycred_coupon[min_balance_type]', 'mycred-coupon-min_balance_type', $coupon->requires_min_type, true, ' style="vertical-align: top;"' ), $allowed_html ); ?>
663
+
664
  </div>
665
  <span class="description"><?php esc_html_e( 'Optional minimum balance a user must have in order to use this coupon. Use zero to disable.', 'mycred' ); ?></span>
666
  </div>
671
  <div class="form-group">
672
  <label for="mycred-coupon-max_balance"><?php esc_html_e( 'Maximum Balance', 'mycred' ); ?></label>
673
  <div>
674
+ <input type="text" name="mycred_coupon[max_balance]" <?php if ( count( $this->point_types ) > 1 ) echo 'size="8"'; else echo ' style="width: 99%;"'; ?> id="mycred-coupon-max_balance" value="<?php echo esc_attr( $mycred->number( $coupon->requires_max['value'] ) ); ?>" />
675
+ <?php echo wp_kses( mycred_types_select_from_dropdown( 'mycred_coupon[max_balance_type]', 'mycred-coupon-max_balance_type', $coupon->requires_max_type, true, ' style="vertical-align: top;"' ), $allowed_html ); ?>
676
  </div>
677
  <span class="description"><?php esc_html_e( 'Optional maximum balance a user can have in order to use this coupon. Use zero to disable.', 'mycred' ); ?></span>
678
  </div>
705
  $ranks = mycred_get_ranks();
706
  $manual_rank = mycred_manual_ranks( $coupon->point_type );
707
  }
708
+
709
+ $allowed_html = array(
710
+ 'input' => array(
711
+ 'type' => array(),
712
+ 'value' => array(),
713
+ 'name' => array(),
714
+ 'id' => array()
715
+ ),
716
+ 'select' => array(
717
+ 'name' => array(),
718
+ 'class' => array(),
719
+ 'id' => array(),
720
+ 'style' => array(),
721
+ ),
722
+ 'option' => array(
723
+ 'value' => array(),
724
+ 'selected' => array()
725
+ ),
726
+ 'button' => array(
727
+ 'type' => array(),
728
+ 'class' => array()
729
+ ),
730
+ 'div' => array(
731
+ 'class' => array()
732
+ ),
733
+ 'label' => array(
734
+ 'for' => array(),
735
+ 'id' => array(),
736
+ 'class' => array(),
737
+ ),
738
+ 'strong' => array(),
739
+ 'span' => array(
740
+ 'class' => array()
741
+ ),
742
+ );
743
  ob_start(); ?>
744
  <div class="mycred-border" >
745
  <div class="row">
806
  <label class="mycred-rank-msg">
807
  <strong><?php esc_html_e( 'You can only assign Ranks when Ranks are set to Manual Mode.: ', 'mycred' ); ?></strong>
808
  </label><?php
 
809
  if( ! empty( $types_ids ) ) {
810
  foreach ( $types_ids[0] as $keys => $values ) {
811
+ echo wp_kses( $this->mycred_coupon_badge_rank_html( $values['types'], $values['ids'], $manual_rank ), $allowed_html );
812
  }
813
  }
814
  else {
815
+ echo wp_kses( $html, $allowed_html );
816
  }?>
817
 
818
  <div><button type="button" class="mycred-addmore-button button-secondary">Add More</button></div>
891
  if( $selected_type == 'badge' ){
892
  foreach ($badge_id as $key => $value) {
893
  $badges = mycred_get_badge( $value );?>
894
+ <option value="<?php echo esc_attr( $value ); ?>" <?php echo $ids == $value ? 'selected="selected"' : ''; ?>><?php esc_html_e( $badges->title ) ?></option><?php
895
  }
896
  }elseif( $selected_type == 'rank' ) {
897
 
898
  foreach ( $ranks as $key => $value ) { ?>
899
+ <option value="<?php echo esc_attr( $value->post_id ); ?>" <?php echo $ids == $value->post_id ? 'selected="selected"' : ''; ?>><?php esc_html_e( $value->post->post_title ) ?></option><?php
900
  }
901
  }
902
  ?>
916
 
917
  public function mycred_change_dropdown_ajax_handler() {
918
 
919
+ $value = isset( $_POST['value'] ) ? sanitize_text_field( wp_unslash( $_POST['value'] ) ) : '';
920
 
921
  if( class_exists( 'myCRED_Badge' ) ) {
922
  $badge_id = mycred_get_badge_ids();
937
 
938
  }
939
 
940
+ echo wp_json_encode( $ids_title );
 
 
941
  wp_die();
942
  }
943
 
952
 
953
  }
954
 
955
+ echo wp_json_encode( $ids_title );
 
 
956
  wp_die();
957
  }
958
 
978
  $page .= '_' . $set_type;
979
 
980
  $url = add_query_arg( array( 'page' => $page, 'ref' => 'coupon', 'data' => $post->post_title ), admin_url( 'admin.php' ) );
981
+ echo '<a href="' . esc_url( $url ) . '">' . sprintf( esc_html( _n( '1 time', '%d times', $count, 'mycred' ) ), esc_html( $count ) ) . '</a>';
982
 
983
  }
984
 
1059
  <div class="row">
1060
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1061
  <div class="form-group">
1062
+ <label for="<?php echo esc_attr( $this->field_id( 'invalid' ) ); ?>"><?php esc_html_e( 'Invalid Coupon Message', 'mycred' ); ?></label>
1063
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'invalid' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'invalid' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['invalid'] ); ?>" />
1064
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Message to show when users try to use a coupon that does not exists.', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general' ) ) ) ); ?></span></p>
1065
  </div>
1066
  </div>
1067
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1068
  <div class="form-group">
1069
+ <label for="<?php echo esc_attr( $this->field_id( 'expired' ) ); ?>"><?php esc_html_e( 'Expired Coupon Message', 'mycred' ); ?></label>
1070
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'expired' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'expired' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['expired'] ); ?>" />
1071
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Message to show when users try to use that has expired.', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general' ) ) ) ); ?></span></p>
1072
  </div>
1073
  </div>
1074
  </div>
1075
  <div class="row">
1076
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1077
  <div class="form-group">
1078
+ <label for="<?php echo esc_attr( $this->field_id( 'min' ) ); ?>"><?php esc_html_e( 'Minimum Balance Message', 'mycred' ); ?></label>
1079
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'min' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'min' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['min'] ); ?>" />
1080
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Message to show when a user does not meet the minimum balance requirement. (if used)', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general' ) ) ) ); ?></span></p>
1081
  </div>
1082
  </div>
1083
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1084
  <div class="form-group">
1085
+ <label for="<?php echo esc_attr( $this->field_id( 'max' ) ); ?>"><?php esc_html_e( 'Maximum Balance Message', 'mycred' ); ?></label>
1086
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'max' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'max' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['max'] ); ?>" />
1087
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Message to show when a user does not meet the maximum balance requirement. (if used)', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general' ) ) ) ); ?></span></p>
1088
  </div>
1089
  </div>
1090
  </div>
1091
  <div class="row">
1092
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1093
  <div class="form-group">
1094
+ <label for="<?php echo esc_attr( $this->field_id( 'user_limit' ) ); ?>"><?php esc_html_e( 'User Limit Message', 'mycred' ); ?></label>
1095
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'user_limit' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'user_limit' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['user_limit'] ); ?>" />
1096
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Message to show when the user limit has been reached for the coupon.', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general' ) ) ) ); ?></span></p>
1097
  </div>
1098
  </div>
1099
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1100
  <div class="form-group">
1101
+ <label for="<?php echo esc_attr( $this->field_id( 'excluded' ) ); ?>"><?php esc_html_e( 'Excluded Message', 'mycred' ); ?></label>
1102
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'excluded' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'excluded' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['excluded'] ); ?>" />
1103
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Message to show when a user is excluded from the point type the coupon gives.', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general' ) ) ) ); ?></span></p>
1104
  </div>
1105
  </div>
1106
  </div>
1107
  <div class="row">
1108
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1109
  <div class="form-group">
1110
+ <label for="<?php echo esc_attr( $this->field_id( 'success' ) ); ?>"><?php esc_html_e( 'Success Message', 'mycred' ); ?></label>
1111
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'success' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'success' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['success'] ); ?>" />
1112
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Message to show when a coupon was successfully deposited to a users account.', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general', 'amount' ) ) ) ); ?></span></p>
1113
  </div>
1114
  </div>
1115
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1116
  <div class="form-group">
1117
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
1118
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" />
1119
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Log entry for successful coupon redemption. Use %coupon% to show the coupon code.', 'mycred' ), wp_kses_post( $this->available_template_tags( array( 'general', 'amount' ) ) ) ); ?></span></p>
1120
  </div>
1121
  </div>
1122
  </div>
addons/email-notices/myCRED-addon-email-notices.php CHANGED
@@ -643,15 +643,35 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
643
  <label for="mycred-email-ctype"><?php esc_html_e( 'Point Types', 'mycred' ); ?></label>
644
  <?php
645
 
646
-
647
-
648
  if ( count( $this->point_types ) > 1 ) {
649
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
650
  $point_types_html = mycred_types_select_from_checkboxes( 'mycred_email[ctype][]', 'mycred-email-ctype', $email->point_types, true );
651
 
652
-
653
- echo apply_filters( 'mycred_point_type_checkbox', $point_types_html );
654
-
655
  }
656
 
657
  else {
@@ -907,7 +927,7 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
907
  $point_types = array();
908
 
909
  // Generic
910
- if ( $_POST['mycred_email']['instance'] != '' && $_POST['mycred_email']['instance'] != 'custom' ) {
911
 
912
  $instance = sanitize_key( $_POST['mycred_email']['instance'] );
913
  if ( ! array_key_exists( $instance, $instances ) )
@@ -923,7 +943,7 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
923
  elseif ( $_POST['mycred_email']['instance'] != '' ) {
924
 
925
  $event = 'specific';
926
- $reference = sanitize_key( $_POST['mycred_email']['reference'] );
927
 
928
  // Based on built-in reference
929
  if ( array_key_exists( $reference, $references ) )
@@ -933,7 +953,8 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
933
  else {
934
 
935
  $reference_list = array();
936
- $custom_reference = explode( ',', sanitize_text_field( $_POST['mycred_email']['custom_reference'] ) );
 
937
 
938
  foreach ( $custom_reference as $reference_id ) {
939
 
@@ -954,16 +975,16 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
954
 
955
  // Construct new settings
956
  if ( ! empty( $_POST['mycred_email']['recipient'] ) )
957
- $settings['recipient'] = sanitize_text_field( $_POST['mycred_email']['recipient'] );
958
 
959
  if ( ! empty( $_POST['mycred_email']['senders_name'] ) )
960
- $settings['senders_name'] = sanitize_text_field( $_POST['mycred_email']['senders_name'] );
961
 
962
  if ( ! empty( $_POST['mycred_email']['senders_email'] ) )
963
- $settings['senders_email'] = sanitize_text_field( $_POST['mycred_email']['senders_email'] );
964
 
965
  if ( ! empty( $_POST['mycred_email']['reply_to'] ) )
966
- $settings['reply_to'] = sanitize_text_field( $_POST['mycred_email']['reply_to'] );
967
 
968
  $email->save_settings( $settings );
969
 
@@ -1007,7 +1028,7 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
1007
 
1008
  // Save styling
1009
  if ( ! empty( $_POST['mycred_email']['styling'] ) )
1010
- mycred_update_post_meta( $post_id, 'mycred_email_styling', wp_kses_post( $_POST['mycred_email']['styling'] ) );
1011
 
1012
  do_action( 'mycred_save_email_notice', $post_id );
1013
  }
@@ -1233,10 +1254,10 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
1233
  <h3><?php esc_html_e( 'Format', 'mycred' ); ?></h3>
1234
  <div class="form-group">
1235
  <div class="radio">
1236
- <label for="<?php echo $this->field_id( array( 'use_html' => 'no' ) ); ?>"><input type="radio" name="<?php echo $this->field_name( 'use_html' ); ?>" id="<?php echo $this->field_id( array( 'use_html' => 'no' ) ); ?>" <?php checked( $this->emailnotices['use_html'], 0 ); ?> value="0" /> <?php esc_html_e( 'Plain Text', 'mycred' ); ?></label>
1237
  </div>
1238
  <div class="radio">
1239
- <label for="<?php echo $this->field_id( array( 'use_html' => 'yes' ) ); ?>"><input type="radio" name="<?php echo $this->field_name( 'use_html' ); ?>" id="<?php echo $this->field_id( array( 'use_html' => 'yes' ) ); ?>" <?php checked( $this->emailnotices['use_html'], 1 ); ?> value="1" /> HTML</label>
1240
  </div>
1241
  </div>
1242
  </div>
@@ -1244,17 +1265,17 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
1244
  <h3><?php esc_html_e( 'Schedule', 'mycred' ); ?></h3>
1245
  <div class="form-group">
1246
  <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
1247
- <input type="hidden" name="<?php echo $this->field_name( 'send' ); ?>" value="" />
1248
  <p class="form-control-static"><?php esc_html_e( 'WordPress Cron is disabled. Emails will be sent immediately.', 'mycred' ); ?></p>
1249
  <?php else : ?>
1250
  <div class="radio">
1251
- <label for="<?php echo $this->field_id( 'send' ); ?>"><input type="radio" name="<?php echo $this->field_name( 'send' ); ?>" id="<?php echo $this->field_id( 'send' ); ?>" <?php checked( $this->emailnotices['send'], '' ); ?> value="" /> <?php esc_html_e( 'Send emails immediately', 'mycred' ); ?></label>
1252
  </div>
1253
  <div class="radio">
1254
- <label for="<?php echo $this->field_id( 'send' ); ?>-hourly"><input type="radio" name="<?php echo $this->field_name( 'send' ); ?>" id="<?php echo $this->field_id( 'send' ); ?>-hourly" <?php checked( $this->emailnotices['send'], 'hourly' ); ?> value="hourly" /> <?php esc_html_e( 'Send emails once an hour', 'mycred' ); ?></label>
1255
  </div>
1256
  <div class="radio">
1257
- <label for="<?php echo $this->field_id( 'send' ); ?>-daily"><input type="radio" name="<?php echo $this->field_name( 'send' ); ?>" id="<?php echo $this->field_id( 'send' ); ?>-daily" <?php checked( $this->emailnotices['send'], 'daily' ); ?> value="daily" /> <?php esc_html_e( 'Send emails once a day', 'mycred' ); ?></label>
1258
  </div>
1259
  <?php endif; ?>
1260
  </div>
@@ -1263,10 +1284,10 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
1263
  <h3><?php esc_html_e( 'Advanced', 'mycred' ); ?></h3>
1264
  <div class="form-group">
1265
  <div class="checkbox">
1266
- <label for="<?php echo $this->field_id( array( 'filter' => 'subject' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'filter' => 'subject' ) ); ?>" id="<?php echo $this->field_id( array( 'filter' => 'subject' ) ); ?>" <?php checked( $this->emailnotices['filter']['subject'], 1 ); ?> value="1" /> <?php esc_html_e( 'Filter Email Subjects', 'mycred' ); ?></label>
1267
  </div>
1268
  <div class="checkbox">
1269
- <label for="<?php echo $this->field_id( array( 'filter' => 'content' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'filter' => 'content' ) ); ?>" id="<?php echo $this->field_id( array( 'filter' => 'content' ) ); ?>" <?php checked( $this->emailnotices['filter']['content'], 1 ); ?> value="1" /> <?php esc_html_e( 'Filter Email Body', 'mycred' ); ?></label>
1270
  </div>
1271
  </div>
1272
  </div>
@@ -1275,7 +1296,7 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
1275
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1276
  <div class="form-group">
1277
  <div class="checkbox">
1278
- <label for="<?php echo $this->field_id( 'override' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'override' ); ?>" id="<?php echo $this->field_id( 'override' ); ?>" <?php checked( $this->emailnotices['override'], 1 ); ?> value="1" /> <?php esc_html_e( 'SMTP Debug. Enable if you are experiencing issues with wp_mail() or if you use a SMTP plugin for emails.', 'mycred' ); ?></label>
1279
  </div>
1280
  </div>
1281
  </div>
@@ -1292,28 +1313,28 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
1292
  <div class="row">
1293
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1294
  <div class="form-group">
1295
- <label for="<?php echo $this->field_id( array( 'from' => 'name' ) ); ?>"><?php esc_html_e( 'Senders Name:', 'mycred' ); ?></label>
1296
- <input type="text" name="<?php echo $this->field_name( array( 'from' => 'name' ) ); ?>" id="<?php echo $this->field_id( array( 'from' => 'name' ) ); ?>" value="<?php echo esc_attr( $this->emailnotices['from']['name'] ); ?>" class="form-control" />
1297
  </div>
1298
  </div>
1299
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1300
  <div class="form-group">
1301
- <label for="<?php echo $this->field_id( array( 'from' => 'email' ) ); ?>"><?php esc_html_e( 'Senders Email:', 'mycred' ); ?></label>
1302
- <input type="text" name="<?php echo $this->field_name( array( 'from' => 'email' ) ); ?>" id="<?php echo $this->field_id( array( 'from' => 'email' ) ); ?>" value="<?php echo esc_attr( $this->emailnotices['from']['email'] ); ?>" class="form-control" />
1303
  </div>
1304
  </div>
1305
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1306
  <div class="form-group">
1307
- <label for="<?php echo $this->field_id( array( 'from' => 'reply_to' ) ); ?>"><?php esc_html_e( 'Reply-To:', 'mycred' ); ?></label>
1308
- <input type="text" name="<?php echo $this->field_name( array( 'from' => 'reply_to' ) ); ?>" id="<?php echo $this->field_id( array( 'from' => 'reply_to' ) ); ?>" value="<?php echo esc_attr( $this->emailnotices['from']['reply_to'] ); ?>" class="form-control" />
1309
  </div>
1310
  </div>
1311
  </div>
1312
  <div class="row">
1313
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1314
  <div class="form-group">
1315
- <label for="<?php echo $this->field_id( 'content' ); ?>"><?php esc_html_e( 'Default Email Content', 'mycred' ); ?></label>
1316
- <textarea rows="10" cols="50" name="<?php echo $this->field_name( 'content' ); ?>" id="<?php echo $this->field_id( 'content' ); ?>" class="form-control"><?php echo esc_attr( $this->emailnotices['content'] ); ?></textarea>
1317
  <p><span class="description"><?php esc_html_e( 'Default email content.', 'mycred' ); ?></span></p>
1318
  </div>
1319
  </div>
@@ -1321,8 +1342,8 @@ if ( ! class_exists( 'myCRED_Email_Notice_Module' ) ) :
1321
  <div class="row">
1322
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1323
  <div class="form-group">
1324
- <label for="<?php echo $this->field_id( 'styling' ); ?>"><?php esc_html_e( 'Default CSS Styling', 'mycred' ); ?></label>
1325
- <textarea rows="10" cols="50" name="<?php echo $this->field_name( 'styling' ); ?>" id="<?php echo $this->field_id( 'styling' ); ?>" class="form-control"><?php echo esc_attr( $this->emailnotices['styling'] ); ?></textarea>
1326
  <p><span class="description"><?php esc_html_e( 'Default email CSS styling. Note that if you intend to send HTML emails, you should use inline CSS styling for best results.', 'mycred' ); ?></span></p>
1327
  </div>
1328
  </div>
643
  <label for="mycred-email-ctype"><?php esc_html_e( 'Point Types', 'mycred' ); ?></label>
644
  <?php
645
 
 
 
646
  if ( count( $this->point_types ) > 1 ) {
647
+ $allowed_html = array(
648
+ 'div' => array(
649
+ 'class' => array()
650
+ ),
651
+ 'label' => array(
652
+ 'for' => array()
653
+ ),
654
+ 'input' => array(
655
+ 'type' => array(),
656
+ 'value' => array(),
657
+ 'name' => array(),
658
+ 'id' => array(),
659
+ 'checked' => array()
660
+ ),
661
+ 'select' => array(
662
+ 'name' => array(),
663
+ 'id' => array(),
664
+ 'style' => array(),
665
+ ),
666
+ 'option' => array(
667
+ 'value' => array(),
668
+ 'selected' => array()
669
+ )
670
+ );
671
  $point_types_html = mycred_types_select_from_checkboxes( 'mycred_email[ctype][]', 'mycred-email-ctype', $email->point_types, true );
672
 
673
+ $point_type_html = apply_filters( 'mycred_point_type_checkbox', $point_types_html );
674
+ echo wp_kses( $point_type_html, $allowed_html );
 
675
  }
676
 
677
  else {
927
  $point_types = array();
928
 
929
  // Generic
930
+ if ( isset( $_POST['mycred_email']['instance'] ) && $_POST['mycred_email']['instance'] != '' && $_POST['mycred_email']['instance'] != 'custom' ) {
931
 
932
  $instance = sanitize_key( $_POST['mycred_email']['instance'] );
933
  if ( ! array_key_exists( $instance, $instances ) )
943
  elseif ( $_POST['mycred_email']['instance'] != '' ) {
944
 
945
  $event = 'specific';
946
+ $reference = isset( $_POST['mycred_email']['reference'] ) ? sanitize_key( $_POST['mycred_email']['reference'] ) : '';
947
 
948
  // Based on built-in reference
949
  if ( array_key_exists( $reference, $references ) )
953
  else {
954
 
955
  $reference_list = array();
956
+ $check_reference = isset( $_POST['mycred_email']['custom_reference'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_email']['custom_reference'] ) ) : '';
957
+ $custom_reference = explode( ',', $check_reference );
958
 
959
  foreach ( $custom_reference as $reference_id ) {
960
 
975
 
976
  // Construct new settings
977
  if ( ! empty( $_POST['mycred_email']['recipient'] ) )
978
+ $settings['recipient'] = sanitize_text_field( wp_unslash( $_POST['mycred_email']['recipient'] ) );
979
 
980
  if ( ! empty( $_POST['mycred_email']['senders_name'] ) )
981
+ $settings['senders_name'] = sanitize_text_field( wp_unslash( $_POST['mycred_email']['senders_name'] ) );
982
 
983
  if ( ! empty( $_POST['mycred_email']['senders_email'] ) )
984
+ $settings['senders_email'] = sanitize_text_field( wp_unslash( $_POST['mycred_email']['senders_email'] ) );
985
 
986
  if ( ! empty( $_POST['mycred_email']['reply_to'] ) )
987
+ $settings['reply_to'] = sanitize_text_field( wp_unslash( $_POST['mycred_email']['reply_to'] ) );
988
 
989
  $email->save_settings( $settings );
990
 
1028
 
1029
  // Save styling
1030
  if ( ! empty( $_POST['mycred_email']['styling'] ) )
1031
+ mycred_update_post_meta( $post_id, 'mycred_email_styling', wp_kses_post( wp_unslash( $_POST['mycred_email']['styling'] ) ) );
1032
 
1033
  do_action( 'mycred_save_email_notice', $post_id );
1034
  }
1254
  <h3><?php esc_html_e( 'Format', 'mycred' ); ?></h3>
1255
  <div class="form-group">
1256
  <div class="radio">
1257
+ <label for="<?php echo esc_attr( $this->field_id( array( 'use_html' => 'no' ) ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'use_html' ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'use_html' => 'no' ) ) ); ?>" <?php checked( $this->emailnotices['use_html'], 0 ); ?> value="0" /> <?php esc_html_e( 'Plain Text', 'mycred' ); ?></label>
1258
  </div>
1259
  <div class="radio">
1260
+ <label for="<?php echo esc_attr( $this->field_id( array( 'use_html' => 'yes' ) ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'use_html' ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'use_html' => 'yes' ) ) ); ?>" <?php checked( $this->emailnotices['use_html'], 1 ); ?> value="1" /> HTML</label>
1261
  </div>
1262
  </div>
1263
  </div>
1265
  <h3><?php esc_html_e( 'Schedule', 'mycred' ); ?></h3>
1266
  <div class="form-group">
1267
  <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
1268
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( 'send' ) ); ?>" value="" />
1269
  <p class="form-control-static"><?php esc_html_e( 'WordPress Cron is disabled. Emails will be sent immediately.', 'mycred' ); ?></p>
1270
  <?php else : ?>
1271
  <div class="radio">
1272
+ <label for="<?php echo esc_attr( $this->field_id( 'send' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'send' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'send' ) ); ?>" <?php checked( $this->emailnotices['send'], '' ); ?> value="" /> <?php esc_html_e( 'Send emails immediately', 'mycred' ); ?></label>
1273
  </div>
1274
  <div class="radio">
1275
+ <label for="<?php echo esc_attr( $this->field_id( 'send' ) ); ?>-hourly"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'send' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'send' ) ); ?>-hourly" <?php checked( $this->emailnotices['send'], 'hourly' ); ?> value="hourly" /> <?php esc_html_e( 'Send emails once an hour', 'mycred' ); ?></label>
1276
  </div>
1277
  <div class="radio">
1278
+ <label for="<?php echo esc_attr( $this->field_id( 'send' ) ); ?>-daily"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'send' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'send' ) ); ?>-daily" <?php checked( $this->emailnotices['send'], 'daily' ); ?> value="daily" /> <?php esc_html_e( 'Send emails once a day', 'mycred' ); ?></label>
1279
  </div>
1280
  <?php endif; ?>
1281
  </div>
1284
  <h3><?php esc_html_e( 'Advanced', 'mycred' ); ?></h3>
1285
  <div class="form-group">
1286
  <div class="checkbox">
1287
+ <label for="<?php echo esc_attr( $this->field_id( array( 'filter' => 'subject' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'filter' => 'subject' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'filter' => 'subject' ) ) ); ?>" <?php checked( $this->emailnotices['filter']['subject'], 1 ); ?> value="1" /> <?php esc_html_e( 'Filter Email Subjects', 'mycred' ); ?></label>
1288
  </div>
1289
  <div class="checkbox">
1290
+ <label for="<?php echo esc_attr( $this->field_id( array( 'filter' => 'content' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'filter' => 'content' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'filter' => 'content' ) ) ); ?>" <?php checked( $this->emailnotices['filter']['content'], 1 ); ?> value="1" /> <?php esc_html_e( 'Filter Email Body', 'mycred' ); ?></label>
1291
  </div>
1292
  </div>
1293
  </div>
1296
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1297
  <div class="form-group">
1298
  <div class="checkbox">
1299
+ <label for="<?php echo esc_attr( $this->field_id( 'override' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'override' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'override' ) ); ?>" <?php checked( $this->emailnotices['override'], 1 ); ?> value="1" /> <?php esc_html_e( 'SMTP Debug. Enable if you are experiencing issues with wp_mail() or if you use a SMTP plugin for emails.', 'mycred' ); ?></label>
1300
  </div>
1301
  </div>
1302
  </div>
1313
  <div class="row">
1314
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1315
  <div class="form-group">
1316
+ <label for="<?php echo esc_attr( $this->field_id( array( 'from' => 'name' ) ) ); ?>"><?php esc_html_e( 'Senders Name:', 'mycred' ); ?></label>
1317
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'from' => 'name' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'from' => 'name' ) ) ); ?>" value="<?php echo esc_attr( $this->emailnotices['from']['name'] ); ?>" class="form-control" />
1318
  </div>
1319
  </div>
1320
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1321
  <div class="form-group">
1322
+ <label for="<?php echo esc_attr( $this->field_id( array( 'from' => 'email' ) ) ); ?>"><?php esc_html_e( 'Senders Email:', 'mycred' ); ?></label>
1323
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'from' => 'email' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'from' => 'email' ) ) ); ?>" value="<?php echo esc_attr( $this->emailnotices['from']['email'] ); ?>" class="form-control" />
1324
  </div>
1325
  </div>
1326
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1327
  <div class="form-group">
1328
+ <label for="<?php echo esc_attr( $this->field_id( array( 'from' => 'reply_to' ) ) ); ?>"><?php esc_html_e( 'Reply-To:', 'mycred' ); ?></label>
1329
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'from' => 'reply_to' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'from' => 'reply_to' ) ) ); ?>" value="<?php echo esc_attr( $this->emailnotices['from']['reply_to'] ); ?>" class="form-control" />
1330
  </div>
1331
  </div>
1332
  </div>
1333
  <div class="row">
1334
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1335
  <div class="form-group">
1336
+ <label for="<?php echo esc_attr( $this->field_id( 'content' ) ); ?>"><?php esc_html_e( 'Default Email Content', 'mycred' ); ?></label>
1337
+ <textarea rows="10" cols="50" name="<?php echo esc_attr( $this->field_name( 'content' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'content' ) ); ?>" class="form-control"><?php echo esc_attr( $this->emailnotices['content'] ); ?></textarea>
1338
  <p><span class="description"><?php esc_html_e( 'Default email content.', 'mycred' ); ?></span></p>
1339
  </div>
1340
  </div>
1342
  <div class="row">
1343
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
1344
  <div class="form-group">
1345
+ <label for="<?php echo esc_attr( $this->field_id( 'styling' ) ); ?>"><?php esc_html_e( 'Default CSS Styling', 'mycred' ); ?></label>
1346
+ <textarea rows="10" cols="50" name="<?php echo esc_attr( $this->field_name( 'styling' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'styling' ) ); ?>" class="form-control"><?php echo esc_attr( $this->emailnotices['styling'] ); ?></textarea>
1347
  <p><span class="description"><?php esc_html_e( 'Default email CSS styling. Note that if you intend to send HTML emails, you should use inline CSS styling for best results.', 'mycred' ); ?></span></p>
1348
  </div>
1349
  </div>
addons/gateway/carts/mycred-woocommerce.php CHANGED
@@ -233,17 +233,17 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
233
  <tr valign="top">
234
  <th scope="row" class="titledesc">
235
  <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
236
- <?php echo $this->get_tooltip_html( $data ); ?>
237
  </th>
238
  <td class="forminp">
239
  <?php if ( $data['type'] == 'currency' ) : $mycred = mycred( $currency ); ?>
240
- <input type="hidden" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" value="<?php echo get_woocommerce_currency(); ?>" />
241
- <p><?php echo $mycred->plural(); ?></p>
242
  <?php else : ?>
243
  <fieldset>
244
  <legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
245
- <input class="input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( $this->get_option( $key ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
246
- <?php echo $this->get_description_html( $data ); ?>
247
  </fieldset>
248
  <?php endif; ?>
249
  </td>
@@ -276,7 +276,7 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
276
  public function admin_options() {
277
 
278
  ?>
279
- <h3><?php printf( __( '%s Payment', 'mycred' ), mycred_label() ); ?></h3>
280
  <table class="form-table">
281
  <?php
282
 
@@ -479,8 +479,8 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
479
  */
480
  function thankyou_page() {
481
 
482
- echo apply_filters( 'mycred_woo_thank_you_message', '<p>' . __( 'Your account has successfully been charged.', 'mycred' ) . '</p>' );
483
-
484
  }
485
 
486
  }
@@ -800,10 +800,10 @@ if ( ! function_exists( 'mycred_woo_after_order_total' ) ) :
800
 
801
  ?>
802
  <tr class="total">
803
- <th><strong><?php echo $mycred->template_tags_general( $available_gateways['mycred']->get_option( 'total_label' ) ); ?></strong></th>
804
  <td>
805
  <div class="current-balance order-total-in-points">
806
- <strong class="<?php if ( $balance < $cost ) echo 'mycred-low-funds'; else echo 'mycred-funds'; ?>"<?php if ( $balance < $cost ) echo ' style="color:red;"'; ?>><?php echo $mycred->format_creds( $cost ); ?></strong>
807
  </div>
808
  </td>
809
  </tr>
@@ -818,10 +818,10 @@ if ( ! function_exists( 'mycred_woo_after_order_total' ) ) :
818
 
819
  ?>
820
  <tr class="total">
821
- <th><strong><?php echo $mycred->template_tags_general( $balance_label ); ?></strong></th>
822
  <td>
823
  <div class="current-balance">
824
- <?php echo $mycred->format_creds( $balance ); ?>
825
  </div>
826
  </td>
827
  </tr>
233
  <tr valign="top">
234
  <th scope="row" class="titledesc">
235
  <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
236
+ <?php echo wp_kses_post( $this->get_tooltip_html( $data ) ); ?>
237
  </th>
238
  <td class="forminp">
239
  <?php if ( $data['type'] == 'currency' ) : $mycred = mycred( $currency ); ?>
240
+ <input type="hidden" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" value="<?php echo esc_attr( get_woocommerce_currency() ); ?>" />
241
+ <p><?php echo esc_html( $mycred->plural() ); ?></p>
242
  <?php else : ?>
243
  <fieldset>
244
  <legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
245
+ <input class="input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( $this->get_option( $key ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo esc_attr( $this->get_custom_attribute_html( $data ) ); ?> />
246
+ <?php echo wp_kses_post( $this->get_description_html( $data ) ); ?>
247
  </fieldset>
248
  <?php endif; ?>
249
  </td>
276
  public function admin_options() {
277
 
278
  ?>
279
+ <h3><?php printf( esc_html__( '%s Payment', 'mycred' ), esc_html( mycred_label() ) ); ?></h3>
280
  <table class="form-table">
281
  <?php
282
 
479
  */
480
  function thankyou_page() {
481
 
482
+ $thankyou_msg = apply_filters( 'mycred_woo_thank_you_message', '<p>' . __( 'Your account has successfully been charged.', 'mycred' ) . '</p>' );
483
+ echo esc_html( $thankyou_msg );
484
  }
485
 
486
  }
800
 
801
  ?>
802
  <tr class="total">
803
+ <th><strong><?php echo esc_html( $mycred->template_tags_general( $available_gateways['mycred']->get_option( 'total_label' ) ) ); ?></strong></th>
804
  <td>
805
  <div class="current-balance order-total-in-points">
806
+ <strong class="<?php if ( $balance < $cost ) echo 'mycred-low-funds'; else echo 'mycred-funds'; ?>"<?php if ( $balance < $cost ) echo ' style="color:red;"'; ?>><?php echo esc_html( $mycred->format_creds( $cost ) ); ?></strong>
807
  </div>
808
  </td>
809
  </tr>
818
 
819
  ?>
820
  <tr class="total">
821
+ <th><strong><?php echo esc_html( $mycred->template_tags_general( $balance_label ) ); ?></strong></th>
822
  <td>
823
  <div class="current-balance">
824
+ <?php echo esc_html( $mycred->format_creds( $balance ) ); ?>
825
  </div>
826
  </td>
827
  </tr>
addons/gateway/carts/mycred-wpecommerce.php CHANGED
@@ -432,14 +432,14 @@ if ( ! function_exists( 'mycred_wpecom_gateway_settings_save' ) ) :
432
 
433
  if ( isset( $_POST['mycred_gateway'] ) ) {
434
  $new_settings = apply_filters( 'mycred_wpecom_save_settings', array(
435
- 'log' => sanitize_text_field( $_POST['mycred_gateway']['log'] ),
436
- 'type' => sanitize_key( $_POST['mycred_gateway']['type'] ),
437
- 'share' => abs( $_POST['mycred_gateway']['share'] ),
438
- 'share_log' => sanitize_text_field( $_POST['mycred_gateway']['share_log'] ),
439
- 'rate' => sanitize_text_field( $_POST['mycred_gateway']['rate'] ),
440
- 'visitor' => sanitize_text_field( $_POST['mycred_gateway']['visitor'] ),
441
- 'low_funds' => sanitize_text_field( $_POST['mycred_gateway']['low_funds'] ),
442
- 'message' => sanitize_text_field( $_POST['mycred_gateway']['message'] )
443
  ) );
444
  update_option( 'mycred_wpecom_settings', $new_settings );
445
  }
432
 
433
  if ( isset( $_POST['mycred_gateway'] ) ) {
434
  $new_settings = apply_filters( 'mycred_wpecom_save_settings', array(
435
+ 'log' => ! empty( $_POST['mycred_gateway']['log'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['log'] ) ) : '',
436
+ 'type' => ! empty( $_POST['mycred_gateway']['type'] ) ? sanitize_key( wp_unslash( $_POST['mycred_gateway']['type'] ) ) : '',
437
+ 'share' => ! empty( $_POST['mycred_gateway']['share'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['share'] ) ) : '',
438
+ 'share_log' => ! empty( $_POST['mycred_gateway']['share_log'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['share_log'] ) ) : '',
439
+ 'rate' => ! empty( $_POST['mycred_gateway']['rate'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['rate'] ) ) : '',
440
+ 'visitor' => ! empty( $_POST['mycred_gateway']['visitor'] ) ?sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['visitor'] ) ) : '',
441
+ 'low_funds' => ! empty( $_POST['mycred_gateway']['low_funds'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['low_funds'] ) ) : '',
442
+ 'message' => ! empty( $_POST['mycred_gateway']['message'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['message'] ) ) : ''
443
  ) );
444
  update_option( 'mycred_wpecom_settings', $new_settings );
445
  }
addons/gateway/event-booking/mycred-eventespresso3.php CHANGED
@@ -118,7 +118,7 @@ if ( ! class_exists( 'myCRED_Espresso_Gateway' ) ) :
118
 
119
  if (
120
  ( isset( $_REQUEST['payment_type'] ) && $_REQUEST['payment_type'] == 'mycred' ) &&
121
- ( isset( $_REQUEST['token'] ) && wp_verify_nonce( $_REQUEST['token'], 'pay-with-mycred' ) ) ) return true;
122
 
123
  return false;
124
 
@@ -174,7 +174,7 @@ if ( ! class_exists( 'myCRED_Espresso_Gateway' ) ) :
174
  if ( ! is_user_logged_in() ) return $payment_data;
175
 
176
  // Security
177
- if ( ! isset( $_REQUEST['token'] ) || ! wp_verify_nonce( $_REQUEST['token'], 'pay-with-mycred' ) ) return $payment_data;
178
 
179
  // Let others play
180
  do_action( 'mycred_espresso_process', $payment_data, $this->prefs, $this->core );
@@ -450,7 +450,7 @@ if ( ! class_exists( 'myCRED_Espresso_Gateway' ) ) :
450
  <?php if ( $this->update ) : ?>
451
  <h2 style="color: green;"><?php esc_html_e( 'Settings Updated', 'mycred' ); ?></h2>
452
  <?php endif; ?>
453
- <form method="post" action="<?php echo sanitize_url( $_SERVER['REQUEST_URI'] ); ?>#mycred-gate">
454
 
455
  <?php do_action( 'mycred_espresso_before_prefs' ); ?>
456
 
@@ -565,35 +565,37 @@ if ( ! class_exists( 'myCRED_Espresso_Gateway' ) ) :
565
  $this->label = mycred_label();
566
 
567
  // Security
568
- if ( ! wp_verify_nonce( $_REQUEST['mycred-gateway-token'], 'mycred-espresso-update' ) ) return;
 
 
569
  if ( ! $this->core->user_is_point_admin() ) return;
570
 
571
  // Prep
572
  $new_settings = array();
573
 
574
- if ( ! is_array( $_POST['mycred_prefs'] ) || empty( $_POST['mycred_prefs'] ) ) return;
575
 
576
  // Labels
577
- $new_settings['labels']['gateway'] = strip_tags( sanitize_text_field( $_POST['mycred_prefs']['labels']['gateway'] ), '<strong><em><span>' );
578
- $new_settings['labels']['payment'] = strip_tags( sanitize_text_field( $_POST['mycred_prefs']['labels']['payment'] ), '<strong><em><span>' );
579
- $new_settings['labels']['button'] = isset( $_POST['mycred_prefs']['labels']['button'] ) ? sanitize_text_field( $_POST['mycred_prefs']['labels']['button'] ) : '';
580
 
581
  // Point Type
582
- $new_settings['type'] = isset( $_POST['mycred_prefs']['type'] ) ? sanitize_text_field( $_POST['mycred_prefs']['type'] ) : '';
583
 
584
  // Exchange Rate
585
- $new_settings['rate'] = isset( $_POST['mycred_prefs']['rate'] ) ? sanitize_text_field( $_POST['mycred_prefs']['rate'] ) : '';
586
 
587
  // Profit Share
588
- $new_settings['share'] = isset( $_POST['mycred_prefs']['share'] ) ? abs( $_POST['mycred_prefs']['share'] ) : '';
589
 
590
  // Log
591
- $new_settings['log'] = isset( $_POST['mycred_prefs']['log'] ) ? sanitize_text_field( $_POST['mycred_prefs']['log'] ) : '';
592
 
593
  // Messages
594
- $new_settings['messages']['solvent'] = stripslashes( sanitize_text_field( $_POST['mycred_prefs']['messages']['solvent'] ) );
595
- $new_settings['messages']['insolvent'] = stripslashes( sanitize_text_field( $_POST['mycred_prefs']['messages']['insolvent'] ) );
596
- $new_settings['messages']['visitors'] = stripslashes( sanitize_text_field( $_POST['mycred_prefs']['messages']['visitors'] ) );
597
 
598
  // Let others play
599
  $new_settings = apply_filters( 'mycred_espresso_save_pref', $new_settings );
118
 
119
  if (
120
  ( isset( $_REQUEST['payment_type'] ) && $_REQUEST['payment_type'] == 'mycred' ) &&
121
+ ( isset( $_REQUEST['token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['token'] ) ), 'pay-with-mycred' ) ) ) return true;
122
 
123
  return false;
124
 
174
  if ( ! is_user_logged_in() ) return $payment_data;
175
 
176
  // Security
177
+ if ( ! isset( $_REQUEST['token'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['token'] ) ), 'pay-with-mycred' ) ) return $payment_data;
178
 
179
  // Let others play
180
  do_action( 'mycred_espresso_process', $payment_data, $this->prefs, $this->core );
450
  <?php if ( $this->update ) : ?>
451
  <h2 style="color: green;"><?php esc_html_e( 'Settings Updated', 'mycred' ); ?></h2>
452
  <?php endif; ?>
453
+ <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>#mycred-gate">
454
 
455
  <?php do_action( 'mycred_espresso_before_prefs' ); ?>
456
 
565
  $this->label = mycred_label();
566
 
567
  // Security
568
+ if ( ! isset( $_REQUEST['mycred-gateway-token'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['mycred-gateway-token'] ) ), 'mycred-espresso-update' ) )
569
+ return;
570
+
571
  if ( ! $this->core->user_is_point_admin() ) return;
572
 
573
  // Prep
574
  $new_settings = array();
575
 
576
+ if ( empty( $_POST['mycred_prefs'] ) || ! is_array( $_POST['mycred_prefs'] ) ) return;
577
 
578
  // Labels
579
+ $new_settings['labels']['gateway'] = isset( $_POST['mycred_prefs']['labels']['gateway'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['labels']['gateway'] ) ) : '';
580
+ $new_settings['labels']['payment'] = isset( $_POST['mycred_prefs']['labels']['payment'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['labels']['payment'] ) ) : '';
581
+ $new_settings['labels']['button'] = isset( $_POST['mycred_prefs']['labels']['button'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['labels']['button'] ) ) : '';
582
 
583
  // Point Type
584
+ $new_settings['type'] = isset( $_POST['mycred_prefs']['type'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['type'] ) ) : '';
585
 
586
  // Exchange Rate
587
+ $new_settings['rate'] = isset( $_POST['mycred_prefs']['rate'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['rate'] ) ) : '';
588
 
589
  // Profit Share
590
+ $new_settings['share'] = isset( $_POST['mycred_prefs']['share'] ) ? abs( sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['share'] ) ) ) : '';
591
 
592
  // Log
593
+ $new_settings['log'] = isset( $_POST['mycred_prefs']['log'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['log'] ) ) : '';
594
 
595
  // Messages
596
+ $new_settings['messages']['solvent'] = isset( $_POST['mycred_prefs']['messages']['solvent'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['messages']['solvent'] ) ) : '';
597
+ $new_settings['messages']['insolvent'] = isset( $_POST['mycred_prefs']['messages']['insolvent'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['messages']['insolvent'] ) ) : '';
598
+ $new_settings['messages']['visitors'] = isset( $_POST['mycred_prefs']['messages']['visitors'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_prefs']['messages']['visitors'] ) ) : '';
599
 
600
  // Let others play
601
  $new_settings = apply_filters( 'mycred_espresso_save_pref', $new_settings );
addons/gateway/event-booking/mycred-eventsmanager.php CHANGED
@@ -531,7 +531,7 @@ jQuery(function($) {
531
  booking_id : booking
532
  },
533
  dataType : "JSON",
534
- url : '<?php echo $ajax_url; ?>',
535
  beforeSend : function() {
536
 
537
  button.val( '<?php echo esc_js( __( 'Processing...', 'mycred' ) ); ?>' );
@@ -733,17 +733,17 @@ jQuery(function($){
733
  $new_settings = array();
734
 
735
  // Setup
736
- $new_settings['setup'] = isset( $_POST['mycred_gateway']['setup'] ) ? sanitize_text_field( $_POST['mycred_gateway']['setup'] ) : '';
737
- $new_settings['type'] = isset( $_POST['mycred_gateway']['type'] ) ? sanitize_text_field( $_POST['mycred_gateway']['type'] ) : '';
738
- $new_settings['refund'] = isset( $_POST['mycred_gateway']['refund'] ) ? abs( $_POST['mycred_gateway']['refund'] ) : '';
739
- $new_settings['share'] = isset( $_POST['mycred_gateway']['share'] ) ? abs( $_POST['mycred_gateway']['share'] ) : '';
740
 
741
  // Logs
742
- $new_settings['log']['purchase'] = isset( $_POST['mycred_gateway']['log']['purchase'] ) ? sanitize_text_field( stripslashes( $_POST['mycred_gateway']['log']['purchase'] ) ) : '';
743
- $new_settings['log']['refund'] = isset( $_POST['mycred_gateway']['log']['refund'] ) ? sanitize_text_field( stripslashes( $_POST['mycred_gateway']['log']['refund'] ) ) : '';
744
 
745
  if ( $new_settings['setup'] == 'multi' )
746
- $new_settings['rate'] = isset( $_POST['mycred_gateway']['rate'] ) ? sanitize_text_field( $_POST['mycred_gateway']['rate'] ) : '';
747
  else
748
  $new_settings['rate'] = $this->prefs['rate'];
749
 
@@ -765,13 +765,13 @@ jQuery(function($){
765
  }
766
 
767
  // Labels
768
- $new_settings['labels']['link'] = sanitize_text_field( stripslashes( $_POST['mycred_gateway']['labels']['link'] ) );
769
- $new_settings['labels']['header'] = sanitize_text_field( stripslashes( $_POST['mycred_gateway']['labels']['header'] ) );
770
- $new_settings['labels']['button'] = sanitize_text_field( stripslashes( $_POST['mycred_gateway']['labels']['button'] ) );
771
 
772
  // Messages
773
- $new_settings['messages']['success'] = sanitize_text_field( stripslashes( $_POST['mycred_gateway']['messages']['success'] ) );
774
- $new_settings['messages']['error'] = sanitize_text_field( stripslashes( $_POST['mycred_gateway']['messages']['error'] ) );
775
 
776
  // Save Settings
777
  $current = $this->prefs;
531
  booking_id : booking
532
  },
533
  dataType : "JSON",
534
+ url : '<?php echo esc_url( $ajax_url ); ?>',
535
  beforeSend : function() {
536
 
537
  button.val( '<?php echo esc_js( __( 'Processing...', 'mycred' ) ); ?>' );
733
  $new_settings = array();
734
 
735
  // Setup
736
+ $new_settings['setup'] = isset( $_POST['mycred_gateway']['setup'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['setup'] ) ) : '';
737
+ $new_settings['type'] = isset( $_POST['mycred_gateway']['type'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['type'] ) ) : '';
738
+ $new_settings['refund'] = isset( $_POST['mycred_gateway']['refund'] ) ? abs( sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['refund'] ) ) ) : '';
739
+ $new_settings['share'] = isset( $_POST['mycred_gateway']['share'] ) ? abs( sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['share'] ) ) ) : '';
740
 
741
  // Logs
742
+ $new_settings['log']['purchase'] = isset( $_POST['mycred_gateway']['log']['purchase'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['log']['purchase'] ) ) : '';
743
+ $new_settings['log']['refund'] = isset( $_POST['mycred_gateway']['log']['refund'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['log']['refund'] ) ) : '';
744
 
745
  if ( $new_settings['setup'] == 'multi' )
746
+ $new_settings['rate'] = isset( $_POST['mycred_gateway']['rate'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['rate'] ) ) : '';
747
  else
748
  $new_settings['rate'] = $this->prefs['rate'];
749
 
765
  }
766
 
767
  // Labels
768
+ $new_settings['labels']['link'] = isset( $_POST['mycred_gateway']['labels']['link'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['labels']['link'] ) ) : '';
769
+ $new_settings['labels']['header'] = isset( $_POST['mycred_gateway']['labels']['header'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['labels']['header'] ) ) : '';
770
+ $new_settings['labels']['button'] = isset( $_POST['mycred_gateway']['labels']['button'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['labels']['button'] ) ) : '';
771
 
772
  // Messages
773
+ $new_settings['messages']['success'] = isset( $_POST['mycred_gateway']['messages']['success'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['messages']['success'] ) ) : '';
774
+ $new_settings['messages']['error'] = isset( $_POST['mycred_gateway']['messages']['error'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_gateway']['messages']['error'] ) ) : '';
775
 
776
  // Save Settings
777
  $current = $this->prefs;
addons/ranks/myCRED-addon-ranks.php CHANGED
@@ -1035,16 +1035,25 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
1035
 
1036
  foreach ( $ranks as $rank ) {
1037
  $rank_dropdown .= '<option value="' . $rank->post_id . '"';
1038
- if ( ! empty( $users_rank ) && $users_rank->post_id == $rank->post_id ) echo ' selected="selected"';
 
1039
  $rank_dropdown .= '>' . $rank->title . '</option>';
1040
  }
1041
 
1042
  $rank_dropdown .= '</select></div>';
1043
 
1044
  $allowed_html = array(
1045
- 'div' => array(),
1046
- 'select' => array(),
1047
- 'option' => array()
 
 
 
 
 
 
 
 
1048
  );
1049
 
1050
  echo wp_kses( $rank_dropdown, $allowed_html );
1035
 
1036
  foreach ( $ranks as $rank ) {
1037
  $rank_dropdown .= '<option value="' . $rank->post_id . '"';
1038
+ if ( ! empty( $users_rank ) && $users_rank->post_id == $rank->post_id )
1039
+ $rank_dropdown .= ' selected="selected"';
1040
  $rank_dropdown .= '>' . $rank->title . '</option>';
1041
  }
1042
 
1043
  $rank_dropdown .= '</select></div>';
1044
 
1045
  $allowed_html = array(
1046
+ 'div' => array(
1047
+ 'class' => array()
1048
+ ),
1049
+ 'select' => array(
1050
+ 'name' => array(),
1051
+ 'id' => array()
1052
+ ),
1053
+ 'option' => array(
1054
+ 'value' => array(),
1055
+ 'selected' => array()
1056
+ )
1057
  );
1058
 
1059
  echo wp_kses( $rank_dropdown, $allowed_html );
addons/stats/includes/mycred-stats-object.php CHANGED
@@ -405,7 +405,7 @@ if ( ! class_exists( 'myCRED_Chart' ) ) :
405
 
406
  $element_id = $this->generate_element_id();
407
  $element_style = $this->get_canvas_styling();
408
- $output = '<div class="chart-container ' . MYCRED_SLUG . '-chart-container"><canvas class="' . MYCRED_SLUG . '-chart-canvas" ' . $element_style . ' id="' . $element_id . '" height="'. $this->args['height'] . ' "></canvas></div>';
409
 
410
  $mycred_charts[ $element_id ] = $chart;
411
 
405
 
406
  $element_id = $this->generate_element_id();
407
  $element_style = $this->get_canvas_styling();
408
+ $output = '<div class="chart-container ' . MYCRED_SLUG . '-chart-container"><canvas class="' . MYCRED_SLUG . '-chart-canvas" ' . $element_style . ' id="' . $element_id . '" height="' . $this->args['height'] . '"></canvas></div>';
409
 
410
  $mycred_charts[ $element_id ] = $chart;
411
 
addons/stats/myCRED-addon-stats.php CHANGED
@@ -270,7 +270,7 @@ if ( ! class_exists( 'myCRED_Stats_Module' ) ) :
270
  $values[] = $set->value;
271
  }
272
 
273
- echo '<span class="' . MYCRED_SLUG . '-stats-bar" data-type="' . $point_type . '" data-positive="' . $color['positive'] . '" data-negative="' . $color['negative'] . '" style="display: none;">' . implode( ',', $values ) . '</span>';
274
 
275
  }
276
 
@@ -287,7 +287,7 @@ if ( ! class_exists( 'myCRED_Stats_Module' ) ) :
287
  <script type="text/javascript">
288
  jQuery(function($){
289
 
290
- $( 'span.<?php echo MYCRED_SLUG; ?>-stats-bar' ).each(function(index,item){
291
 
292
  var barchart = $(this);
293
  var positivecolor = barchart.data( 'positive' );
@@ -362,16 +362,16 @@ jQuery(function($){
362
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
363
 
364
  <div class="form-group">
365
- <label for="<?php echo $this->field_id( 'color_positive' ); ?>"><?php esc_html_e( 'Positive Values', 'mycred' ); ?></label>
366
- <input type="text" name="<?php echo $this->field_name( 'color_positive' ); ?>" id="<?php echo $this->field_id( 'color_positive' ); ?>" value="<?php echo esc_attr( $prefs['color_positive'] ); ?>" class="form-control <?php if ( MYCRED_STATS_COLOR_TYPE == 'hex' ) echo ' wp-color-picker-field" data-default-color="#dedede'; ?>" />
367
  </div>
368
 
369
  </div>
370
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
371
 
372
  <div class="form-group">
373
- <label for="<?php echo $this->field_id( 'color_negative' ); ?>"><?php esc_html_e( 'Negative Values', 'mycred' ); ?></label>
374
- <input type="text" name="<?php echo $this->field_name( 'color_negative' ); ?>" id="<?php echo $this->field_id( 'color_negative' ); ?>" value="<?php echo esc_attr( $prefs['color_negative'] ); ?>" class="form-control <?php if ( MYCRED_STATS_COLOR_TYPE == 'hex' ) echo ' wp-color-picker-field" data-default-color="#dedede'; ?>" />
375
  </div>
376
 
377
  </div>
@@ -395,7 +395,7 @@ jQuery(function($){
395
 
396
  <div class="form-group">
397
  <div class="checkbox">
398
- <label for="<?php echo $this->field_id( 'animate' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'animate' ); ?>" id="<?php echo $this->field_id( 'animate' ); ?>"<?php checked( $prefs['animate'], 1 ); ?> value="1" /> <?php esc_html_e( 'Animate Charts', 'mycred' ); ?></label>
399
  </div>
400
  </div>
401
 
@@ -404,7 +404,7 @@ jQuery(function($){
404
 
405
  <div class="form-group">
406
  <div class="checkbox">
407
- <label for="<?php echo $this->field_id( 'bezier' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'bezier' ); ?>" id="<?php echo $this->field_id( 'bezier' ); ?>"<?php checked( $prefs['bezier'], 1 ); ?> value="1" /> <?php esc_html_e( 'Use Bezier Curves', 'mycred' ); ?></label>
408
  </div>
409
  </div>
410
 
@@ -412,14 +412,14 @@ jQuery(function($){
412
  </div>
413
 
414
  <div class="form-group">
415
- <label for="<?php echo $this->field_id( 'caching' ); ?>"><?php esc_html_e( 'Caching', 'mycred' ); ?></label>
416
- <select name="<?php echo $this->field_name( 'caching' ); ?>" id="<?php echo $this->field_id( 'caching' ); ?>" class="form-control">
417
  <?php
418
 
419
  foreach ( $cache_options as $value => $label ) {
420
- echo '<option value="' . $value . '"';
421
  if ( $prefs['caching'] == $value ) echo ' selected="selected"';
422
- echo '>' . $label . '</option>';
423
  }
424
 
425
  ?>
270
  $values[] = $set->value;
271
  }
272
 
273
+ echo '<span class="' . esc_attr( MYCRED_SLUG ) . '-stats-bar" data-type="' . esc_attr( $point_type ) . '" data-positive="' . esc_attr( $color['positive'] ) . '" data-negative="' . esc_attr( $color['negative'] ) . '" style="display: none;">' . esc_html( implode( ',', $values ) ) . '</span>';
274
 
275
  }
276
 
287
  <script type="text/javascript">
288
  jQuery(function($){
289
 
290
+ $( 'span.<?php echo esc_attr( MYCRED_SLUG ); ?>-stats-bar' ).each(function(index,item){
291
 
292
  var barchart = $(this);
293
  var positivecolor = barchart.data( 'positive' );
362
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
363
 
364
  <div class="form-group">
365
+ <label for="<?php echo esc_attr( $this->field_id( 'color_positive' ) ); ?>"><?php esc_html_e( 'Positive Values', 'mycred' ); ?></label>
366
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'color_positive' )); ?>" id="<?php echo esc_attr( $this->field_id( 'color_positive' ) ); ?>" value="<?php echo esc_attr( $prefs['color_positive'] ); ?>" class="form-control <?php if ( MYCRED_STATS_COLOR_TYPE == 'hex' ) echo ' wp-color-picker-field" data-default-color="#dedede'; ?>" />
367
  </div>
368
 
369
  </div>
370
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
371
 
372
  <div class="form-group">
373
+ <label for="<?php echo esc_attr( $this->field_id( 'color_negative' ) ); ?>"><?php esc_html_e( 'Negative Values', 'mycred' ); ?></label>
374
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'color_negative' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'color_negative' ) ); ?>" value="<?php echo esc_attr( $prefs['color_negative'] ); ?>" class="form-control <?php if ( MYCRED_STATS_COLOR_TYPE == 'hex' ) echo ' wp-color-picker-field" data-default-color="#dedede'; ?>" />
375
  </div>
376
 
377
  </div>
395
 
396
  <div class="form-group">
397
  <div class="checkbox">
398
+ <label for="<?php echo esc_attr( $this->field_id( 'animate' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'animate' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'animate' ) ); ?>"<?php checked( $prefs['animate'], 1 ); ?> value="1" /> <?php esc_html_e( 'Animate Charts', 'mycred' ); ?></label>
399
  </div>
400
  </div>
401
 
404
 
405
  <div class="form-group">
406
  <div class="checkbox">
407
+ <label for="<?php echo esc_attr( $this->field_id( 'bezier' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'bezier' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'bezier' ) ); ?>"<?php checked( $prefs['bezier'], 1 ); ?> value="1" /> <?php esc_html_e( 'Use Bezier Curves', 'mycred' ); ?></label>
408
  </div>
409
  </div>
410
 
412
  </div>
413
 
414
  <div class="form-group">
415
+ <label for="<?php echo esc_attr( $this->field_id( 'caching' ) ); ?>"><?php esc_html_e( 'Caching', 'mycred' ); ?></label>
416
+ <select name="<?php echo esc_attr( $this->field_name( 'caching' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'caching' ) ); ?>" class="form-control">
417
  <?php
418
 
419
  foreach ( $cache_options as $value => $label ) {
420
+ echo '<option value="' . esc_attr( $value ) . '"';
421
  if ( $prefs['caching'] == $value ) echo ' selected="selected"';
422
+ echo '>' . esc_html( $label ) . '</option>';
423
  }
424
 
425
  ?>
addons/stats/widgets/mycred-stats-widget-circulation.php CHANGED
@@ -142,17 +142,17 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Circulation' ) ) :
142
 
143
  ?>
144
  <div id="mycred-stats-overview" class="row">
145
- <div id="mycred-stats-<?php echo $this->id; ?>" class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
146
- <canvas id="total-circulation-<?php echo $this->id; ?>-chart"></canvas>
147
  </div>
148
  <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
149
- <h1><?php echo $label; ?>: <?php echo $this->format_number( $circulation['total'] ); ?></h1>
150
  <?php
151
 
152
  if ( $this->args['ctypes'] == 'all' ) :
153
 
154
  ?>
155
- <ul id="total-per-point-type"><li><?php echo implode( '</li><li>', $circulation['totals'] ); ?></li></ul>
156
  <?php
157
 
158
  else :
@@ -175,7 +175,7 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Circulation' ) ) :
175
 
176
  //
177
  ?>
178
- <ul id="total-per-point-type"><li><?php printf( __( 'Total Gained: %s', 'mycred' ), '<span style="color:' . $gain_color . '">' . $mycred->format_creds( $gains ) . '</span>' ); ?></li><li><?php printf( __( 'Total Spent: %s', 'mycred' ), '<span style="color:' . $lose_color . '">' . $mycred->format_creds( $loses ) . '</span>' ); ?></li></ul>
179
  <?php
180
 
181
  endif;
@@ -211,8 +211,8 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Circulation' ) ) :
211
  $mycred = mycred( $type_id );
212
 
213
  ?>
214
- <tr style="color: <?php echo $this->colors[ $type_id ]['positive']; ?>;">
215
- <td class="rowtitle"><?php echo $this->ctypes[ $type_id ]; ?></td>
216
  <?php
217
 
218
  $page_id = MYCRED_SLUG;
@@ -221,8 +221,8 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Circulation' ) ) :
221
 
222
  $base_url = add_query_arg( array( 'page' => $page_id ), admin_url( 'admin.php' ) );
223
  foreach ( $dates as $key => $item ) {
224
- echo '<td class="cell">' . $mycred->format_number( $item['gains'] ) . '</td>';
225
- echo '<td class="cell">' . $mycred->format_number( $item['loses'] ) . '</td>';
226
  }
227
 
228
  }
@@ -236,12 +236,12 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Circulation' ) ) :
236
  <script type="text/javascript">
237
  jQuery(function($) {
238
 
239
- var <?php echo $this->id; ?> = $( '#total-circulation-<?php echo $this->id; ?>-chart' ).get(0).getContext( '2d' );
240
- <?php echo $this->id; ?>.canvas.width = 240;
241
- <?php echo $this->id; ?>.canvas.height = 240;
242
 
243
- var <?php echo $this->id; ?>chart = new Chart( <?php echo $this->id; ?> ).Doughnut([
244
- <?php echo implode( ',', $circulation['series'] ); ?>
245
  ],{
246
  segmentStrokeColor : '#F1F1F1',
247
  segmentStrokeWidth : 3,
@@ -270,16 +270,16 @@ jQuery(function($) {
270
 
271
  ?>
272
  <div id="mycred-stats-overview" class="clear clearfix">
273
- <div id="mycred-stats-<?php echo $this->id; ?>" class="left-column">
274
- <canvas id="total-circulation-<?php echo $this->id; ?>-chart"></canvas>
275
  </div>
276
- <h1><?php echo $label; ?>: <?php echo $this->format_number( $circulation['total'] ); ?></h1>
277
  <?php
278
 
279
  if ( $this->args['ctypes'] == 'all' ) :
280
 
281
  ?>
282
- <ul id="total-per-point-type"><li><?php echo implode( '</li><li>', $circulation['totals'] ); ?></li></ul>
283
  <?php
284
 
285
  else :
@@ -305,7 +305,7 @@ jQuery(function($) {
305
  $circulation['series'][] = "{ value: {$gains_l}, color: '" . $color . "', highlight: '" . $color . "', label: '" . esc_attr__( 'Total loses (%)', 'mycred' ) . "' }";
306
 
307
  ?>
308
- <ul id="total-per-point-type"><li><?php printf( __( 'Total Gained: %s', 'mycred' ), '<span style="color:' . $gain_color . '">' . $mycred->format_creds( $gains ) . '</span>' ); ?></li><li><?php printf( __( 'Total Spent: %s', 'mycred' ), '<span style="color:' . $lose_color . '">' . $mycred->format_creds( $loses ) . '</span>' ); ?></li></ul>
309
  <?php
310
 
311
  endif;
@@ -342,8 +342,8 @@ jQuery(function($) {
342
  $mycred = mycred( $type_id );
343
 
344
  ?>
345
- <tr style="color: <?php echo $this->colors[ $type_id ]['positive']; ?>;">
346
- <td class="rowtitle"><?php echo $this->ctypes[ $type_id ]; ?></td>
347
  <?php
348
 
349
  $page_id = MYCRED_SLUG;
@@ -353,9 +353,9 @@ jQuery(function($) {
353
  $base_url = add_query_arg( array( 'page' => $page_id ), admin_url( 'admin.php' ) );
354
  foreach ( $dates as $key => $item ) {
355
  $url = add_query_arg( array( 'show' => $key ), $base_url );
356
- echo '<td class="cell"><a href="' . esc_url( $url ) . '">' . $mycred->format_number( $item['gains'] ) . '</a></td>';
357
  $url = add_query_arg( array( 'show' => $key, 'num' => 0, 'compare' => urlencode( '<' ) ), $base_url );
358
- echo '<td class="cell"><a href="' . esc_url( $url ) . '">' . $mycred->format_number( $item['loses'] ) . '</a></td>';
359
  }
360
 
361
  }
@@ -363,19 +363,19 @@ jQuery(function($) {
363
  ?>
364
  </tbody>
365
  </table>
366
- <?php echo $this->action_buttons(); ?>
367
  </div>
368
  <div class="clear clearfix"></div>
369
  </div>
370
  <script type="text/javascript">
371
  jQuery(function($) {
372
 
373
- var <?php echo $this->id; ?> = $( '#total-circulation-<?php echo $this->id; ?>-chart' ).get(0).getContext( '2d' );
374
- <?php echo $this->id; ?>.canvas.width = 240;
375
- <?php echo $this->id; ?>.canvas.height = 240;
376
 
377
- var <?php echo $this->id; ?>chart = new Chart( <?php echo $this->id; ?> ).Doughnut([
378
- <?php echo implode( ',', $circulation['series'] ); ?>
379
  ],{
380
  segmentStrokeColor : '#F1F1F1',
381
  segmentStrokeWidth : 3,
142
 
143
  ?>
144
  <div id="mycred-stats-overview" class="row">
145
+ <div id="mycred-stats-<?php echo esc_attr( $this->id ); ?>" class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
146
+ <canvas id="total-circulation-<?php echo esc_attr( $this->id ); ?>-chart"></canvas>
147
  </div>
148
  <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
149
+ <h1><?php echo esc_html( $label ); ?>: <?php echo esc_html( $this->format_number( $circulation['total'] ) ); ?></h1>
150
  <?php
151
 
152
  if ( $this->args['ctypes'] == 'all' ) :
153
 
154
  ?>
155
+ <ul id="total-per-point-type"><li><?php echo wp_kses_post( implode( '</li><li>', $circulation['totals'] ) ); ?></li></ul>
156
  <?php
157
 
158
  else :
175
 
176
  //
177
  ?>
178
+ <ul id="total-per-point-type"><li><?php printf( esc_html__( 'Total Gained: %s', 'mycred' ), '<span style="color:' . esc_attr( $gain_color ) . '">' . esc_html( $mycred->format_creds( $gains ) ) . '</span>' ); ?></li><li><?php printf( esc_html__( 'Total Spent: %s', 'mycred' ), '<span style="color:' . esc_attr( $lose_color ) . '">' . esc_html( $mycred->format_creds( $loses ) ) . '</span>' ); ?></li></ul>
179
  <?php
180
 
181
  endif;
211
  $mycred = mycred( $type_id );
212
 
213
  ?>
214
+ <tr style="color: <?php echo esc_attr( $this->colors[ $type_id ]['positive'] ); ?>;">
215
+ <td class="rowtitle"><?php echo esc_html( $this->ctypes[ $type_id ] ); ?></td>
216
  <?php
217
 
218
  $page_id = MYCRED_SLUG;
221
 
222
  $base_url = add_query_arg( array( 'page' => $page_id ), admin_url( 'admin.php' ) );
223
  foreach ( $dates as $key => $item ) {
224
+ echo '<td class="cell">' . esc_html( $mycred->format_number( $item['gains'] ) ) . '</td>';
225
+ echo '<td class="cell">' . esc_html( $mycred->format_number( $item['loses'] ) ) . '</td>';
226
  }
227
 
228
  }
236
  <script type="text/javascript">
237
  jQuery(function($) {
238
 
239
+ var <?php echo esc_attr( $this->id ); ?> = $( '#total-circulation-<?php echo esc_attr( $this->id ); ?>-chart' ).get(0).getContext( '2d' );
240
+ <?php echo esc_attr( $this->id ); ?>.canvas.width = 240;
241
+ <?php echo esc_attr( $this->id ); ?>.canvas.height = 240;
242
 
243
+ var <?php echo esc_attr( $this->id ); ?>chart = new Chart( <?php echo esc_attr( $this->id ); ?> ).Doughnut([
244
+ <?php echo esc_attr( implode( ',', $circulation['series'] ) ); ?>
245
  ],{
246
  segmentStrokeColor : '#F1F1F1',
247
  segmentStrokeWidth : 3,
270
 
271
  ?>
272
  <div id="mycred-stats-overview" class="clear clearfix">
273
+ <div id="mycred-stats-<?php echo esc_attr( $this->id ); ?>" class="left-column">
274
+ <canvas id="total-circulation-<?php echo esc_attr( $this->id ); ?>-chart"></canvas>
275
  </div>
276
+ <h1><?php echo esc_html( $label ); ?>: <?php echo esc_html( $this->format_number( $circulation['total'] ) ); ?></h1>
277
  <?php
278
 
279
  if ( $this->args['ctypes'] == 'all' ) :
280
 
281
  ?>
282
+ <ul id="total-per-point-type"><li><?php echo wp_kses_post( implode( '</li><li>', $circulation['totals'] ) ); ?></li></ul>
283
  <?php
284
 
285
  else :
305
  $circulation['series'][] = "{ value: {$gains_l}, color: '" . $color . "', highlight: '" . $color . "', label: '" . esc_attr__( 'Total loses (%)', 'mycred' ) . "' }";
306
 
307
  ?>
308
+ <ul id="total-per-point-type"><li><?php printf( esc_html__( 'Total Gained: %s', 'mycred' ), '<span style="color:' . esc_attr( $gain_color ) . '">' . esc_html( $mycred->format_creds( $gains ) ) . '</span>' ); ?></li><li><?php printf( esc_html__( 'Total Spent: %s', 'mycred' ), '<span style="color:' . esc_attr( $lose_color ) . '">' . esc_html( $mycred->format_creds( $loses ) ) . '</span>' ); ?></li></ul>
309
  <?php
310
 
311
  endif;
342
  $mycred = mycred( $type_id );
343
 
344
  ?>
345
+ <tr style="color: <?php echo esc_attr( $this->colors[ $type_id ]['positive'] ); ?>;">
346
+ <td class="rowtitle"><?php echo esc_html( $this->ctypes[ $type_id ] ); ?></td>
347
  <?php
348
 
349
  $page_id = MYCRED_SLUG;
353
  $base_url = add_query_arg( array( 'page' => $page_id ), admin_url( 'admin.php' ) );
354
  foreach ( $dates as $key => $item ) {
355
  $url = add_query_arg( array( 'show' => $key ), $base_url );
356
+ echo '<td class="cell"><a href="' . esc_url( $url ) . '">' . esc_html( $mycred->format_number( $item['gains'] ) ) . '</a></td>';
357
  $url = add_query_arg( array( 'show' => $key, 'num' => 0, 'compare' => urlencode( '<' ) ), $base_url );
358
+ echo '<td class="cell"><a href="' . esc_url( $url ) . '">' . esc_html( $mycred->format_number( $item['loses'] ) ) . '</a></td>';
359
  }
360
 
361
  }
363
  ?>
364
  </tbody>
365
  </table>
366
+ <?php echo wp_kses_post( $this->action_buttons() ); ?>
367
  </div>
368
  <div class="clear clearfix"></div>
369
  </div>
370
  <script type="text/javascript">
371
  jQuery(function($) {
372
 
373
+ var <?php echo esc_attr( $this->id ); ?> = $( '#total-circulation-<?php echo esc_attr( $this->id ); ?>-chart' ).get(0).getContext( '2d' );
374
+ <?php echo esc_attr( $this->id ); ?>.canvas.width = 240;
375
+ <?php echo esc_attr( $this->id ); ?>.canvas.height = 240;
376
 
377
+ var <?php echo esc_attr( $this->id ); ?>chart = new Chart( <?php echo esc_attr( $this->id ); ?> ).Doughnut([
378
+ <?php echo esc_html( implode( ',', $circulation['series'] ) ); ?>
379
  ],{
380
  segmentStrokeColor : '#F1F1F1',
381
  segmentStrokeWidth : 3,
addons/stats/widgets/mycred-stats-widget-daily-gains.php CHANGED
@@ -125,7 +125,7 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Gains' ) ) :
125
  ?>
126
  <div id="" class="clear clearfix">
127
  <h1><?php esc_html_e( 'Gains in the last 10 days', 'mycred' ); ?></h1>
128
- <p><span class="description"><?php echo $label; ?></span></p>
129
  <?php
130
 
131
  if ( ! empty( $ten_day_gain ) ) {
@@ -147,11 +147,11 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Gains' ) ) :
147
 
148
  ?>
149
  <li>
150
- <strong style="color:<?php echo $this->colors[ $item->type ]['positive']; ?>;"><?php echo $label; ?></strong>
151
  <span class="view"><a href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'View', 'mycred' ); ?></a></span>
152
  <ul>
153
  <li><?php echo number_format( $item->total, 0, '.', ' ' ); ?></li>
154
- <li><?php echo $item->count; ?></li>
155
  </ul>
156
  <div class="clear clearfix"></div>
157
  </li>
@@ -159,11 +159,11 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Gains' ) ) :
159
 
160
  }
161
 
162
- echo '</ol></div><div class="last-ten-days-chart"><canvas id="daily-gain-' . $this->id . '-chart"></canvas><div id="' . $this->id . '-legend" class="mycred-chart-legend clear clearfix"></div></div>';
163
 
164
  }
165
  else {
166
- echo '<div class="mycred-empty-widget"><p>' . __( 'No data found', 'mycred' ) . '</p></div>';
167
  }
168
 
169
  ?>
@@ -177,20 +177,20 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Gains' ) ) :
177
  <script type="text/javascript">
178
  jQuery(function($) {
179
 
180
- var <?php echo $this->id; ?> = $( '#daily-gain-<?php echo $this->id; ?>-chart' ).get(0).getContext( '2d' );
181
 
182
- <?php echo $this->id; ?>.canvas.height = 400;
183
- var <?php echo $this->id; ?>chart = new Chart( <?php echo $this->id; ?> ).Line({
184
- labels : [<?php echo "'" . implode( "', '", $earned['categories'] ) . "'"; ?>],
185
- datasets : [<?php echo implode( ',', $earned['series'] ); ?>]
186
  },{
187
  bezierCurve: false,
188
  responsive: true,
189
  maintainAspectRatio: false
190
  });
191
 
192
- var <?php echo $this->id; ?>legend = <?php echo $this->id; ?>chart.generateLegend();
193
- $( '#<?php echo $this->id; ?>-legend' ).append( <?php echo $this->id; ?>legend );
194
 
195
  });
196
  </script>
125
  ?>
126
  <div id="" class="clear clearfix">
127
  <h1><?php esc_html_e( 'Gains in the last 10 days', 'mycred' ); ?></h1>
128
+ <p><span class="description"><?php echo esc_html( $label ); ?></span></p>
129
  <?php
130
 
131
  if ( ! empty( $ten_day_gain ) ) {
147
 
148
  ?>
149
  <li>
150
+ <strong style="color:<?php echo esc_attr( $this->colors[ $item->type ]['positive'] ); ?>;"><?php echo esc_html( $label ); ?></strong>
151
  <span class="view"><a href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'View', 'mycred' ); ?></a></span>
152
  <ul>
153
  <li><?php echo number_format( $item->total, 0, '.', ' ' ); ?></li>
154
+ <li><?php echo esc_html( $item->count ); ?></li>
155
  </ul>
156
  <div class="clear clearfix"></div>
157
  </li>
159
 
160
  }
161
 
162
+ echo '</ol></div><div class="last-ten-days-chart"><canvas id="daily-gain-' . esc_attr( $this->id ) . '-chart"></canvas><div id="' . esc_attr( $this->id ) . '-legend" class="mycred-chart-legend clear clearfix"></div></div>';
163
 
164
  }
165
  else {
166
+ echo '<div class="mycred-empty-widget"><p>' . esc_html__( 'No data found', 'mycred' ) . '</p></div>';
167
  }
168
 
169
  ?>
177
  <script type="text/javascript">
178
  jQuery(function($) {
179
 
180
+ var <?php echo esc_attr( $this->id ); ?> = $( '#daily-gain-<?php echo esc_attr( $this->id ); ?>-chart' ).get(0).getContext( '2d' );
181
 
182
+ <?php echo esc_attr( $this->id ); ?>.canvas.height = 400;
183
+ var <?php echo esc_attr( $this->id ); ?>chart = new Chart( <?php echo esc_attr( $this->id ); ?> ).Line({
184
+ labels : [<?php echo "'" . esc_html( implode( "', '", $earned['categories'] ) ) . "'"; ?>],
185
+ datasets : [<?php echo esc_html( implode( ',', $earned['series'] ) ); ?>]
186
  },{
187
  bezierCurve: false,
188
  responsive: true,
189
  maintainAspectRatio: false
190
  });
191
 
192
+ var <?php echo esc_attr( $this->id ); ?>legend = <?php echo esc_attr( $this->id ); ?>chart.generateLegend();
193
+ $( '#<?php echo esc_attr( $this->id ); ?>-legend' ).append( <?php echo esc_attr( $this->id ); ?>legend );
194
 
195
  });
196
  </script>
addons/stats/widgets/mycred-stats-widget-daily-loses.php CHANGED
@@ -125,7 +125,7 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Loses' ) ) :
125
  ?>
126
  <div id="" class="clear clearfix">
127
  <h1><?php esc_html_e( 'Loses in the last 10 days', 'mycred' ); ?></h1>
128
- <p><span class="description"><?php echo $lose_label; ?></span></p>
129
  <?php
130
 
131
  if ( ! empty( $ten_day_lose ) ) {
@@ -147,11 +147,11 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Loses' ) ) :
147
 
148
  ?>
149
  <li>
150
- <strong style="color:<?php echo $this->colors[ $item->type ]['negative']; ?>;"><?php echo $label; ?></strong>
151
  <span class="view"><a href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'View', 'mycred' ); ?></a></span>
152
  <ul>
153
  <li><?php echo number_format( $item->total, 0, '.', ' ' ); ?></li>
154
- <li><?php echo $item->count; ?></li>
155
  </ul>
156
  <div class="clear clearfix"></div>
157
  </li>
@@ -159,11 +159,11 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Loses' ) ) :
159
 
160
  }
161
 
162
- echo '</ol></div><div class="last-ten-days-chart"><canvas id="daily-loses-' . $this->id . '-chart"></canvas><div id="' . $this->id . '-legend" class="mycred-chart-legend clear clearfix"></div></div>';
163
 
164
  }
165
  else {
166
- echo '<div class="mycred-empty-widget"><p>' . __( 'No data found', 'mycred' ) . '</p></div>';
167
  }
168
 
169
  ?>
@@ -177,20 +177,20 @@ if ( ! class_exists( 'myCRED_Stats_Widget_Daily_Loses' ) ) :
177
  <script type="text/javascript">
178
  jQuery(function($) {
179
 
180
- var <?php echo $this->id; ?> = $( '#daily-loses-<?php echo $this->id; ?>-chart' ).get(0).getContext( '2d' );
181
 
182
- <?php echo $this->id; ?>.canvas.height = 400;
183
- var <?php echo $this->id; ?>chart = new Chart( <?php echo $this->id; ?> ).Line({
184
- labels : [<?php echo "'" . implode( "', '", $spending['categories'] ) . "'"; ?>],
185
- datasets : [<?php echo implode( ',', $spending['series'] ); ?>]
186
  },{
187
  bezierCurve: false,
188
  responsive: true,
189
  maintainAspectRatio: false
190
  });
191
 
192
- var <?php echo $this->id; ?>legend = <?php echo $this->id; ?>chart.generateLegend();
193
- $( '#<?php echo $this->id; ?>-legend' ).append( <?php echo $this->id; ?>legend );
194
 
195
  });
196
  </script>
125
  ?>
126
  <div id="" class="clear clearfix">
127
  <h1><?php esc_html_e( 'Loses in the last 10 days', 'mycred' ); ?></h1>
128
+ <p><span class="description"><?php echo esc_html( $lose_label ); ?></span></p>
129
  <?php
130
 
131
  if ( ! empty( $ten_day_lose ) ) {
147
 
148
  ?>
149
  <li>
150
+ <strong style="color:<?php echo esc_attr( $this->colors[ $item->type ]['negative'] ); ?>;"><?php echo esc_html( $label ); ?></strong>
151
  <span class="view"><a href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'View', 'mycred' ); ?></a></span>
152
  <ul>
153
  <li><?php echo number_format( $item->total, 0, '.', ' ' ); ?></li>
154
+ <li><?php echo esc_html( $item->count ); ?></li>
155
  </ul>
156
  <div class="clear clearfix"></div>
157
  </li>
159
 
160
  }
161
 
162
+ echo '</ol></div><div class="last-ten-days-chart"><canvas id="daily-loses-' . esc_attr( $this->id ) . '-chart"></canvas><div id="' . esc_attr( $this->id ) . '-legend" class="mycred-chart-legend clear clearfix"></div></div>';
163
 
164
  }
165
  else {
166
+ echo '<div class="mycred-empty-widget"><p>' . esc_html__( 'No data found', 'mycred' ) . '</p></div>';
167
  }
168
 
169
  ?>
177
  <script type="text/javascript">
178
  jQuery(function($) {
179
 
180
+ var <?php echo esc_attr( $this->id ); ?> = $( '#daily-loses-<?php echo esc_attr( $this->id ); ?>-chart' ).get(0).getContext( '2d' );
181
 
182
+ <?php echo esc_attr( $this->id ); ?>.canvas.height = 400;
183
+ var <?php echo esc_attr( $this->id ); ?>chart = new Chart( <?php echo esc_attr( $this->id ); ?> ).Line({
184
+ labels : [<?php echo "'" . esc_html( implode( "', '", $spending['categories'] ) ) . "'"; ?>],
185
+ datasets : [<?php echo esc_html( implode( ',', $spending['series'] ) ); ?>]
186
  },{
187
  bezierCurve: false,
188
  responsive: true,
189
  maintainAspectRatio: false
190
  });
191
 
192
+ var <?php echo esc_attr( $this->id ); ?>legend = <?php echo esc_attr( $this->id ); ?>chart.generateLegend();
193
+ $( '#<?php echo esc_attr( $this->id ); ?>-legend' ).append( <?php echo esc_attr( $this->id ); ?>legend );
194
 
195
  });
196
  </script>
addons/transfer/assets/js/mycred-transfer.js CHANGED
@@ -127,7 +127,7 @@
127
  }
128
 
129
  else if ( myCREDTransfer[ response.data ] !== undefined )
130
- alert( myCREDTransfer[ response.data ] );
131
 
132
  }
133
 
127
  }
128
 
129
  else if ( myCREDTransfer[ response.data ] !== undefined )
130
+ alert( myCREDTransfer[ response.data ][ $( formid + ' [name="mycred_new_transfer[ctype]"]' ).val() ] );
131
 
132
  }
133
 
addons/transfer/includes/mycred-transfer-object.php CHANGED
@@ -895,7 +895,7 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
895
  <div class="row">
896
 
897
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
898
- <input type="hidden" name="mycred_new_transfer[token]" value="<?php echo wp_create_nonce( 'mycred-new-transfer-' . $this->reference ); ?>" />
899
  <input type="hidden" name="mycred_new_transfer[reference]" value="<?php echo esc_attr( $this->reference ); ?>" />
900
  <input type="hidden" name="mycred_new_transfer[transfered_attributes]" value="<?php echo esc_attr( $this->encode( $this->shortcode_attr ) ); ?>" />
901
  <button class="mycred-submit-transfer<?php echo ' ' . esc_attr( $this->args['button_class'] ); ?>"><?php echo esc_attr( $this->args['button'] ); ?></button>
@@ -968,7 +968,48 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
968
  $placeholder = sprintf( apply_filters( 'mycred_transfer_to_placeholder', __( 'recipients %s', 'mycred' ), $this->settings, $this->args ), $placeholder );
969
 
970
  }
971
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
972
 
973
 
974
  $field = '<div class="form-group select-recipient-wrapper">';
@@ -1021,7 +1062,7 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1021
  if ( $return )
1022
  return $field;
1023
 
1024
- echo $field;
1025
 
1026
  }
1027
 
@@ -1264,13 +1305,20 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1264
  */
1265
  public function encode( $value = array() )
1266
  {
1267
- if (!$value) {
1268
- return false;
1269
- }
1270
 
1271
  $value = json_encode( $value );
 
 
 
 
 
 
 
 
 
1272
 
1273
- $key = sha1( AUTH_KEY );
1274
  $strLen = strlen($value);
1275
  $keyLen = strlen($key);
1276
  $j = 0;
@@ -1296,11 +1344,11 @@ if ( ! class_exists( 'myCRED_Transfer' ) ) :
1296
  */
1297
  public function decode( $value )
1298
  {
1299
- if ( !$value ) {
1300
- return false;
1301
- }
1302
 
1303
- $key = sha1( AUTH_KEY );
1304
  $strLen = strlen($value);
1305
  $keyLen = strlen($key);
1306
  $j = 0;
895
  <div class="row">
896
 
897
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
898
+ <input type="hidden" name="mycred_new_transfer[token]" value="<?php echo esc_attr( wp_create_nonce( 'mycred-new-transfer-' . sanitize_key( $this->reference ) ) ); ?>" />
899
  <input type="hidden" name="mycred_new_transfer[reference]" value="<?php echo esc_attr( $this->reference ); ?>" />
900
  <input type="hidden" name="mycred_new_transfer[transfered_attributes]" value="<?php echo esc_attr( $this->encode( $this->shortcode_attr ) ); ?>" />
901
  <button class="mycred-submit-transfer<?php echo ' ' . esc_attr( $this->args['button_class'] ); ?>"><?php echo esc_attr( $this->args['button'] ); ?></button>
968
  $placeholder = sprintf( apply_filters( 'mycred_transfer_to_placeholder', __( 'recipients %s', 'mycred' ), $this->settings, $this->args ), $placeholder );
969
 
970
  }
971
+ $allowed_html = array(
972
+ 'label' => array(
973
+ 'class' => array()
974
+ ),
975
+ 'input' => array(
976
+ 'type' => array(),
977
+ 'value' => array(),
978
+ 'name' => array(),
979
+ 'class' => array(),
980
+ 'aria-required' => array(),
981
+ 'data-form' => array(),
982
+ 'placeholder' => array(),
983
+ 'autocomplete' => array(),
984
+ 'id' => array()
985
+ ),
986
+ 'ul' => array(
987
+ 'id' => array(),
988
+ 'tabindex' => array(),
989
+ 'class' => array(),
990
+ 'unselectable' => array(),
991
+ 'style' => array(),
992
+ ),
993
+ 'li' => array(
994
+ 'class' => array()
995
+ ),
996
+ 'div' => array(
997
+ 'class' => array(),
998
+ 'id' => array(),
999
+ 'tabindex' => array()
1000
+ ),
1001
+ 'span' => array(
1002
+ 'class' => array()
1003
+ ),
1004
+ 'select' => array(
1005
+ 'name' => array(),
1006
+ 'class' => array()
1007
+ ),
1008
+ 'option' => array(
1009
+ 'value' => array(),
1010
+ 'selected' => array()
1011
+ )
1012
+ );
1013
 
1014
 
1015
  $field = '<div class="form-group select-recipient-wrapper">';
1062
  if ( $return )
1063
  return $field;
1064
 
1065
+ echo wp_kses( $field, $allowed_html );
1066
 
1067
  }
1068
 
1305
  */
1306
  public function encode( $value = array() )
1307
  {
1308
+ if ( empty( $value ) ) return false;
 
 
1309
 
1310
  $value = json_encode( $value );
1311
+
1312
+ $mycred_transfer_salt = mycred_get_option( 'mycred_transfer_salt' );
1313
+
1314
+ if ( empty( $mycred_transfer_salt ) ) {
1315
+
1316
+ $mycred_transfer_salt = wp_generate_password();
1317
+ mycred_update_option( 'mycred_transfer_salt', $mycred_transfer_salt );
1318
+
1319
+ }
1320
 
1321
+ $key = sha1($mycred_transfer_salt);
1322
  $strLen = strlen($value);
1323
  $keyLen = strlen($key);
1324
  $j = 0;
1344
  */
1345
  public function decode( $value )
1346
  {
1347
+ if ( empty( $value ) ) return false;
1348
+
1349
+ $mycred_transfer_salt = mycred_get_option( 'mycred_transfer_salt' );
1350
 
1351
+ $key = sha1($mycred_transfer_salt);
1352
  $strLen = strlen($value);
1353
  $keyLen = strlen($key);
1354
  $j = 0;
addons/transfer/myCRED-addon-transfer.php CHANGED
@@ -123,7 +123,7 @@ if ( ! class_exists( 'myCRED_Transfer_Module' ) ) :
123
  */
124
  public function maybe_load_script() {
125
 
126
- global $mycred_do_transfer;
127
 
128
  if ( $mycred_do_transfer !== true ) return;
129
 
@@ -140,6 +140,15 @@ if ( ! class_exists( 'myCRED_Transfer_Module' ) ) :
140
  'autofill' => $this->transfers['autofill']
141
  );
142
 
 
 
 
 
 
 
 
 
 
143
  // Messages
144
  $messages = apply_filters( 'mycred_transfer_messages', array(
145
  'completed' => esc_attr__( 'Transaction completed.', 'mycred' ),
@@ -149,7 +158,7 @@ if ( ! class_exists( 'myCRED_Transfer_Module' ) ) :
149
  'error_4' => esc_attr__( 'Transaction declined by recipient.', 'mycred' ),
150
  'error_5' => esc_attr__( 'Incorrect amount. Please try again.', 'mycred' ),
151
  'error_6' => esc_attr__( 'This myCRED Add-on has not yet been setup! No transfers are allowed until this has been done!', 'mycred' ),
152
- 'error_7' => esc_attr__( 'Insufficient Funds. Please try a lower amount.', 'mycred' ),
153
  'error_8' => esc_attr__( 'Transfer Limit exceeded.', 'mycred' ),
154
  'error_9' => esc_attr__( 'Communications error. Please try again later.', 'mycred' ),
155
  'error_10' => esc_attr__( 'The selected point type can not be transferred.', 'mycred' ),
123
  */
124
  public function maybe_load_script() {
125
 
126
+ global $mycred_do_transfer, $mycred_transfer;
127
 
128
  if ( $mycred_do_transfer !== true ) return;
129
 
140
  'autofill' => $this->transfers['autofill']
141
  );
142
 
143
+ $insufficient_fund_errors = array();
144
+
145
+ foreach ( $mycred_transfer->settings['types'] as $type ) {
146
+
147
+ $mycred = mycred( $type );
148
+ $insufficient_fund_errors[ $type ] = $mycred->template_tags_general( $mycred_transfer->settings['errors']['low'] );
149
+
150
+ }
151
+
152
  // Messages
153
  $messages = apply_filters( 'mycred_transfer_messages', array(
154
  'completed' => esc_attr__( 'Transaction completed.', 'mycred' ),
158
  'error_4' => esc_attr__( 'Transaction declined by recipient.', 'mycred' ),
159
  'error_5' => esc_attr__( 'Incorrect amount. Please try again.', 'mycred' ),
160
  'error_6' => esc_attr__( 'This myCRED Add-on has not yet been setup! No transfers are allowed until this has been done!', 'mycred' ),
161
+ 'error_7' => $insufficient_fund_errors,
162
  'error_8' => esc_attr__( 'Transfer Limit exceeded.', 'mycred' ),
163
  'error_9' => esc_attr__( 'Communications error. Please try again later.', 'mycred' ),
164
  'error_10' => esc_attr__( 'The selected point type can not be transferred.', 'mycred' ),
assets/css/mycred-admin.css CHANGED
@@ -239,4 +239,8 @@ h4.buycred-cashcred-more-tab-btn.ui-accordion-header.ui-state-active:before, h4.
239
  .mycred-tools-setup, .mycred-tools-setup-export{
240
  float: left;
241
  width: 50%;
 
 
 
 
242
  }
239
  .mycred-tools-setup, .mycred-tools-setup-export{
240
  float: left;
241
  width: 50%;
242
+ }
243
+
244
+ .mycred-input-date {
245
+ min-width: 176.4px;
246
  }
assets/css/mycred-front.css CHANGED
@@ -1,6 +1,13 @@
1
  .widget .myCRED-rank {
2
  float: right;
3
  }
 
 
 
 
 
 
 
4
  .widget .myCRED-rank span {
5
  padding-right: 4px;
6
  color: gray;
1
  .widget .myCRED-rank {
2
  float: right;
3
  }
4
+ .item-meta > #mycred-my-ranks {
5
+ display: none;
6
+ }
7
+ .item-meta > .mycred-balance {
8
+ display:none;
9
+
10
+ }
11
  .widget .myCRED-rank span {
12
  padding-right: 4px;
13
  color: gray;
includes/classes/class.mycred-license.php CHANGED
@@ -58,7 +58,7 @@ if ( ! class_exists( 'myCRED_License' ) ) :
58
  $plugin->package = add_query_arg(
59
  array(
60
  'license_key' => $this->get_license_key(),
61
- 'site' => site_url(),
62
  'api-key' => md5( get_bloginfo( 'url' ) ),
63
  'slug' => $plugin->slug
64
  ),
@@ -201,7 +201,7 @@ if ( ! class_exists( 'myCRED_License' ) ) :
201
  $request_args = array(
202
  'body' => array(
203
  'license_key' => $license_key,
204
- 'site' => site_url(),
205
  'api-key' => md5( get_bloginfo( 'url' ) ),
206
  'addons' => $addons
207
  ),
58
  $plugin->package = add_query_arg(
59
  array(
60
  'license_key' => $this->get_license_key(),
61
+ 'site' => get_bloginfo( 'url' ),
62
  'api-key' => md5( get_bloginfo( 'url' ) ),
63
  'slug' => $plugin->slug
64
  ),
201
  $request_args = array(
202
  'body' => array(
203
  'license_key' => $license_key,
204
+ 'site' => get_bloginfo( 'url' ),
205
  'api-key' => md5( get_bloginfo( 'url' ) ),
206
  'addons' => $addons
207
  ),
includes/classes/class.query-export.php CHANGED
@@ -531,7 +531,7 @@ if ( ! function_exists( 'mycred_get_export_url' ) ) :
531
  if ( $is_admin ) {
532
 
533
  if ( isset( $_GET['page'] ) )
534
- $args['page'] = $_GET['page'];
535
 
536
  $args['mycred-action'] = 'export';
537
  $args['_token'] = wp_create_nonce( 'mycred-export-request-admin' );
@@ -574,9 +574,9 @@ if ( ! function_exists( 'mycred_is_valid_export_url' ) ) :
574
 
575
  if ( is_user_logged_in() ) {
576
 
577
- if ( isset( $_REQUEST['mycred-action'] ) && isset( $_REQUEST['_token'] ) && substr( $_REQUEST['mycred-action'], 0, 6 ) === 'export' ) {
578
 
579
- if ( wp_verify_nonce( $_REQUEST['_token'], $token ) )
580
  $valid = true;
581
 
582
  }
531
  if ( $is_admin ) {
532
 
533
  if ( isset( $_GET['page'] ) )
534
+ $args['page'] = sanitize_key( wp_unslash( $_GET['page'] ) );
535
 
536
  $args['mycred-action'] = 'export';
537
  $args['_token'] = wp_create_nonce( 'mycred-export-request-admin' );
574
 
575
  if ( is_user_logged_in() ) {
576
 
577
+ if ( isset( $_REQUEST['mycred-action'] ) && isset( $_REQUEST['_token'] ) && substr( sanitize_text_field( wp_unslash( $_REQUEST['mycred-action'] ) ), 0, 6 ) === 'export' ) {
578
 
579
+ if ( wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_token'] ) ), $token ) )
580
  $valid = true;
581
 
582
  }
includes/classes/class.query-log.php CHANGED
@@ -1065,7 +1065,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1065
  */
1066
  public function no_entries() {
1067
 
1068
- echo $this->get_no_entries();
1069
 
1070
  }
1071
 
@@ -1152,7 +1152,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1152
  <?php
1153
 
1154
  foreach ( $bulk_actions as $action_id => $label )
1155
- echo '<option value="' . $action_id . '">' . $label . '</option>';
1156
 
1157
  ?>
1158
  </select>
@@ -1177,10 +1177,10 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1177
  // Filter by reference
1178
  if ( ! empty( $this->references ) ) {
1179
 
1180
- echo '<select name="ref" id="myCRED-reference-filter"><option value="">' . __( 'Show all references', 'mycred' ) . '</option>';
1181
  foreach ( $this->references as $ref_id => $ref_label ) {
1182
 
1183
- echo '<option value="' . $ref_id . '"';
1184
  if ( isset( $_GET['ref'] ) && $_GET['ref'] == $ref_id ) echo ' selected="selected"';
1185
  echo '>' . esc_html( $ref_label ) . '</option>';
1186
 
@@ -1193,7 +1193,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1193
  // Filter by user
1194
  if ( $this->core->user_is_point_editor() && ! $is_profile && $this->num_rows > 0 ) {
1195
 
1196
- echo '<input type="text" class="form-control" name="user" id="myCRED-user-filter" size="22" placeholder="' . __( 'User ID, Username, Email or Nicename', 'mycred' ) . '" value="' . ( ( isset( $_GET['user'] ) ) ? esc_attr( $_GET['user'] ) : '' ) . '" /> ';
1197
  $show = true;
1198
 
1199
  }
@@ -1201,13 +1201,13 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1201
  // Filter Order
1202
  if ( $this->num_rows > 0 ) {
1203
 
1204
- echo '<select name="order" id="myCRED-order-filter"><option value="">' . __( 'Show in order', 'mycred' ) . '</option>';
1205
  foreach ( array( 'ASC' => __( 'Ascending', 'mycred' ), 'DESC' => __( 'Descending', 'mycred' ) ) as $value => $label ) {
1206
 
1207
- echo '<option value="' . $value . '"';
1208
  if ( ! isset( $_GET['order'] ) && $value == 'DESC' ) echo ' selected="selected"';
1209
  elseif ( isset( $_GET['order'] ) && $_GET['order'] == $value ) echo ' selected="selected"';
1210
- echo '>' . $label . '</option>';
1211
 
1212
  }
1213
  echo '</select>';
@@ -1222,7 +1222,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1222
  }
1223
 
1224
  if ( $show === true )
1225
- echo '<input type="submit" class="btn btn-default button button-secondary" value="' . __( 'Filter', 'mycred' ) . '" />';
1226
 
1227
  echo '</div>';
1228
 
@@ -1239,7 +1239,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1239
  if ( ! $this->have_entries() || $this->max_num_pages == 1 || ! $this->render_mode ) return;
1240
 
1241
  ?>
1242
- <div class="row pagination-<?php echo $location; ?>">
1243
  <div class="col-xs-12">
1244
 
1245
  <?php $this->front_pagination( $pagination ); ?>
@@ -1366,7 +1366,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1366
  );
1367
  }
1368
 
1369
- echo '<nav><ul class="pagination">' . implode( '', $page_links ) . '</ul></nav>';
1370
 
1371
  }
1372
 
@@ -1478,7 +1478,35 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1478
  $page_class = ' no-pages';
1479
  }
1480
 
1481
- echo $output;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1482
 
1483
  }
1484
 
@@ -1490,7 +1518,67 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1490
  public function display() {
1491
 
1492
  if ( $this->render_mode )
1493
- echo $this->get_display();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1494
 
1495
  }
1496
 
@@ -1515,7 +1603,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1515
  $output .= '<div class="table-responsive">';
1516
 
1517
  $output .= '
1518
- <table class="' . apply_filters( 'mycred_log_table_classes', $table_class, $this ) . '" cellspacing="0" cellspacing="0">
1519
  <thead>
1520
  <tr>';
1521
 
@@ -1681,8 +1769,13 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1681
  $content = $time = apply_filters( 'mycred_log_date', date_i18n( $date_format, $log_entry->time ), $log_entry->time, $log_entry );
1682
  $content = '<time>' . $content . '</time>';
1683
 
1684
- if ( $this->is_admin )
1685
- $content .= '<div class="row-actions"><span class="view"><a href="' . add_query_arg( array( 'page' => $_REQUEST['page'], 'time' => $this->get_time_for_filter( $log_entry->time ) ), admin_url( 'admin.php' ) ) . '">' . __( 'Filter by Date', 'mycred' ) . '</a></span></div>';
 
 
 
 
 
1686
 
1687
  break;
1688
 
@@ -1737,11 +1830,15 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1737
 
1738
  $actions = array();
1739
 
1740
- if ( ! isset( $_REQUEST['user'] ) || $_REQUEST['user'] == '' )
1741
- $actions['view'] = '<a href="' . add_query_arg( array( 'page' => $_REQUEST['page'], 'user' => $entry->user_id ), admin_url( 'admin.php' ) ) . '">' . $filter_label . '</a>';
 
 
 
 
1742
 
1743
- $actions['edit'] = '<a href="javascript:void(0);" class="mycred-open-log-entry-editor" data-id="' . $entry->id . '" data-ref="' . $entry->ref . '">' . __( 'Edit', 'mycred' ) . '</a>';
1744
- $actions['delete'] = '<a href="javascript:void(0);" class="mycred-delete-row" data-id="' . $entry->id . '">' . __( 'Delete', 'mycred' ) . '</a>';
1745
 
1746
  if ( ! empty( $actions ) ) {
1747
 
@@ -1785,7 +1882,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1785
 
1786
  ?>
1787
  <div style="display:none;" class="clear" id="export-log-history">
1788
- <?php if ( ! empty( $title ) ) : ?><h3 class="group-title"><?php echo $title; ?></h3><?php endif; ?>
1789
  <?php
1790
 
1791
  if ( ! empty( $exports ) ) {
@@ -1801,7 +1898,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1801
  $url = mycred_get_export_url( $id );
1802
  if ( $url === false ) continue;
1803
 
1804
- echo '<a href="" class="' . $data['class'] . '">' . $label . '</a> ';
1805
 
1806
  }
1807
 
@@ -1813,7 +1910,7 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
1813
 
1814
  else {
1815
 
1816
- echo '<p>' . __( 'No export options available.', 'mycred' ) . '</p>';
1817
 
1818
  }
1819
 
@@ -1840,7 +1937,7 @@ jQuery(function($) {
1840
  if ( ! $this->render_mode ) return;
1841
 
1842
  if ( isset( $_GET['s'] ) && $_GET['s'] != '' )
1843
- $serarch_string = sanitize_text_field( $_GET['s'] );
1844
  else
1845
  $serarch_string = '';
1846
 
@@ -1882,21 +1979,21 @@ jQuery(function($) {
1882
 
1883
  $count = $count+1;
1884
 
1885
- echo '<li class="' . $sorting_id . '"><a href="';
1886
 
1887
  // Build Query Args
1888
  $url_args = array();
1889
  if ( isset( $_GET['user_id'] ) && $_GET['user_id'] != '' )
1890
- $url_args['user_id'] = $_GET['user_id'];
1891
 
1892
  if ( isset( $_GET['ref'] ) && $_GET['ref'] != '' )
1893
- $url_args['ref'] = $_GET['ref'];
1894
 
1895
  if ( isset( $_GET['order'] ) && $_GET['order'] != '' )
1896
- $url_args['order'] = $_GET['order'];
1897
 
1898
  if ( isset( $_GET['s'] ) && $_GET['s'] != '' )
1899
- $url_args['s'] = $_GET['s'];
1900
 
1901
  if ( $sorting_id != '' )
1902
  $url_args['show'] = $sorting_id;
@@ -1913,7 +2010,7 @@ jQuery(function($) {
1913
  if ( isset( $_GET['show'] ) && $_GET['show'] == $sorting_id ) echo ' class="current"';
1914
  elseif ( ! isset( $_GET['show'] ) && $sorting_id == '' ) echo ' class="current"';
1915
 
1916
- echo '>' . $sorting_name . '</a>';
1917
  if ( $count != $total ) echo ' | ';
1918
  echo '</li>';
1919
 
1065
  */
1066
  public function no_entries() {
1067
 
1068
+ echo esc_html( $this->get_no_entries() );
1069
 
1070
  }
1071
 
1152
  <?php
1153
 
1154
  foreach ( $bulk_actions as $action_id => $label )
1155
+ echo '<option value="' . esc_attr( $action_id ) . '">' . esc_html( $label ) . '</option>';
1156
 
1157
  ?>
1158
  </select>
1177
  // Filter by reference
1178
  if ( ! empty( $this->references ) ) {
1179
 
1180
+ echo '<select name="ref" id="myCRED-reference-filter"><option value="">' . esc_html__( 'Show all references', 'mycred' ) . '</option>';
1181
  foreach ( $this->references as $ref_id => $ref_label ) {
1182
 
1183
+ echo '<option value="' . esc_attr( $ref_id ) . '"';
1184
  if ( isset( $_GET['ref'] ) && $_GET['ref'] == $ref_id ) echo ' selected="selected"';
1185
  echo '>' . esc_html( $ref_label ) . '</option>';
1186
 
1193
  // Filter by user
1194
  if ( $this->core->user_is_point_editor() && ! $is_profile && $this->num_rows > 0 ) {
1195
 
1196
+ echo '<input type="text" class="form-control" name="user" id="myCRED-user-filter" size="22" placeholder="' . esc_attr__( 'User ID, Username, Email or Nicename', 'mycred' ) . '" value="' . ( ( isset( $_GET['user'] ) ) ? esc_attr( sanitize_text_field( wp_unslash( $_GET['user'] ) ) ) : '' ) . '" /> ';
1197
  $show = true;
1198
 
1199
  }
1201
  // Filter Order
1202
  if ( $this->num_rows > 0 ) {
1203
 
1204
+ echo '<select name="order" id="myCRED-order-filter"><option value="">' . esc_html__( 'Show in order', 'mycred' ) . '</option>';
1205
  foreach ( array( 'ASC' => __( 'Ascending', 'mycred' ), 'DESC' => __( 'Descending', 'mycred' ) ) as $value => $label ) {
1206
 
1207
+ echo '<option value="' . esc_attr( $value ) . '"';
1208
  if ( ! isset( $_GET['order'] ) && $value == 'DESC' ) echo ' selected="selected"';
1209
  elseif ( isset( $_GET['order'] ) && $_GET['order'] == $value ) echo ' selected="selected"';
1210
+ echo '>' . esc_html( $label ) . '</option>';
1211
 
1212
  }
1213
  echo '</select>';
1222
  }
1223
 
1224
  if ( $show === true )
1225
+ echo '<input type="submit" class="btn btn-default button button-secondary" value="' . esc_attr__( 'Filter', 'mycred' ) . '" />';
1226
 
1227
  echo '</div>';
1228
 
1239
  if ( ! $this->have_entries() || $this->max_num_pages == 1 || ! $this->render_mode ) return;
1240
 
1241
  ?>
1242
+ <div class="row pagination-<?php echo esc_attr( $location ); ?>">
1243
  <div class="col-xs-12">
1244
 
1245
  <?php $this->front_pagination( $pagination ); ?>
1366
  );
1367
  }
1368
 
1369
+ echo '<nav><ul class="pagination">' . wp_kses_post( implode( '', $page_links ) ) . '</ul></nav>';
1370
 
1371
  }
1372
 
1478
  $page_class = ' no-pages';
1479
  }
1480
 
1481
+ echo wp_kses(
1482
+ $output,
1483
+ array(
1484
+ 'div' => array(
1485
+ 'class' => array()
1486
+ ),
1487
+ 'span' => array(
1488
+ 'class' => array(),
1489
+ 'aria-hidden' => array()
1490
+ ),
1491
+ 'a' => array(
1492
+ 'class' => array(),
1493
+ 'href' => array()
1494
+ ),
1495
+ 'label' => array(
1496
+ 'for' => array(),
1497
+ 'class' => array()
1498
+ ),
1499
+ 'input' => array(
1500
+ 'id' => array(),
1501
+ 'type' => array(),
1502
+ 'name' => array(),
1503
+ 'value' => array(),
1504
+ 'size' => array(),
1505
+ 'aria-describedby' => array(),
1506
+ 'class' => array()
1507
+ )
1508
+ )
1509
+ );
1510
 
1511
  }
1512
 
1518
  public function display() {
1519
 
1520
  if ( $this->render_mode )
1521
+ echo wp_kses(
1522
+ $this->get_display(),
1523
+ array(
1524
+ 'div' => array(
1525
+ 'class' => array()
1526
+ ),
1527
+ 'table' => array(
1528
+ 'class' => array(),
1529
+ 'cellspacing' => array(),
1530
+ 'cellpadding' => array()
1531
+ ),
1532
+ 'thead' => array(),
1533
+ 'tbody' => array(
1534
+ 'id' => array()
1535
+ ),
1536
+ 'tfoot' => array(),
1537
+ 'tr' => array(
1538
+ 'class' => array(),
1539
+ 'id' => array()
1540
+ ),
1541
+ 'td' => array(
1542
+ 'colspan' => array(),
1543
+ 'class' => array(),
1544
+ 'id' => array(),
1545
+ 'data-colname' => array(),
1546
+ 'data-raw' => array()
1547
+ ),
1548
+ 'th' => array(
1549
+ 'scope' => array(),
1550
+ 'class' => array(),
1551
+ 'id' => array()
1552
+ ),
1553
+ 'label' => array(
1554
+ 'class' => array(),
1555
+ 'for' => array()
1556
+ ),
1557
+ 'input' => array(
1558
+ 'id' => array(),
1559
+ 'type' => array(),
1560
+ 'name' => array(),
1561
+ 'value' => array(),
1562
+ 'size' => array(),
1563
+ 'class' => array(),
1564
+ 'placeholder' => array()
1565
+ ),
1566
+ 'strong' => array(),
1567
+ 'span' => array(
1568
+ 'class' => array()
1569
+ ),
1570
+ 'a' => array(
1571
+ 'href' => array(),
1572
+ 'data-id' => array(),
1573
+ 'data-ref' => array(),
1574
+ 'class' => array()
1575
+ ),
1576
+ 'button' => array(
1577
+ 'type' => array(),
1578
+ 'class' => array()
1579
+ )
1580
+ )
1581
+ );
1582
 
1583
  }
1584
 
1603
  $output .= '<div class="table-responsive">';
1604
 
1605
  $output .= '
1606
+ <table class="' . apply_filters( 'mycred_log_table_classes', $table_class, $this ) . '" cellspacing="0" cellpadding="0">
1607
  <thead>
1608
  <tr>';
1609
 
1769
  $content = $time = apply_filters( 'mycred_log_date', date_i18n( $date_format, $log_entry->time ), $log_entry->time, $log_entry );
1770
  $content = '<time>' . $content . '</time>';
1771
 
1772
+ if ( $this->is_admin ) {
1773
+
1774
+ $request_page = isset( $_REQUEST['page'] ) ? intval( $_REQUEST['page'] ) : 0;
1775
+
1776
+ $content .= '<div class="row-actions"><span class="view"><a href="' . esc_url( add_query_arg( array( 'page' => $request_page, 'time' => $this->get_time_for_filter( $log_entry->time ) ), admin_url( 'admin.php' ) ) ) . '">' . esc_html__( 'Filter by Date', 'mycred' ) . '</a></span></div>';
1777
+
1778
+ }
1779
 
1780
  break;
1781
 
1830
 
1831
  $actions = array();
1832
 
1833
+ if ( ! isset( $_REQUEST['user'] ) || $_REQUEST['user'] == '' ) {
1834
+
1835
+ $request_page = isset( $_REQUEST['page'] ) ? intval( $_REQUEST['page'] ) : 0;
1836
+
1837
+ $actions['view'] = '<a href="' . add_query_arg( array( 'page' => $request_page, 'user' => $entry->user_id ), admin_url( 'admin.php' ) ) . '">' . $filter_label . '</a>';
1838
+ }
1839
 
1840
+ $actions['edit'] = '<a href="#" class="mycred-open-log-entry-editor" data-id="' . $entry->id . '" data-ref="' . $entry->ref . '">' . __( 'Edit', 'mycred' ) . '</a>';
1841
+ $actions['delete'] = '<a href="#" class="mycred-delete-row" data-id="' . $entry->id . '">' . __( 'Delete', 'mycred' ) . '</a>';
1842
 
1843
  if ( ! empty( $actions ) ) {
1844
 
1882
 
1883
  ?>
1884
  <div style="display:none;" class="clear" id="export-log-history">
1885
+ <?php if ( ! empty( $title ) ) : ?><h3 class="group-title"><?php echo esc_html( $title ); ?></h3><?php endif; ?>
1886
  <?php
1887
 
1888
  if ( ! empty( $exports ) ) {
1898
  $url = mycred_get_export_url( $id );
1899
  if ( $url === false ) continue;
1900
 
1901
+ echo '<a href="" class="' . esc_attr( $data['class'] ) . '">' . esc_html( $label ) . '</a> ';
1902
 
1903
  }
1904
 
1910
 
1911
  else {
1912
 
1913
+ echo '<p>' . esc_html__( 'No export options available.', 'mycred' ) . '</p>';
1914
 
1915
  }
1916
 
1937
  if ( ! $this->render_mode ) return;
1938
 
1939
  if ( isset( $_GET['s'] ) && $_GET['s'] != '' )
1940
+ $serarch_string = sanitize_text_field( wp_unslash( $_GET['s'] ) );
1941
  else
1942
  $serarch_string = '';
1943
 
1979
 
1980
  $count = $count+1;
1981
 
1982
+ echo '<li class="' . esc_attr( $sorting_id ) . '"><a href="';
1983
 
1984
  // Build Query Args
1985
  $url_args = array();
1986
  if ( isset( $_GET['user_id'] ) && $_GET['user_id'] != '' )
1987
+ $url_args['user_id'] = absint( $_GET['user_id'] );
1988
 
1989
  if ( isset( $_GET['ref'] ) && $_GET['ref'] != '' )
1990
+ $url_args['ref'] = sanitize_text_field( wp_unslash( $_GET['ref'] ) );
1991
 
1992
  if ( isset( $_GET['order'] ) && $_GET['order'] != '' )
1993
+ $url_args['order'] = sanitize_text_field( wp_unslash( $_GET['order'] ) );
1994
 
1995
  if ( isset( $_GET['s'] ) && $_GET['s'] != '' )
1996
+ $url_args['s'] = sanitize_text_field( wp_unslash( $_GET['s'] ) );
1997
 
1998
  if ( $sorting_id != '' )
1999
  $url_args['show'] = $sorting_id;
2010
  if ( isset( $_GET['show'] ) && $_GET['show'] == $sorting_id ) echo ' class="current"';
2011
  elseif ( ! isset( $_GET['show'] ) && $sorting_id == '' ) echo ' class="current"';
2012
 
2013
+ echo '>' . esc_html( $sorting_name ) . '</a>';
2014
  if ( $count != $total ) echo ' | ';
2015
  echo '</li>';
2016
 
includes/hooks/external/mycred-hook-affiliatewp.php CHANGED
@@ -318,7 +318,32 @@ function mycred_load_affiliatewp_hook() {
318
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
319
  <div class="form-group">
320
  <label for="<?php echo esc_attr( $this->field_id( array( 'visits', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
321
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'visits', 'limit' ) ), $this->field_id( array( 'visits', 'limit' ) ), $prefs['visits']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  </div>
323
  </div>
324
  </div>
@@ -362,7 +387,7 @@ function mycred_load_affiliatewp_hook() {
362
  </div>
363
  <label for="<?php echo esc_attr( $this->field_id( array( 'referrals', 'exchange' ) ) ); ?>"><?php esc_html_e( 'Exchange Rate', 'mycred' ); ?></label>
364
  <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'referrals', 'exchange' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'referrals', 'exchange' ) ) ); ?>" class="form-control"<?php if ( array_key_exists( $this->currency, $this->point_types ) ) echo ' readonly="readonly"'; ?> value="<?php echo esc_attr( $prefs['referrals']['exchange'] ); ?>" />
365
- <span class="description"><?php if ( ! array_key_exists( $this->currency, $this->point_types ) ) printf( __( 'How much is 1 %s worth in %s', 'mycred' ), $this->core->plural(), $this->currency ); else esc_html_e( 'Disabled', 'mycred' ); ?></span>
366
  </div>
367
  </div>
368
  </div>
318
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
319
  <div class="form-group">
320
  <label for="<?php echo esc_attr( $this->field_id( array( 'visits', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
321
+ <?php echo wp_kses(
322
+ $this->hook_limit_setting( $this->field_name( array( 'visits', 'limit' ) ), $this->field_id( array( 'visits', 'limit' ) ), $prefs['visits']['limit'] ),
323
+ array(
324
+ 'div' => array(
325
+ 'class' => array()
326
+ ),
327
+ 'input' => array(
328
+ 'type' => array(),
329
+ 'size' => array(),
330
+ 'class' => array(),
331
+ 'name' => array(),
332
+ 'id' => array(),
333
+ 'value' => array()
334
+ ),
335
+ 'select' => array(
336
+ 'name' => array(),
337
+ 'id' => array(),
338
+ 'class' => array()
339
+ ),
340
+ 'option' => array(
341
+ 'value' => array(),
342
+ 'selected' => array()
343
+ )
344
+ )
345
+ );
346
+ ?>
347
  </div>
348
  </div>
349
  </div>
387
  </div>
388
  <label for="<?php echo esc_attr( $this->field_id( array( 'referrals', 'exchange' ) ) ); ?>"><?php esc_html_e( 'Exchange Rate', 'mycred' ); ?></label>
389
  <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'referrals', 'exchange' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'referrals', 'exchange' ) ) ); ?>" class="form-control"<?php if ( array_key_exists( $this->currency, $this->point_types ) ) echo ' readonly="readonly"'; ?> value="<?php echo esc_attr( $prefs['referrals']['exchange'] ); ?>" />
390
+ <span class="description"><?php if ( ! array_key_exists( $this->currency, $this->point_types ) ) printf( esc_html__( 'How much is 1 %s worth in %s', 'mycred' ), esc_html( $this->core->plural() ), esc_html( $this->currency ) ); else esc_html_e( 'Disabled', 'mycred' ); ?></span>
391
  </div>
392
  </div>
393
  </div>
includes/hooks/external/mycred-hook-badgeOS.php CHANGED
@@ -121,7 +121,7 @@ function mycred_load_badgeos_hook() {
121
  if ( ! $this->is_main_type )
122
  $page = MYCRED_SLUG . '_' . $this->mycred_type . '-hooks';
123
 
124
- echo '<p>' . sprintf( esc_html__( 'Please setup your <a href="%s">default settings</a> before using this feature.', 'mycred' ), admin_url( 'admin.php?page=' . $page ) ) . '</p>';
125
  return;
126
 
127
  }
@@ -135,9 +135,9 @@ function mycred_load_badgeos_hook() {
135
  $achievement_data = $prefs[ $post->post_type ];
136
 
137
  ?>
138
- <p><strong><?php echo $this->core->template_tags_general( __( '%plural% to Award', 'mycred' ) ); ?></strong></p>
139
  <p>
140
- <label class="screen-reader-text" for="mycred-values-<?php echo esc_attr( $this->mycred_type ); ?>-creds"><?php echo $this->core->template_tags_general( __( '%plural% to Award', 'mycred' ) ); ?></label>
141
  <input type="text" name="<?php echo esc_attr( $post_key ); ?>[creds]" id="mycred-values-<?php echo esc_attr( $this->mycred_type ); ?>-creds" value="<?php echo esc_attr( $this->core->number( $achievement_data['creds'] ) ); ?>" size="8" />
142
  <span class="description"><?php esc_html_e( 'Use zero to disable', 'mycred' ); ?></span>
143
  </p>
@@ -194,20 +194,20 @@ function mycred_load_badgeos_hook() {
194
 
195
  // Creds
196
  if ( ! empty( $_POST[ $post_key ]['creds'] ) && $_POST[ $post_key ]['creds'] != $this->prefs[ $post_type ]['creds'] )
197
- $data['creds'] = $this->core->number( $_POST[ $post_key ]['creds'] );
198
  else
199
  $data['creds'] = $this->core->number( $this->prefs[ $post_type ]['creds'] );
200
 
201
  // Log template
202
  if ( ! empty( $_POST[ $post_key ]['log'] ) && $_POST[ $post_key ]['log'] != $this->prefs[ $post_type ]['log'] )
203
- $data['log'] = sanitize_text_field( $_POST[ $post_key ]['log'] );
204
  else
205
  $data['log'] = sanitize_text_field( $this->prefs[ $post_type ]['log'] );
206
 
207
  // If deduction is enabled save log template
208
  if ( $this->prefs[ $post_type ]['deduct'] == 1 ) {
209
  if ( ! empty( $_POST[ $post_key ]['deduct_log'] ) && $_POST[ $post_key ]['deduct_log'] != $this->prefs[ $post_type ]['deduct_log'] )
210
- $data['deduct_log'] = sanitize_text_field( $_POST[ $post_key ]['deduct_log'] );
211
  else
212
  $data['deduct_log'] = sanitize_text_field( $this->prefs[ $post_type ]['deduct_log'] );
213
  }
@@ -314,7 +314,7 @@ function mycred_load_badgeos_hook() {
314
 
315
  ?>
316
  <div class="hook-instance">
317
- <h3><?php printf( esc_html__( 'Earning: %s', 'mycred' ), $post_type_object->labels->singular_name ); ?></h3>
318
  <div class="row">
319
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
320
  <div class="form-group">
@@ -332,7 +332,7 @@ function mycred_load_badgeos_hook() {
332
  </div>
333
  </div>
334
  <div class="hook-instance">
335
- <h3><?php printf( __( 'Revoked: %s', 'mycred' ), $post_type_object->labels->singular_name ); ?></h3>
336
  <div class="row">
337
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
338
  <div class="form-group">
121
  if ( ! $this->is_main_type )
122
  $page = MYCRED_SLUG . '_' . $this->mycred_type . '-hooks';
123
 
124
+ echo '<p>' . sprintf( esc_html__( 'Please setup your <a href="%s">default settings</a> before using this feature.', 'mycred' ), esc_url( admin_url( 'admin.php?page=' . $page ) ) ) . '</p>';
125
  return;
126
 
127
  }
135
  $achievement_data = $prefs[ $post->post_type ];
136
 
137
  ?>
138
+ <p><strong><?php echo wp_kses_post( $this->core->template_tags_general( __( '%plural% to Award', 'mycred' ) ) ); ?></strong></p>
139
  <p>
140
+ <label class="screen-reader-text" for="mycred-values-<?php echo esc_attr( $this->mycred_type ); ?>-creds"><?php echo wp_kses_post( $this->core->template_tags_general( __( '%plural% to Award', 'mycred' ) ) ); ?></label>
141
  <input type="text" name="<?php echo esc_attr( $post_key ); ?>[creds]" id="mycred-values-<?php echo esc_attr( $this->mycred_type ); ?>-creds" value="<?php echo esc_attr( $this->core->number( $achievement_data['creds'] ) ); ?>" size="8" />
142
  <span class="description"><?php esc_html_e( 'Use zero to disable', 'mycred' ); ?></span>
143
  </p>
194
 
195
  // Creds
196
  if ( ! empty( $_POST[ $post_key ]['creds'] ) && $_POST[ $post_key ]['creds'] != $this->prefs[ $post_type ]['creds'] )
197
+ $data['creds'] = $this->core->number( sanitize_text_field( wp_unslash( $_POST[ $post_key ]['creds'] ) ) );
198
  else
199
  $data['creds'] = $this->core->number( $this->prefs[ $post_type ]['creds'] );
200
 
201
  // Log template
202
  if ( ! empty( $_POST[ $post_key ]['log'] ) && $_POST[ $post_key ]['log'] != $this->prefs[ $post_type ]['log'] )
203
+ $data['log'] = sanitize_text_field( wp_unslash( $_POST[ $post_key ]['log'] ) );
204
  else
205
  $data['log'] = sanitize_text_field( $this->prefs[ $post_type ]['log'] );
206
 
207
  // If deduction is enabled save log template
208
  if ( $this->prefs[ $post_type ]['deduct'] == 1 ) {
209
  if ( ! empty( $_POST[ $post_key ]['deduct_log'] ) && $_POST[ $post_key ]['deduct_log'] != $this->prefs[ $post_type ]['deduct_log'] )
210
+ $data['deduct_log'] = sanitize_text_field( wp_unslash( $_POST[ $post_key ]['deduct_log'] ) );
211
  else
212
  $data['deduct_log'] = sanitize_text_field( $this->prefs[ $post_type ]['deduct_log'] );
213
  }
314
 
315
  ?>
316
  <div class="hook-instance">
317
+ <h3><?php printf( esc_html__( 'Earning: %s', 'mycred' ), esc_html( $post_type_object->labels->singular_name ) ); ?></h3>
318
  <div class="row">
319
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
320
  <div class="form-group">
332
  </div>
333
  </div>
334
  <div class="hook-instance">
335
+ <h3><?php printf( esc_html__( 'Revoked: %s', 'mycred' ), esc_html( $post_type_object->labels->singular_name ) ); ?></h3>
336
  <div class="row">
337
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
338
  <div class="form-group">
includes/hooks/external/mycred-hook-bbPress.php CHANGED
@@ -159,7 +159,7 @@ function mycred_load_bbpress_hook() {
159
  $balance = $this->core->get_users_balance( $user_id, $this->mycred_type );
160
  $layout = $this->core->plural() . ': ' . $this->core->format_creds( $balance );
161
 
162
- echo apply_filters( 'mycred_bbp_profile_balance', '<div class="users-mycred-balance">' . $layout . '</div>', $layout, $user_id, $this );
163
 
164
  }
165
 
@@ -184,7 +184,7 @@ function mycred_load_bbpress_hook() {
184
  $balance = $this->core->get_users_balance( $user_id, $this->mycred_type );
185
  $layout = $this->core->plural() . ': ' . $this->core->format_creds( $balance );
186
 
187
- echo apply_filters( 'mycred_bbp_reply_balance', '<div class="users-mycred-balance">' . $layout . '</div>', $layout, $user_id, $this );
188
 
189
  }
190
 
@@ -441,7 +441,32 @@ function mycred_load_bbpress_hook() {
441
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
442
  <div class="form-group">
443
  <label for="<?php echo esc_attr( $this->field_id( array( 'new_forum', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
444
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_forum', 'limit' ) ), $this->field_id( array( 'new_forum', 'limit' ) ), $prefs['new_forum']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  </div>
446
  </div>
447
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -459,7 +484,7 @@ function mycred_load_bbpress_hook() {
459
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
460
  <div class="form-group">
461
  <label for="<?php echo esc_attr( $this->field_id( array( 'delete_forum', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
462
- <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_forum', 'creds' ) ) ); ?>" id="<?php echo $this->field_id( array( 'delete_forum', 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['delete_forum']['creds'] ) ); ?>" class="form-control" />
463
  </div>
464
  </div>
465
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
@@ -483,7 +508,32 @@ function mycred_load_bbpress_hook() {
483
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
484
  <div class="form-group">
485
  <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
486
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
487
  </div>
488
  </div>
489
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -498,7 +548,7 @@ function mycred_load_bbpress_hook() {
498
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
499
  <div class="form-group">
500
  <div class="radio">
501
- <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic' => 'author' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'new_topic' => 'author' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_topic' => 'author' ) ) ); ?>" <?php checked( $prefs['new_topic']['author'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Forum authors can receive %_plural% for creating new topics.', 'mycred' ) ); ?></label>
502
  </div>
503
  </div>
504
  </div>
@@ -534,14 +584,39 @@ function mycred_load_bbpress_hook() {
534
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
535
  <div class="form-group">
536
  <label for="<?php echo esc_attr( $this->field_id( array( 'fav_topic', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
537
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'fav_topic', 'limit' ) ), $this->field_id( array( 'fav_topic', 'limit' ) ), $prefs['fav_topic']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
  </div>
539
  </div>
540
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
541
  <div class="form-group">
542
  <label for="<?php echo esc_attr( $this->field_id( array( 'fav_topic', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
543
  <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'fav_topic', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'fav_topic', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['fav_topic']['log'] ); ?>" class="form-control" />
544
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
545
  </div>
546
  </div>
547
  </div>
@@ -558,7 +633,32 @@ function mycred_load_bbpress_hook() {
558
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
559
  <div class="form-group">
560
  <label for="<?php echo esc_attr( $this->field_id( array( 'new_reply', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
561
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_reply', 'limit' ) ), $this->field_id( array( 'new_reply', 'limit' ) ), $prefs['new_reply']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  </div>
563
  </div>
564
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -573,7 +673,7 @@ function mycred_load_bbpress_hook() {
573
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
574
  <div class="form-group">
575
  <div class="radio">
576
- <label for="<?php echo $this->field_id( array( 'new_reply' => 'author' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'new_reply' => 'author' ) ); ?>" id="<?php echo $this->field_id( array( 'new_reply' => 'author' ) ); ?>" <?php checked( $prefs['new_reply']['author'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Topic authors can receive %_plural% for replying to their own Topic.', 'mycred' ) ); ?></label>
577
  </div>
578
  </div>
579
  </div>
@@ -584,15 +684,15 @@ function mycred_load_bbpress_hook() {
584
  <div class="row">
585
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
586
  <div class="form-group">
587
- <label for="<?php echo $this->field_id( array( 'delete_reply', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
588
- <input type="text" name="<?php echo $this->field_name( array( 'delete_reply', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_reply', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['delete_reply']['creds'] ); ?>" class="form-control" />
589
  </div>
590
  </div>
591
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
592
  <div class="form-group">
593
- <label for="<?php echo $this->field_id( array( 'delete_reply', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
594
- <input type="text" name="<?php echo $this->field_name( array( 'delete_reply', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_reply', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_reply']['log'] ); ?>" class="form-control" />
595
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
596
  </div>
597
  </div>
598
  </div>
@@ -602,10 +702,10 @@ function mycred_load_bbpress_hook() {
602
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
603
  <div class="form-group">
604
  <div class="radio">
605
- <label for="<?php echo $this->field_id( 'show_points_in_reply' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'show_points_in_reply' ); ?>" id="<?php echo $this->field_id( 'show_points_in_reply' ); ?>" <?php checked( $prefs['show_points_in_reply'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Show users %_plural% balance in replies', 'mycred' ) ); ?></label>
606
  </div>
607
  <div class="radio">
608
- <label for="<?php echo $this->field_id( 'show_points_in_profile' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'show_points_in_profile' ); ?>" id="<?php echo $this->field_id( 'show_points_in_profile' ); ?>" <?php checked( $prefs['show_points_in_profile'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Show users %_plural% balance in their bbPress profiles', 'mycred' ) ); ?></label>
609
  </div>
610
  </div>
611
  </div>
159
  $balance = $this->core->get_users_balance( $user_id, $this->mycred_type );
160
  $layout = $this->core->plural() . ': ' . $this->core->format_creds( $balance );
161
 
162
+ echo wp_kses_post( apply_filters( 'mycred_bbp_profile_balance', '<div class="users-mycred-balance">' . $layout . '</div>', $layout, $user_id, $this ) );
163
 
164
  }
165
 
184
  $balance = $this->core->get_users_balance( $user_id, $this->mycred_type );
185
  $layout = $this->core->plural() . ': ' . $this->core->format_creds( $balance );
186
 
187
+ echo wp_kses_post( apply_filters( 'mycred_bbp_reply_balance', '<div class="users-mycred-balance">' . $layout . '</div>', $layout, $user_id, $this ) );
188
 
189
  }
190
 
441
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
442
  <div class="form-group">
443
  <label for="<?php echo esc_attr( $this->field_id( array( 'new_forum', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
444
+ <?php echo wp_kses(
445
+ $this->hook_limit_setting( $this->field_name( array( 'new_forum', 'limit' ) ), $this->field_id( array( 'new_forum', 'limit' ) ), $prefs['new_forum']['limit'] ),
446
+ array(
447
+ 'div' => array(
448
+ 'class' => array()
449
+ ),
450
+ 'input' => array(
451
+ 'type' => array(),
452
+ 'size' => array(),
453
+ 'class' => array(),
454
+ 'name' => array(),
455
+ 'id' => array(),
456
+ 'value' => array()
457
+ ),
458
+ 'select' => array(
459
+ 'name' => array(),
460
+ 'id' => array(),
461
+ 'class' => array()
462
+ ),
463
+ 'option' => array(
464
+ 'value' => array(),
465
+ 'selected' => array()
466
+ )
467
+ )
468
+ );
469
+ ?>
470
  </div>
471
  </div>
472
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
484
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
485
  <div class="form-group">
486
  <label for="<?php echo esc_attr( $this->field_id( array( 'delete_forum', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
487
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_forum', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_forum', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['delete_forum']['creds'] ) ); ?>" class="form-control" />
488
  </div>
489
  </div>
490
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
508
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
509
  <div class="form-group">
510
  <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
511
+ <?php echo wp_kses(
512
+ $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ),
513
+ array(
514
+ 'div' => array(
515
+ 'class' => array()
516
+ ),
517
+ 'input' => array(
518
+ 'type' => array(),
519
+ 'size' => array(),
520
+ 'class' => array(),
521
+ 'name' => array(),
522
+ 'id' => array(),
523
+ 'value' => array()
524
+ ),
525
+ 'select' => array(
526
+ 'name' => array(),
527
+ 'id' => array(),
528
+ 'class' => array()
529
+ ),
530
+ 'option' => array(
531
+ 'value' => array(),
532
+ 'selected' => array()
533
+ )
534
+ )
535
+ );
536
+ ?>
537
  </div>
538
  </div>
539
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
548
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
549
  <div class="form-group">
550
  <div class="radio">
551
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic' => 'author' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'new_topic' => 'author' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_topic' => 'author' ) ) ); ?>" <?php checked( $prefs['new_topic']['author'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Forum authors can receive %_plural% for creating new topics.', 'mycred' ) ) ); ?></label>
552
  </div>
553
  </div>
554
  </div>
584
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
585
  <div class="form-group">
586
  <label for="<?php echo esc_attr( $this->field_id( array( 'fav_topic', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
587
+ <?php echo wp_kses(
588
+ $this->hook_limit_setting( $this->field_name( array( 'fav_topic', 'limit' ) ), $this->field_id( array( 'fav_topic', 'limit' ) ), $prefs['fav_topic']['limit'] ),
589
+ array(
590
+ 'div' => array(
591
+ 'class' => array()
592
+ ),
593
+ 'input' => array(
594
+ 'type' => array(),
595
+ 'size' => array(),
596
+ 'class' => array(),
597
+ 'name' => array(),
598
+ 'id' => array(),
599
+ 'value' => array()
600
+ ),
601
+ 'select' => array(
602
+ 'name' => array(),
603
+ 'id' => array(),
604
+ 'class' => array()
605
+ ),
606
+ 'option' => array(
607
+ 'value' => array(),
608
+ 'selected' => array()
609
+ )
610
+ )
611
+ );
612
+ ?>
613
  </div>
614
  </div>
615
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
616
  <div class="form-group">
617
  <label for="<?php echo esc_attr( $this->field_id( array( 'fav_topic', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
618
  <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'fav_topic', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'fav_topic', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['fav_topic']['log'] ); ?>" class="form-control" />
619
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
620
  </div>
621
  </div>
622
  </div>
633
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
634
  <div class="form-group">
635
  <label for="<?php echo esc_attr( $this->field_id( array( 'new_reply', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
636
+ <?php echo wp_kses(
637
+ $this->hook_limit_setting( $this->field_name( array( 'new_reply', 'limit' ) ), $this->field_id( array( 'new_reply', 'limit' ) ), $prefs['new_reply']['limit'] ),
638
+ array(
639
+ 'div' => array(
640
+ 'class' => array()
641
+ ),
642
+ 'input' => array(
643
+ 'type' => array(),
644
+ 'size' => array(),
645
+ 'class' => array(),
646
+ 'name' => array(),
647
+ 'id' => array(),
648
+ 'value' => array()
649
+ ),
650
+ 'select' => array(
651
+ 'name' => array(),
652
+ 'id' => array(),
653
+ 'class' => array()
654
+ ),
655
+ 'option' => array(
656
+ 'value' => array(),
657
+ 'selected' => array()
658
+ )
659
+ )
660
+ );
661
+ ?>
662
  </div>
663
  </div>
664
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
673
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
674
  <div class="form-group">
675
  <div class="radio">
676
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_reply' => 'author' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'new_reply' => 'author' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_reply' => 'author' ) ) ); ?>" <?php checked( $prefs['new_reply']['author'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Topic authors can receive %_plural% for replying to their own Topic.', 'mycred' ) ) ); ?></label>
677
  </div>
678
  </div>
679
  </div>
684
  <div class="row">
685
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
686
  <div class="form-group">
687
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_reply', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
688
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_reply', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_reply', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['delete_reply']['creds'] ) ); ?>" class="form-control" />
689
  </div>
690
  </div>
691
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
692
  <div class="form-group">
693
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_reply', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
694
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_reply', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_reply', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_reply']['log'] ); ?>" class="form-control" />
695
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
696
  </div>
697
  </div>
698
  </div>
702
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
703
  <div class="form-group">
704
  <div class="radio">
705
+ <label for="<?php echo esc_attr( $this->field_id( 'show_points_in_reply' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'show_points_in_reply' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'show_points_in_reply' ) ); ?>" <?php checked( $prefs['show_points_in_reply'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Show users %_plural% balance in replies', 'mycred' ) ) ); ?></label>
706
  </div>
707
  <div class="radio">
708
+ <label for="<?php echo esc_attr( $this->field_id( 'show_points_in_profile' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'show_points_in_profile' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'show_points_in_profile' ) ); ?>" <?php checked( $prefs['show_points_in_profile'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Show users %_plural% balance in their bbPress profiles', 'mycred' ) ) ); ?></label>
709
  </div>
710
  </div>
711
  </div>
includes/hooks/external/mycred-hook-buddypress-media.php CHANGED
@@ -291,21 +291,46 @@ function mycred_load_buddypress_media_hook() {
291
  <div class="row">
292
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
293
  <div class="form-group">
294
- <label for="<?php echo $this->field_id( array( 'new_media', 'photo' ) ); ?>"><?php echo $this->core->plural(); ?></label>
295
- <input type="text" name="<?php echo $this->field_name( array( 'new_media', 'photo' ) ); ?>" id="<?php echo $this->field_id( array( 'new_media', 'photo' ) ); ?>"<?php echo $photos; ?> value="<?php echo $this->core->number( $prefs['new_media']['photo'] ); ?>" class="form-control" />
296
  </div>
297
  </div>
298
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
299
  <div class="form-group">
300
- <label for="<?php echo $this->field_id( array( 'new_media', 'photo_limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
301
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_media', 'photo_limit' ) ), $this->field_id( array( 'new_media', 'photo_limit' ) ), $prefs['new_media']['photo_limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  </div>
303
  </div>
304
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
305
  <div class="form-group">
306
- <label for="<?php echo $this->field_id( array( 'new_media', 'photo_log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
307
- <input type="text" name="<?php echo $this->field_name( array( 'new_media', 'photo_log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_media', 'photo_log' ) ); ?>"<?php echo $photos; ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_media']['photo_log'] ); ?>" class="form-control" />
308
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
309
  </div>
310
  </div>
311
  </div>
@@ -315,21 +340,46 @@ function mycred_load_buddypress_media_hook() {
315
  <div class="row">
316
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
317
  <div class="form-group">
318
- <label for="<?php echo $this->field_id( array( 'new_media', 'video' ) ); ?>"><?php echo $this->core->plural(); ?></label>
319
- <input type="text" name="<?php echo $this->field_name( array( 'new_media', 'video' ) ); ?>" id="<?php echo $this->field_id( array( 'new_media', 'video' ) ); ?>"<?php echo $photos; ?> value="<?php echo $this->core->number( $prefs['new_media']['video'] ); ?>" class="form-control" />
320
  </div>
321
  </div>
322
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
323
  <div class="form-group">
324
- <label for="<?php echo $this->field_id( array( 'new_media', 'video_limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
325
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_media', 'video_limit' ) ), $this->field_id( array( 'new_media', 'video_limit' ) ), $prefs['new_media']['video_limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  </div>
327
  </div>
328
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
329
  <div class="form-group">
330
- <label for="<?php echo $this->field_id( array( 'new_media', 'video_log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
331
- <input type="text" name="<?php echo $this->field_name( array( 'new_media', 'video_log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_media', 'video_log' ) ); ?>"<?php echo $photos; ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_media']['video_log'] ); ?>" class="form-control" />
332
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
333
  </div>
334
  </div>
335
  </div>
@@ -339,21 +389,46 @@ function mycred_load_buddypress_media_hook() {
339
  <div class="row">
340
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
341
  <div class="form-group">
342
- <label for="<?php echo $this->field_id( array( 'new_media', 'music' ) ); ?>"><?php echo $this->core->plural(); ?></label>
343
- <input type="text" name="<?php echo $this->field_name( array( 'new_media', 'music' ) ); ?>" id="<?php echo $this->field_id( array( 'new_media', 'music' ) ); ?>"<?php echo $photos; ?> value="<?php echo $this->core->number( $prefs['new_media']['music'] ); ?>" class="form-control" />
344
  </div>
345
  </div>
346
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
347
  <div class="form-group">
348
- <label for="<?php echo $this->field_id( array( 'new_media', 'music_limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
349
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_media', 'music_limit' ) ), $this->field_id( array( 'new_media', 'music_limit' ) ), $prefs['new_media']['music_limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  </div>
351
  </div>
352
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
353
  <div class="form-group">
354
- <label for="<?php echo $this->field_id( array( 'new_media', 'music_log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
355
- <input type="text" name="<?php echo $this->field_name( array( 'new_media', 'music_log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_media', 'music_log' ) ); ?>"<?php echo $photos; ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_media']['music_log'] ); ?>" class="form-control" />
356
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
357
  </div>
358
  </div>
359
  </div>
@@ -363,15 +438,15 @@ function mycred_load_buddypress_media_hook() {
363
  <div class="row">
364
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
365
  <div class="form-group">
366
- <label for="<?php echo $this->field_id( array( 'delete_media', 'photo' ) ); ?>"><?php echo $this->core->plural(); ?></label>
367
- <input type="text" name="<?php echo $this->field_name( array( 'delete_media', 'photo' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_media', 'photo' ) ); ?>"<?php echo $photos; ?> value="<?php echo $this->core->number( $prefs['delete_media']['photo'] ); ?>" class="form-control" />
368
  </div>
369
  </div>
370
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
371
  <div class="form-group">
372
- <label for="<?php echo $this->field_id( array( 'delete_media', 'photo_log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
373
- <input type="text" name="<?php echo $this->field_name( array( 'delete_media', 'photo_log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_media', 'photo_log' ) ); ?>"<?php echo $photos; ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_media']['photo_log'] ); ?>" class="form-control" />
374
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
375
  </div>
376
  </div>
377
  </div>
@@ -381,15 +456,15 @@ function mycred_load_buddypress_media_hook() {
381
  <div class="row">
382
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
383
  <div class="form-group">
384
- <label for="<?php echo $this->field_id( array( 'delete_media', 'video' ) ); ?>"><?php echo $this->core->plural(); ?></label>
385
- <input type="text" name="<?php echo $this->field_name( array( 'delete_media', 'video' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_media', 'video' ) ); ?>"<?php echo $photos; ?> value="<?php echo $this->core->number( $prefs['delete_media']['video'] ); ?>" class="form-control" />
386
  </div>
387
  </div>
388
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
389
  <div class="form-group">
390
- <label for="<?php echo $this->field_id( array( 'delete_media', 'video_log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
391
- <input type="text" name="<?php echo $this->field_name( array( 'delete_media', 'video_log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_media', 'video_log' ) ); ?>"<?php echo $photos; ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_media']['video_log'] ); ?>" class="form-control" />
392
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
393
  </div>
394
  </div>
395
  </div>
@@ -399,15 +474,15 @@ function mycred_load_buddypress_media_hook() {
399
  <div class="row">
400
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
401
  <div class="form-group">
402
- <label for="<?php echo $this->field_id( array( 'delete_media', 'music' ) ); ?>"><?php echo $this->core->plural(); ?></label>
403
- <input type="text" name="<?php echo $this->field_name( array( 'delete_media', 'music' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_media', 'music' ) ); ?>"<?php echo $photos; ?> value="<?php echo $this->core->number( $prefs['delete_media']['music'] ); ?>" class="form-control" />
404
  </div>
405
  </div>
406
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
407
  <div class="form-group">
408
- <label for="<?php echo $this->field_id( array( 'delete_media', 'music_log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
409
- <input type="text" name="<?php echo $this->field_name( array( 'delete_media', 'music_log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_media', 'music_log' ) ); ?>"<?php echo $photos; ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_media']['music_log'] ); ?>" class="form-control" />
410
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
411
  </div>
412
  </div>
413
  </div>
291
  <div class="row">
292
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
293
  <div class="form-group">
294
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'photo' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
295
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_media', 'photo' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_media', 'photo' ) ) ); ?>"<?php echo wp_kses_post( $photos ); ?> value="<?php echo esc_attr( $this->core->number( $prefs['new_media']['photo'] ) ); ?>" class="form-control" />
296
  </div>
297
  </div>
298
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
299
  <div class="form-group">
300
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'photo_limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
301
+ <?php echo wp_kses(
302
+ $this->hook_limit_setting( $this->field_name( array( 'new_media', 'photo_limit' ) ), $this->field_id( array( 'new_media', 'photo_limit' ) ), $prefs['new_media']['photo_limit'] ),
303
+ array(
304
+ 'div' => array(
305
+ 'class' => array()
306
+ ),
307
+ 'input' => array(
308
+ 'type' => array(),
309
+ 'size' => array(),
310
+ 'class' => array(),
311
+ 'name' => array(),
312
+ 'id' => array(),
313
+ 'value' => array()
314
+ ),
315
+ 'select' => array(
316
+ 'name' => array(),
317
+ 'id' => array(),
318
+ 'class' => array()
319
+ ),
320
+ 'option' => array(
321
+ 'value' => array(),
322
+ 'selected' => array()
323
+ )
324
+ )
325
+ );
326
+ ?>
327
  </div>
328
  </div>
329
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
330
  <div class="form-group">
331
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'photo_log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
332
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_media', 'photo_log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_media', 'photo_log' ) ) ); ?>"<?php echo wp_kses_post( $photos ); ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_media']['photo_log'] ); ?>" class="form-control" />
333
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
334
  </div>
335
  </div>
336
  </div>
340
  <div class="row">
341
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
342
  <div class="form-group">
343
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'video' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
344
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_media', 'video' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_media', 'video' ) ) ); ?>"<?php echo wp_kses_post( $videos ); ?> value="<?php echo esc_attr( $this->core->number( $prefs['new_media']['video'] ) ); ?>" class="form-control" />
345
  </div>
346
  </div>
347
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
348
  <div class="form-group">
349
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'video_limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
350
+ <?php echo wp_kses(
351
+ $this->hook_limit_setting( $this->field_name( array( 'new_media', 'video_limit' ) ), $this->field_id( array( 'new_media', 'video_limit' ) ), $prefs['new_media']['video_limit'] ),
352
+ array(
353
+ 'div' => array(
354
+ 'class' => array()
355
+ ),
356
+ 'input' => array(
357
+ 'type' => array(),
358
+ 'size' => array(),
359
+ 'class' => array(),
360
+ 'name' => array(),
361
+ 'id' => array(),
362
+ 'value' => array()
363
+ ),
364
+ 'select' => array(
365
+ 'name' => array(),
366
+ 'id' => array(),
367
+ 'class' => array()
368
+ ),
369
+ 'option' => array(
370
+ 'value' => array(),
371
+ 'selected' => array()
372
+ )
373
+ )
374
+ );
375
+ ?>
376
  </div>
377
  </div>
378
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
379
  <div class="form-group">
380
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'video_log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
381
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_media', 'video_log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_media', 'video_log' ) ) ); ?>"<?php echo wp_kses_post( $videos ); ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_media']['video_log'] ); ?>" class="form-control" />
382
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
383
  </div>
384
  </div>
385
  </div>
389
  <div class="row">
390
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
391
  <div class="form-group">
392
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'music' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
393
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_media', 'music' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_media', 'music' ) ) ); ?>"<?php echo wp_kses_post( $music ); ?> value="<?php echo esc_attr( $this->core->number( $prefs['new_media']['music'] ) ); ?>" class="form-control" />
394
  </div>
395
  </div>
396
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
397
  <div class="form-group">
398
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'music_limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
399
+ <?php echo wp_kses(
400
+ $this->hook_limit_setting( $this->field_name( array( 'new_media', 'music_limit' ) ), $this->field_id( array( 'new_media', 'music_limit' ) ), $prefs['new_media']['music_limit'] ),
401
+ array(
402
+ 'div' => array(
403
+ 'class' => array()
404
+ ),
405
+ 'input' => array(
406
+ 'type' => array(),
407
+ 'size' => array(),
408
+ 'class' => array(),
409
+ 'name' => array(),
410
+ 'id' => array(),
411
+ 'value' => array()
412
+ ),
413
+ 'select' => array(
414
+ 'name' => array(),
415
+ 'id' => array(),
416
+ 'class' => array()
417
+ ),
418
+ 'option' => array(
419
+ 'value' => array(),
420
+ 'selected' => array()
421
+ )
422
+ )
423
+ );
424
+ ?>
425
  </div>
426
  </div>
427
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
428
  <div class="form-group">
429
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_media', 'music_log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
430
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_media', 'music_log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_media', 'music_log' ) ) ); ?>"<?php echo wp_kses_post( $music ); ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_media']['music_log'] ); ?>" class="form-control" />
431
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
432
  </div>
433
  </div>
434
  </div>
438
  <div class="row">
439
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
440
  <div class="form-group">
441
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'photo' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
442
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_media', 'photo' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'photo' ) ) ); ?>"<?php echo wp_kses_post( $photos ); ?> value="<?php echo esc_attr( $this->core->number( $prefs['delete_media']['photo'] ) ); ?>" class="form-control" />
443
  </div>
444
  </div>
445
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
446
  <div class="form-group">
447
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'photo_log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
448
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_media', 'photo_log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'photo_log' ) ) ); ?>"<?php echo wp_kses_post( $photos ); ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_media']['photo_log'] ); ?>" class="form-control" />
449
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
450
  </div>
451
  </div>
452
  </div>
456
  <div class="row">
457
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
458
  <div class="form-group">
459
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'video' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
460
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_media', 'video' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'video' ) ) ); ?>"<?php echo wp_kses_post( $videos ); ?> value="<?php echo esc_attr( $this->core->number( $prefs['delete_media']['video'] ) ); ?>" class="form-control" />
461
  </div>
462
  </div>
463
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
464
  <div class="form-group">
465
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'video_log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
466
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_media', 'video_log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'video_log' ) ) ); ?>"<?php echo wp_kses_post( $videos ); ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_media']['video_log'] ); ?>" class="form-control" />
467
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
468
  </div>
469
  </div>
470
  </div>
474
  <div class="row">
475
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
476
  <div class="form-group">
477
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'music' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
478
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_media', 'music' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'music' ) ) ); ?>"<?php echo wp_kses_post( $music ); ?> value="<?php echo esc_attr( $this->core->number( $prefs['delete_media']['music'] ) ); ?>" class="form-control" />
479
  </div>
480
  </div>
481
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
482
  <div class="form-group">
483
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'music_log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
484
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_media', 'music_log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_media', 'music_log' ) ) ); ?>"<?php echo wp_kses_post( $music ); ?> placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_media']['music_log'] ); ?>" class="form-control" />
485
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
486
  </div>
487
  </div>
488
  </div>
includes/hooks/external/mycred-hook-buddypress.php CHANGED
@@ -307,7 +307,7 @@ function mycred_load_buddypress_profile_hook() {
307
 
308
  // Prevent BP from running this ajax call
309
  if ( $balance < $cost ) {
310
- echo apply_filters( 'mycred_bp_declined_addfriend', __( 'Insufficient Funds', 'mycred' ), $this );
311
  exit;
312
  }
313
 
@@ -623,21 +623,46 @@ function mycred_load_buddypress_profile_hook() {
623
  <div class="row">
624
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
625
  <div class="form-group">
626
- <label for="<?php echo $this->field_id( array( 'update', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
627
- <input type="text" name="<?php echo $this->field_name( array( 'update', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'update', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['update']['creds'] ); ?>" class="form-control" />
628
  </div>
629
  </div>
630
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
631
  <div class="form-group">
632
- <label for="<?php echo $this->field_id( array( 'update', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
633
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'update', 'limit' ) ), $this->field_id( array( 'update', 'limit' ) ), $prefs['update']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
634
  </div>
635
  </div>
636
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
637
  <div class="form-group">
638
- <label for="<?php echo $this->field_id( array( 'update', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
639
- <input type="text" name="<?php echo $this->field_name( array( 'update', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'update', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['update']['log'] ); ?>" class="form-control" />
640
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
641
  </div>
642
  </div>
643
  </div>
@@ -647,21 +672,46 @@ function mycred_load_buddypress_profile_hook() {
647
  <div class="row">
648
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
649
  <div class="form-group">
650
- <label for="<?php echo $this->field_id( array( 'removed_update', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
651
- <input type="text" name="<?php echo $this->field_name( array( 'removed_update', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'removed_update', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['removed_update']['creds'] ); ?>" class="form-control" />
652
  </div>
653
  </div>
654
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
655
  <div class="form-group">
656
- <label for="<?php echo $this->field_id( array( 'removed_update', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
657
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'removed_update', 'limit' ) ), $this->field_id( array( 'removed_update', 'limit' ) ), $prefs['removed_update']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  </div>
659
  </div>
660
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
661
  <div class="form-group">
662
- <label for="<?php echo $this->field_id( array( 'removed_update', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
663
- <input type="text" name="<?php echo $this->field_name( array( 'removed_update', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'removed_update', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['removed_update']['log'] ); ?>" class="form-control" />
664
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
665
  </div>
666
  </div>
667
  </div>
@@ -671,21 +721,46 @@ function mycred_load_buddypress_profile_hook() {
671
  <div class="row">
672
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
673
  <div class="form-group">
674
- <label for="<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
675
- <input type="text" name="<?php echo $this->field_name( array( 'avatar', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['avatar']['creds'] ); ?>" class="form-control" />
676
  </div>
677
  </div>
678
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
679
  <div class="form-group">
680
- <label for="<?php echo $this->field_id( array( 'avatar', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
681
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'avatar', 'limit' ) ), $this->field_id( array( 'avatar', 'limit' ) ), $prefs['avatar']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
  </div>
683
  </div>
684
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
685
  <div class="form-group">
686
- <label for="<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
687
- <input type="text" name="<?php echo $this->field_name( array( 'avatar', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['avatar']['log'] ); ?>" class="form-control" />
688
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
689
  </div>
690
  </div>
691
  </div>
@@ -695,21 +770,46 @@ function mycred_load_buddypress_profile_hook() {
695
  <div class="row">
696
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
697
  <div class="form-group">
698
- <label for="<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
699
- <input type="text" name="<?php echo $this->field_name( array( 'cover', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['cover']['creds'] ); ?>" class="form-control" />
700
  </div>
701
  </div>
702
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
703
  <div class="form-group">
704
- <label for="<?php echo $this->field_id( array( 'cover', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
705
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'cover', 'limit' ) ), $this->field_id( array( 'cover', 'limit' ) ), $prefs['cover']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  </div>
707
  </div>
708
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
709
  <div class="form-group">
710
- <label for="<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
711
- <input type="text" name="<?php echo $this->field_name( array( 'cover', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['cover']['log'] ); ?>" class="form-control" />
712
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
713
  </div>
714
  </div>
715
  </div>
@@ -719,21 +819,46 @@ function mycred_load_buddypress_profile_hook() {
719
  <div class="row">
720
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
721
  <div class="form-group">
722
- <label for="<?php echo $this->field_id( array( 'new_friend', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
723
- <input type="text" name="<?php echo $this->field_name( array( 'new_friend', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'new_friend', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_friend']['creds'] ); ?>" class="form-control" />
724
  </div>
725
  </div>
726
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
727
  <div class="form-group">
728
- <label for="<?php echo $this->field_id( array( 'new_friend', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
729
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_friend', 'limit' ) ), $this->field_id( array( 'new_friend', 'limit' ) ), $prefs['new_friend']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
  </div>
731
  </div>
732
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
733
  <div class="form-group">
734
- <label for="<?php echo $this->field_id( array( 'new_friend', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
735
- <input type="text" name="<?php echo $this->field_name( array( 'new_friend', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_friend', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_friend']['log'] ); ?>" class="form-control" />
736
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
737
  </div>
738
  </div>
739
  </div>
@@ -741,7 +866,7 @@ function mycred_load_buddypress_profile_hook() {
741
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
742
  <div class="form-group">
743
  <div class="radio">
744
- <label for="<?php echo $this->field_id( array( 'new_friend', 'block' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'new_friend', 'block' ) ); ?>"<?php checked( $friend_block, 1 ); ?> id="<?php echo $this->field_id( array( 'new_friend', 'block' ) ); ?>" value="1" /> <?php echo $this->core->template_tags_general( __( 'Users with zero balance can not add friends. Requires that you deduct %_plural% for adding a new friend.', 'mycred' ) ); ?></label>
745
  </div>
746
  </div>
747
  </div>
@@ -752,15 +877,15 @@ function mycred_load_buddypress_profile_hook() {
752
  <div class="row">
753
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
754
  <div class="form-group">
755
- <label for="<?php echo $this->field_id( array( 'leave_friend', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
756
- <input type="text" name="<?php echo $this->field_name( array( 'leave_friend', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'leave_friend', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['leave_friend']['creds'] ); ?>" class="form-control" />
757
  </div>
758
  </div>
759
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
760
  <div class="form-group">
761
- <label for="<?php echo $this->field_id( array( 'leave_friend', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
762
- <input type="text" name="<?php echo $this->field_name( array( 'leave_friend', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'leave_friend', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['leave_friend']['log'] ); ?>" class="form-control" />
763
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
764
  </div>
765
  </div>
766
  </div>
@@ -770,21 +895,46 @@ function mycred_load_buddypress_profile_hook() {
770
  <div class="row">
771
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
772
  <div class="form-group">
773
- <label for="<?php echo $this->field_id( array( 'new_comment', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
774
- <input type="text" name="<?php echo $this->field_name( array( 'new_comment', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'new_comment', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_comment']['creds'] ); ?>" class="form-control" />
775
  </div>
776
  </div>
777
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
778
  <div class="form-group">
779
- <label for="<?php echo $this->field_id( array( 'new_comment', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
780
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_comment', 'limit' ) ), $this->field_id( array( 'new_comment', 'limit' ) ), $prefs['new_comment']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
781
  </div>
782
  </div>
783
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
784
  <div class="form-group">
785
- <label for="<?php echo $this->field_id( array( 'new_comment', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
786
- <input type="text" name="<?php echo $this->field_name( array( 'new_comment', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_comment', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_comment']['log'] ); ?>" class="form-control" />
787
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
788
  </div>
789
  </div>
790
  </div>
@@ -794,15 +944,15 @@ function mycred_load_buddypress_profile_hook() {
794
  <div class="row">
795
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
796
  <div class="form-group">
797
- <label for="<?php echo $this->field_id( array( 'delete_comment', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
798
- <input type="text" name="<?php echo $this->field_name( array( 'delete_comment', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_comment', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['delete_comment']['creds'] ); ?>" class="form-control" />
799
  </div>
800
  </div>
801
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
802
  <div class="form-group">
803
- <label for="<?php echo $this->field_id( array( 'delete_comment', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
804
- <input type="text" name="<?php echo $this->field_name( array( 'delete_comment', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_comment', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_comment']['log'] ); ?>" class="form-control" />
805
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
806
  </div>
807
  </div>
808
  </div>
@@ -812,21 +962,46 @@ function mycred_load_buddypress_profile_hook() {
812
  <div class="row">
813
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
814
  <div class="form-group">
815
- <label for="<?php echo $this->field_id( array( 'add_favorite', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
816
- <input type="text" name="<?php echo $this->field_name( array( 'add_favorite', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'add_favorite', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['add_favorite']['creds'] ); ?>" class="form-control" />
817
  </div>
818
  </div>
819
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
820
  <div class="form-group">
821
- <label for="<?php echo $this->field_id( array( 'add_favorite', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
822
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'add_favorite', 'limit' ) ), $this->field_id( array( 'add_favorite', 'limit' ) ), $prefs['add_favorite']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
823
  </div>
824
  </div>
825
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
826
  <div class="form-group">
827
- <label for="<?php echo $this->field_id( array( 'add_favorite', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
828
- <input type="text" name="<?php echo $this->field_name( array( 'add_favorite', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'add_favorite', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['add_favorite']['log'] ); ?>" class="form-control" />
829
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
830
  </div>
831
  </div>
832
  </div>
@@ -836,15 +1011,15 @@ function mycred_load_buddypress_profile_hook() {
836
  <div class="row">
837
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
838
  <div class="form-group">
839
- <label for="<?php echo $this->field_id( array( 'remove_favorite', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
840
- <input type="text" name="<?php echo $this->field_name( array( 'remove_favorite', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'remove_favorite', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['remove_favorite']['creds'] ); ?>" class="form-control" />
841
  </div>
842
  </div>
843
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
844
  <div class="form-group">
845
- <label for="<?php echo $this->field_id( array( 'remove_favorite', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
846
- <input type="text" name="<?php echo $this->field_name( array( 'remove_favorite', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'remove_favorite', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['remove_favorite']['log'] ); ?>" class="form-control" />
847
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
848
  </div>
849
  </div>
850
  </div>
@@ -854,21 +1029,46 @@ function mycred_load_buddypress_profile_hook() {
854
  <div class="row">
855
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
856
  <div class="form-group">
857
- <label for="<?php echo $this->field_id( array( 'message', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
858
- <input type="text" name="<?php echo $this->field_name( array( 'message', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'message', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['message']['creds'] ); ?>" class="form-control" />
859
  </div>
860
  </div>
861
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
862
  <div class="form-group">
863
- <label for="<?php echo $this->field_id( array( 'message', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
864
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'message', 'limit' ) ), $this->field_id( array( 'message', 'limit' ) ), $prefs['message']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
865
  </div>
866
  </div>
867
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
868
  <div class="form-group">
869
- <label for="<?php echo $this->field_id( array( 'message', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
870
- <input type="text" name="<?php echo $this->field_name( array( 'message', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'message', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['message']['log'] ); ?>" class="form-control" />
871
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
872
  </div>
873
  </div>
874
  </div>
@@ -878,21 +1078,46 @@ function mycred_load_buddypress_profile_hook() {
878
  <div class="row">
879
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
880
  <div class="form-group">
881
- <label for="<?php echo $this->field_id( array( 'send_gift', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
882
- <input type="text" name="<?php echo $this->field_name( array( 'send_gift', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'send_gift', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['send_gift']['creds'] ); ?>" class="form-control" />
883
  </div>
884
  </div>
885
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
886
  <div class="form-group">
887
- <label for="<?php echo $this->field_id( array( 'send_gift', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
888
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'send_gift', 'limit' ) ), $this->field_id( array( 'send_gift', 'limit' ) ), $prefs['send_gift']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
889
  </div>
890
  </div>
891
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
892
  <div class="form-group">
893
- <label for="<?php echo $this->field_id( array( 'send_gift', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
894
- <input type="text" name="<?php echo $this->field_name( array( 'send_gift', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'send_gift', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['send_gift']['log'] ); ?>" class="form-control" />
895
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
896
  </div>
897
  </div>
898
  </div>
@@ -1512,23 +1737,23 @@ function mycred_load_buddypress_groups_hook() {
1512
  <div class="row">
1513
  <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
1514
  <div class="form-group">
1515
- <label for="<?php echo $this->field_id( array( 'create', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1516
- <input type="text" name="<?php echo $this->field_name( array( 'create', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'create', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['create']['creds'] ); ?>" class="form-control" />
1517
- <span class="description"><?php echo $this->core->template_tags_general( __( 'If you use a negative value and the user does not have enough %_plural%, the "Create Group" button will be disabled.', 'mycred' ) ); ?></span>
1518
  </div>
1519
  </div>
1520
  <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
1521
  <div class="form-group">
1522
- <label for="<?php echo $this->field_id( array( 'create', 'min' ) ); ?>"><?php esc_html_e( 'No. of Members', 'mycred' ); ?></label>
1523
- <input type="text" name="<?php echo $this->field_name( array( 'create', 'min' ) ); ?>" id="<?php echo $this->field_id( array( 'create', 'min' ) ); ?>" value="<?php echo esc_attr( $prefs['create']['min'] ); ?>" class="form-control" />
1524
- <span class="description"><?php echo $this->core->template_tags_general( __( 'The number of members a group must gain before awarding %_plural%. Use zero to award as soon as the group is created.', 'mycred' ) ); ?></span>
1525
  </div>
1526
  </div>
1527
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1528
  <div class="form-group">
1529
- <label for="<?php echo $this->field_id( array( 'create', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1530
- <input type="text" name="<?php echo $this->field_name( array( 'create', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'create', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['create']['log'] ); ?>" class="form-control" />
1531
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1532
  </div>
1533
  </div>
1534
  </div>
@@ -1538,15 +1763,15 @@ function mycred_load_buddypress_groups_hook() {
1538
  <div class="row">
1539
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1540
  <div class="form-group">
1541
- <label for="<?php echo $this->field_id( array( 'delete', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1542
- <input type="text" name="<?php echo $this->field_name( array( 'delete', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'delete', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['delete']['creds'] ); ?>" class="form-control" />
1543
  </div>
1544
  </div>
1545
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
1546
  <div class="form-group">
1547
- <label for="<?php echo $this->field_id( array( 'delete', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1548
- <input type="text" name="<?php echo $this->field_name( array( 'delete', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete']['log'] ); ?>" class="form-control" />
1549
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1550
  </div>
1551
  </div>
1552
  </div>
@@ -1556,21 +1781,46 @@ function mycred_load_buddypress_groups_hook() {
1556
  <div class="row">
1557
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1558
  <div class="form-group">
1559
- <label for="<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1560
- <input type="text" name="<?php echo $this->field_name( array( 'avatar', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['avatar']['creds'] ); ?>" class="form-control" />
1561
  </div>
1562
  </div>
1563
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1564
  <div class="form-group">
1565
- <label for="<?php echo $this->field_id( array( 'avatar', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1566
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'avatar', 'limit' ) ), $this->field_id( array( 'avatar', 'limit' ) ), $prefs['avatar']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1567
  </div>
1568
  </div>
1569
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1570
  <div class="form-group">
1571
- <label for="<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1572
- <input type="text" name="<?php echo $this->field_name( array( 'avatar', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['avatar']['log'] ); ?>" class="form-control" />
1573
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1574
  </div>
1575
  </div>
1576
  </div>
@@ -1580,21 +1830,46 @@ function mycred_load_buddypress_groups_hook() {
1580
  <div class="row">
1581
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1582
  <div class="form-group">
1583
- <label for="<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1584
- <input type="text" name="<?php echo $this->field_name( array( 'cover', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['cover']['creds'] ); ?>" class="form-control" />
1585
  </div>
1586
  </div>
1587
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1588
  <div class="form-group">
1589
- <label for="<?php echo $this->field_id( array( 'cover', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1590
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'cover', 'limit' ) ), $this->field_id( array( 'cover', 'limit' ) ), $prefs['cover']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1591
  </div>
1592
  </div>
1593
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1594
  <div class="form-group">
1595
- <label for="<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1596
- <input type="text" name="<?php echo $this->field_name( array( 'cover', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['cover']['log'] ); ?>" class="form-control" />
1597
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1598
  </div>
1599
  </div>
1600
  </div>
@@ -1604,21 +1879,46 @@ function mycred_load_buddypress_groups_hook() {
1604
  <div class="row">
1605
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1606
  <div class="form-group">
1607
- <label for="<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1608
- <input type="text" name="<?php echo $this->field_name( array( 'new_topic', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_topic']['creds'] ); ?>" class="form-control" />
1609
  </div>
1610
  </div>
1611
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1612
  <div class="form-group">
1613
- <label for="<?php echo $this->field_id( array( 'new_topic', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1614
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1615
  </div>
1616
  </div>
1617
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1618
  <div class="form-group">
1619
- <label for="<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1620
- <input type="text" name="<?php echo $this->field_name( array( 'new_topic', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_topic']['log'] ); ?>" class="form-control" />
1621
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1622
  </div>
1623
  </div>
1624
  </div>
@@ -1628,21 +1928,46 @@ function mycred_load_buddypress_groups_hook() {
1628
  <div class="row">
1629
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1630
  <div class="form-group">
1631
- <label for="<?php echo $this->field_id( array( 'edit_topic', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1632
- <input type="text" name="<?php echo $this->field_name( array( 'edit_topic', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'edit_topic', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['edit_topic']['creds'] ); ?>" class="form-control" />
1633
  </div>
1634
  </div>
1635
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1636
  <div class="form-group">
1637
- <label for="<?php echo $this->field_id( array( 'edit_topic', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1638
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'edit_topic', 'limit' ) ), $this->field_id( array( 'edit_topic', 'limit' ) ), $prefs['edit_topic']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1639
  </div>
1640
  </div>
1641
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1642
  <div class="form-group">
1643
- <label for="<?php echo $this->field_id( array( 'edit_topic', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1644
- <input type="text" name="<?php echo $this->field_name( array( 'edit_topic', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'edit_topic', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['edit_topic']['log'] ); ?>" class="form-control" />
1645
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1646
  </div>
1647
  </div>
1648
  </div>
@@ -1652,21 +1977,46 @@ function mycred_load_buddypress_groups_hook() {
1652
  <div class="row">
1653
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1654
  <div class="form-group">
1655
- <label for="<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1656
- <input type="text" name="<?php echo $this->field_name( array( 'new_post', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_post']['creds'] ); ?>" class="form-control" />
1657
  </div>
1658
  </div>
1659
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1660
  <div class="form-group">
1661
- <label for="<?php echo $this->field_id( array( 'new_post', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1662
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_post', 'limit' ) ), $this->field_id( array( 'new_post', 'limit' ) ), $prefs['new_post']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1663
  </div>
1664
  </div>
1665
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1666
  <div class="form-group">
1667
- <label for="<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1668
- <input type="text" name="<?php echo $this->field_name( array( 'new_post', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_post']['log'] ); ?>" class="form-control" />
1669
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1670
  </div>
1671
  </div>
1672
  </div>
@@ -1676,21 +2026,46 @@ function mycred_load_buddypress_groups_hook() {
1676
  <div class="row">
1677
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1678
  <div class="form-group">
1679
- <label for="<?php echo $this->field_id( array( 'edit_post', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1680
- <input type="text" name="<?php echo $this->field_name( array( 'edit_post', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'edit_post', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['edit_post']['creds'] ); ?>" class="form-control" />
1681
  </div>
1682
  </div>
1683
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1684
  <div class="form-group">
1685
- <label for="<?php echo $this->field_id( array( 'edit_post', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1686
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'edit_post', 'limit' ) ), $this->field_id( array( 'edit_post', 'limit' ) ), $prefs['edit_post']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1687
  </div>
1688
  </div>
1689
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1690
  <div class="form-group">
1691
- <label for="<?php echo $this->field_id( array( 'edit_post', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1692
- <input type="text" name="<?php echo $this->field_name( array( 'edit_post', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'edit_post', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['edit_post']['log'] ); ?>" class="form-control" />
1693
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1694
  </div>
1695
  </div>
1696
  </div>
@@ -1700,21 +2075,46 @@ function mycred_load_buddypress_groups_hook() {
1700
  <div class="row">
1701
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1702
  <div class="form-group">
1703
- <label for="<?php echo $this->field_id( array( 'join', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1704
- <input type="text" name="<?php echo $this->field_name( array( 'join', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'join', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['join']['creds'] ); ?>" class="form-control" />
1705
  </div>
1706
  </div>
1707
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1708
  <div class="form-group">
1709
- <label for="<?php echo $this->field_id( array( 'join', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1710
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'join', 'limit' ) ), $this->field_id( array( 'join', 'limit' ) ), $prefs['join']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1711
  </div>
1712
  </div>
1713
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1714
  <div class="form-group">
1715
- <label for="<?php echo $this->field_id( array( 'join', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1716
- <input type="text" name="<?php echo $this->field_name( array( 'join', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'join', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['join']['log'] ); ?>" class="form-control" />
1717
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1718
  </div>
1719
  </div>
1720
  </div>
@@ -1724,15 +2124,15 @@ function mycred_load_buddypress_groups_hook() {
1724
  <div class="row">
1725
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1726
  <div class="form-group">
1727
- <label for="<?php echo $this->field_id( array( 'leave', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1728
- <input type="text" name="<?php echo $this->field_name( array( 'leave', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'leave', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['leave']['creds'] ); ?>" class="form-control" />
1729
  </div>
1730
  </div>
1731
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
1732
  <div class="form-group">
1733
- <label for="<?php echo $this->field_id( array( 'leave', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1734
- <input type="text" name="<?php echo $this->field_name( array( 'leave', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'leave', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['leave']['log'] ); ?>" class="form-control" />
1735
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1736
  </div>
1737
  </div>
1738
  </div>
@@ -1742,21 +2142,46 @@ function mycred_load_buddypress_groups_hook() {
1742
  <div class="row">
1743
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1744
  <div class="form-group">
1745
- <label for="<?php echo $this->field_id( array( 'comments', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
1746
- <input type="text" name="<?php echo $this->field_name( array( 'comments', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'comments', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['comments']['creds'] ); ?>" class="form-control" />
1747
  </div>
1748
  </div>
1749
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1750
  <div class="form-group">
1751
- <label for="<?php echo $this->field_id( array( 'comments', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1752
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'comments', 'limit' ) ), $this->field_id( array( 'comments', 'limit' ) ), $prefs['comments']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1753
  </div>
1754
  </div>
1755
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1756
  <div class="form-group">
1757
- <label for="<?php echo $this->field_id( array( 'comments', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1758
- <input type="text" name="<?php echo $this->field_name( array( 'comments', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'comments', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['comments']['log'] ); ?>" class="form-control" />
1759
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
1760
  </div>
1761
  </div>
1762
  </div>
307
 
308
  // Prevent BP from running this ajax call
309
  if ( $balance < $cost ) {
310
+ echo esc_html( apply_filters( 'mycred_bp_declined_addfriend', __( 'Insufficient Funds', 'mycred' ), $this ) );
311
  exit;
312
  }
313
 
623
  <div class="row">
624
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
625
  <div class="form-group">
626
+ <label for="<?php echo esc_attr( $this->field_id( array( 'update', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
627
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'update', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'update', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['update']['creds'] ) ); ?>" class="form-control" />
628
  </div>
629
  </div>
630
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
631
  <div class="form-group">
632
+ <label for="<?php echo esc_attr( $this->field_id( array( 'update', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
633
+ <?php echo wp_kses(
634
+ $this->hook_limit_setting( $this->field_name( array( 'update', 'limit' ) ), $this->field_id( array( 'update', 'limit' ) ), $prefs['update']['limit'] ),
635
+ array(
636
+ 'div' => array(
637
+ 'class' => array()
638
+ ),
639
+ 'input' => array(
640
+ 'type' => array(),
641
+ 'size' => array(),
642
+ 'class' => array(),
643
+ 'name' => array(),
644
+ 'id' => array(),
645
+ 'value' => array()
646
+ ),
647
+ 'select' => array(
648
+ 'name' => array(),
649
+ 'id' => array(),
650
+ 'class' => array()
651
+ ),
652
+ 'option' => array(
653
+ 'value' => array(),
654
+ 'selected' => array()
655
+ )
656
+ )
657
+ );
658
+ ?>
659
  </div>
660
  </div>
661
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
662
  <div class="form-group">
663
+ <label for="<?php echo esc_attr( $this->field_id( array( 'update', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
664
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'update', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'update', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['update']['log'] ); ?>" class="form-control" />
665
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
666
  </div>
667
  </div>
668
  </div>
672
  <div class="row">
673
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
674
  <div class="form-group">
675
+ <label for="<?php echo esc_attr( $this->field_id( array( 'removed_update', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
676
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'removed_update', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'removed_update', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['removed_update']['creds'] ) ); ?>" class="form-control" />
677
  </div>
678
  </div>
679
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
680
  <div class="form-group">
681
+ <label for="<?php echo esc_attr( $this->field_id( array( 'removed_update', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
682
+ <?php echo wp_kses(
683
+ $this->hook_limit_setting( $this->field_name( array( 'removed_update', 'limit' ) ), $this->field_id( array( 'removed_update', 'limit' ) ), $prefs['removed_update']['limit'] ),
684
+ array(
685
+ 'div' => array(
686
+ 'class' => array()
687
+ ),
688
+ 'input' => array(
689
+ 'type' => array(),
690
+ 'size' => array(),
691
+ 'class' => array(),
692
+ 'name' => array(),
693
+ 'id' => array(),
694
+ 'value' => array()
695
+ ),
696
+ 'select' => array(
697
+ 'name' => array(),
698
+ 'id' => array(),
699
+ 'class' => array()
700
+ ),
701
+ 'option' => array(
702
+ 'value' => array(),
703
+ 'selected' => array()
704
+ )
705
+ )
706
+ );
707
+ ?>
708
  </div>
709
  </div>
710
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
711
  <div class="form-group">
712
+ <label for="<?php echo esc_attr( $this->field_id( array( 'removed_update', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
713
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'removed_update', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'removed_update', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['removed_update']['log'] ); ?>" class="form-control" />
714
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
715
  </div>
716
  </div>
717
  </div>
721
  <div class="row">
722
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
723
  <div class="form-group">
724
+ <label for="<?php echo esc_attr( $this->field_id( array( 'avatar', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
725
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'avatar', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'avatar', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['avatar']['creds'] ) ); ?>" class="form-control" />
726
  </div>
727
  </div>
728
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
729
  <div class="form-group">
730
+ <label for="<?php echo esc_attr( $this->field_id( array( 'avatar', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
731
+ <?php echo wp_kses(
732
+ $this->hook_limit_setting( $this->field_name( array( 'avatar', 'limit' ) ), $this->field_id( array( 'avatar', 'limit' ) ), $prefs['avatar']['limit'] ),
733
+ array(
734
+ 'div' => array(
735
+ 'class' => array()
736
+ ),
737
+ 'input' => array(
738
+ 'type' => array(),
739
+ 'size' => array(),
740
+ 'class' => array(),
741
+ 'name' => array(),
742
+ 'id' => array(),
743
+ 'value' => array()
744
+ ),
745
+ 'select' => array(
746
+ 'name' => array(),
747
+ 'id' => array(),
748
+ 'class' => array()
749
+ ),
750
+ 'option' => array(
751
+ 'value' => array(),
752
+ 'selected' => array()
753
+ )
754
+ )
755
+ );
756
+ ?>
757
  </div>
758
  </div>
759
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
760
  <div class="form-group">
761
+ <label for="<?php echo esc_attr( $this->field_id( array( 'avatar', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
762
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'avatar', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'avatar', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['avatar']['log'] ); ?>" class="form-control" />
763
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
764
  </div>
765
  </div>
766
  </div>
770
  <div class="row">
771
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
772
  <div class="form-group">
773
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cover', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
774
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'cover', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'cover', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['cover']['creds'] ) ); ?>" class="form-control" />
775
  </div>
776
  </div>
777
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
778
  <div class="form-group">
779
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cover', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
780
+ <?php echo wp_kses(
781
+ $this->hook_limit_setting( $this->field_name( array( 'cover', 'limit' ) ), $this->field_id( array( 'cover', 'limit' ) ), $prefs['cover']['limit'] ),
782
+ array(
783
+ 'div' => array(
784
+ 'class' => array()
785
+ ),
786
+ 'input' => array(
787
+ 'type' => array(),
788
+ 'size' => array(),
789
+ 'class' => array(),
790
+ 'name' => array(),
791
+ 'id' => array(),
792
+ 'value' => array()
793
+ ),
794
+ 'select' => array(
795
+ 'name' => array(),
796
+ 'id' => array(),
797
+ 'class' => array()
798
+ ),
799
+ 'option' => array(
800
+ 'value' => array(),
801
+ 'selected' => array()
802
+ )
803
+ )
804
+ );
805
+ ?>
806
  </div>
807
  </div>
808
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
809
  <div class="form-group">
810
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cover', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
811
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'cover', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'cover', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['cover']['log'] ); ?>" class="form-control" />
812
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
813
  </div>
814
  </div>
815
  </div>
819
  <div class="row">
820
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
821
  <div class="form-group">
822
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_friend', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
823
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_friend', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_friend', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['new_friend']['creds'] ) ); ?>" class="form-control" />
824
  </div>
825
  </div>
826
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
827
  <div class="form-group">
828
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_friend', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
829
+ <?php echo wp_kses(
830
+ $this->hook_limit_setting( $this->field_name( array( 'new_friend', 'limit' ) ), $this->field_id( array( 'new_friend', 'limit' ) ), $prefs['new_friend']['limit'] ),
831
+ array(
832
+ 'div' => array(
833
+ 'class' => array()
834
+ ),
835
+ 'input' => array(
836
+ 'type' => array(),
837
+ 'size' => array(),
838
+ 'class' => array(),
839
+ 'name' => array(),
840
+ 'id' => array(),
841
+ 'value' => array()
842
+ ),
843
+ 'select' => array(
844
+ 'name' => array(),
845
+ 'id' => array(),
846
+ 'class' => array()
847
+ ),
848
+ 'option' => array(
849
+ 'value' => array(),
850
+ 'selected' => array()
851
+ )
852
+ )
853
+ );
854
+ ?>
855
  </div>
856
  </div>
857
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
858
  <div class="form-group">
859
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_friend', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
860
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_friend', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_friend', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_friend']['log'] ); ?>" class="form-control" />
861
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
862
  </div>
863
  </div>
864
  </div>
866
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
867
  <div class="form-group">
868
  <div class="radio">
869
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_friend', 'block' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'new_friend', 'block' ) ) ); ?>"<?php checked( $friend_block, 1 ); ?> id="<?php echo esc_attr( $this->field_id( array( 'new_friend', 'block' ) ) ); ?>" value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Users with zero balance can not add friends. Requires that you deduct %_plural% for adding a new friend.', 'mycred' ) ) ); ?></label>
870
  </div>
871
  </div>
872
  </div>
877
  <div class="row">
878
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
879
  <div class="form-group">
880
+ <label for="<?php echo esc_attr( $this->field_id( array( 'leave_friend', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
881
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'leave_friend', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'leave_friend', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['leave_friend']['creds'] ) ); ?>" class="form-control" />
882
  </div>
883
  </div>
884
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
885
  <div class="form-group">
886
+ <label for="<?php echo esc_attr( $this->field_id( array( 'leave_friend', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
887
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'leave_friend', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'leave_friend', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['leave_friend']['log'] ); ?>" class="form-control" />
888
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
889
  </div>
890
  </div>
891
  </div>
895
  <div class="row">
896
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
897
  <div class="form-group">
898
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_comment', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
899
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_comment', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_comment', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['new_comment']['creds'] ) ); ?>" class="form-control" />
900
  </div>
901
  </div>
902
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
903
  <div class="form-group">
904
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_comment', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
905
+ <?php echo wp_kses(
906
+ $this->hook_limit_setting( $this->field_name( array( 'new_comment', 'limit' ) ), $this->field_id( array( 'new_comment', 'limit' ) ), $prefs['new_comment']['limit'] ),
907
+ array(
908
+ 'div' => array(
909
+ 'class' => array()
910
+ ),
911
+ 'input' => array(
912
+ 'type' => array(),
913
+ 'size' => array(),
914
+ 'class' => array(),
915
+ 'name' => array(),
916
+ 'id' => array(),
917
+ 'value' => array()
918
+ ),
919
+ 'select' => array(
920
+ 'name' => array(),
921
+ 'id' => array(),
922
+ 'class' => array()
923
+ ),
924
+ 'option' => array(
925
+ 'value' => array(),
926
+ 'selected' => array()
927
+ )
928
+ )
929
+ );
930
+ ?>
931
  </div>
932
  </div>
933
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
934
  <div class="form-group">
935
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_comment', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
936
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_comment', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_comment', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_comment']['log'] ); ?>" class="form-control" />
937
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
938
  </div>
939
  </div>
940
  </div>
944
  <div class="row">
945
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
946
  <div class="form-group">
947
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_comment', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
948
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_comment', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_comment', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['delete_comment']['creds'] ) ); ?>" class="form-control" />
949
  </div>
950
  </div>
951
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
952
  <div class="form-group">
953
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_comment', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
954
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_comment', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_comment', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_comment']['log'] ); ?>" class="form-control" />
955
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
956
  </div>
957
  </div>
958
  </div>
962
  <div class="row">
963
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
964
  <div class="form-group">
965
+ <label for="<?php echo esc_attr( $this->field_id( array( 'add_favorite', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
966
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'add_favorite', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'add_favorite', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['add_favorite']['creds'] ) ); ?>" class="form-control" />
967
  </div>
968
  </div>
969
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
970
  <div class="form-group">
971
+ <label for="<?php echo esc_attr( $this->field_id( array( 'add_favorite', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
972
+ <?php echo wp_kses(
973
+ $this->hook_limit_setting( $this->field_name( array( 'add_favorite', 'limit' ) ), $this->field_id( array( 'add_favorite', 'limit' ) ), $prefs['add_favorite']['limit'] ),
974
+ array(
975
+ 'div' => array(
976
+ 'class' => array()
977
+ ),
978
+ 'input' => array(
979
+ 'type' => array(),
980
+ 'size' => array(),
981
+ 'class' => array(),
982
+ 'name' => array(),
983
+ 'id' => array(),
984
+ 'value' => array()
985
+ ),
986
+ 'select' => array(
987
+ 'name' => array(),
988
+ 'id' => array(),
989
+ 'class' => array()
990
+ ),
991
+ 'option' => array(
992
+ 'value' => array(),
993
+ 'selected' => array()
994
+ )
995
+ )
996
+ );
997
+ ?>
998
  </div>
999
  </div>
1000
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1001
  <div class="form-group">
1002
+ <label for="<?php echo esc_attr( $this->field_id( array( 'add_favorite', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1003
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'add_favorite', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'add_favorite', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['add_favorite']['log'] ); ?>" class="form-control" />
1004
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1005
  </div>
1006
  </div>
1007
  </div>
1011
  <div class="row">
1012
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1013
  <div class="form-group">
1014
+ <label for="<?php echo esc_attr( $this->field_id( array( 'remove_favorite', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1015
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'remove_favorite', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'remove_favorite', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['remove_favorite']['creds'] ) ); ?>" class="form-control" />
1016
  </div>
1017
  </div>
1018
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
1019
  <div class="form-group">
1020
+ <label for="<?php echo esc_attr( $this->field_id( array( 'remove_favorite', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1021
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'remove_favorite', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'remove_favorite', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['remove_favorite']['log'] ); ?>" class="form-control" />
1022
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1023
  </div>
1024
  </div>
1025
  </div>
1029
  <div class="row">
1030
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1031
  <div class="form-group">
1032
+ <label for="<?php echo esc_attr( $this->field_id( array( 'message', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1033
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'message', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'message', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['message']['creds'] ) ); ?>" class="form-control" />
1034
  </div>
1035
  </div>
1036
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1037
  <div class="form-group">
1038
+ <label for="<?php echo esc_attr( $this->field_id( array( 'message', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1039
+ <?php echo wp_kses(
1040
+ $this->hook_limit_setting( $this->field_name( array( 'message', 'limit' ) ), $this->field_id( array( 'message', 'limit' ) ), $prefs['message']['limit'] ),
1041
+ array(
1042
+ 'div' => array(
1043
+ 'class' => array()
1044
+ ),
1045
+ 'input' => array(
1046
+ 'type' => array(),
1047
+ 'size' => array(),
1048
+ 'class' => array(),
1049
+ 'name' => array(),
1050
+ 'id' => array(),
1051
+ 'value' => array()
1052
+ ),
1053
+ 'select' => array(
1054
+ 'name' => array(),
1055
+ 'id' => array(),
1056
+ 'class' => array()
1057
+ ),
1058
+ 'option' => array(
1059
+ 'value' => array(),
1060
+ 'selected' => array()
1061
+ )
1062
+ )
1063
+ );
1064
+ ?>
1065
  </div>
1066
  </div>
1067
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1068
  <div class="form-group">
1069
+ <label for="<?php echo esc_attr( $this->field_id( array( 'message', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1070
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'message', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'message', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['message']['log'] ); ?>" class="form-control" />
1071
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1072
  </div>
1073
  </div>
1074
  </div>
1078
  <div class="row">
1079
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1080
  <div class="form-group">
1081
+ <label for="<?php echo esc_attr( $this->field_id( array( 'send_gift', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1082
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'send_gift', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'send_gift', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['send_gift']['creds'] ) ); ?>" class="form-control" />
1083
  </div>
1084
  </div>
1085
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1086
  <div class="form-group">
1087
+ <label for="<?php echo esc_attr( $this->field_id( array( 'send_gift', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1088
+ <?php echo wp_kses(
1089
+ $this->hook_limit_setting( $this->field_name( array( 'send_gift', 'limit' ) ), $this->field_id( array( 'send_gift', 'limit' ) ), $prefs['send_gift']['limit'] ),
1090
+ array(
1091
+ 'div' => array(
1092
+ 'class' => array()
1093
+ ),
1094
+ 'input' => array(
1095
+ 'type' => array(),
1096
+ 'size' => array(),
1097
+ 'class' => array(),
1098
+ 'name' => array(),
1099
+ 'id' => array(),
1100
+ 'value' => array()
1101
+ ),
1102
+ 'select' => array(
1103
+ 'name' => array(),
1104
+ 'id' => array(),
1105
+ 'class' => array()
1106
+ ),
1107
+ 'option' => array(
1108
+ 'value' => array(),
1109
+ 'selected' => array()
1110
+ )
1111
+ )
1112
+ );
1113
+ ?>
1114
  </div>
1115
  </div>
1116
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1117
  <div class="form-group">
1118
+ <label for="<?php echo esc_attr( $this->field_id( array( 'send_gift', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1119
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'send_gift', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'send_gift', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['send_gift']['log'] ); ?>" class="form-control" />
1120
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1121
  </div>
1122
  </div>
1123
  </div>
1737
  <div class="row">
1738
  <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
1739
  <div class="form-group">
1740
+ <label for="<?php echo esc_attr( $this->field_id( array( 'create', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1741
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'create', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'create', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['create']['creds'] ) ); ?>" class="form-control" />
1742
+ <span class="description"><?php echo wp_kses_post( $this->core->template_tags_general( __( 'If you use a negative value and the user does not have enough %_plural%, the "Create Group" button will be disabled.', 'mycred' ) ) ); ?></span>
1743
  </div>
1744
  </div>
1745
  <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
1746
  <div class="form-group">
1747
+ <label for="<?php echo esc_attr( $this->field_id( array( 'create', 'min' ) ) ); ?>"><?php esc_html_e( 'No. of Members', 'mycred' ); ?></label>
1748
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'create', 'min' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'create', 'min' ) ) ); ?>" value="<?php echo esc_attr( $prefs['create']['min'] ); ?>" class="form-control" />
1749
+ <span class="description"><?php echo wp_kses_post( $this->core->template_tags_general( __( 'The number of members a group must gain before awarding %_plural%. Use zero to award as soon as the group is created.', 'mycred' ) ) ); ?></span>
1750
  </div>
1751
  </div>
1752
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1753
  <div class="form-group">
1754
+ <label for="<?php echo esc_attr( $this->field_id( array( 'create', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1755
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'create', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'create', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['create']['log'] ); ?>" class="form-control" />
1756
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1757
  </div>
1758
  </div>
1759
  </div>
1763
  <div class="row">
1764
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1765
  <div class="form-group">
1766
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1767
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['delete']['creds'] ) ); ?>" class="form-control" />
1768
  </div>
1769
  </div>
1770
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
1771
  <div class="form-group">
1772
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1773
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete']['log'] ); ?>" class="form-control" />
1774
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1775
  </div>
1776
  </div>
1777
  </div>
1781
  <div class="row">
1782
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1783
  <div class="form-group">
1784
+ <label for="<?php echo esc_attr( $this->field_id( array( 'avatar', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1785
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'avatar', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'avatar', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['avatar']['creds'] ) ); ?>" class="form-control" />
1786
  </div>
1787
  </div>
1788
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1789
  <div class="form-group">
1790
+ <label for="<?php echo esc_attr( $this->field_id( array( 'avatar', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1791
+ <?php echo wp_kses(
1792
+ $this->hook_limit_setting( $this->field_name( array( 'avatar', 'limit' ) ), $this->field_id( array( 'avatar', 'limit' ) ), $prefs['avatar']['limit'] ),
1793
+ array(
1794
+ 'div' => array(
1795
+ 'class' => array()
1796
+ ),
1797
+ 'input' => array(
1798
+ 'type' => array(),
1799
+ 'size' => array(),
1800
+ 'class' => array(),
1801
+ 'name' => array(),
1802
+ 'id' => array(),
1803
+ 'value' => array()
1804
+ ),
1805
+ 'select' => array(
1806
+ 'name' => array(),
1807
+ 'id' => array(),
1808
+ 'class' => array()
1809
+ ),
1810
+ 'option' => array(
1811
+ 'value' => array(),
1812
+ 'selected' => array()
1813
+ )
1814
+ )
1815
+ );
1816
+ ?>
1817
  </div>
1818
  </div>
1819
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1820
  <div class="form-group">
1821
+ <label for="<?php echo esc_attr( $this->field_id( array( 'avatar', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1822
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'avatar', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'avatar', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['avatar']['log'] ); ?>" class="form-control" />
1823
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1824
  </div>
1825
  </div>
1826
  </div>
1830
  <div class="row">
1831
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1832
  <div class="form-group">
1833
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cover', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1834
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'cover', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'cover', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['cover']['creds'] ) ); ?>" class="form-control" />
1835
  </div>
1836
  </div>
1837
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1838
  <div class="form-group">
1839
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cover', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1840
+ <?php echo wp_kses(
1841
+ $this->hook_limit_setting( $this->field_name( array( 'cover', 'limit' ) ), $this->field_id( array( 'cover', 'limit' ) ), $prefs['cover']['limit'] ),
1842
+ array(
1843
+ 'div' => array(
1844
+ 'class' => array()
1845
+ ),
1846
+ 'input' => array(
1847
+ 'type' => array(),
1848
+ 'size' => array(),
1849
+ 'class' => array(),
1850
+ 'name' => array(),
1851
+ 'id' => array(),
1852
+ 'value' => array()
1853
+ ),
1854
+ 'select' => array(
1855
+ 'name' => array(),
1856
+ 'id' => array(),
1857
+ 'class' => array()
1858
+ ),
1859
+ 'option' => array(
1860
+ 'value' => array(),
1861
+ 'selected' => array()
1862
+ )
1863
+ )
1864
+ );
1865
+ ?>
1866
  </div>
1867
  </div>
1868
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1869
  <div class="form-group">
1870
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cover', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1871
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'cover', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'cover', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['cover']['log'] ); ?>" class="form-control" />
1872
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1873
  </div>
1874
  </div>
1875
  </div>
1879
  <div class="row">
1880
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1881
  <div class="form-group">
1882
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1883
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_topic', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['new_topic']['creds'] ) ); ?>" class="form-control" />
1884
  </div>
1885
  </div>
1886
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1887
  <div class="form-group">
1888
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1889
+ <?php echo wp_kses(
1890
+ $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ),
1891
+ array(
1892
+ 'div' => array(
1893
+ 'class' => array()
1894
+ ),
1895
+ 'input' => array(
1896
+ 'type' => array(),
1897
+ 'size' => array(),
1898
+ 'class' => array(),
1899
+ 'name' => array(),
1900
+ 'id' => array(),
1901
+ 'value' => array()
1902
+ ),
1903
+ 'select' => array(
1904
+ 'name' => array(),
1905
+ 'id' => array(),
1906
+ 'class' => array()
1907
+ ),
1908
+ 'option' => array(
1909
+ 'value' => array(),
1910
+ 'selected' => array()
1911
+ )
1912
+ )
1913
+ );
1914
+ ?>
1915
  </div>
1916
  </div>
1917
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1918
  <div class="form-group">
1919
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1920
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_topic', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_topic']['log'] ); ?>" class="form-control" />
1921
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1922
  </div>
1923
  </div>
1924
  </div>
1928
  <div class="row">
1929
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1930
  <div class="form-group">
1931
+ <label for="<?php echo esc_attr( $this->field_id( array( 'edit_topic', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1932
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'edit_topic', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'edit_topic', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['edit_topic']['creds'] ) ); ?>" class="form-control" />
1933
  </div>
1934
  </div>
1935
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1936
  <div class="form-group">
1937
+ <label for="<?php echo esc_attr( $this->field_id( array( 'edit_topic', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1938
+ <?php echo wp_kses(
1939
+ $this->hook_limit_setting( $this->field_name( array( 'edit_topic', 'limit' ) ), $this->field_id( array( 'edit_topic', 'limit' ) ), $prefs['edit_topic']['limit'] ),
1940
+ array(
1941
+ 'div' => array(
1942
+ 'class' => array()
1943
+ ),
1944
+ 'input' => array(
1945
+ 'type' => array(),
1946
+ 'size' => array(),
1947
+ 'class' => array(),
1948
+ 'name' => array(),
1949
+ 'id' => array(),
1950
+ 'value' => array()
1951
+ ),
1952
+ 'select' => array(
1953
+ 'name' => array(),
1954
+ 'id' => array(),
1955
+ 'class' => array()
1956
+ ),
1957
+ 'option' => array(
1958
+ 'value' => array(),
1959
+ 'selected' => array()
1960
+ )
1961
+ )
1962
+ );
1963
+ ?>
1964
  </div>
1965
  </div>
1966
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
1967
  <div class="form-group">
1968
+ <label for="<?php echo esc_attr( $this->field_id( array( 'edit_topic', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
1969
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'edit_topic', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'edit_topic', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['edit_topic']['log'] ); ?>" class="form-control" />
1970
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
1971
  </div>
1972
  </div>
1973
  </div>
1977
  <div class="row">
1978
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
1979
  <div class="form-group">
1980
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_post', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
1981
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_post', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_post', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['new_post']['creds'] ) ); ?>" class="form-control" />
1982
  </div>
1983
  </div>
1984
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
1985
  <div class="form-group">
1986
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_post', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
1987
+ <?php echo wp_kses(
1988
+ $this->hook_limit_setting( $this->field_name( array( 'new_post', 'limit' ) ), $this->field_id( array( 'new_post', 'limit' ) ), $prefs['new_post']['limit'] ),
1989
+ array(
1990
+ 'div' => array(
1991
+ 'class' => array()
1992
+ ),
1993
+ 'input' => array(
1994
+ 'type' => array(),
1995
+ 'size' => array(),
1996
+ 'class' => array(),
1997
+ 'name' => array(),
1998
+ 'id' => array(),
1999
+ 'value' => array()
2000
+ ),
2001
+ 'select' => array(
2002
+ 'name' => array(),
2003
+ 'id' => array(),
2004
+ 'class' => array()
2005
+ ),
2006
+ 'option' => array(
2007
+ 'value' => array(),
2008
+ 'selected' => array()
2009
+ )
2010
+ )
2011
+ );
2012
+ ?>
2013
  </div>
2014
  </div>
2015
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
2016
  <div class="form-group">
2017
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_post', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
2018
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_post', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_post', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_post']['log'] ); ?>" class="form-control" />
2019
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
2020
  </div>
2021
  </div>
2022
  </div>
2026
  <div class="row">
2027
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
2028
  <div class="form-group">
2029
+ <label for="<?php echo esc_attr( $this->field_id( array( 'edit_post', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
2030
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'edit_post', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'edit_post', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['edit_post']['creds'] ) ); ?>" class="form-control" />
2031
  </div>
2032
  </div>
2033
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
2034
  <div class="form-group">
2035
+ <label for="<?php echo esc_attr( $this->field_id( array( 'edit_post', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
2036
+ <?php echo wp_kses(
2037
+ $this->hook_limit_setting( $this->field_name( array( 'edit_post', 'limit' ) ), $this->field_id( array( 'edit_post', 'limit' ) ), $prefs['edit_post']['limit'] ),
2038
+ array(
2039
+ 'div' => array(
2040
+ 'class' => array()
2041
+ ),
2042
+ 'input' => array(
2043
+ 'type' => array(),
2044
+ 'size' => array(),
2045
+ 'class' => array(),
2046
+ 'name' => array(),
2047
+ 'id' => array(),
2048
+ 'value' => array()
2049
+ ),
2050
+ 'select' => array(
2051
+ 'name' => array(),
2052
+ 'id' => array(),
2053
+ 'class' => array()
2054
+ ),
2055
+ 'option' => array(
2056
+ 'value' => array(),
2057
+ 'selected' => array()
2058
+ )
2059
+ )
2060
+ );
2061
+ ?>
2062
  </div>
2063
  </div>
2064
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
2065
  <div class="form-group">
2066
+ <label for="<?php echo esc_attr( $this->field_id( array( 'edit_post', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
2067
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'edit_post', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'edit_post', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['edit_post']['log'] ); ?>" class="form-control" />
2068
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
2069
  </div>
2070
  </div>
2071
  </div>
2075
  <div class="row">
2076
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
2077
  <div class="form-group">
2078
+ <label for="<?php echo esc_attr( $this->field_id( array( 'join', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
2079
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'join', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'join', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['join']['creds'] ) ); ?>" class="form-control" />
2080
  </div>
2081
  </div>
2082
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
2083
  <div class="form-group">
2084
+ <label for="<?php echo esc_attr( $this->field_id( array( 'join', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
2085
+ <?php echo wp_kses(
2086
+ $this->hook_limit_setting( $this->field_name( array( 'join', 'limit' ) ), $this->field_id( array( 'join', 'limit' ) ), $prefs['join']['limit'] ),
2087
+ array(
2088
+ 'div' => array(
2089
+ 'class' => array()
2090
+ ),
2091
+ 'input' => array(
2092
+ 'type' => array(),
2093
+ 'size' => array(),
2094
+ 'class' => array(),
2095
+ 'name' => array(),
2096
+ 'id' => array(),
2097
+ 'value' => array()
2098
+ ),
2099
+ 'select' => array(
2100
+ 'name' => array(),
2101
+ 'id' => array(),
2102
+ 'class' => array()
2103
+ ),
2104
+ 'option' => array(
2105
+ 'value' => array(),
2106
+ 'selected' => array()
2107
+ )
2108
+ )
2109
+ );
2110
+ ?>
2111
  </div>
2112
  </div>
2113
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
2114
  <div class="form-group">
2115
+ <label for="<?php echo esc_attr( $this->field_id( array( 'join', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
2116
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'join', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'join', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['join']['log'] ); ?>" class="form-control" />
2117
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
2118
  </div>
2119
  </div>
2120
  </div>
2124
  <div class="row">
2125
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
2126
  <div class="form-group">
2127
+ <label for="<?php echo esc_attr( $this->field_id( array( 'leave', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
2128
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'leave', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'leave', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['leave']['creds'] ) ); ?>" class="form-control" />
2129
  </div>
2130
  </div>
2131
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
2132
  <div class="form-group">
2133
+ <label for="<?php echo esc_attr( $this->field_id( array( 'leave', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
2134
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'leave', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'leave', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['leave']['log'] ); ?>" class="form-control" />
2135
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
2136
  </div>
2137
  </div>
2138
  </div>
2142
  <div class="row">
2143
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
2144
  <div class="form-group">
2145
+ <label for="<?php echo esc_attr( $this->field_id( array( 'comments', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
2146
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'comments', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'comments', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['comments']['creds'] ) ); ?>" class="form-control" />
2147
  </div>
2148
  </div>
2149
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
2150
  <div class="form-group">
2151
+ <label for="<?php echo esc_attr( $this->field_id( array( 'comments', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
2152
+ <?php echo wp_kses(
2153
+ $this->hook_limit_setting( $this->field_name( array( 'comments', 'limit' ) ), $this->field_id( array( 'comments', 'limit' ) ), $prefs['comments']['limit'] ),
2154
+ array(
2155
+ 'div' => array(
2156
+ 'class' => array()
2157
+ ),
2158
+ 'input' => array(
2159
+ 'type' => array(),
2160
+ 'size' => array(),
2161
+ 'class' => array(),
2162
+ 'name' => array(),
2163
+ 'id' => array(),
2164
+ 'value' => array()
2165
+ ),
2166
+ 'select' => array(
2167
+ 'name' => array(),
2168
+ 'id' => array(),
2169
+ 'class' => array()
2170
+ ),
2171
+ 'option' => array(
2172
+ 'value' => array(),
2173
+ 'selected' => array()
2174
+ )
2175
+ )
2176
+ );
2177
+ ?>
2178
  </div>
2179
  </div>
2180
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
2181
  <div class="form-group">
2182
+ <label for="<?php echo esc_attr( $this->field_id( array( 'comments', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
2183
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'comments', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'comments', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['comments']['log'] ); ?>" class="form-control" />
2184
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
2185
  </div>
2186
  </div>
2187
  </div>
includes/hooks/external/mycred-hook-contact-form7.php CHANGED
@@ -132,7 +132,7 @@ function mycred_load_contact_form_seven_hook() {
132
 
133
  // No forms found
134
  if ( empty( $forms ) ) {
135
- echo '<p>' . __( 'No forms found.', 'mycred' ) . '</p>';
136
  return;
137
  }
138
 
@@ -160,25 +160,50 @@ function mycred_load_contact_form_seven_hook() {
160
 
161
  ?>
162
  <div class="hook-instance">
163
- <h3><?php printf( __( 'Form: %s', 'mycred' ), $form_title ); ?></h3>
164
  <div class="row">
165
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
166
  <div class="form-group">
167
- <label for="<?php echo $this->field_id( array( $form_id, 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
168
- <input type="text" name="<?php echo $this->field_name( array( $form_id, 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs[ $form_id ]['creds'] ); ?>" class="form-control" />
169
  </div>
170
  </div>
171
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
172
  <div class="form-group">
173
- <label for="<?php echo $this->field_id( array( $form_id, 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
174
- <?php echo $this->hook_limit_setting( $this->field_name( array( $form_id, 'limit' ) ), $this->field_id( array( $form_id, 'limit' ) ), $prefs[ $form_id ]['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  </div>
176
  </div>
177
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
178
  <div class="form-group">
179
- <label for="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
180
- <input type="text" name="<?php echo $this->field_name( array( $form_id, 'log' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs[ $form_id ]['log'] ); ?>" class="form-control" />
181
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
182
  </div>
183
  </div>
184
  </div>
132
 
133
  // No forms found
134
  if ( empty( $forms ) ) {
135
+ echo '<p>' . esc_html__( 'No forms found.', 'mycred' ) . '</p>';
136
  return;
137
  }
138
 
160
 
161
  ?>
162
  <div class="hook-instance">
163
+ <h3><?php printf( esc_html__( 'Form: %s', 'mycred' ), esc_html( $form_title ) ); ?></h3>
164
  <div class="row">
165
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
166
  <div class="form-group">
167
+ <label for="<?php echo esc_attr( $this->field_id( array( $form_id, 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
168
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $form_id, 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $form_id, 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs[ $form_id ]['creds'] ) ); ?>" class="form-control" />
169
  </div>
170
  </div>
171
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
172
  <div class="form-group">
173
+ <label for="<?php echo esc_attr( $this->field_id( array( $form_id, 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
174
+ <?php echo wp_kses(
175
+ $this->hook_limit_setting( $this->field_name( array( $form_id, 'limit' ) ), $this->field_id( array( $form_id, 'limit' ) ), $prefs[ $form_id ]['limit'] ),
176
+ array(
177
+ 'div' => array(
178
+ 'class' => array()
179
+ ),
180
+ 'input' => array(
181
+ 'type' => array(),
182
+ 'size' => array(),
183
+ 'class' => array(),
184
+ 'name' => array(),
185
+ 'id' => array(),
186
+ 'value' => array()
187
+ ),
188
+ 'select' => array(
189
+ 'name' => array(),
190
+ 'id' => array(),
191
+ 'class' => array()
192
+ ),
193
+ 'option' => array(
194
+ 'value' => array(),
195
+ 'selected' => array()
196
+ )
197
+ )
198
+ );
199
+ ?>
200
  </div>
201
  </div>
202
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
203
  <div class="form-group">
204
+ <label for="<?php echo esc_attr( $this->field_id( array( $form_id, 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
205
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $form_id, 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $form_id, 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs[ $form_id ]['log'] ); ?>" class="form-control" />
206
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
207
  </div>
208
  </div>
209
  </div>
includes/hooks/external/mycred-hook-events-manager-light.php CHANGED
@@ -202,21 +202,46 @@ function mycred_load_events_manager_light_hook() {
202
  <div class="row">
203
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
204
  <div class="form-group">
205
- <label for="<?php echo $this->field_id( array( 'attend' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
206
- <input type="text" name="<?php echo $this->field_name( array( 'attend' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'attend' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['attend']['creds'] ); ?>" class="form-control" />
207
  </div>
208
  </div>
209
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
210
  <div class="form-group">
211
- <label for="<?php echo $this->field_id( array( 'attend' => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
212
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'attend' => 'limit' ) ), $this->field_id( array( 'attend' => 'limit' ) ), $prefs['attend']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  </div>
214
  </div>
215
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
216
  <div class="form-group">
217
- <label for="<?php echo $this->field_id( array( 'attend' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
218
- <input type="text" name="<?php echo $this->field_name( array( 'attend' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'attend' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['attend']['log'] ); ?>" class="form-control" />
219
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
220
  </div>
221
  </div>
222
  </div>
@@ -226,15 +251,15 @@ function mycred_load_events_manager_light_hook() {
226
  <div class="row">
227
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
228
  <div class="form-group">
229
- <label for="<?php echo $this->field_id( array( 'cancel' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
230
- <input type="text" name="<?php echo $this->field_name( array( 'cancel' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'cancel' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['cancel']['creds'] ); ?>" class="form-control" />
231
  </div>
232
  </div>
233
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
234
  <div class="form-group">
235
- <label for="<?php echo $this->field_id( array( 'cancel' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
236
- <input type="text" name="<?php echo $this->field_name( array( 'cancel' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'cancel' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['cancel']['log'] ); ?>" class="form-control" />
237
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
238
  </div>
239
  </div>
240
  </div>
202
  <div class="row">
203
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
204
  <div class="form-group">
205
+ <label for="<?php echo esc_attr( $this->field_id( array( 'attend' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
206
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'attend' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'attend' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['attend']['creds'] ) ); ?>" class="form-control" />
207
  </div>
208
  </div>
209
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
210
  <div class="form-group">
211
+ <label for="<?php echo esc_attr( $this->field_id( array( 'attend' => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
212
+ <?php echo wp_kses(
213
+ $this->hook_limit_setting( $this->field_name( array( 'attend' => 'limit' ) ), $this->field_id( array( 'attend' => 'limit' ) ), $prefs['attend']['limit'] ),
214
+ array(
215
+ 'div' => array(
216
+ 'class' => array()
217
+ ),
218
+ 'input' => array(
219
+ 'type' => array(),
220
+ 'size' => array(),
221
+ 'class' => array(),
222
+ 'name' => array(),
223
+ 'id' => array(),
224
+ 'value' => array()
225
+ ),
226
+ 'select' => array(
227
+ 'name' => array(),
228
+ 'id' => array(),
229
+ 'class' => array()
230
+ ),
231
+ 'option' => array(
232
+ 'value' => array(),
233
+ 'selected' => array()
234
+ )
235
+ )
236
+ );
237
+ ?>
238
  </div>
239
  </div>
240
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
241
  <div class="form-group">
242
+ <label for="<?php echo esc_attr( $this->field_id( array( 'attend' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
243
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'attend' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'attend' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['attend']['log'] ); ?>" class="form-control" />
244
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
245
  </div>
246
  </div>
247
  </div>
251
  <div class="row">
252
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
253
  <div class="form-group">
254
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cancel' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
255
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'cancel' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'cancel' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['cancel']['creds'] ) ); ?>" class="form-control" />
256
  </div>
257
  </div>
258
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
259
  <div class="form-group">
260
+ <label for="<?php echo esc_attr( $this->field_id( array( 'cancel' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
261
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'cancel' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'cancel' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['cancel']['log'] ); ?>" class="form-control" />
262
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
263
  </div>
264
  </div>
265
  </div>
includes/hooks/external/mycred-hook-gravityforms.php CHANGED
@@ -127,7 +127,7 @@ function mycred_load_gravity_forms_hook() {
127
 
128
  // No forms found
129
  if ( empty( $forms ) ) {
130
- echo '<p>' . __( 'No forms found.', 'mycred' ) . '</p>';
131
  return;
132
  }
133
 
@@ -153,25 +153,50 @@ function mycred_load_gravity_forms_hook() {
153
 
154
  ?>
155
  <div class="hook-instance">
156
- <h3><?php printf( __( 'Form: %s', 'mycred' ), $form->title ); ?></h3>
157
  <div class="row">
158
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
159
  <div class="form-group">
160
- <label for="<?php echo $this->field_id( array( $form->id, 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
161
- <input type="text" name="<?php echo $this->field_name( array( $form->id, 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $form->id, 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs[ $form->id ]['creds'] ); ?>" class="form-control" />
162
  </div>
163
  </div>
164
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
165
  <div class="form-group">
166
- <label for="<?php echo $this->field_id( array( $form->id, 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
167
- <?php echo $this->hook_limit_setting( $this->field_name( array( $form->id, 'limit' ) ), $this->field_id( array( $form->id, 'limit' ) ), $prefs[ $form->id ]['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  </div>
169
  </div>
170
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
171
  <div class="form-group">
172
- <label for="<?php echo $this->field_id( array( $form->id, 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
173
- <input type="text" name="<?php echo $this->field_name( array( $form->id, 'log' ) ); ?>" id="<?php echo $this->field_id( array( $form->id, 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs[ $form->id ]['log'] ); ?>" class="form-control" />
174
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
175
  </div>
176
  </div>
177
  </div>
127
 
128
  // No forms found
129
  if ( empty( $forms ) ) {
130
+ echo '<p>' . esc_html__( 'No forms found.', 'mycred' ) . '</p>';
131
  return;
132
  }
133
 
153
 
154
  ?>
155
  <div class="hook-instance">
156
+ <h3><?php printf( esc_html__( 'Form: %s', 'mycred' ), esc_html( $form->title ) ); ?></h3>
157
  <div class="row">
158
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
159
  <div class="form-group">
160
+ <label for="<?php echo esc_attr( $this->field_id( array( $form->id, 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
161
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $form->id, 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $form->id, 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs[ $form->id ]['creds'] ) ); ?>" class="form-control" />
162
  </div>
163
  </div>
164
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
165
  <div class="form-group">
166
+ <label for="<?php echo esc_attr( $this->field_id( array( $form->id, 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
167
+ <?php echo wp_kses(
168
+ $this->hook_limit_setting( $this->field_name( array( $form->id, 'limit' ) ), $this->field_id( array( $form->id, 'limit' ) ), $prefs[ $form->id ]['limit'] ),
169
+ array(
170
+ 'div' => array(
171
+ 'class' => array()
172
+ ),
173
+ 'input' => array(
174
+ 'type' => array(),
175
+ 'size' => array(),
176
+ 'class' => array(),
177
+ 'name' => array(),
178
+ 'id' => array(),
179
+ 'value' => array()
180
+ ),
181
+ 'select' => array(
182
+ 'name' => array(),
183
+ 'id' => array(),
184
+ 'class' => array()
185
+ ),
186
+ 'option' => array(
187
+ 'value' => array(),
188
+ 'selected' => array()
189
+ )
190
+ )
191
+ );
192
+ ?>
193
  </div>
194
  </div>
195
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
196
  <div class="form-group">
197
+ <label for="<?php echo esc_attr( $this->field_id( array( $form->id, 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
198
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $form->id, 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $form->id, 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs[ $form->id ]['log'] ); ?>" class="form-control" />
199
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
200
  </div>
201
  </div>
202
  </div>
includes/hooks/external/mycred-hook-invite-anyone.php CHANGED
@@ -206,21 +206,46 @@ function mycred_load_invite_anyone_hook() {
206
  <div class="row">
207
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
208
  <div class="form-group">
209
- <label for="<?php echo $this->field_id( array( 'send_invite' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
210
- <input type="text" name="<?php echo $this->field_name( array( 'send_invite' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['send_invite']['creds'] ); ?>" class="form-control" />
211
  </div>
212
  </div>
213
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
214
  <div class="form-group">
215
- <label for="<?php echo $this->field_id( array( 'send_invite' => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
216
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'send_invite' => 'limit' ) ), $this->field_id( array( 'send_invite' => 'limit' ) ), $prefs['send_invite']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  </div>
218
  </div>
219
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
220
  <div class="form-group">
221
- <label for="<?php echo $this->field_id( array( 'send_invite' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
222
- <input type="text" name="<?php echo $this->field_name( array( 'send_invite' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['send_invite']['log'] ); ?>" class="form-control" />
223
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
224
  </div>
225
  </div>
226
  </div>
@@ -230,21 +255,46 @@ function mycred_load_invite_anyone_hook() {
230
  <div class="row">
231
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
232
  <div class="form-group">
233
- <label for="<?php echo $this->field_id( array( 'accept_invite' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
234
- <input type="text" name="<?php echo $this->field_name( array( 'accept_invite' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['accept_invite']['creds'] ); ?>" class="form-control" />
235
  </div>
236
  </div>
237
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
238
  <div class="form-group">
239
- <label for="<?php echo $this->field_id( array( 'accept_invite' => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
240
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'accept_invite' => 'limit' ) ), $this->field_id( array( 'accept_invite' => 'limit' ) ), $prefs['accept_invite']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  </div>
242
  </div>
243
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
244
  <div class="form-group">
245
- <label for="<?php echo $this->field_id( array( 'accept_invite' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
246
- <input type="text" name="<?php echo $this->field_name( array( 'accept_invite' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['accept_invite']['log'] ); ?>" class="form-control" />
247
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
248
  </div>
249
  </div>
250
  </div>
206
  <div class="row">
207
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
208
  <div class="form-group">
209
+ <label for="<?php echo esc_attr( $this->field_id( array( 'send_invite' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
210
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'send_invite' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'send_invite' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['send_invite']['creds'] ) ); ?>" class="form-control" />
211
  </div>
212
  </div>
213
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
214
  <div class="form-group">
215
+ <label for="<?php echo esc_attr( $this->field_id( array( 'send_invite' => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
216
+ <?php echo wp_kses(
217
+ $this->hook_limit_setting( $this->field_name( array( 'send_invite' => 'limit' ) ), $this->field_id( array( 'send_invite' => 'limit' ) ), $prefs['send_invite']['limit'] ),
218
+ array(
219
+ 'div' => array(
220
+ 'class' => array()
221
+ ),
222
+ 'input' => array(
223
+ 'type' => array(),
224
+ 'size' => array(),
225
+ 'class' => array(),
226
+ 'name' => array(),
227
+ 'id' => array(),
228
+ 'value' => array()
229
+ ),
230
+ 'select' => array(
231
+ 'name' => array(),
232
+ 'id' => array(),
233
+ 'class' => array()
234
+ ),
235
+ 'option' => array(
236
+ 'value' => array(),
237
+ 'selected' => array()
238
+ )
239
+ )
240
+ );
241
+ ?>
242
  </div>
243
  </div>
244
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
245
  <div class="form-group">
246
+ <label for="<?php echo esc_attr( $this->field_id( array( 'send_invite' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
247
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'send_invite' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'send_invite' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['send_invite']['log'] ); ?>" class="form-control" />
248
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
249
  </div>
250
  </div>
251
  </div>
255
  <div class="row">
256
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
257
  <div class="form-group">
258
+ <label for="<?php echo esc_attr( $this->field_id( array( 'accept_invite' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
259
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'accept_invite' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'accept_invite' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['accept_invite']['creds'] ) ); ?>" class="form-control" />
260
  </div>
261
  </div>
262
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
263
  <div class="form-group">
264
+ <label for="<?php echo esc_attr( $this->field_id( array( 'accept_invite' => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
265
+ <?php echo wp_kses(
266
+ $this->hook_limit_setting( $this->field_name( array( 'accept_invite' => 'limit' ) ), $this->field_id( array( 'accept_invite' => 'limit' ) ), $prefs['accept_invite']['limit'] ),
267
+ array(
268
+ 'div' => array(
269
+ 'class' => array()
270
+ ),
271
+ 'input' => array(
272
+ 'type' => array(),
273
+ 'size' => array(),
274
+ 'class' => array(),
275
+ 'name' => array(),
276
+ 'id' => array(),
277
+ 'value' => array()
278
+ ),
279
+ 'select' => array(
280
+ 'name' => array(),
281
+ 'id' => array(),
282
+ 'class' => array()
283
+ ),
284
+ 'option' => array(
285
+ 'value' => array(),
286
+ 'selected' => array()
287
+ )
288
+ )
289
+ );
290
+ ?>
291
  </div>
292
  </div>
293
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
294
  <div class="form-group">
295
+ <label for="<?php echo esc_attr( $this->field_id( array( 'accept_invite' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
296
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'accept_invite' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'accept_invite' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['accept_invite']['log'] ); ?>" class="form-control" />
297
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
298
  </div>
299
  </div>
300
  </div>
includes/hooks/external/mycred-hook-jetpack.php CHANGED
@@ -236,7 +236,7 @@ function mycred_load_jetpack_hook() {
236
  return $location;
237
 
238
  // Make sure user exist
239
- $user = get_user_by( 'email', $_REQUEST['email'] );
240
  if ( $user === false )
241
  return $location;
242
 
@@ -248,7 +248,7 @@ function mycred_load_jetpack_hook() {
248
  if ( $this->core->has_entry( 'site_subscription', '', $user->ID ) )
249
  return $location;
250
 
251
- $this->site_subscribe( $_REQUEST['email'], $user->ID );
252
 
253
  return $location;
254
 
@@ -540,15 +540,15 @@ function mycred_load_jetpack_hook() {
540
  <div class="row">
541
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
542
  <div class="form-group">
543
- <label for="<?php echo $this->field_id( array( 'subscribe_site' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
544
- <input type="text" name="<?php echo $this->field_name( array( 'subscribe_site' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'subscribe_site' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['subscribe_site']['creds'] ); ?>" class="form-control" />
545
  </div>
546
  </div>
547
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
548
  <div class="form-group">
549
- <label for="<?php echo $this->field_id( array( 'subscribe_site' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
550
- <input type="text" name="<?php echo $this->field_name( array( 'subscribe_site' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'subscribe_site' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['subscribe_site']['log'] ); ?>" class="form-control" />
551
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
552
  </div>
553
  </div>
554
  </div>
@@ -558,15 +558,15 @@ function mycred_load_jetpack_hook() {
558
  <div class="row">
559
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
560
  <div class="form-group">
561
- <label for="<?php echo $this->field_id( array( 'subscribe_comment' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
562
- <input type="text" name="<?php echo $this->field_name( array( 'subscribe_comment' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'subscribe_comment' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['subscribe_comment']['creds'] ); ?>" class="form-control" />
563
  </div>
564
  </div>
565
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
566
  <div class="form-group">
567
- <label for="<?php echo $this->field_id( array( 'subscribe_comment' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
568
- <input type="text" name="<?php echo $this->field_name( array( 'subscribe_comment' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'subscribe_comment' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['subscribe_comment']['log'] ); ?>" class="form-control" />
569
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
570
  </div>
571
  </div>
572
  </div>
236
  return $location;
237
 
238
  // Make sure user exist
239
+ $user = get_user_by( 'email', sanitize_email( wp_unslash( $_REQUEST['email'] ) ) );
240
  if ( $user === false )
241
  return $location;
242
 
248
  if ( $this->core->has_entry( 'site_subscription', '', $user->ID ) )
249
  return $location;
250
 
251
+ $this->site_subscribe( sanitize_email( wp_unslash( $_REQUEST['email'] ) ), $user->ID );
252
 
253
  return $location;
254
 
540
  <div class="row">
541
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
542
  <div class="form-group">
543
+ <label for="<?php echo esc_attr( $this->field_id( array( 'subscribe_site' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
544
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'subscribe_site' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'subscribe_site' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['subscribe_site']['creds'] ) ); ?>" class="form-control" />
545
  </div>
546
  </div>
547
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
548
  <div class="form-group">
549
+ <label for="<?php echo esc_attr( $this->field_id( array( 'subscribe_site' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
550
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'subscribe_site' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'subscribe_site' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['subscribe_site']['log'] ); ?>" class="form-control" />
551
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
552
  </div>
553
  </div>
554
  </div>
558
  <div class="row">
559
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
560
  <div class="form-group">
561
+ <label for="<?php echo esc_attr( $this->field_id( array( 'subscribe_comment' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
562
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'subscribe_comment' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'subscribe_comment' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['subscribe_comment']['creds'] ) ); ?>" class="form-control" />
563
  </div>
564
  </div>
565
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
566
  <div class="form-group">
567
+ <label for="<?php echo esc_attr( $this->field_id( array( 'subscribe_comment' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
568
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'subscribe_comment' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'subscribe_comment' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['subscribe_comment']['log'] ); ?>" class="form-control" />
569
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
570
  </div>
571
  </div>
572
  </div>
includes/hooks/external/mycred-hook-simplepress.php CHANGED
@@ -292,21 +292,46 @@ function mycred_load_simplepress_hook() {
292
  <div class="row">
293
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
294
  <div class="form-group">
295
- <label for="<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
296
- <input type="text" name="<?php echo $this->field_name( array( 'new_topic', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_topic']['creds'] ); ?>" class="form-control" />
297
  </div>
298
  </div>
299
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
300
  <div class="form-group">
301
- <label for="<?php echo $this->field_id( array( 'new_topic', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
302
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  </div>
304
  </div>
305
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
306
  <div class="form-group">
307
- <label for="<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
308
- <input type="text" name="<?php echo $this->field_name( array( 'new_topic', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_topic']['log'] ); ?>" class="form-control" />
309
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ), '%topic_name%' ); ?></span>
310
  </div>
311
  </div>
312
  </div>
@@ -316,15 +341,15 @@ function mycred_load_simplepress_hook() {
316
  <div class="row">
317
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
318
  <div class="form-group">
319
- <label for="<?php echo $this->field_id( array( 'delete_topic', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
320
- <input type="text" name="<?php echo $this->field_name( array( 'delete_topic', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_topic', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['delete_topic']['creds'] ); ?>" class="form-control" />
321
  </div>
322
  </div>
323
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
324
  <div class="form-group">
325
- <label for="<?php echo $this->field_id( array( 'delete_topic', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
326
- <input type="text" name="<?php echo $this->field_name( array( 'delete_topic', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_topic', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_topic']['log'] ); ?>" class="form-control" />
327
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
328
  </div>
329
  </div>
330
  </div>
@@ -334,21 +359,46 @@ function mycred_load_simplepress_hook() {
334
  <div class="row">
335
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
336
  <div class="form-group">
337
- <label for="<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
338
- <input type="text" name="<?php echo $this->field_name( array( 'new_post', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_post']['creds'] ); ?>" class="form-control" />
339
  </div>
340
  </div>
341
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
342
  <div class="form-group">
343
- <label for="<?php echo $this->field_id( array( 'new_post', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
344
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'new_post', 'limit' ) ), $this->field_id( array( 'new_post', 'limit' ) ), $prefs['new_post']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  </div>
346
  </div>
347
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
348
  <div class="form-group">
349
- <label for="<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
350
- <input type="text" name="<?php echo $this->field_name( array( 'new_post', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_post']['log'] ); ?>" class="form-control" />
351
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
352
  </div>
353
  </div>
354
  </div>
@@ -356,7 +406,7 @@ function mycred_load_simplepress_hook() {
356
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
357
  <div class="form-group">
358
  <div class="radio">
359
- <label for="<?php echo $this->field_id( array( 'new_post' => 'author' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'new_post' => 'author' ) ); ?>" id="<?php echo $this->field_id( array( 'new_post' => 'author' ) ); ?>" <?php checked( $prefs['new_post']['author'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Topic authors can receive %_plural% for posting on their own Topic.', 'mycred' ) ); ?></label>
360
  </div>
361
  </div>
362
  </div>
@@ -367,15 +417,15 @@ function mycred_load_simplepress_hook() {
367
  <div class="row">
368
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
369
  <div class="form-group">
370
- <label for="<?php echo $this->field_id( array( 'delete_post', 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
371
- <input type="text" name="<?php echo $this->field_name( array( 'delete_post', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_post', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['delete_post']['creds'] ); ?>" class="form-control" />
372
  </div>
373
  </div>
374
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
375
  <div class="form-group">
376
- <label for="<?php echo $this->field_id( array( 'delete_post', 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
377
- <input type="text" name="<?php echo $this->field_name( array( 'delete_post', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'delete_post', 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_post']['log'] ); ?>" class="form-control" />
378
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
379
  </div>
380
  </div>
381
  </div>
292
  <div class="row">
293
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
294
  <div class="form-group">
295
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
296
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_topic', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['new_topic']['creds'] ) ); ?>" class="form-control" />
297
  </div>
298
  </div>
299
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
300
  <div class="form-group">
301
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
302
+ <?php echo wp_kses(
303
+ $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ),
304
+ array(
305
+ 'div' => array(
306
+ 'class' => array()
307
+ ),
308
+ 'input' => array(
309
+ 'type' => array(),
310
+ 'size' => array(),
311
+ 'class' => array(),
312
+ 'name' => array(),
313
+ 'id' => array(),
314
+ 'value' => array()
315
+ ),
316
+ 'select' => array(
317
+ 'name' => array(),
318
+ 'id' => array(),
319
+ 'class' => array()
320
+ ),
321
+ 'option' => array(
322
+ 'value' => array(),
323
+ 'selected' => array()
324
+ )
325
+ )
326
+ );
327
+ ?>
328
  </div>
329
  </div>
330
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
331
  <div class="form-group">
332
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
333
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_topic', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_topic', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_topic']['log'] ); ?>" class="form-control" />
334
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ), '%topic_name%' ) ); ?></span>
335
  </div>
336
  </div>
337
  </div>
341
  <div class="row">
342
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
343
  <div class="form-group">
344
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_topic', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
345
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_topic', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_topic', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['delete_topic']['creds'] ) ); ?>" class="form-control" />
346
  </div>
347
  </div>
348
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
349
  <div class="form-group">
350
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_topic', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
351
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_topic', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_topic', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_topic']['log'] ); ?>" class="form-control" />
352
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
353
  </div>
354
  </div>
355
  </div>
359
  <div class="row">
360
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
361
  <div class="form-group">
362
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_post', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
363
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_post', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_post', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['new_post']['creds'] ) ); ?>" class="form-control" />
364
  </div>
365
  </div>
366
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
367
  <div class="form-group">
368
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_post', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
369
+ <?php echo wp_kses(
370
+ $this->hook_limit_setting( $this->field_name( array( 'new_post', 'limit' ) ), $this->field_id( array( 'new_post', 'limit' ) ), $prefs['new_post']['limit'] ),
371
+ array(
372
+ 'div' => array(
373
+ 'class' => array()
374
+ ),
375
+ 'input' => array(
376
+ 'type' => array(),
377
+ 'size' => array(),
378
+ 'class' => array(),
379
+ 'name' => array(),
380
+ 'id' => array(),
381
+ 'value' => array()
382
+ ),
383
+ 'select' => array(
384
+ 'name' => array(),
385
+ 'id' => array(),
386
+ 'class' => array()
387
+ ),
388
+ 'option' => array(
389
+ 'value' => array(),
390
+ 'selected' => array()
391
+ )
392
+ )
393
+ );
394
+ ?>
395
  </div>
396
  </div>
397
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
398
  <div class="form-group">
399
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_post', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
400
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'new_post', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_post', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['new_post']['log'] ); ?>" class="form-control" />
401
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
402
  </div>
403
  </div>
404
  </div>
406
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
407
  <div class="form-group">
408
  <div class="radio">
409
+ <label for="<?php echo esc_attr( $this->field_id( array( 'new_post' => 'author' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'new_post' => 'author' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'new_post' => 'author' ) ) ); ?>" <?php checked( $prefs['new_post']['author'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Topic authors can receive %_plural% for posting on their own Topic.', 'mycred' ) ) ); ?></label>
410
  </div>
411
  </div>
412
  </div>
417
  <div class="row">
418
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
419
  <div class="form-group">
420
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_post', 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
421
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_post', 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_post', 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['delete_post']['creds'] ) ); ?>" class="form-control" />
422
  </div>
423
  </div>
424
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
425
  <div class="form-group">
426
+ <label for="<?php echo esc_attr( $this->field_id( array( 'delete_post', 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
427
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'delete_post', 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'delete_post', 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['delete_post']['log'] ); ?>" class="form-control" />
428
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
429
  </div>
430
  </div>
431
  </div>
includes/hooks/external/mycred-hook-woocommerce.php CHANGED
@@ -4,6 +4,7 @@ if ( ! defined( 'myCRED_VERSION' ) ) exit;
4
  /**
5
  * WooCommerce Setup
6
  * @since 1.5
 
7
  * @version 1.1
8
  */
9
  if ( ! function_exists( 'mycred_load_woocommerce_reward' ) ) :
@@ -19,6 +20,9 @@ if ( ! function_exists( 'mycred_load_woocommerce_reward' ) ) :
19
  add_action( 'woocommerce_product_after_variable_attributes', 'mycred_woo_add_product_variation_detail', 10, 3 );
20
  add_action( 'woocommerce_save_product_variation', 'mycred_woo_save_product_variation_detail' );
21
  add_filter( 'mycred_run_this', 'mycred_woo_refund_points' );
 
 
 
22
 
23
  }
24
  endif;
@@ -94,9 +98,9 @@ if ( ! function_exists( 'mycred_woo_product_metabox' ) ) :
94
  $setup = $prefs[ $point_type ];
95
 
96
  ?>
97
- <p class="<?php if ( $count == 1 ) echo 'first'; ?>"><label for="mycred-reward-purchase-with-<?php echo $point_type; ?>"><input class="toggle-mycred-reward" data-id="<?php echo $point_type; ?>" <?php if ( $setup != '' ) echo 'checked="checked"'; ?> type="checkbox" name="mycred_reward[<?php echo $point_type; ?>][use]" id="mycred-reward-purchase-with-<?php echo $point_type; ?>" value="1" /> <?php echo $mycred->template_tags_general( __( 'Reward with %plural%', 'mycred' ) ); ?></label></p>
98
- <div class="mycred-woo-wrap" id="reward-<?php echo $point_type; ?>" style="display:<?php if ( $setup == '' ) echo 'none'; else echo 'block'; ?>">
99
- <label><?php echo $mycred->plural(); ?></label> <input type="text" size="8" name="mycred_reward[<?php echo $point_type; ?>][amount]" value="<?php echo esc_attr( $setup ); ?>" placeholder="<?php echo $mycred->zero(); ?>" />
100
  </div>
101
  <?php
102
 
@@ -172,8 +176,8 @@ if ( ! function_exists( 'mycred_woo_add_product_variation_detail' ) ) :
172
 
173
  ?>
174
  <div class="box">
175
- <label for="<?php echo $id; ?>"><?php echo $mycred->template_tags_general( __( 'Reward with %plural%', 'mycred' ) ); ?></label>
176
- <input type="text" name="_mycred_reward[<?php echo $variation->ID; ?>][<?php echo $point_type; ?>]" id="<?php echo $id; ?>" class="input-text" placeholder="<?php esc_attr_e( 'Leave empty for no rewards', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs[ $point_type ] ); ?>" />
177
  </div>
178
  <?php
179
 
@@ -279,7 +283,7 @@ endif;
279
  */
280
  function mycred_register_woo_reward_ref( $list ) {
281
 
282
- $list['reward'] = 'WooCommerce Purchase reaward';
283
  return $list;
284
 
285
  }
@@ -430,6 +434,68 @@ if ( ! function_exists( 'mycred_get_woo_product_reward' ) ) :
430
  }
431
  endif;
432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  /**
434
  * Register Hook
435
  * @since 1.5
@@ -560,21 +626,46 @@ function mycred_load_woocommerce_hook() {
560
  <div class="row">
561
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
562
  <div class="form-group">
563
- <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label>
564
- <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
565
  </div>
566
  </div>
567
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
568
  <div class="form-group">
569
- <label for="<?php echo $this->field_id( 'limit' ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
570
- <?php echo $this->hook_limit_setting( $this->field_name( 'limit' ), $this->field_id( 'limit' ), $prefs['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
571
  </div>
572
  </div>
573
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
574
  <div class="form-group">
575
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
576
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
577
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
578
  </div>
579
  </div>
580
  </div>
4
  /**
5
  * WooCommerce Setup
6
  * @since 1.5
7
+ * @since 2.4.6 Added @function `mycred_woo_reward_refund`
8
  * @version 1.1
9
  */
10
  if ( ! function_exists( 'mycred_load_woocommerce_reward' ) ) :
20
  add_action( 'woocommerce_product_after_variable_attributes', 'mycred_woo_add_product_variation_detail', 10, 3 );
21
  add_action( 'woocommerce_save_product_variation', 'mycred_woo_save_product_variation_detail' );
22
  add_filter( 'mycred_run_this', 'mycred_woo_refund_points' );
23
+ add_action( 'woocommerce_order_status_cancelled', 'mycred_woo_reward_refund' );
24
+ add_action( 'woocommerce_order_status_refunded', 'mycred_woo_reward_refund' );
25
+ add_action( 'woocommerce_order_status_failed', 'mycred_woo_reward_refund' );
26
 
27
  }
28
  endif;
98
  $setup = $prefs[ $point_type ];
99
 
100
  ?>
101
+ <p class="<?php if ( $count == 1 ) echo 'first'; ?>"><label for="mycred-reward-purchase-with-<?php echo esc_attr( $point_type ); ?>"><input class="toggle-mycred-reward" data-id="<?php echo esc_attr( $point_type ); ?>" <?php if ( $setup != '' ) echo wp_kses_post( 'checked="checked"' ); ?> type="checkbox" name="mycred_reward[<?php echo esc_attr( $point_type ); ?>][use]" id="mycred-reward-purchase-with-<?php echo esc_attr( $point_type ); ?>" value="1" /> <?php echo wp_kses_post( $mycred->template_tags_general( __( 'Reward with %plural%', 'mycred' ) ) ); ?></label></p>
102
+ <div class="mycred-woo-wrap" id="reward-<?php echo esc_attr( $point_type ); ?>" style="display:<?php if ( $setup == '' ) echo 'none'; else echo 'block'; ?>">
103
+ <label><?php echo esc_html( $mycred->plural() ); ?></label> <input type="text" size="8" name="mycred_reward[<?php echo esc_attr( $point_type ); ?>][amount]" value="<?php echo esc_attr( $setup ); ?>" placeholder="<?php echo esc_attr( $mycred->zero() ); ?>" />
104
  </div>
105
  <?php
106
 
176
 
177
  ?>
178
  <div class="box">
179
+ <label for="<?php echo esc_attr( $id ); ?>"><?php echo wp_kses_post( $mycred->template_tags_general( __( 'Reward with %plural%', 'mycred' ) ) ); ?></label>
180
+ <input type="text" name="_mycred_reward[<?php echo esc_attr( $variation->ID ); ?>][<?php echo esc_attr( $point_type ); ?>]" id="<?php echo esc_attr( $id ); ?>" class="input-text" placeholder="<?php esc_attr_e( 'Leave empty for no rewards', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs[ $point_type ] ); ?>" />
181
  </div>
182
  <?php
183
 
283
  */
284
  function mycred_register_woo_reward_ref( $list ) {
285
 
286
+ $list['reward'] = 'WooCommerce Purchase Reward';
287
  return $list;
288
 
289
  }
434
  }
435
  endif;
436
 
437
+ /**
438
+ * Reward Refund
439
+ *
440
+ * @since 2.4.6
441
+ * @version 1.0
442
+ */
443
+ if ( !function_exists( 'mycred_woo_reward_refund' ) ):
444
+ function mycred_woo_reward_refund( $order_id ) {
445
+ $product_reward = mycred_woo_get_reward( $order_id );
446
+ mycred_woo_product_unreward( $product_reward );
447
+ }
448
+ endif;
449
+
450
+ /**
451
+ * Delete Product Reward
452
+ *
453
+ * @since 2.4.6
454
+ * @version 1.0
455
+ */
456
+ if ( !function_exists( 'mycred_woo_get_reward' ) ):
457
+ function mycred_woo_get_reward( $order_id = null ) {
458
+
459
+ global $wpdb, $mycred;
460
+
461
+ $payment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %1s WHERE ref = 'reward' AND ref_id = %d;", $mycred->log_table, $order_id ) );
462
+ if ( ! isset( $payment->user_id ) ) {
463
+ $payment = false;
464
+ }
465
+
466
+ return $payment;
467
+
468
+ }
469
+ endif;
470
+
471
+ /**
472
+ * Delete Product Reward
473
+ *
474
+ * @since 2.4.6
475
+ * @version 1.0
476
+ */
477
+ if ( !function_exists( 'mycred_woo_product_unreward' ) ):
478
+ function mycred_woo_product_unreward( $product_reward ) {
479
+
480
+ if ( !$product_reward ) return;
481
+
482
+ $product_reward->ref = 'order_cancelation';
483
+ $product_reward->entry = '%plural% deducted for Order Cancelation';
484
+ $product_reward = apply_filters( 'mycred_woo_product_unreward', $product_reward );
485
+
486
+ return mycred_subtract(
487
+ $product_reward->ref,
488
+ $product_reward->user_id,
489
+ $product_reward->creds,
490
+ $product_reward->entry,
491
+ $product_reward->id,
492
+ $product_reward->data,
493
+ $product_reward->ctype,
494
+ );
495
+
496
+ }
497
+ endif;
498
+
499
  /**
500
  * Register Hook
501
  * @since 1.5
626
  <div class="row">
627
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
628
  <div class="form-group">
629
+ <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
630
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
631
  </div>
632
  </div>
633
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
634
  <div class="form-group">
635
+ <label for="<?php echo esc_attr( $this->field_id( 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
636
+ <?php echo wp_kses(
637
+ $this->hook_limit_setting( $this->field_name( 'limit' ), $this->field_id( 'limit' ), $prefs['limit'] ),
638
+ array(
639
+ 'div' => array(
640
+ 'class' => array()
641
+ ),
642
+ 'input' => array(
643
+ 'type' => array(),
644
+ 'size' => array(),
645
+ 'class' => array(),
646
+ 'name' => array(),
647
+ 'id' => array(),
648
+ 'value' => array()
649
+ ),
650
+ 'select' => array(
651
+ 'name' => array(),
652
+ 'id' => array(),
653
+ 'class' => array()
654
+ ),
655
+ 'option' => array(
656
+ 'value' => array(),
657
+ 'selected' => array()
658
+ )
659
+ )
660
+ );
661
+ ?>
662
  </div>
663
  </div>
664
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
665
  <div class="form-group">
666
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
667
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
668
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
669
  </div>
670
  </div>
671
  </div>
includes/hooks/external/mycred-hook-wp-favorite-posts.php CHANGED
@@ -219,42 +219,92 @@ function mycred_load_wp_favorite_posts_hook() {
219
  <div class="row">
220
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
221
  <div class="form-group">
222
- <label for="<?php echo $this->field_id( array( 'add' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
223
- <input type="text" name="<?php echo $this->field_name( array( 'add' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'add' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['add']['creds'] ); ?>" class="form-control" />
224
  </div>
225
  </div>
226
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
227
  <div class="form-group">
228
- <label for="<?php echo $this->field_id( array( 'add', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
229
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'add', 'limit' ) ), $this->field_id( array( 'add', 'limit' ) ), $prefs['add']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  </div>
231
  </div>
232
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
233
  <div class="form-group">
234
- <label for="<?php echo $this->field_id( array( 'added' => 'creds' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
235
- <input type="text" name="<?php echo $this->field_name( array( 'added' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'added' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['added']['creds'] ); ?>" class="form-control" />
236
  </div>
237
  </div>
238
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
239
  <div class="form-group">
240
- <label for="<?php echo $this->field_id( array( 'added', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
241
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'added', 'limit' ) ), $this->field_id( array( 'added', 'limit' ) ), $prefs['added']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  </div>
243
  </div>
244
  </div>
245
  <div class="row">
246
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
247
  <div class="form-group">
248
- <label for="<?php echo $this->field_id( array( 'add' => 'log' ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
249
- <input type="text" name="<?php echo $this->field_name( array( 'add' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'add' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['add']['log'] ); ?>" class="form-control" />
250
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
251
  </div>
252
  </div>
253
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
254
  <div class="form-group">
255
- <label for="<?php echo $this->field_id( array( 'added' => 'log' ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
256
- <input type="text" name="<?php echo $this->field_name( array( 'added' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'added' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['added']['log'] ); ?>" class="form-control" />
257
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
258
  </div>
259
  </div>
260
  </div>
@@ -264,30 +314,30 @@ function mycred_load_wp_favorite_posts_hook() {
264
  <div class="row">
265
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
266
  <div class="form-group">
267
- <label for="<?php echo $this->field_id( array( 'remove' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
268
- <input type="text" name="<?php echo $this->field_name( array( 'remove' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'remove' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['remove']['creds'] ); ?>" class="form-control" />
269
  </div>
270
  </div>
271
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
272
  <div class="form-group">
273
- <label for="<?php echo $this->field_id( array( 'remove' => 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
274
- <input type="text" name="<?php echo $this->field_name( array( 'remove' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'remove' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['remove']['log'] ); ?>" class="form-control" />
275
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
276
  </div>
277
  </div>
278
  </div>
279
  <div class="row">
280
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
281
  <div class="form-group">
282
- <label for="<?php echo $this->field_id( array( 'removed' => 'creds' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
283
- <input type="text" name="<?php echo $this->field_name( array( 'removed' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'removed' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['removed']['creds'] ); ?>" class="form-control" />
284
  </div>
285
  </div>
286
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
287
  <div class="form-group">
288
- <label for="<?php echo $this->field_id( array( 'removed' => 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
289
- <input type="text" name="<?php echo $this->field_name( array( 'removed' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'removed' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['removed']['log'] ); ?>" class="form-control" />
290
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
291
  </div>
292
  </div>
293
  </div>
219
  <div class="row">
220
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
221
  <div class="form-group">
222
+ <label for="<?php echo esc_attr( $this->field_id( array( 'add' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
223
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'add' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'add' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['add']['creds'] ) ); ?>" class="form-control" />
224
  </div>
225
  </div>
226
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
227
  <div class="form-group">
228
+ <label for="<?php echo esc_attr( $this->field_id( array( 'add', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
229
+ <?php echo wp_kses(
230
+ $this->hook_limit_setting( $this->field_name( array( 'add', 'limit' ) ), $this->field_id( array( 'add', 'limit' ) ), $prefs['add']['limit'] ),
231
+ array(
232
+ 'div' => array(
233
+ 'class' => array()
234
+ ),
235
+ 'input' => array(
236
+ 'type' => array(),
237
+ 'size' => array(),
238
+ 'class' => array(),
239
+ 'name' => array(),
240
+ 'id' => array(),
241
+ 'value' => array()
242
+ ),
243
+ 'select' => array(
244
+ 'name' => array(),
245
+ 'id' => array(),
246
+ 'class' => array()
247
+ ),
248
+ 'option' => array(
249
+ 'value' => array(),
250
+ 'selected' => array()
251
+ )
252
+ )
253
+ );
254
+ ?>
255
  </div>
256
  </div>
257
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
258
  <div class="form-group">
259
+ <label for="<?php echo esc_attr( $this->field_id( array( 'added' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
260
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'added' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'added' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['added']['creds'] ) ); ?>" class="form-control" />
261
  </div>
262
  </div>
263
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
264
  <div class="form-group">
265
+ <label for="<?php echo esc_attr( $this->field_id( array( 'added', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
266
+ <?php echo wp_kses(
267
+ $this->hook_limit_setting( $this->field_name( array( 'added', 'limit' ) ), $this->field_id( array( 'added', 'limit' ) ), $prefs['added']['limit'] ),
268
+ array(
269
+ 'div' => array(
270
+ 'class' => array()
271
+ ),
272
+ 'input' => array(
273
+ 'type' => array(),
274
+ 'size' => array(),
275
+ 'class' => array(),
276
+ 'name' => array(),
277
+ 'id' => array(),
278
+ 'value' => array()
279
+ ),
280
+ 'select' => array(
281
+ 'name' => array(),
282
+ 'id' => array(),
283
+ 'class' => array()
284
+ ),
285
+ 'option' => array(
286
+ 'value' => array(),
287
+ 'selected' => array()
288
+ )
289
+ )
290
+ );
291
+ ?>
292
  </div>
293
  </div>
294
  </div>
295
  <div class="row">
296
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
297
  <div class="form-group">
298
+ <label for="<?php echo esc_attr( $this->field_id( array( 'add' => 'log' ) ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
299
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'add' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'add' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['add']['log'] ); ?>" class="form-control" />
300
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
301
  </div>
302
  </div>
303
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
304
  <div class="form-group">
305
+ <label for="<?php echo esc_attr( $this->field_id( array( 'added' => 'log' ) ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
306
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'added' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'added' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['added']['log'] ); ?>" class="form-control" />
307
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
308
  </div>
309
  </div>
310
  </div>
314
  <div class="row">
315
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
316
  <div class="form-group">
317
+ <label for="<?php echo esc_attr( $this->field_id( array( 'remove' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
318
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'remove' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'remove' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['remove']['creds'] ) ); ?>" class="form-control" />
319
  </div>
320
  </div>
321
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
322
  <div class="form-group">
323
+ <label for="<?php echo esc_attr( $this->field_id( array( 'remove' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
324
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'remove' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'remove' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['remove']['log'] ); ?>" class="form-control" />
325
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
326
  </div>
327
  </div>
328
  </div>
329
  <div class="row">
330
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
331
  <div class="form-group">
332
+ <label for="<?php echo esc_attr( $this->field_id( array( 'removed' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
333
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'removed' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'removed' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['removed']['creds'] ) ); ?>" class="form-control" />
334
  </div>
335
  </div>
336
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
337
  <div class="form-group">
338
+ <label for="<?php echo esc_attr( $this->field_id( array( 'removed' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
339
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'removed' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'removed' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['removed']['log'] ); ?>" class="form-control" />
340
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
341
  </div>
342
  </div>
343
  </div>
includes/hooks/external/mycred-hook-wp-polls.php CHANGED
@@ -80,12 +80,14 @@ function mycred_load_wp_polls_hook() {
80
  // Verify Referer
81
  if ( check_ajax_referer( 'poll_' . $poll_id . '-nonce', 'poll_' . $poll_id . '_nonce', false ) ) {
82
 
 
 
83
  // Which View
84
- switch ( $_REQUEST['view'] ) {
85
 
86
  case 'process':
87
 
88
- $poll_aid = $_POST["poll_$poll_id"];
89
  $poll_aid_array = array_unique( array_map( 'intval', explode( ',', $poll_aid ) ) );
90
 
91
  if ( $poll_id > 0 && ! empty( $poll_aid_array ) && check_allowtovote() ) {
@@ -168,15 +170,15 @@ function mycred_load_wp_polls_hook() {
168
  <div class="row">
169
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
170
  <div class="form-group">
171
- <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label>
172
- <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
173
  </div>
174
  </div>
175
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
176
  <div class="form-group">
177
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
178
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
179
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
180
  </div>
181
  </div>
182
  </div>
80
  // Verify Referer
81
  if ( check_ajax_referer( 'poll_' . $poll_id . '-nonce', 'poll_' . $poll_id . '_nonce', false ) ) {
82
 
83
+ $request_view = isset( $_REQUEST['view'] ) ? sanitize_key( wp_unslash( $_REQUEST['view'] ) ) : '';
84
+
85
  // Which View
86
+ switch ( $request_view ) {
87
 
88
  case 'process':
89
 
90
+ $poll_aid = ( isset( $_POST["poll_$poll_id"] ) ? intval( $_POST["poll_$poll_id"] ) : 0 );
91
  $poll_aid_array = array_unique( array_map( 'intval', explode( ',', $poll_aid ) ) );
92
 
93
  if ( $poll_id > 0 && ! empty( $poll_aid_array ) && check_allowtovote() ) {
170
  <div class="row">
171
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
172
  <div class="form-group">
173
+ <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
174
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
175
  </div>
176
  </div>
177
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
178
  <div class="form-group">
179
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
180
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
181
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
182
  </div>
183
  </div>
184
  </div>
includes/hooks/external/mycred-hook-wp-postratings.php CHANGED
@@ -162,26 +162,76 @@ function mycred_load_wp_postratings_hook() {
162
  <div class="row">
163
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
164
  <div class="form-group">
165
- <label for="<?php echo $this->field_id( array( 'rating' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
166
- <input type="text" name="<?php echo $this->field_name( array( 'rating' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'rating' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['rating']['creds'] ); ?>" class="form-control" />
167
  </div>
168
  </div>
169
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
170
  <div class="form-group">
171
- <label for="<?php echo $this->field_id( array( 'rating', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
172
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'rating', 'limit' ) ), $this->field_id( array( 'rating', 'limit' ) ), $prefs['rating']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  </div>
174
  </div>
175
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
176
  <div class="form-group">
177
- <label for="<?php echo $this->field_id( array( 'rated' => 'creds' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
178
- <input type="text" name="<?php echo $this->field_name( array( 'rated' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'rated' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['rated']['creds'] ); ?>" class="form-control" />
179
  </div>
180
  </div>
181
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
182
  <div class="form-group">
183
- <label for="<?php echo $this->field_id( array( 'rated', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
184
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'rated', 'limit' ) ), $this->field_id( array( 'rated', 'limit' ) ), $prefs['rated']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  </div>
186
  </div>
187
  </div>
@@ -189,14 +239,14 @@ function mycred_load_wp_postratings_hook() {
189
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
190
  <div class="form-group">
191
  <div class="checkbox">
192
- <label for="<?php echo $this->field_id( array( 'rating', 'value' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'rating', 'value' ) ); ?>" id="<?php echo $this->field_id( array( 'rating', 'value' ) ); ?>" <?php checked( $prefs['rating']['value'], 1 ); ?> value="1" /> <?php esc_html_e( 'Use the Rating Value instead of the amount set here.', 'mycred' ); ?></label>
193
  </div>
194
  </div>
195
  </div>
196
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
197
  <div class="form-group">
198
  <div class="checkbox">
199
- <label for="<?php echo $this->field_id( array( 'rated', 'value' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'rated', 'value' ) ); ?>" id="<?php echo $this->field_id( array( 'rated', 'value' ) ); ?>" <?php checked( $prefs['rated']['value'], 1 ); ?> value="1" /> <?php esc_html_e( 'Use the Rating Value instead of the amount set here.', 'mycred' ); ?></label>
200
  </div>
201
  </div>
202
  </div>
@@ -204,16 +254,16 @@ function mycred_load_wp_postratings_hook() {
204
  <div class="row">
205
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
206
  <div class="form-group">
207
- <label for="<?php echo $this->field_id( array( 'rating' => 'log' ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
208
- <input type="text" name="<?php echo $this->field_name( array( 'rating' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'rating' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['rating']['log'] ); ?>" class="form-control" />
209
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
210
  </div>
211
  </div>
212
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
213
  <div class="form-group">
214
- <label for="<?php echo $this->field_id( array( 'rated' => 'log' ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
215
- <input type="text" name="<?php echo $this->field_name( array( 'rated' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'rated' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['rated']['log'] ); ?>" class="form-control" />
216
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
217
  </div>
218
  </div>
219
  </div>
162
  <div class="row">
163
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
164
  <div class="form-group">
165
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rating' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
166
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'rating' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'rating' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['rating']['creds'] ) ); ?>" class="form-control" />
167
  </div>
168
  </div>
169
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
170
  <div class="form-group">
171
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rating', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
172
+ <?php echo wp_kses(
173
+ $this->hook_limit_setting( $this->field_name( array( 'rating', 'limit' ) ), $this->field_id( array( 'rating', 'limit' ) ), $prefs['rating']['limit'] ),
174
+ array(
175
+ 'div' => array(
176
+ 'class' => array()
177
+ ),
178
+ 'input' => array(
179
+ 'type' => array(),
180
+ 'size' => array(),
181
+ 'class' => array(),
182
+ 'name' => array(),
183
+ 'id' => array(),
184
+ 'value' => array()
185
+ ),
186
+ 'select' => array(
187
+ 'name' => array(),
188
+ 'id' => array(),
189
+ 'class' => array()
190
+ ),
191
+ 'option' => array(
192
+ 'value' => array(),
193
+ 'selected' => array()
194
+ )
195
+ )
196
+ );
197
+ ?>
198
  </div>
199
  </div>
200
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
201
  <div class="form-group">
202
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rated' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
203
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'rated' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'rated' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['rated']['creds'] ) ); ?>" class="form-control" />
204
  </div>
205
  </div>
206
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
207
  <div class="form-group">
208
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rated', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
209
+ <?php echo wp_kses(
210
+ $this->hook_limit_setting( $this->field_name( array( 'rated', 'limit' ) ), $this->field_id( array( 'rated', 'limit' ) ), $prefs['rated']['limit'] ),
211
+ array(
212
+ 'div' => array(
213
+ 'class' => array()
214
+ ),
215
+ 'input' => array(
216
+ 'type' => array(),
217
+ 'size' => array(),
218
+ 'class' => array(),
219
+ 'name' => array(),
220
+ 'id' => array(),
221
+ 'value' => array()
222
+ ),
223
+ 'select' => array(
224
+ 'name' => array(),
225
+ 'id' => array(),
226
+ 'class' => array()
227
+ ),
228
+ 'option' => array(
229
+ 'value' => array(),
230
+ 'selected' => array()
231
+ )
232
+ )
233
+ );
234
+ ?>
235
  </div>
236
  </div>
237
  </div>
239
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
240
  <div class="form-group">
241
  <div class="checkbox">
242
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rating', 'value' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'rating', 'value' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'rating', 'value' ) ) ); ?>" <?php checked( $prefs['rating']['value'], 1 ); ?> value="1" /> <?php esc_html_e( 'Use the Rating Value instead of the amount set here.', 'mycred' ); ?></label>
243
  </div>
244
  </div>
245
  </div>
246
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
247
  <div class="form-group">
248
  <div class="checkbox">
249
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rated', 'value' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'rated', 'value' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'rated', 'value' ) ) ); ?>" <?php checked( $prefs['rated']['value'], 1 ); ?> value="1" /> <?php esc_html_e( 'Use the Rating Value instead of the amount set here.', 'mycred' ); ?></label>
250
  </div>
251
  </div>
252
  </div>
254
  <div class="row">
255
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
256
  <div class="form-group">
257
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rating' => 'log' ) ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
258
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'rating' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'rating' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['rating']['log'] ); ?>" class="form-control" />
259
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
260
  </div>
261
  </div>
262
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
263
  <div class="form-group">
264
+ <label for="<?php echo esc_attr( $this->field_id( array( 'rated' => 'log' ) ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
265
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'rated' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'rated' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['rated']['log'] ); ?>" class="form-control" />
266
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
267
  </div>
268
  </div>
269
  </div>
includes/hooks/mycred-hook-anniversary.php CHANGED
@@ -105,7 +105,7 @@ if ( ! class_exists( 'myCRED_Hook_Anniversary' ) ) :
105
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
106
  <div class="form-group">
107
  <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
108
- <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
109
  </div>
110
  </div>
111
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
105
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
106
  <div class="form-group">
107
  <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
108
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
109
  </div>
110
  </div>
111
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
includes/hooks/mycred-hook-comments.php CHANGED
@@ -360,7 +360,7 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
360
  );
361
 
362
  if ( function_exists( 'dsq_is_installed' ) )
363
- echo '<p>' . $this->core->template_tags_general( __( '%plural% are only awarded when your website has been synced with the Disqus server!', 'mycred' ) ) . '</p>';
364
 
365
  ?>
366
  <div class="hook-instance">
@@ -368,23 +368,23 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
368
  <div class="row">
369
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
370
  <div class="form-group">
371
- <label for="<?php echo $this->field_id( array( 'approved' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
372
- <input type="text" name="<?php echo $this->field_name( array( 'approved' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'approved' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['approved']['creds'] ); ?>" class="form-control" />
373
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
374
  </div>
375
  </div>
376
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
377
  <div class="form-group">
378
- <label for="<?php echo $this->field_id( array( 'approved' => 'author' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
379
- <input type="text" name="<?php echo $this->field_name( array( 'approved' => 'author' ) ); ?>" id="<?php echo $this->field_id( array( 'approved' => 'author' ) ); ?>" value="<?php echo $this->core->number( $prefs['approved']['author'] ); ?>" class="form-control" />
380
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
381
  </div>
382
  </div>
383
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
384
  <div class="form-group">
385
- <label for="<?php echo $this->field_id( array( 'approved' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
386
- <input type="text" name="<?php echo $this->field_name( array( 'approved' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'approved' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['approved']['log'] ); ?>" class="form-control" />
387
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'comment' ) ); ?></span>
388
  </div>
389
  </div>
390
  </div>
@@ -392,7 +392,7 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
392
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
393
  <div class="form-group">
394
  <div class="checkbox">
395
- <label for="<?php echo $this->field_id( array( 'limits' => 'self_reply' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'limits' => 'self_reply' ) ); ?>" id="<?php echo $this->field_id( array( 'limits' => 'self_reply' ) ); ?>" <?php checked( $prefs['limits']['self_reply'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( '%plural% is to be awarded even when comment authors reply to their own comment.', 'mycred' ) ); ?></label>
396
  </div>
397
  </div>
398
  </div>
@@ -400,16 +400,16 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
400
  <div class="row">
401
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
402
  <div class="form-group">
403
- <label for="<?php echo $this->field_id( array( 'limits' => 'per_post' ) ); ?>"><?php esc_html_e( 'Limit per post', 'mycred' ); ?></label>
404
- <input type="text" name="<?php echo $this->field_name( array( 'limits' => 'per_post' ) ); ?>" id="<?php echo $this->field_id( array( 'limits' => 'per_post' ) ); ?>" value="<?php echo esc_attr( $prefs['limits']['per_post'] ); ?>" class="form-control" />
405
- <span class="description"><?php echo $this->core->template_tags_general( __( 'The number of comments per post that grants %_plural% to the comment author. Use zero for unlimited.', 'mycred' ) ); ?></span>
406
  </div>
407
  </div>
408
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
409
  <div class="form-group">
410
- <label for="<?php echo $this->field_id( array( 'limits' => 'per_day' ) ); ?>"><?php esc_html_e( 'Limit per day', 'mycred' ); ?></label>
411
- <input type="text" name="<?php echo $this->field_name( array( 'limits' => 'per_day' ) ); ?>" id="<?php echo $this->field_id( array( 'limits' => 'per_day' ) ); ?>" value="<?php echo $prefs['limits']['per_day']; ?>" class="form-control" />
412
- <span class="description"><?php echo $this->core->template_tags_general( __( 'Number of comments per day that grants %_plural%. Use zero for unlimited.', 'mycred' ) ); ?></span>
413
  </div>
414
  </div>
415
  </div>
@@ -419,23 +419,23 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
419
  <div class="row">
420
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
421
  <div class="form-group">
422
- <label for="<?php echo $this->field_id( array( 'spam' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
423
- <input type="text" name="<?php echo $this->field_name( array( 'spam' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'spam' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['spam']['creds'] ); ?>" class="form-control" />
424
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
425
  </div>
426
  </div>
427
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
428
  <div class="form-group">
429
- <label for="<?php echo $this->field_id( array( 'spam' => 'author' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
430
- <input type="text" name="<?php echo $this->field_name( array( 'spam' => 'author' ) ); ?>" id="<?php echo $this->field_id( array( 'spam' => 'author' ) ); ?>" value="<?php echo $this->core->number( $prefs['spam']['author'] ); ?>" class="form-control" />
431
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
432
  </div>
433
  </div>
434
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
435
  <div class="form-group">
436
- <label for="<?php echo $this->field_id( array( 'spam' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
437
- <input type="text" name="<?php echo $this->field_name( array( 'spam' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'spam' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['spam']['log'] ); ?>" class="form-control" />
438
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'comment' ) ); ?></span>
439
  </div>
440
  </div>
441
  </div>
@@ -445,23 +445,23 @@ if ( ! class_exists( 'myCRED_Hook_Comments' ) ) :
445
  <div class="row">
446
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
447
  <div class="form-group">
448
- <label for="<?php echo $this->field_id( array( 'trash' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
449
- <input type="text" name="<?php echo $this->field_name( array( 'trash' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'trash' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['trash']['creds'] ); ?>" class="form-control" />
450
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
451
  </div>
452
  </div>
453
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
454
  <div class="form-group">
455
- <label for="<?php echo $this->field_id( array( 'trash' => 'author' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
456
- <input type="text" name="<?php echo $this->field_name( array( 'trash' => 'author' ) ); ?>" id="<?php echo $this->field_id( array( 'trash' => 'author' ) ); ?>" value="<?php echo $this->core->number( $prefs['trash']['author'] ); ?>" class="form-control" />
457
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
458
  </div>
459
  </div>
460
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
461
  <div class="form-group">
462
- <label for="<?php echo $this->field_id( array( 'trash' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
463
- <input type="text" name="<?php echo $this->field_name( array( 'trash' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'trash' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['trash']['log'] ); ?>" class="form-control" />
464
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'comment' ) ); ?></span>
465
  </div>
466
  </div>
467
  </div>
360
  );
361
 
362
  if ( function_exists( 'dsq_is_installed' ) )
363
+ echo '<p>' . wp_kses_post( $this->core->template_tags_general( __( '%plural% are only awarded when your website has been synced with the Disqus server!', 'mycred' ) ) ) . '</p>';
364
 
365
  ?>
366
  <div class="hook-instance">
368
  <div class="row">
369
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
370
  <div class="form-group">
371
+ <label for="<?php echo esc_attr( $this->field_id( array( 'approved' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
372
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'approved' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'approved' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['approved']['creds'] ) ); ?>" class="form-control" />
373
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
374
  </div>
375
  </div>
376
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
377
  <div class="form-group">
378
+ <label for="<?php echo esc_attr( $this->field_id( array( 'approved' => 'author' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
379
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'approved' => 'author' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'approved' => 'author' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['approved']['author'] ) ); ?>" class="form-control" />
380
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
381
  </div>
382
  </div>
383
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
384
  <div class="form-group">
385
+ <label for="<?php echo esc_attr( $this->field_id( array( 'approved' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
386
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'approved' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'approved' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['approved']['log'] ); ?>" class="form-control" />
387
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'comment' ) ) ); ?></span>
388
  </div>
389
  </div>
390
  </div>
392
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
393
  <div class="form-group">
394
  <div class="checkbox">
395
+ <label for="<?php echo esc_attr( $this->field_id( array( 'limits' => 'self_reply' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'limits' => 'self_reply' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'limits' => 'self_reply' ) ) ); ?>" <?php checked( $prefs['limits']['self_reply'], 1 ); ?> value="1" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( '%plural% is to be awarded even when comment authors reply to their own comment.', 'mycred' ) ) ); ?></label>
396
  </div>
397
  </div>
398
  </div>
400
  <div class="row">
401
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
402
  <div class="form-group">
403
+ <label for="<?php echo esc_attr( $this->field_id( array( 'limits' => 'per_post' ) ) ); ?>"><?php esc_html_e( 'Limit per post', 'mycred' ); ?></label>
404
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'limits' => 'per_post' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'limits' => 'per_post' ) ) ); ?>" value="<?php echo esc_attr( $prefs['limits']['per_post'] ); ?>" class="form-control" />
405
+ <span class="description"><?php echo wp_kses_post( $this->core->template_tags_general( __( 'The number of comments per post that grants %_plural% to the comment author. Use zero for unlimited.', 'mycred' ) ) ); ?></span>
406
  </div>
407
  </div>
408
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
409
  <div class="form-group">
410
+ <label for="<?php echo esc_attr( $this->field_id( array( 'limits' => 'per_day' ) ) ); ?>"><?php esc_html_e( 'Limit per day', 'mycred' ); ?></label>
411
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'limits' => 'per_day' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'limits' => 'per_day' ) ) ); ?>" value="<?php echo esc_attr( $prefs['limits']['per_day'] ); ?>" class="form-control" />
412
+ <span class="description"><?php echo wp_kses_post( $this->core->template_tags_general( __( 'Number of comments per day that grants %_plural%. Use zero for unlimited.', 'mycred' ) ) ); ?></span>
413
  </div>
414
  </div>
415
  </div>
419
  <div class="row">
420
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
421
  <div class="form-group">
422
+ <label for="<?php echo esc_attr( $this->field_id( array( 'spam' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
423
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'spam' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'spam' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['spam']['creds'] ) ); ?>" class="form-control" />
424
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
425
  </div>
426
  </div>
427
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
428
  <div class="form-group">
429
+ <label for="<?php echo esc_attr( $this->field_id( array( 'spam' => 'author' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
430
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'spam' => 'author' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'spam' => 'author' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['spam']['author'] ) ); ?>" class="form-control" />
431
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
432
  </div>
433
  </div>
434
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
435
  <div class="form-group">
436
+ <label for="<?php echo esc_attr( $this->field_id( array( 'spam' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
437
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'spam' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'spam' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['spam']['log'] ); ?>" class="form-control" />
438
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'comment' ) ) ); ?></span>
439
  </div>
440
  </div>
441
  </div>
445
  <div class="row">
446
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
447
  <div class="form-group">
448
+ <label for="<?php echo esc_attr( $this->field_id( array( 'trash' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
449
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'trash' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'trash' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['trash']['creds'] ) ); ?>" class="form-control" />
450
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
451
  </div>
452
  </div>
453
  <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
454
  <div class="form-group">
455
+ <label for="<?php echo esc_attr( $this->field_id( array( 'trash' => 'author' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
456
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'trash' => 'author' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'trash' => 'author' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['trash']['author'] ) ); ?>" class="form-control" />
457
  <span class="description"><?php esc_html_e( 'Use zero to disable.', 'mycred' ); ?></span>
458
  </div>
459
  </div>
460
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
461
  <div class="form-group">
462
+ <label for="<?php echo esc_attr( $this->field_id( array( 'trash' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
463
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'trash' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'trash' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['trash']['log'] ); ?>" class="form-control" />
464
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'comment' ) ) ); ?></span>
465
  </div>
466
  </div>
467
  </div>
includes/hooks/mycred-hook-delete-content.php CHANGED
@@ -108,21 +108,46 @@ if ( ! class_exists( 'myCRED_Hook_Delete_Content' ) ) :
108
  <div class="row">
109
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
110
  <div class="form-group">
111
- <label for="<?php echo $this->field_id( array( 'post' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
112
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['post']['creds'] ); ?>" class="form-control" />
113
  </div>
114
  </div>
115
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
116
  <div class="form-group">
117
- <label for="<?php echo $this->field_id( array( 'post' => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
118
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'post' => 'limit' ) ), $this->field_id( array( 'post' => 'limit' ) ), $prefs['post']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  </div>
120
  </div>
121
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
122
  <div class="form-group">
123
- <label for="<?php echo $this->field_id( array( 'post' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
124
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'log' ) ); ?>" placeholder="<?php esc_html_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['log'] ); ?>" class="form-control" />
125
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
126
  </div>
127
  </div>
128
  </div>
@@ -132,21 +157,46 @@ if ( ! class_exists( 'myCRED_Hook_Delete_Content' ) ) :
132
  <div class="row">
133
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
134
  <div class="form-group">
135
- <label for="<?php echo $this->field_id( array( 'page' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
136
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['page']['creds'] ); ?>" class="form-control" />
137
  </div>
138
  </div>
139
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
140
  <div class="form-group">
141
- <label for="<?php echo $this->field_id( array( 'page' => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
142
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'page' => 'limit' ) ), $this->field_id( array( 'page' => 'limit' ) ), $prefs['page']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  </div>
144
  </div>
145
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
146
  <div class="form-group">
147
- <label for="<?php echo $this->field_id( array( 'page' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
148
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['log'] ); ?>" class="form-control" />
149
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
150
  </div>
151
  </div>
152
  </div>
@@ -184,25 +234,50 @@ if ( ! class_exists( 'myCRED_Hook_Delete_Content' ) ) :
184
 
185
  ?>
186
  <div class="hook-instance">
187
- <h3><?php printf( __( 'Trashing %s', 'mycred' ), $post_type->labels->name ); ?></h3>
188
  <div class="row">
189
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
190
  <div class="form-group">
191
- <label for="<?php echo $this->field_id( array( $post_type->name => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
192
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'creds' ) ); ?>" value="<?php echo $this->core->number( $_creds ); ?>" class="form-control" />
193
  </div>
194
  </div>
195
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
196
  <div class="form-group">
197
- <label for="<?php echo $this->field_id( array( $post_type->name => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
198
- <?php echo $this->hook_limit_setting( $this->field_name( array( $post_type->name => 'limit' ) ), $this->field_id( array( $post_type->name => 'limit' ) ), $_limit ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  </div>
200
  </div>
201
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
202
  <div class="form-group">
203
- <label for="<?php echo $this->field_id( array( $post_type->name => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
204
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'log' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_log ); ?>" class="form-control" />
205
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
206
  </div>
207
  </div>
208
  </div>
108
  <div class="row">
109
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
110
  <div class="form-group">
111
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
112
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['post']['creds'] ) ); ?>" class="form-control" />
113
  </div>
114
  </div>
115
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
116
  <div class="form-group">
117
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
118
+ <?php echo wp_kses(
119
+ $this->hook_limit_setting( $this->field_name( array( 'post' => 'limit' ) ), $this->field_id( array( 'post' => 'limit' ) ), $prefs['post']['limit'] ),
120
+ array(
121
+ 'div' => array(
122
+ 'class' => array()
123
+ ),
124
+ 'input' => array(
125
+ 'type' => array(),
126
+ 'size' => array(),
127
+ 'class' => array(),
128
+ 'name' => array(),
129
+ 'id' => array(),
130
+ 'value' => array()
131
+ ),
132
+ 'select' => array(
133
+ 'name' => array(),
134
+ 'id' => array(),
135
+ 'class' => array()
136
+ ),
137
+ 'option' => array(
138
+ 'value' => array(),
139
+ 'selected' => array()
140
+ )
141
+ )
142
+ );
143
+ ?>
144
  </div>
145
  </div>
146
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
147
  <div class="form-group">
148
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
149
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'log' ) ) ); ?>" placeholder="<?php esc_html_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['log'] ); ?>" class="form-control" />
150
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
151
  </div>
152
  </div>
153
  </div>
157
  <div class="row">
158
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
159
  <div class="form-group">
160
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
161
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['page']['creds'] ) ); ?>" class="form-control" />
162
  </div>
163
  </div>
164
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
165
  <div class="form-group">
166
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
167
+ <?php echo wp_kses(
168
+ $this->hook_limit_setting( $this->field_name( array( 'page' => 'limit' ) ), $this->field_id( array( 'page' => 'limit' ) ), $prefs['page']['limit'] ),
169
+ array(
170
+ 'div' => array(
171
+ 'class' => array()
172
+ ),
173
+ 'input' => array(
174
+ 'type' => array(),
175
+ 'size' => array(),
176
+ 'class' => array(),
177
+ 'name' => array(),
178
+ 'id' => array(),
179
+ 'value' => array()
180
+ ),
181
+ 'select' => array(
182
+ 'name' => array(),
183
+ 'id' => array(),
184
+ 'class' => array()
185
+ ),
186
+ 'option' => array(
187
+ 'value' => array(),
188
+ 'selected' => array()
189
+ )
190
+ )
191
+ );
192
+ ?>
193
  </div>
194
  </div>
195
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
196
  <div class="form-group">
197
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
198
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['log'] ); ?>" class="form-control" />
199
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
200
  </div>
201
  </div>
202
  </div>
234
 
235
  ?>
236
  <div class="hook-instance">
237
+ <h3><?php printf( esc_html__( 'Trashing %s', 'mycred' ), esc_html( $post_type->labels->name ) ); ?></h3>
238
  <div class="row">
239
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
240
  <div class="form-group">
241
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
242
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $_creds ) ); ?>" class="form-control" />
243
  </div>
244
  </div>
245
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
246
  <div class="form-group">
247
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
248
+ <?php echo wp_kses(
249
+ $this->hook_limit_setting( $this->field_name( array( $post_type->name => 'limit' ) ), $this->field_id( array( $post_type->name => 'limit' ) ), $_limit ),
250
+ array(
251
+ 'div' => array(
252
+ 'class' => array()
253
+ ),
254
+ 'input' => array(
255
+ 'type' => array(),
256
+ 'size' => array(),
257
+ 'class' => array(),
258
+ 'name' => array(),
259
+ 'id' => array(),
260
+ 'value' => array()
261
+ ),
262
+ 'select' => array(
263
+ 'name' => array(),
264
+ 'id' => array(),
265
+ 'class' => array()
266
+ ),
267
+ 'option' => array(
268
+ 'value' => array(),
269
+ 'selected' => array()
270
+ )
271
+ )
272
+ );
273
+ ?>
274
  </div>
275
  </div>
276
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
277
  <div class="form-group">
278
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
279
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_log ); ?>" class="form-control" />
280
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
281
  </div>
282
  </div>
283
  </div>
includes/hooks/mycred-hook-link-clicks.php CHANGED
@@ -38,7 +38,7 @@ if ( ! class_exists( 'myCRED_Hook_Click_Links' ) ) :
38
  add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
39
  add_filter( 'mycred_parse_tags_link', array( $this, 'parse_custom_tags' ), 10, 2 );
40
 
41
- if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-click-points' && isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-link-points' ) )
42
  $this->ajax_call_link_points();
43
 
44
  }
@@ -177,14 +177,14 @@ if ( ! class_exists( 'myCRED_Hook_Click_Links' ) ) :
177
 
178
  // Token
179
  if ( ! isset( $_POST['key'] ) ) wp_send_json( 300 );
180
- $token = mycred_verify_token( $_POST['key'], 4 );
181
  if ( $token === false ) wp_send_json( 305 );
182
 
183
  list ( $amount, $point_type, $id, $url ) = $token;
184
  if ( $amount == '' || $point_type == '' || $id == '' || $url == '' ) wp_send_json( 310 );
185
 
186
  // Make sure the token is not abused
187
- if ( $url != urlencode( $_POST['url'] ) ) wp_send_json( 315 );
188
 
189
  // Bail now if this was not intenteded for this type
190
  if ( $point_type != $this->mycred_type ) return;
@@ -199,9 +199,9 @@ if ( ! class_exists( 'myCRED_Hook_Click_Links' ) ) :
199
 
200
  $data = array(
201
  'ref_type' => 'link',
202
- 'link_url' => esc_url_raw( $_POST['url'] ),
203
  'link_id' => $id,
204
- 'link_title' => ( isset( $_POST['etitle'] ) ) ? sanitize_text_field( $_POST['etitle'] ) : ''
205
  );
206
 
207
  // Limits
@@ -275,15 +275,15 @@ if ( ! class_exists( 'myCRED_Hook_Click_Links' ) ) :
275
  <div class="row">
276
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
277
  <div class="form-group">
278
- <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label>
279
- <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
280
  </div>
281
  </div>
282
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
283
  <div class="form-group">
284
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
285
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
286
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'user' ), '%url%, %title% or %id%' ); ?></span>
287
  </div>
288
  </div>
289
  </div>
38
  add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
39
  add_filter( 'mycred_parse_tags_link', array( $this, 'parse_custom_tags' ), 10, 2 );
40
 
41
+ if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-click-points' && isset( $_POST['token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['token'] ) ), 'mycred-link-points' ) )
42
  $this->ajax_call_link_points();
43
 
44
  }
177
 
178
  // Token
179
  if ( ! isset( $_POST['key'] ) ) wp_send_json( 300 );
180
+ $token = mycred_verify_token( sanitize_text_field( wp_unslash( $_POST['key'] ) ), 4 );
181
  if ( $token === false ) wp_send_json( 305 );
182
 
183
  list ( $amount, $point_type, $id, $url ) = $token;
184
  if ( $amount == '' || $point_type == '' || $id == '' || $url == '' ) wp_send_json( 310 );
185
 
186
  // Make sure the token is not abused
187
+ if ( $url != urlencode( esc_url_raw( wp_unslash( $_POST['url'] ) ) ) ) wp_send_json( 315 );
188
 
189
  // Bail now if this was not intenteded for this type
190
  if ( $point_type != $this->mycred_type ) return;
199
 
200
  $data = array(
201
  'ref_type' => 'link',
202
+ 'link_url' => esc_url_raw( wp_unslash( $_POST['url'] ) ),
203
  'link_id' => $id,
204
+ 'link_title' => ( isset( $_POST['etitle'] ) ) ? sanitize_text_field( wp_unslash( $_POST['etitle'] ) ) : ''
205
  );
206
 
207
  // Limits
275
  <div class="row">
276
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
277
  <div class="form-group">
278
+ <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
279
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
280
  </div>
281
  </div>
282
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
283
  <div class="form-group">
284
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
285
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
286
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'user' ), '%url%, %title% or %id%' ) ); ?></span>
287
  </div>
288
  </div>
289
  </div>
includes/hooks/mycred-hook-logins.php CHANGED
@@ -126,21 +126,46 @@ if ( ! class_exists( 'myCRED_Hook_Logging_In' ) ) :
126
  <div class="row">
127
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
128
  <div class="form-group">
129
- <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label>
130
- <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
131
  </div>
132
  </div>
133
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
134
  <div class="form-group">
135
- <label for="<?php echo $this->field_id( 'limit' ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
136
- <?php echo $this->hook_limit_setting( $this->field_name( 'limit' ), $this->field_id( 'limit' ), $prefs['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  </div>
138
  </div>
139
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
140
  <div class="form-group">
141
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
142
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
143
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
144
  </div>
145
  </div>
146
  </div>
126
  <div class="row">
127
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
128
  <div class="form-group">
129
+ <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
130
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
131
  </div>
132
  </div>
133
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
134
  <div class="form-group">
135
+ <label for="<?php echo esc_attr( $this->field_id( 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
136
+ <?php echo wp_kses(
137
+ $this->hook_limit_setting( $this->field_name( 'limit' ), $this->field_id( 'limit' ), $prefs['limit'] ),
138
+ array(
139
+ 'div' => array(
140
+ 'class' => array()
141
+ ),
142
+ 'input' => array(
143
+ 'type' => array(),
144
+ 'size' => array(),
145
+ 'class' => array(),
146
+ 'name' => array(),
147
+ 'id' => array(),
148
+ 'value' => array()
149
+ ),
150
+ 'select' => array(
151
+ 'name' => array(),
152
+ 'id' => array(),
153
+ 'class' => array()
154
+ ),
155
+ 'option' => array(
156
+ 'value' => array(),
157
+ 'selected' => array()
158
+ )
159
+ )
160
+ );
161
+ ?>
162
  </div>
163
  </div>
164
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
165
  <div class="form-group">
166
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
167
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
168
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
169
  </div>
170
  </div>
171
  </div>
includes/hooks/mycred-hook-publishing-content.php CHANGED
@@ -110,21 +110,46 @@ if ( ! class_exists( 'myCRED_Hook_Publishing_Content' ) ) :
110
  <div class="row">
111
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
112
  <div class="form-group">
113
- <label for="<?php echo $this->field_id( array( 'post' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
114
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['post']['creds'] ); ?>" class="form-control" />
115
  </div>
116
  </div>
117
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
118
  <div class="form-group">
119
- <label for="<?php echo $this->field_id( array( 'post' => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
120
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'post' => 'limit' ) ), $this->field_id( array( 'post' => 'limit' ) ), $prefs['post']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  </div>
122
  </div>
123
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
124
  <div class="form-group">
125
- <label for="<?php echo $this->field_id( array( 'post' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
126
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['log'] ); ?>" class="form-control" />
127
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
128
  </div>
129
  </div>
130
  </div>
@@ -134,21 +159,46 @@ if ( ! class_exists( 'myCRED_Hook_Publishing_Content' ) ) :
134
  <div class="row">
135
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
136
  <div class="form-group">
137
- <label for="<?php echo $this->field_id( array( 'page' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
138
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['page']['creds'] ); ?>" class="form-control" />
139
  </div>
140
  </div>
141
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
142
  <div class="form-group">
143
- <label for="<?php echo $this->field_id( array( 'page' => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
144
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'page' => 'limit' ) ), $this->field_id( array( 'page' => 'limit' ) ), $prefs['page']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  </div>
146
  </div>
147
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
148
  <div class="form-group">
149
- <label for="<?php echo $this->field_id( array( 'page' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
150
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['log'] ); ?>" class="form-control" />
151
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
152
  </div>
153
  </div>
154
  </div>
@@ -186,25 +236,50 @@ if ( ! class_exists( 'myCRED_Hook_Publishing_Content' ) ) :
186
 
187
  ?>
188
  <div class="hook-instance">
189
- <h3><?php printf( __( 'Publishing %s', 'mycred' ), $post_type->labels->name ); ?></h3>
190
  <div class="row">
191
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
192
  <div class="form-group">
193
- <label for="<?php echo $this->field_id( array( $post_type->name => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
194
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'creds' ) ); ?>" value="<?php echo $this->core->number( $_creds ); ?>" class="form-control" />
195
  </div>
196
  </div>
197
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
198
  <div class="form-group">
199
- <label for="<?php echo $this->field_id( array( $post_type->name => 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
200
- <?php echo $this->hook_limit_setting( $this->field_name( array( $post_type->name => 'limit' ) ), $this->field_id( array( $post_type->name => 'limit' ) ), $_limit ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  </div>
202
  </div>
203
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
204
  <div class="form-group">
205
- <label for="<?php echo $this->field_id( array( $post_type->name => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
206
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'log' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_log ); ?>" class="form-control" />
207
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
208
  </div>
209
  </div>
210
  </div>
110
  <div class="row">
111
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
112
  <div class="form-group">
113
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
114
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['post']['creds'] ) ); ?>" class="form-control" />
115
  </div>
116
  </div>
117
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
118
  <div class="form-group">
119
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
120
+ <?php echo wp_kses(
121
+ $this->hook_limit_setting( $this->field_name( array( 'post' => 'limit' ) ), $this->field_id( array( 'post' => 'limit' ) ), $prefs['post']['limit'] ),
122
+ array(
123
+ 'div' => array(
124
+ 'class' => array()
125
+ ),
126
+ 'input' => array(
127
+ 'type' => array(),
128
+ 'size' => array(),
129
+ 'class' => array(),
130
+ 'name' => array(),
131
+ 'id' => array(),
132
+ 'value' => array()
133
+ ),
134
+ 'select' => array(
135
+ 'name' => array(),
136
+ 'id' => array(),
137
+ 'class' => array()
138
+ ),
139
+ 'option' => array(
140
+ 'value' => array(),
141
+ 'selected' => array()
142
+ )
143
+ )
144
+ );
145
+ ?>
146
  </div>
147
  </div>
148
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
149
  <div class="form-group">
150
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
151
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['log'] ); ?>" class="form-control" />
152
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
153
  </div>
154
  </div>
155
  </div>
159
  <div class="row">
160
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
161
  <div class="form-group">
162
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
163
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['page']['creds'] ) ); ?>" class="form-control" />
164
  </div>
165
  </div>
166
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
167
  <div class="form-group">
168
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
169
+ <?php echo wp_kses(
170
+ $this->hook_limit_setting( $this->field_name( array( 'page' => 'limit' ) ), $this->field_id( array( 'page' => 'limit' ) ), $prefs['page']['limit'] ),
171
+ array(
172
+ 'div' => array(
173
+ 'class' => array()
174
+ ),
175
+ 'input' => array(
176
+ 'type' => array(),
177
+ 'size' => array(),
178
+ 'class' => array(),
179
+ 'name' => array(),
180
+ 'id' => array(),
181
+ 'value' => array()
182
+ ),
183
+ 'select' => array(
184
+ 'name' => array(),
185
+ 'id' => array(),
186
+ 'class' => array()
187
+ ),
188
+ 'option' => array(
189
+ 'value' => array(),
190
+ 'selected' => array()
191
+ )
192
+ )
193
+ );
194
+ ?>
195
  </div>
196
  </div>
197
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
198
  <div class="form-group">
199
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
200
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['log'] ); ?>" class="form-control" />
201
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
202
  </div>
203
  </div>
204
  </div>
236
 
237
  ?>
238
  <div class="hook-instance">
239
+ <h3><?php printf( esc_html__( 'Publishing %s', 'mycred' ), esc_html( $post_type->labels->name ) ); ?></h3>
240
  <div class="row">
241
  <div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
242
  <div class="form-group">
243
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
244
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $_creds ) ); ?>" class="form-control" />
245
  </div>
246
  </div>
247
  <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
248
  <div class="form-group">
249
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
250
+ <?php echo wp_kses(
251
+ $this->hook_limit_setting( $this->field_name( array( $post_type->name => 'limit' ) ), $this->field_id( array( $post_type->name => 'limit' ) ), $_limit ),
252
+ array(
253
+ 'div' => array(
254
+ 'class' => array()
255
+ ),
256
+ 'input' => array(
257
+ 'type' => array(),
258
+ 'size' => array(),
259
+ 'class' => array(),
260
+ 'name' => array(),
261
+ 'id' => array(),
262
+ 'value' => array()
263
+ ),
264
+ 'select' => array(
265
+ 'name' => array(),
266
+ 'id' => array(),
267
+ 'class' => array()
268
+ ),
269
+ 'option' => array(
270
+ 'value' => array(),
271
+ 'selected' => array()
272
+ )
273
+ )
274
+ );
275
+ ?>
276
  </div>
277
  </div>
278
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
279
  <div class="form-group">
280
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
281
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_log ); ?>" class="form-control" />
282
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
283
  </div>
284
  </div>
285
  </div>
includes/hooks/mycred-hook-referrals.php CHANGED
@@ -238,7 +238,35 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
238
  }
239
 
240
  $output = do_shortcode( $output );
241
- echo apply_filters( 'mycred_affiliate_bp_profile', $output, $user_id, $users_ref_link, $this );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
  }
244
 
@@ -253,7 +281,7 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
253
  if ( ! isset( $_GET[ $this->ref_key ] ) || empty( $_GET[ $this->ref_key ] ) || isset( $_COOKIE[ 'mycred_ref' . $this->mycred_type ] ) ) return;
254
 
255
  // Attempt to get the user id based on the referral id
256
- $user_id = $this->get_user_id_from_ref_id( $_GET[ $this->ref_key ] );
257
  if ( $user_id !== NULL && ! is_user_logged_in() ) {
258
 
259
  // Attempt to get the users IP
@@ -285,10 +313,10 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
285
  // Set cookies
286
  if ( ! headers_sent() ) {
287
 
288
- setcookie( 'mycred_ref' . $this->mycred_type, $_GET[ $this->ref_key ], apply_filters( 'mycred_affiliate_cookie', ( time()+3600*24 ), false, $this ), COOKIEPATH, COOKIE_DOMAIN );
289
 
290
  if ( get_option( 'users_can_register' ) && $this->prefs['signup']['creds'] > 0 )
291
- setcookie( 'signup_ref' . $this->mycred_type, $_GET[ $this->ref_key ], apply_filters( 'mycred_affiliate_cookie', ( time()+3600*24 ), true, $this ), COOKIEPATH, COOKIE_DOMAIN );
292
 
293
  }
294
 
@@ -309,11 +337,11 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
309
  $ref = false;
310
  $key = '';
311
  if ( isset( $_COOKIE[ 'signup_ref' . $this->mycred_type ] ) ) {
312
- $ref = $_COOKIE[ 'signup_ref' . $this->mycred_type ];
313
  $key = 'signup_ref' . $this->mycred_type;
314
  }
315
  elseif ( isset( $_COOKIE[ 'mycred_ref' . $this->mycred_type ] ) ) {
316
- $ref = $_COOKIE[ 'mycred_ref' . $this->mycred_type ];
317
  $key = 'mycred_ref' . $this->mycred_type;
318
  }
319
 
@@ -601,21 +629,46 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
601
  <div class="row">
602
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
603
  <div class="form-group">
604
- <label for="<?php echo $this->field_id( array( 'visit' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
605
- <input type="text" name="<?php echo $this->field_name( array( 'visit' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'visit' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['visit']['creds'] ); ?>" class="form-control" />
606
  </div>
607
  </div>
608
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
609
  <div class="form-group">
610
- <label for="<?php echo $this->field_id( array( 'visit', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
611
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'visit', 'limit' ) ), $this->field_id( array( 'visit', 'limit' ) ), $prefs['visit']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  </div>
613
  </div>
614
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
615
  <div class="form-group">
616
- <label for="<?php echo $this->field_id( array( 'visit' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
617
- <input type="text" name="<?php echo $this->field_name( array( 'visit' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'visit' => 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['visit']['log'] ); ?>" class="form-control" />
618
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
619
  </div>
620
  </div>
621
  </div>
@@ -628,21 +681,46 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
628
  <div class="row">
629
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
630
  <div class="form-group">
631
- <label for="<?php echo $this->field_id( array( 'signup' => 'creds' ) ); ?>"><?php echo $this->core->plural(); ?></label>
632
- <input type="text" name="<?php echo $this->field_name( array( 'signup' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'signup' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['signup']['creds'] ); ?>" class="form-control" />
633
  </div>
634
  </div>
635
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
636
  <div class="form-group">
637
- <label for="<?php echo $this->field_id( array( 'signup', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
638
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'signup', 'limit' ) ), $this->field_id( array( 'signup', 'limit' ) ), $prefs['signup']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
  </div>
640
  </div>
641
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
642
  <div class="form-group">
643
- <label for="<?php echo $this->field_id( array( 'signup' => 'log' ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
644
- <input type="text" name="<?php echo $this->field_name( array( 'signup' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'signup' => 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['signup']['log'] ); ?>" class="form-control" />
645
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ), '%user_name%' ); ?></span>
646
  </div>
647
  </div>
648
  </div>
@@ -654,9 +732,9 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
654
  <div class="row">
655
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
656
  <p>Registrations are disabled.</p>
657
- <input type="hidden" name="<?php echo $this->field_name( array( 'signup' => 'creds' ) ); ?>" value="<?php echo esc_attr( $this->defaults['signup']['creds'] ); ?>" />
658
- <input type="hidden" name="<?php echo $this->field_name( array( 'signup' => 'limit' ) ); ?>" value="<?php echo esc_attr( $this->defaults['signup']['limit'] ); ?>" />
659
- <input type="hidden" name="<?php echo $this->field_name( array( 'signup' => 'log' ) ); ?>" value="<?php echo esc_attr( $this->defaults['signup']['log'] ); ?>" />
660
  </div>
661
  </div>
662
 
@@ -668,23 +746,23 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
668
  <div class="row">
669
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
670
  <div class="form-group">
671
- <label for="<?php echo $this->field_id( array( 'setup' => 'links' ) ); ?>-numeric"><input type="radio" name="<?php echo $this->field_name( array( 'setup' => 'links' ) ); ?>" id="<?php echo $this->field_id( array( 'setup' => 'links' ) ); ?>-numeric" <?php checked( $prefs['setup']['links'], 'numeric' ); ?> value="numeric" /> <?php esc_html_e( 'Assign numeric referral IDs to each user.', 'mycred' ); ?></label>
672
- <span class="description"><?php printf( '%s: %s', __( 'Example', 'mycred' ), esc_url( add_query_arg( array( $this->ref_key => 1 ), home_url( '/' ) ) ) ); ?></span>
673
  </div>
674
  </div>
675
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
676
  <div class="form-group">
677
- <label for="<?php echo $this->field_id( array( 'setup' => 'links' ) ); ?>-username"><input type="radio" name="<?php echo $this->field_name( array( 'setup' => 'links' ) ); ?>" id="<?php echo $this->field_id( array( 'setup' => 'links' ) ); ?>-username" <?php checked( $prefs['setup']['links'], 'username' ); ?> value="username" /> <?php esc_html_e( 'Assign usernames as IDs for each user.', 'mycred' ); ?></label>
678
- <span class="description"><?php printf( '%s: %s', __( 'Example', 'mycred' ), esc_url( add_query_arg( array( $this->ref_key => 'john+doe' ), home_url( '/' ) ) ) ); ?></span>
679
  </div>
680
  </div>
681
  </div>
682
  <div class="row">
683
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
684
  <div class="form-group">
685
- <label for="<?php echo $this->field_id( array( 'setup' => 'IP' ) ); ?>"><?php esc_html_e( 'IP Limit', 'mycred' ); ?></label>
686
- <input type="text" name="<?php echo $this->field_name( array( 'setup' => 'IP' ) ); ?>" id="<?php echo $this->field_id( array( 'setup' => 'IP' ) ); ?>" value="<?php echo absint( $prefs['setup']['IP'] ); ?>" class="form-control" />
687
- <span class="description"><?php echo $this->core->template_tags_general( __( 'The number of times each IP address grants %_plural%. Use zero for unlimited.', 'mycred' ) ); ?></span>
688
  </div>
689
  </div>
690
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -703,7 +781,7 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
703
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
704
  <div class="form-group">
705
  <div class="checkbox">
706
- <label for="<?php echo $this->field_id( array( 'buddypress' => 'profile' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'buddypress' => 'profile' ) ); ?>" id="<?php echo $this->field_id( array( 'buddypress' => 'profile' ) ); ?>"<?php checked( $prefs['buddypress']['profile'], 1 ); ?> value="1" /> <?php esc_html_e( 'Insert referral link in users profiles', 'mycred' ); ?></label>
707
  </div>
708
  </div>
709
  </div>
@@ -712,14 +790,14 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
712
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
713
  <div class="form-group">
714
  <label><?php esc_html_e( 'Title', 'mycred' ); ?></label><br />
715
- <input type="text" name="<?php echo $this->field_name( array( 'buddypress' => 'title' ) ); ?>" id="<?php echo $this->field_id( array( 'buddypress' => 'title' ) ); ?>" value="<?php echo esc_attr( $prefs['buddypress']['title'] ); ?>" class="form-control" />
716
  <span class="description"><?php esc_html_e( 'Leave empty to hide.', 'mycred' ); ?></span>
717
  </div>
718
  </div>
719
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
720
  <div class="form-group">
721
  <label><?php esc_html_e( 'Profile Positioning', 'mycred' ); ?></label><br />
722
- <input type="text" name="<?php echo $this->field_name( array( 'buddypress' => 'priority' ) ); ?>" id="<?php echo $this->field_id( array( 'buddypress' => 'priority' ) ); ?>" value="<?php echo absint( $prefs['buddypress']['priority'] ); ?>" class="form-control" />
723
  <span class="description"><?php esc_html_e( 'You can move around the referral link on your users profile by changing the position. Increase to move up, decrease to move down.', 'mycred' ); ?></span>
724
  </div>
725
  </div>
@@ -727,18 +805,18 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
727
  <div class="row">
728
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
729
  <div class="form-group">
730
- <label for="<?php echo $this->field_id( array( 'buddypress' => 'desc' ) ); ?>"><?php esc_html_e( 'Description', 'mycred' ); ?></label>
731
  <span class="description"><?php esc_html_e( 'Optional description to insert under the link.', 'mycred' ); ?></span>
732
- <textarea name="<?php echo $this->field_name( array( 'buddypress' => 'desc' ) ); ?>" id="<?php echo $this->field_id( array( 'buddypress' => 'desc' ) ); ?>" class="form-control" rows="5" cols="30"><?php echo esc_attr( $prefs['buddypress']['desc'] ); ?></textarea>
733
  </div>
734
  </div>
735
  </div>
736
  </div>
737
  <?php else : ?>
738
- <input type="hidden" name="<?php echo $this->field_name( array( 'buddypress' => 'profile' ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['profile'] ); ?>" />
739
- <input type="hidden" name="<?php echo $this->field_name( array( 'buddypress' => 'title' ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['title'] ); ?>" />
740
- <input type="hidden" name="<?php echo $this->field_name( array( 'buddypress' => 'desc' ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['desc'] ); ?>" />
741
- <input type="hidden" name="<?php echo $this->field_name( array( 'buddypress' => 'priority' ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['priority'] ); ?>" />
742
  <?php endif; ?>
743
  <?php
744
 
238
  }
239
 
240
  $output = do_shortcode( $output );
241
+
242
+ echo wp_kses(
243
+ apply_filters( 'mycred_affiliate_bp_profile', $output, $user_id, $users_ref_link, $this ),
244
+ array(
245
+ 'div' => array(
246
+ 'class' => array()
247
+ ),
248
+ 'p' => array(),
249
+ 'h4' => array(),
250
+ 'input' => array(
251
+ 'type' => array(),
252
+ 'readonly' => array(),
253
+ 'id' => array(),
254
+ 'value' => array()
255
+ ),
256
+ 'button' => array(
257
+ 'onclick' => array()
258
+ ),
259
+ 'table' => array(
260
+ 'class' => array()
261
+ ),
262
+ 'tr' => array(
263
+ 'class' => array()
264
+ ),
265
+ 'td' => array(
266
+ 'class' => array()
267
+ )
268
+ )
269
+ );
270
 
271
  }
272
 
281
  if ( ! isset( $_GET[ $this->ref_key ] ) || empty( $_GET[ $this->ref_key ] ) || isset( $_COOKIE[ 'mycred_ref' . $this->mycred_type ] ) ) return;
282
 
283
  // Attempt to get the user id based on the referral id
284
+ $user_id = $this->get_user_id_from_ref_id( sanitize_text_field( wp_unslash( $_GET[ $this->ref_key ] ) ) );
285
  if ( $user_id !== NULL && ! is_user_logged_in() ) {
286
 
287
  // Attempt to get the users IP
313
  // Set cookies
314
  if ( ! headers_sent() ) {
315
 
316
+ setcookie( 'mycred_ref' . $this->mycred_type, sanitize_text_field( wp_unslash( $_GET[ $this->ref_key ] ) ), apply_filters( 'mycred_affiliate_cookie', ( time()+3600*24 ), false, $this ), COOKIEPATH, COOKIE_DOMAIN );
317
 
318
  if ( get_option( 'users_can_register' ) && $this->prefs['signup']['creds'] > 0 )
319
+ setcookie( 'signup_ref' . $this->mycred_type, sanitize_text_field( wp_unslash( $_GET[ $this->ref_key ] ) ), apply_filters( 'mycred_affiliate_cookie', ( time()+3600*24 ), true, $this ), COOKIEPATH, COOKIE_DOMAIN );
320
 
321
  }
322
 
337
  $ref = false;
338
  $key = '';
339
  if ( isset( $_COOKIE[ 'signup_ref' . $this->mycred_type ] ) ) {
340
+ $ref = sanitize_text_field( wp_unslash( $_COOKIE[ 'signup_ref' . $this->mycred_type ] ) );
341
  $key = 'signup_ref' . $this->mycred_type;
342
  }
343
  elseif ( isset( $_COOKIE[ 'mycred_ref' . $this->mycred_type ] ) ) {
344
+ $ref = sanitize_text_field( wp_unslash( $_COOKIE[ 'mycred_ref' . $this->mycred_type ] ) );
345
  $key = 'mycred_ref' . $this->mycred_type;
346
  }
347
 
629
  <div class="row">
630
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
631
  <div class="form-group">
632
+ <label for="<?php echo esc_attr( $this->field_id( array( 'visit' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
633
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'visit' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'visit' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['visit']['creds'] ) ); ?>" class="form-control" />
634
  </div>
635
  </div>
636
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
637
  <div class="form-group">
638
+ <label for="<?php echo esc_attr( $this->field_id( array( 'visit', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
639
+ <?php echo wp_kses(
640
+ $this->hook_limit_setting( $this->field_name( array( 'visit', 'limit' ) ), $this->field_id( array( 'visit', 'limit' ) ), $prefs['visit']['limit'] ),
641
+ array(
642
+ 'div' => array(
643
+ 'class' => array()
644
+ ),
645
+ 'input' => array(
646
+ 'type' => array(),
647
+ 'size' => array(),
648
+ 'class' => array(),
649
+ 'name' => array(),
650
+ 'id' => array(),
651
+ 'value' => array()
652
+ ),
653
+ 'select' => array(
654
+ 'name' => array(),
655
+ 'id' => array(),
656
+ 'class' => array()
657
+ ),
658
+ 'option' => array(
659
+ 'value' => array(),
660
+ 'selected' => array()
661
+ )
662
+ )
663
+ );
664
+ ?>
665
  </div>
666
  </div>
667
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
668
  <div class="form-group">
669
+ <label for="<?php echo esc_attr( $this->field_id( array( 'visit' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
670
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'visit' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'visit' => 'log' ) ) ); ?>" value="<?php echo esc_attr( $prefs['visit']['log'] ); ?>" class="form-control" />
671
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
672
  </div>
673
  </div>
674
  </div>
681
  <div class="row">
682
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
683
  <div class="form-group">
684
+ <label for="<?php echo esc_attr( $this->field_id( array( 'signup' => 'creds' ) ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
685
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'signup' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'signup' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['signup']['creds'] ) ); ?>" class="form-control" />
686
  </div>
687
  </div>
688
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
689
  <div class="form-group">
690
+ <label for="<?php echo esc_attr( $this->field_id( array( 'signup', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
691
+ <?php echo wp_kses(
692
+ $this->hook_limit_setting( $this->field_name( array( 'signup', 'limit' ) ), $this->field_id( array( 'signup', 'limit' ) ), $prefs['signup']['limit'] ),
693
+ array(
694
+ 'div' => array(
695
+ 'class' => array()
696
+ ),
697
+ 'input' => array(
698
+ 'type' => array(),
699
+ 'size' => array(),
700
+ 'class' => array(),
701
+ 'name' => array(),
702
+ 'id' => array(),
703
+ 'value' => array()
704
+ ),
705
+ 'select' => array(
706
+ 'name' => array(),
707
+ 'id' => array(),
708
+ 'class' => array()
709
+ ),
710
+ 'option' => array(
711
+ 'value' => array(),
712
+ 'selected' => array()
713
+ )
714
+ )
715
+ );
716
+ ?>
717
  </div>
718
  </div>
719
  <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
720
  <div class="form-group">
721
+ <label for="<?php echo esc_attr( $this->field_id( array( 'signup' => 'log' ) ) ); ?>"><?php esc_html_e( 'Log template', 'mycred' ); ?></label>
722
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'signup' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'signup' => 'log' ) ) ); ?>" value="<?php echo esc_attr( $prefs['signup']['log'] ); ?>" class="form-control" />
723
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ), '%user_name%' ) ); ?></span>
724
  </div>
725
  </div>
726
  </div>
732
  <div class="row">
733
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
734
  <p>Registrations are disabled.</p>
735
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( array( 'signup' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->defaults['signup']['creds'] ); ?>" />
736
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( array( 'signup' => 'limit' ) ) ); ?>" value="<?php echo esc_attr( $this->defaults['signup']['limit'] ); ?>" />
737
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( array( 'signup' => 'log' ) ) ); ?>" value="<?php echo esc_attr( $this->defaults['signup']['log'] ); ?>" />
738
  </div>
739
  </div>
740
 
746
  <div class="row">
747
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
748
  <div class="form-group">
749
+ <label for="<?php echo esc_attr( $this->field_id( array( 'setup' => 'links' ) ) ); ?>-numeric"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'setup' => 'links' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'setup' => 'links' ) ) ); ?>-numeric" <?php checked( $prefs['setup']['links'], 'numeric' ); ?> value="numeric" /> <?php esc_html_e( 'Assign numeric referral IDs to each user.', 'mycred' ); ?></label>
750
+ <span class="description"><?php printf( '%s: %s', esc_html__( 'Example', 'mycred' ), esc_url( add_query_arg( array( $this->ref_key => 1 ), home_url( '/' ) ) ) ); ?></span>
751
  </div>
752
  </div>
753
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
754
  <div class="form-group">
755
+ <label for="<?php echo esc_attr( $this->field_id( array( 'setup' => 'links' ) ) ); ?>-username"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'setup' => 'links' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'setup' => 'links' ) ) ); ?>-username" <?php checked( $prefs['setup']['links'], 'username' ); ?> value="username" /> <?php esc_html_e( 'Assign usernames as IDs for each user.', 'mycred' ); ?></label>
756
+ <span class="description"><?php printf( '%s: %s', esc_html__( 'Example', 'mycred' ), esc_url( add_query_arg( array( $this->ref_key => 'john+doe' ), home_url( '/' ) ) ) ); ?></span>
757
  </div>
758
  </div>
759
  </div>
760
  <div class="row">
761
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
762
  <div class="form-group">
763
+ <label for="<?php echo esc_attr( $this->field_id( array( 'setup' => 'IP' ) ) ); ?>"><?php esc_html_e( 'IP Limit', 'mycred' ); ?></label>
764
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'setup' => 'IP' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'setup' => 'IP' ) ) ); ?>" value="<?php echo absint( $prefs['setup']['IP'] ); ?>" class="form-control" />
765
+ <span class="description"><?php echo wp_kses_post( $this->core->template_tags_general( __( 'The number of times each IP address grants %_plural%. Use zero for unlimited.', 'mycred' ) ) ); ?></span>
766
  </div>
767
  </div>
768
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
781
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
782
  <div class="form-group">
783
  <div class="checkbox">
784
+ <label for="<?php echo esc_attr( $this->field_id( array( 'buddypress' => 'profile' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'profile' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'buddypress' => 'profile' ) ) ); ?>"<?php checked( $prefs['buddypress']['profile'], 1 ); ?> value="1" /> <?php esc_html_e( 'Insert referral link in users profiles', 'mycred' ); ?></label>
785
  </div>
786
  </div>
787
  </div>
790
  <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
791
  <div class="form-group">
792
  <label><?php esc_html_e( 'Title', 'mycred' ); ?></label><br />
793
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'title' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'buddypress' => 'title' ) ) ); ?>" value="<?php echo esc_attr( $prefs['buddypress']['title'] ); ?>" class="form-control" />
794
  <span class="description"><?php esc_html_e( 'Leave empty to hide.', 'mycred' ); ?></span>
795
  </div>
796
  </div>
797
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
798
  <div class="form-group">
799
  <label><?php esc_html_e( 'Profile Positioning', 'mycred' ); ?></label><br />
800
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'priority' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'buddypress' => 'priority' ) ) ); ?>" value="<?php echo absint( $prefs['buddypress']['priority'] ); ?>" class="form-control" />
801
  <span class="description"><?php esc_html_e( 'You can move around the referral link on your users profile by changing the position. Increase to move up, decrease to move down.', 'mycred' ); ?></span>
802
  </div>
803
  </div>
805
  <div class="row">
806
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
807
  <div class="form-group">
808
+ <label for="<?php echo esc_attr( $this->field_id( array( 'buddypress' => 'desc' ) ) ); ?>"><?php esc_html_e( 'Description', 'mycred' ); ?></label>
809
  <span class="description"><?php esc_html_e( 'Optional description to insert under the link.', 'mycred' ); ?></span>
810
+ <textarea name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'desc' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'buddypress' => 'desc' ) ) ); ?>" class="form-control" rows="5" cols="30"><?php echo esc_attr( $prefs['buddypress']['desc'] ); ?></textarea>
811
  </div>
812
  </div>
813
  </div>
814
  </div>
815
  <?php else : ?>
816
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'profile' ) ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['profile'] ); ?>" />
817
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'title' ) ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['title'] ); ?>" />
818
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'desc' ) ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['desc'] ); ?>" />
819
+ <input type="hidden" name="<?php echo esc_attr( $this->field_name( array( 'buddypress' => 'priority' ) ) ); ?>" value="<?php echo esc_attr( $this->defaults['buddypress']['priority'] ); ?>" />
820
  <?php endif; ?>
821
  <?php
822
 
includes/hooks/mycred-hook-registrations.php CHANGED
@@ -77,15 +77,15 @@ if ( ! class_exists( 'myCRED_Hook_Registration' ) ) :
77
  <div class="row">
78
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
79
  <div class="form-group">
80
- <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label>
81
- <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
82
  </div>
83
  </div>
84
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
85
  <div class="form-group">
86
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
87
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
88
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'user' ) ); ?></span>
89
  </div>
90
  </div>
91
  </div>
77
  <div class="row">
78
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
79
  <div class="form-group">
80
+ <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
81
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
82
  </div>
83
  </div>
84
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
85
  <div class="form-group">
86
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
87
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
88
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'user' ) ) ); ?></span>
89
  </div>
90
  </div>
91
  </div>
includes/hooks/mycred-hook-site-visits.php CHANGED
@@ -92,15 +92,15 @@ if ( ! class_exists( 'myCRED_Hook_Site_Visits' ) ) :
92
  <div class="row">
93
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
94
  <div class="form-group">
95
- <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label>
96
- <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
97
  </div>
98
  </div>
99
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
100
  <div class="form-group">
101
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
102
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
103
- <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
104
  </div>
105
  </div>
106
  </div>
92
  <div class="row">
93
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
94
  <div class="form-group">
95
+ <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
96
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
97
  </div>
98
  </div>
99
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
100
  <div class="form-group">
101
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
102
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
103
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general' ) ) ); ?></span>
104
  </div>
105
  </div>
106
  </div>
includes/hooks/mycred-hook-view-content.php CHANGED
@@ -147,42 +147,92 @@ if ( ! class_exists( 'myCRED_Hook_View_Contents' ) ) :
147
  <div class="row">
148
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
149
  <div class="form-group">
150
- <label for="<?php echo $this->field_id( array( 'post' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
151
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['post']['creds'] ); ?>" class="form-control" />
152
  </div>
153
  </div>
154
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
155
  <div class="form-group">
156
- <label for="<?php echo $this->field_id( array( 'post', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
157
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'post', 'limit' ) ), $this->field_id( array( 'post', 'limit' ) ), $prefs['post']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  </div>
159
  </div>
160
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
161
  <div class="form-group">
162
- <label for="<?php echo $this->field_id( array( 'post' => 'acreds' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
163
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'acreds' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'acreds' ) ); ?>" value="<?php echo $this->core->number( $prefs['post']['acreds'] ); ?>" class="form-control" />
164
  </div>
165
  </div>
166
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
167
  <div class="form-group">
168
- <label for="<?php echo $this->field_id( array( 'post', 'alimit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
169
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'post', 'alimit' ) ), $this->field_id( array( 'post', 'alimit' ) ), $prefs['post']['alimit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  </div>
171
  </div>
172
  </div>
173
  <div class="row">
174
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
175
  <div class="form-group">
176
- <label for="<?php echo $this->field_id( array( 'post' => 'log' ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
177
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['log'] ); ?>" class="form-control" />
178
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
179
  </div>
180
  </div>
181
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
182
  <div class="form-group">
183
- <label for="<?php echo $this->field_id( array( 'post' => 'alog' ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
184
- <input type="text" name="<?php echo $this->field_name( array( 'post' => 'alog' ) ); ?>" id="<?php echo $this->field_id( array( 'post' => 'alog' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['alog'] ); ?>" class="form-control" />
185
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
186
  </div>
187
  </div>
188
  </div>
@@ -192,42 +242,92 @@ if ( ! class_exists( 'myCRED_Hook_View_Contents' ) ) :
192
  <div class="row">
193
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
194
  <div class="form-group">
195
- <label for="<?php echo $this->field_id( array( 'page' => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
196
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['page']['creds'] ); ?>" class="form-control" />
197
  </div>
198
  </div>
199
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
200
  <div class="form-group">
201
- <label for="<?php echo $this->field_id( array( 'page', 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
202
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'page', 'limit' ) ), $this->field_id( array( 'page', 'limit' ) ), $prefs['page']['limit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  </div>
204
  </div>
205
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
206
  <div class="form-group">
207
- <label for="<?php echo $this->field_id( array( 'page' => 'acreds' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
208
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'acreds' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'acreds' ) ); ?>" value="<?php echo $this->core->number( $prefs['page']['acreds'] ); ?>" class="form-control" />
209
  </div>
210
  </div>
211
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
212
  <div class="form-group">
213
- <label for="<?php echo $this->field_id( array( 'page', 'alimit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
214
- <?php echo $this->hook_limit_setting( $this->field_name( array( 'page', 'alimit' ) ), $this->field_id( array( 'page', 'alimit' ) ), $prefs['page']['alimit'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  </div>
216
  </div>
217
  </div>
218
  <div class="row">
219
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
220
  <div class="form-group">
221
- <label for="<?php echo $this->field_id( array( 'page' => 'log' ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
222
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['log'] ); ?>" class="form-control" />
223
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
224
  </div>
225
  </div>
226
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
227
  <div class="form-group">
228
- <label for="<?php echo $this->field_id( array( 'page' => 'alog' ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
229
- <input type="text" name="<?php echo $this->field_name( array( 'page' => 'alog' ) ); ?>" id="<?php echo $this->field_id( array( 'page' => 'alog' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['alog'] ); ?>" class="form-control" />
230
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
231
  </div>
232
  </div>
233
  </div>
@@ -279,46 +379,96 @@ if ( ! class_exists( 'myCRED_Hook_View_Contents' ) ) :
279
 
280
  ?>
281
  <div class="hook-instance">
282
- <h3><?php printf( __( 'Viewing %s', 'mycred' ), $post_type->labels->name ); ?></h3>
283
  <div class="row">
284
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
285
  <div class="form-group">
286
- <label for="<?php echo $this->field_id( array( $post_type->name => 'creds' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
287
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'creds' ) ); ?>" value="<?php echo $this->core->number( $_creds ); ?>" class="form-control" />
288
  </div>
289
  </div>
290
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
291
  <div class="form-group">
292
- <label for="<?php echo $this->field_id( array( $post_type->name, 'limit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
293
- <?php echo $this->hook_limit_setting( $this->field_name( array( $post_type->name, 'limit' ) ), $this->field_id( array( $post_type->name, 'limit' ) ), $limit ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  </div>
295
  </div>
296
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
297
  <div class="form-group">
298
- <label for="<?php echo $this->field_id( array( $post_type->name => 'acreds' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
299
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'acreds' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'acreds' ) ); ?>" value="<?php echo $this->core->number( $_acreds ); ?>" class="form-control" />
300
  </div>
301
  </div>
302
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
303
  <div class="form-group">
304
- <label for="<?php echo $this->field_id( array( $post_type->name, 'alimit' ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
305
- <?php echo $this->hook_limit_setting( $this->field_name( array( $post_type->name, 'alimit' ) ), $this->field_id( array( $post_type->name, 'alimit' ) ), $alimit ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  </div>
307
  </div>
308
  </div>
309
  <div class="row">
310
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
311
  <div class="form-group">
312
- <label for="<?php echo $this->field_id( array( $post_type->name => 'log' ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
313
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'log' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_log ); ?>" class="form-control" />
314
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
315
  </div>
316
  </div>
317
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
318
  <div class="form-group">
319
- <label for="<?php echo $this->field_id( array( $post_type->name => 'alog' ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
320
- <input type="text" name="<?php echo $this->field_name( array( $post_type->name => 'alog' ) ); ?>" id="<?php echo $this->field_id( array( $post_type->name => 'alog' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_alog ); ?>" class="form-control" />
321
- <span class="description"><?php echo $this->available_template_tags( array( 'general', 'post' ) ); ?></span>
322
  </div>
323
  </div>
324
  </div>
147
  <div class="row">
148
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
149
  <div class="form-group">
150
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
151
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['post']['creds'] ) ); ?>" class="form-control" />
152
  </div>
153
  </div>
154
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
155
  <div class="form-group">
156
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
157
+ <?php echo wp_kses(
158
+ $this->hook_limit_setting( $this->field_name( array( 'post', 'limit' ) ), $this->field_id( array( 'post', 'limit' ) ), $prefs['post']['limit'] ),
159
+ array(
160
+ 'div' => array(
161
+ 'class' => array()
162
+ ),
163
+ 'input' => array(
164
+ 'type' => array(),
165
+ 'size' => array(),
166
+ 'class' => array(),
167
+ 'name' => array(),
168
+ 'id' => array(),
169
+ 'value' => array()
170
+ ),
171
+ 'select' => array(
172
+ 'name' => array(),
173
+ 'id' => array(),
174
+ 'class' => array()
175
+ ),
176
+ 'option' => array(
177
+ 'value' => array(),
178
+ 'selected' => array()
179
+ )
180
+ )
181
+ );
182
+ ?>
183
  </div>
184
  </div>
185
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
186
  <div class="form-group">
187
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'acreds' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
188
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'acreds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'acreds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['post']['acreds'] ) ); ?>" class="form-control" />
189
  </div>
190
  </div>
191
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
192
  <div class="form-group">
193
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post', 'alimit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
194
+ <?php echo wp_kses(
195
+ $this->hook_limit_setting( $this->field_name( array( 'post', 'alimit' ) ), $this->field_id( array( 'post', 'alimit' ) ), $prefs['post']['alimit'] ),
196
+ array(
197
+ 'div' => array(
198
+ 'class' => array()
199
+ ),
200
+ 'input' => array(
201
+ 'type' => array(),
202
+ 'size' => array(),
203
+ 'class' => array(),
204
+ 'name' => array(),
205
+ 'id' => array(),
206
+ 'value' => array()
207
+ ),
208
+ 'select' => array(
209
+ 'name' => array(),
210
+ 'id' => array(),
211
+ 'class' => array()
212
+ ),
213
+ 'option' => array(
214
+ 'value' => array(),
215
+ 'selected' => array()
216
+ )
217
+ )
218
+ );
219
+ ?>
220
  </div>
221
  </div>
222
  </div>
223
  <div class="row">
224
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
225
  <div class="form-group">
226
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'log' ) ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
227
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['log'] ); ?>" class="form-control" />
228
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
229
  </div>
230
  </div>
231
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
232
  <div class="form-group">
233
+ <label for="<?php echo esc_attr( $this->field_id( array( 'post' => 'alog' ) ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
234
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'post' => 'alog' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'post' => 'alog' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['post']['alog'] ); ?>" class="form-control" />
235
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
236
  </div>
237
  </div>
238
  </div>
242
  <div class="row">
243
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
244
  <div class="form-group">
245
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
246
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['page']['creds'] ) ); ?>" class="form-control" />
247
  </div>
248
  </div>
249
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
250
  <div class="form-group">
251
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page', 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
252
+ <?php echo wp_kses(
253
+ $this->hook_limit_setting( $this->field_name( array( 'page', 'limit' ) ), $this->field_id( array( 'page', 'limit' ) ), $prefs['page']['limit'] ),
254
+ array(
255
+ 'div' => array(
256
+ 'class' => array()
257
+ ),
258
+ 'input' => array(
259
+ 'type' => array(),
260
+ 'size' => array(),
261
+ 'class' => array(),
262
+ 'name' => array(),
263
+ 'id' => array(),
264
+ 'value' => array()
265
+ ),
266
+ 'select' => array(
267
+ 'name' => array(),
268
+ 'id' => array(),
269
+ 'class' => array()
270
+ ),
271
+ 'option' => array(
272
+ 'value' => array(),
273
+ 'selected' => array()
274
+ )
275
+ )
276
+ );
277
+ ?>
278
  </div>
279
  </div>
280
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
281
  <div class="form-group">
282
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'acreds' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
283
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'acreds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'acreds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['page']['acreds'] ) ); ?>" class="form-control" />
284
  </div>
285
  </div>
286
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
287
  <div class="form-group">
288
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page', 'alimit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
289
+ <?php echo wp_kses(
290
+ $this->hook_limit_setting( $this->field_name( array( 'page', 'alimit' ) ), $this->field_id( array( 'page', 'alimit' ) ), $prefs['page']['alimit'] ),
291
+ array(
292
+ 'div' => array(
293
+ 'class' => array()
294
+ ),
295
+ 'input' => array(
296
+ 'type' => array(),
297
+ 'size' => array(),
298
+ 'class' => array(),
299
+ 'name' => array(),
300
+ 'id' => array(),
301
+ 'value' => array()
302
+ ),
303
+ 'select' => array(
304
+ 'name' => array(),
305
+ 'id' => array(),
306
+ 'class' => array()
307
+ ),
308
+ 'option' => array(
309
+ 'value' => array(),
310
+ 'selected' => array()
311
+ )
312
+ )
313
+ );
314
+ ?>
315
  </div>
316
  </div>
317
  </div>
318
  <div class="row">
319
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
320
  <div class="form-group">
321
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'log' ) ) ); ?>"><?php esc_html_e( 'Member Log Template', 'mycred' ); ?></label>
322
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['log'] ); ?>" class="form-control" />
323
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
324
  </div>
325
  </div>
326
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
327
  <div class="form-group">
328
+ <label for="<?php echo esc_attr( $this->field_id( array( 'page' => 'alog' ) ) ); ?>"><?php esc_html_e( 'Content Author Log Template', 'mycred' ); ?></label>
329
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'page' => 'alog' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'page' => 'alog' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['page']['alog'] ); ?>" class="form-control" />
330
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
331
  </div>
332
  </div>
333
  </div>
379
 
380
  ?>
381
  <div class="hook-instance">
382
+ <h3><?php printf( esc_html__( 'Viewing %s', 'mycred' ), esc_html( $post_type->labels->name ) ); ?></h3>
383
  <div class="row">
384
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
385
  <div class="form-group">
386
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'creds' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
387
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'creds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $_creds ) ); ?>" class="form-control" />
388
  </div>
389
  </div>
390
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
391
  <div class="form-group">
392
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name, 'limit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
393
+ <?php echo wp_kses(
394
+ $this->hook_limit_setting( $this->field_name( array( $post_type->name, 'limit' ) ), $this->field_id( array( $post_type->name, 'limit' ) ), $limit ),
395
+ array(
396
+ 'div' => array(
397
+ 'class' => array()
398
+ ),
399
+ 'input' => array(
400
+ 'type' => array(),
401
+ 'size' => array(),
402
+ 'class' => array(),
403
+ 'name' => array(),
404
+ 'id' => array(),
405
+ 'value' => array()
406
+ ),
407
+ 'select' => array(
408
+ 'name' => array(),
409
+ 'id' => array(),
410
+ 'class' => array()
411
+ ),
412
+ 'option' => array(
413
+ 'value' => array(),
414
+ 'selected' => array()
415
+ )
416
+ )
417
+ );
418
+ ?>
419
  </div>
420
  </div>
421
  <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
422
  <div class="form-group">
423
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'acreds' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
424
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'acreds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'acreds' ) ) ); ?>" value="<?php echo esc_attr( $this->core->number( $_acreds ) ); ?>" class="form-control" />
425
  </div>
426
  </div>
427
  <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
428
  <div class="form-group">
429
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name, 'alimit' ) ) ); ?>"><?php esc_html_e( 'Limit', 'mycred' ); ?></label>
430
+ <?php echo wp_kses(
431
+ $this->hook_limit_setting( $this->field_name( array( $post_type->name, 'alimit' ) ), $this->field_id( array( $post_type->name, 'alimit' ) ), $alimit ),
432
+ array(
433
+ 'div' => array(
434
+ 'class' => array()
435
+ ),
436
+ 'input' => array(
437
+ 'type' => array(),
438
+ 'size' => array(),
439
+ 'class' => array(),
440
+ 'name' => array(),
441
+ 'id' => array(),
442
+ 'value' => array()
443
+ ),
444
+ 'select' => array(
445
+ 'name' => array(),
446
+ 'id' => array(),
447
+ 'class' => array()
448
+ ),
449
+ 'option' => array(
450
+ 'value' => array(),
451
+ 'selected' => array()
452
+ )
453
+ )
454
+ );
455
+ ?>
456
  </div>
457
  </div>
458
  </div>
459
  <div class="row">
460
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
461
  <div class="form-group">
462
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'log' ) ) ); ?>"><?php esc_html_e( 'Member', 'mycred' ); ?></label>
463
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'log' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'log' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_log ); ?>" class="form-control" />
464
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
465
  </div>
466
  </div>
467
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
468
  <div class="form-group">
469
+ <label for="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'alog' ) ) ); ?>"><?php esc_html_e( 'Content Author', 'mycred' ); ?></label>
470
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( $post_type->name => 'alog' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( $post_type->name => 'alog' ) ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $_alog ); ?>" class="form-control" />
471
+ <span class="description"><?php echo wp_kses_post( $this->available_template_tags( array( 'general', 'post' ) ) ); ?></span>
472
  </div>
473
  </div>
474
  </div>
includes/hooks/mycred-hook-watching-video.php CHANGED
@@ -82,12 +82,12 @@ if ( ! class_exists( 'myCRED_Hook_Video_Views' ) ) :
82
  $interval = abs( floatval( $interval ) / 1000 );
83
 
84
  // Get playback details
85
- $actions = sanitize_text_field( $_POST['video_a'] );
86
- $seconds = absint( $_POST['video_b'] );
87
- $duration = absint( $_POST['video_c'] );
88
- $state = absint( $_POST['video_d'] );
89
- $streaming = sanitize_text_field( mycred_decode_values( $_POST['video_e'] ) );
90
- $stream_live_duration = absint( mycred_decode_values( $_POST['video_f'] ) );
91
 
92
  // Apply Leniency
93
  $leniency = $duration * ( $this->prefs['leniency'] / 100 );
@@ -321,44 +321,44 @@ if ( ! class_exists( 'myCRED_Hook_Video_Views' ) ) :
321
  <div class="row">
322
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
323
  <div class="form-group">
324
- <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label>
325
- <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" />
326
  </div>
327
  </div>
328
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
329
  <div class="form-group">
330
- <label for="<?php echo $this->field_id( 'log' ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
331
- <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
332
  </div>
333
  </div>
334
  </div>
335
  <div class="row">
336
  <div class="col-lg-7 col-md-6 col-sm-12 col-xs-12">
337
  <div class="form-group">
338
- <label for="<?php echo $this->field_id( array( 'logic' => 'play' ) ); ?>"><?php esc_html_e( 'Award Logic', 'mycred' ); ?></label>
339
  <div class="checkbox">
340
- <label for="<?php echo $this->field_id( array( 'logic' => 'play' ) ); ?>"><input type="radio" name="<?php echo $this->field_name( 'logic' ); ?>" id="<?php echo $this->field_id( array( 'logic' => 'play' ) ); ?>"<?php checked( $prefs['logic'], 'play' ); ?> value="play" class="toggle-hook-option" /> <?php esc_html_e( 'Play - As soon as video starts playing.', 'mycred' ); ?></label>
341
  </div>
342
  <div class="checkbox">
343
- <label for="<?php echo $this->field_id( array( 'logic' => 'full' ) ); ?>"><input type="radio" name="<?php echo $this->field_name( 'logic' ); ?>" id="<?php echo $this->field_id( array( 'logic' => 'full' ) ); ?>"<?php checked( $prefs['logic'], 'full' ); ?> value="full" class="toggle-hook-option" /> <?php esc_html_e( 'Full - First when the entire video has played.', 'mycred' ); ?></label>
344
  </div>
345
  <div class="checkbox">
346
- <label for="<?php echo $this->field_id( array( 'logic' => 'interval' ) ); ?>"><input type="radio" name="<?php echo $this->field_name( 'logic' ); ?>" id="<?php echo $this->field_id( array( 'logic' => 'interval' ) ); ?>"<?php checked( $prefs['logic'], 'interval' ); ?> value="interval" class="toggle-hook-option" /> <?php echo $this->core->template_tags_general( __( 'Interval - For each x number of seconds watched.', 'mycred' ) ); ?></label>
347
  </div>
348
  </div>
349
  </div>
350
  <div class="col-lg-5 col-md-6 col-sm-12 col-xs-12">
351
- <div id="<?php echo $this->field_id( array( 'logic-option-interval' ) ); ?>"<?php if ( $prefs['logic'] != 'interval' ) echo ' style="display: none;"';?>>
352
  <div class="form-group">
353
- <label for="<?php echo $this->field_id( 'interval' ); ?>"><?php esc_html_e( 'Intervals', 'mycred' ); ?></label>
354
- <input type="text" name="<?php echo $this->field_name( 'interval' ); ?>" id="<?php echo $this->field_id( 'interval' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['interval'] ); ?>" class="form-control" />
355
- <span class="description"><?php printf( __( 'The number of seconds a user must watch in order to get %s.', 'mycred' ), $this->core->plural() ); ?></span>
356
  </div>
357
  </div>
358
- <div id="<?php echo $this->field_id( array( 'logic-option-full' ) ); ?>"<?php if ( $prefs['logic'] != 'full' ) echo ' style="display: none;"';?>>
359
  <div class="form-group">
360
- <label for="<?php echo $this->field_id( 'leniency' ); ?>"><?php esc_html_e( 'Leniency', 'mycred' ); ?></label>
361
- <input type="text" name="<?php echo $this->field_name( 'leniency' ); ?>" id="<?php echo $this->field_id( 'leniency' ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['leniency'] ); ?>" class="form-control" />
362
  <span class="description"><?php esc_html_e( 'Do not set this value to zero! A lot of thing can happen while a user watches a movie and sometimes a few seconds can drop of the counter due to buffering or play back errors.', 'mycred' ); ?></span>
363
  </div>
364
  </div>
@@ -379,16 +379,16 @@ jQuery(function($){
379
  $( '#sidebar-active .toggle-hook-option' ).change(function(){
380
 
381
  if ( $(this).val() == 'interval' ) {
382
- $( '#<?php echo $this->field_id( array( 'logic-option-interval' ) ); ?>' ).show();
383
- $( '#<?php echo $this->field_id( array( 'logic-option-full' ) ); ?>' ).hide();
384
  }
385
  else if ( $(this).val() == 'full' ) {
386
- $( '#<?php echo $this->field_id( array( 'logic-option-full' ) ); ?>' ).show();
387
- $( '#<?php echo $this->field_id( array( 'logic-option-interval' ) ); ?>' ).hide();
388
  }
389
  else {
390
- $( '#<?php echo $this->field_id( array( 'logic-option-full' ) ); ?>' ).hide();
391
- $( '#<?php echo $this->field_id( array( 'logic-option-interval' ) ); ?>' ).hide();
392
  }
393
 
394
  });
@@ -474,10 +474,10 @@ if ( ! function_exists( 'mycred_video_detect_views' ) ) :
474
 
475
  if ( is_user_logged_in() ) {
476
 
477
- if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-viewing-videos' && isset( $_POST['setup'] ) && isset( $_POST['type'] ) && isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-video-points' ) ) {
478
 
479
- $key = sanitize_text_field( $_POST['setup'] );
480
- $point_type = sanitize_text_field( $_POST['type'] );
481
  $setup = mycred_verify_token( $key, 6 );
482
 
483
  if ( $setup === false || $setup[5] != $point_type ) wp_send_json_error();
82
  $interval = abs( floatval( $interval ) / 1000 );
83
 
84
  // Get playback details
85
+ $actions = isset( $_POST['video_a'] ) ? sanitize_text_field( wp_unslash( $_POST['video_a'] ) ) : '';
86
+ $seconds = isset( $_POST['video_b'] ) ? absint( $_POST['video_b'] ) : 0;
87
+ $duration = isset( $_POST['video_c'] ) ? absint( $_POST['video_c'] ) : 0;
88
+ $state = isset( $_POST['video_d'] ) ? absint( $_POST['video_d'] ) : 0;
89
+ $streaming = isset( $_POST['video_e'] ) ? mycred_decode_values( sanitize_text_field( wp_unslash( $_POST['video_e'] ) ) ) : '';
90
+ $stream_live_duration = isset( $_POST['video_f'] ) ? mycred_decode_values( absint( $_POST['video_f'] ) ) : 0;
91
 
92
  // Apply Leniency
93
  $leniency = $duration * ( $this->prefs['leniency'] / 100 );
321
  <div class="row">
322
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
323
  <div class="form-group">
324
+ <label for="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>"><?php echo esc_html( $this->core->plural() ); ?></label>
325
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'creds' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'creds' ) ); ?>" value="<?php echo esc_attr( $this->core->number( $prefs['creds'] ) ); ?>" class="form-control" />
326
  </div>
327
  </div>
328
  <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
329
  <div class="form-group">
330
+ <label for="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>"><?php esc_html_e( 'Log Template', 'mycred' ); ?></label>
331
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'log' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'log' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" />
332
  </div>
333
  </div>
334
  </div>
335
  <div class="row">
336
  <div class="col-lg-7 col-md-6 col-sm-12 col-xs-12">
337
  <div class="form-group">
338
+ <label for="<?php echo esc_attr( $this->field_id( array( 'logic' => 'play' ) ) ); ?>"><?php esc_html_e( 'Award Logic', 'mycred' ); ?></label>
339
  <div class="checkbox">
340
+ <label for="<?php echo esc_attr( $this->field_id( array( 'logic' => 'play' ) ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'logic' ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'logic' => 'play' ) ) ); ?>"<?php checked( $prefs['logic'], 'play' ); ?> value="play" class="toggle-hook-option" /> <?php esc_html_e( 'Play - As soon as video starts playing.', 'mycred' ); ?></label>
341
  </div>
342
  <div class="checkbox">
343
+ <label for="<?php echo esc_attr( $this->field_id( array( 'logic' => 'full' ) ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'logic' ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'logic' => 'full' ) ) ); ?>"<?php checked( $prefs['logic'], 'full' ); ?> value="full" class="toggle-hook-option" /> <?php esc_html_e( 'Full - First when the entire video has played.', 'mycred' ); ?></label>
344
  </div>
345
  <div class="checkbox">
346
+ <label for="<?php echo esc_attr( $this->field_id( array( 'logic' => 'interval' ) ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( 'logic' ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'logic' => 'interval' ) ) ); ?>"<?php checked( $prefs['logic'], 'interval' ); ?> value="interval" class="toggle-hook-option" /> <?php echo wp_kses_post( $this->core->template_tags_general( __( 'Interval - For each x number of seconds watched.', 'mycred' ) ) ); ?></label>
347
  </div>
348
  </div>
349
  </div>
350
  <div class="col-lg-5 col-md-6 col-sm-12 col-xs-12">
351
+ <div id="<?php echo esc_attr( $this->field_id( array( 'logic-option-interval' ) ) ); ?>"<?php if ( $prefs['logic'] != 'interval' ) echo ' style="display: none;"';?>>
352
  <div class="form-group">
353
+ <label for="<?php echo esc_attr( $this->field_id( 'interval' ) ); ?>"><?php esc_html_e( 'Intervals', 'mycred' ); ?></label>
354
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'interval' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'interval' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['interval'] ); ?>" class="form-control" />
355
+ <span class="description"><?php printf( esc_html__( 'The number of seconds a user must watch in order to get %s.', 'mycred' ), esc_html( $this->core->plural() ) ); ?></span>
356
  </div>
357
  </div>
358
+ <div id="<?php echo esc_attr( $this->field_id( array( 'logic-option-full' ) ) ); ?>"<?php if ( $prefs['logic'] != 'full' ) echo ' style="display: none;"';?>>
359
  <div class="form-group">
360
+ <label for="<?php echo esc_attr( $this->field_id( 'leniency' ) ); ?>"><?php esc_html_e( 'Leniency', 'mycred' ); ?></label>
361
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'leniency' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'leniency' ) ); ?>" placeholder="<?php esc_attr_e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $prefs['leniency'] ); ?>" class="form-control" />
362
  <span class="description"><?php esc_html_e( 'Do not set this value to zero! A lot of thing can happen while a user watches a movie and sometimes a few seconds can drop of the counter due to buffering or play back errors.', 'mycred' ); ?></span>
363
  </div>
364
  </div>
379
  $( '#sidebar-active .toggle-hook-option' ).change(function(){
380
 
381
  if ( $(this).val() == 'interval' ) {
382
+ $( '#<?php echo esc_js( $this->field_id( array( 'logic-option-interval' ) ) ); ?>' ).show();
383
+ $( '#<?php echo esc_js( $this->field_id( array( 'logic-option-full' ) ) ); ?>' ).hide();
384
  }
385
  else if ( $(this).val() == 'full' ) {
386
+ $( '#<?php echo esc_js( $this->field_id( array( 'logic-option-full' ) ) ); ?>' ).show();
387
+ $( '#<?php echo esc_js( $this->field_id( array( 'logic-option-interval' ) ) ); ?>' ).hide();
388
  }
389
  else {
390
+ $( '#<?php echo esc_js( $this->field_id( array( 'logic-option-full' ) ) ); ?>' ).hide();
391
+ $( '#<?php echo esc_js( $this->field_id( array( 'logic-option-interval' ) ) ); ?>' ).hide();
392
  }
393
 
394
  });
474
 
475
  if ( is_user_logged_in() ) {
476
 
477
+ if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-viewing-videos' && isset( $_POST['setup'] ) && isset( $_POST['type'] ) && isset( $_POST['token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['token'] ) ), 'mycred-video-points' ) ) {
478
 
479
+ $key = sanitize_text_field( wp_unslash( $_POST['setup'] ) );
480
+ $point_type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
481
  $setup = mycred_verify_token( $key, 6 );
482
 
483
  if ( $setup === false || $setup[5] != $point_type ) wp_send_json_error();
includes/importers/mycred-balances.php CHANGED
@@ -25,7 +25,8 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
25
  public function __construct() {
26
 
27
  $this->import_page = MYCRED_SLUG . '-import-balance';
28
- $this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) strip_tags( trim( $_POST['delimiter'] ) );
 
29
  $this->documentation = 'http://codex.mycred.me/chapter-ii/import-data/importing-balances/';
30
 
31
  }
@@ -108,13 +109,13 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
108
 
109
  } else {
110
 
111
- if ( file_exists( ABSPATH . $_POST['file_url'] ) ) {
112
 
113
- $this->file_url = esc_attr( $_POST['file_url'] );
114
 
115
  } else {
116
 
117
- echo '<div class="error notice notice-error is-dismissible"><p>' . __( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
118
  return false;
119
 
120
  }
@@ -141,7 +142,7 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
141
  // Make sure the file exists
142
  if ( ! is_file( $file ) ) {
143
 
144
- echo '<div class="error notice notice-error is-dismissible"><p>' . __( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
145
  return true;
146
 
147
  }
@@ -193,7 +194,7 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
193
  }
194
 
195
  $mycred = mycred( $point_type );
196
- $method = trim( $_POST['method'] );
197
 
198
  // If a log entry should be added with the import
199
  if ( ! empty( $log_entry ) )
@@ -217,7 +218,7 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
217
 
218
  } else {
219
 
220
- echo '<div class="error notice notice-error is-dismissible"><p>' . __( 'Invalid CSV file. Please consult the documentation for further assistance.', 'mycred' ) . '</p></div>';
221
 
222
  }
223
 
@@ -226,8 +227,8 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
226
  }
227
 
228
  if ( $ran ) {
229
- echo '<div class="updated notice notice-success is-dismissible"><p>' . sprintf( __( 'Import complete - A total of <strong>%d</strong> balances were successfully imported. <strong>%d</strong> was skipped.', 'mycred' ), $this->imported, $this->skipped ) . '</p></div>';
230
- echo '<p><a href="' . admin_url( 'users.php' ) . '" class="button button-large button-primary">' . __( 'View Users', 'mycred' ) . '</a></p>';
231
  }
232
 
233
  do_action( 'import_end' );
@@ -242,11 +243,11 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
242
  */
243
  public function header() {
244
 
245
- $label = __( 'Import Balances', 'mycred' );
246
  if ( MYCRED_DEFAULT_LABEL === 'myCRED' )
247
- $label .= ' <a href="' . $this->documentation . '" target="_blank" class="page-title-action">' . __( 'Documentation', 'mycred' ) . '</a>';
248
 
249
- echo '<div class="wrap"><h1>' . $label . '</h1>';
250
 
251
  }
252
 
@@ -274,7 +275,7 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
274
  if ( ! empty( $upload_dir['error'] ) ) :
275
 
276
  ?>
277
- <div class="error notice notice-error"><p><?php echo $upload_dir['error']; ?></p></div>
278
  <?php
279
 
280
  else :
@@ -290,8 +291,8 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
290
  <td>
291
  <input type="file" id="upload" name="import" size="25" />
292
  <input type="hidden" name="action" value="save" />
293
- <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
294
- <small><?php printf( __( 'Maximum size: %s', 'mycred' ), $size ); ?></small>
295
  </td>
296
  </tr>
297
  <tr>
@@ -299,7 +300,7 @@ if ( ! class_exists( 'myCRED_Importer_Balances' ) ) :
299
  <label for="file_url"><?php esc_html_e( 'OR enter path to file:', 'mycred' ); ?></label>
300
  </th>
301
  <td>
302
- <?php echo ABSPATH . ' '; ?><input type="text" id="file_url" name="file_url" size="25" />
303
  </td>
304
  </tr>
305
  <tr>
25
  public function __construct() {
26
 
27
  $this->import_page = MYCRED_SLUG . '-import-balance';
28
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
29
+ $this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) strip_tags( trim( sanitize_text_field( $_POST['delimiter'] ) ) );
30
  $this->documentation = 'http://codex.mycred.me/chapter-ii/import-data/importing-balances/';
31
 
32
  }
109
 
110
  } else {
111
 
112
+ if ( file_exists( ABSPATH . sanitize_text_field( wp_unslash( $_POST['file_url'] ) ) ) ) {
113
 
114
+ $this->file_url = sanitize_text_field( wp_unslash( $_POST['file_url'] ) );
115
 
116
  } else {
117
 
118
+ echo '<div class="error notice notice-error is-dismissible"><p>' . esc_html__( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
119
  return false;
120
 
121
  }
142
  // Make sure the file exists
143
  if ( ! is_file( $file ) ) {
144
 
145
+ echo '<div class="error notice notice-error is-dismissible"><p>' . esc_html__( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
146
  return true;
147
 
148
  }
194
  }
195
 
196
  $mycred = mycred( $point_type );
197
+ $method = isset( $_POST['method'] ) ? trim( sanitize_key( wp_unslash( $_POST['method'] ) ) ): '';
198
 
199
  // If a log entry should be added with the import
200
  if ( ! empty( $log_entry ) )
218
 
219
  } else {
220
 
221
+ echo '<div class="error notice notice-error is-dismissible"><p>' . esc_html__( 'Invalid CSV file. Please consult the documentation for further assistance.', 'mycred' ) . '</p></div>';
222
 
223
  }
224
 
227
  }
228
 
229
  if ( $ran ) {
230
+ echo '<div class="updated notice notice-success is-dismissible"><p>' . sprintf( esc_html__( 'Import complete - A total of <strong>%d</strong> balances were successfully imported. <strong>%d</strong> was skipped.', 'mycred' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) . '</p></div>';
231
+ echo '<p><a href="' . esc_url( admin_url( 'users.php' ) ) . '" class="button button-large button-primary">' . esc_html__( 'View Users', 'mycred' ) . '</a></p>';
232
  }
233
 
234
  do_action( 'import_end' );
243
  */
244
  public function header() {
245
 
246
+ $label = esc_html__( 'Import Balances', 'mycred' );
247
  if ( MYCRED_DEFAULT_LABEL === 'myCRED' )
248
+ $label .= ' <a href="' . $this->documentation . '" target="_blank" class="page-title-action">' . esc_html__( 'Documentation', 'mycred' ) . '</a>';
249
 
250
+ echo '<div class="wrap"><h1>' . wp_kses_post( $label ) . '</h1>';
251
 
252
  }
253
 
275
  if ( ! empty( $upload_dir['error'] ) ) :
276
 
277
  ?>
278
+ <div class="error notice notice-error"><p><?php echo esc_html( $upload_dir['error'] ); ?></p></div>
279
  <?php
280
 
281
  else :
291
  <td>
292
  <input type="file" id="upload" name="import" size="25" />
293
  <input type="hidden" name="action" value="save" />
294
+ <input type="hidden" name="max_file_size" value="<?php echo esc_attr( $bytes ); ?>" />
295
+ <small><?php printf( esc_html__( 'Maximum size: %s', 'mycred' ), esc_html( $size ) ); ?></small>
296
  </td>
297
  </tr>
298
  <tr>
300
  <label for="file_url"><?php esc_html_e( 'OR enter path to file:', 'mycred' ); ?></label>
301
  </th>
302
  <td>
303
+ <?php echo esc_html( ABSPATH ) . ' '; ?><input type="text" id="file_url" name="file_url" size="25" />
304
  </td>
305
  </tr>
306
  <tr>
includes/importers/mycred-cubepoints.php CHANGED
@@ -25,7 +25,8 @@ if ( ! class_exists( 'myCRED_Importer_CubePoints' ) ) :
25
  public function __construct() {
26
 
27
  $this->import_page = MYCRED_SLUG . '-import-cp';
28
- $this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) strip_tags( trim( $_POST['delimiter'] ) );
 
29
  $this->documentation = 'http://codex.mycred.me/chapter-ii/import-data/import-cubepoints/';
30
 
31
  }
@@ -84,7 +85,7 @@ if ( ! class_exists( 'myCRED_Importer_CubePoints' ) ) :
84
 
85
  $cubepoints = $wpdb->prefix . 'cp';
86
  if ( $wpdb->get_var( "SHOW TABLES LIKE '{$cubepoints}';" ) != $cubepoints ) {
87
- echo '<div class="error notice notice-error"><p>' . __( 'Could not find a CubePoints installation.', 'mycred' ) . '</p></div>';
88
  return false;
89
  }
90
 
@@ -161,8 +162,8 @@ if ( ! class_exists( 'myCRED_Importer_CubePoints' ) ) :
161
 
162
  global $wpdb;
163
 
164
- $action = $_POST['action'];
165
- $point_type = $_POST['type'];
166
  $cubepoints = $wpdb->prefix . 'cp';
167
 
168
  $show_greet = true;
@@ -345,14 +346,14 @@ if ( ! class_exists( 'myCRED_Importer_CubePoints' ) ) :
345
  // Show Result
346
  if ( $this->imported == 0 ) {
347
 
348
- echo '<div class="error notice notice-error is-dismissible"><p>' . ( ( $action == 'balance' ) ? __( 'No balances were imported.', 'mycred' ) : __( 'No log entries were imported!', 'mycred' ) ) . '</p></div>';
349
 
350
  }
351
  else {
352
 
353
  $show_greet = false;
354
- echo '<div class="updated notice notice-success is-dismissible"><p>' . sprintf( __( 'Import complete - A total of <strong>%d</strong> balances were successfully imported. <strong>%d</strong> was skipped.', 'mycred' ), $this->imported, $this->skipped ) . '</p></div>';
355
- echo '<p><a href="' . admin_url( 'users.php' ) . '" class="button button-large button-primary">' . __( 'View Users', 'mycred' ) . '</a></p>';
356
 
357
  }
358
 
@@ -372,7 +373,7 @@ if ( ! class_exists( 'myCRED_Importer_CubePoints' ) ) :
372
  if ( MYCRED_DEFAULT_LABEL === 'myCRED' )
373
  $label .= ' <a href="' . $this->documentation . '" target="_blank" class="page-title-action">' . __( 'Documentation', 'mycred' ) . '</a>';
374
 
375
- echo '<div class="wrap"><h1>' . $label . '</h1>';
376
 
377
  }
378
 
25
  public function __construct() {
26
 
27
  $this->import_page = MYCRED_SLUG . '-import-cp';
28
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
29
+ $this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) strip_tags( trim( sanitize_text_field( $_POST['delimiter'] ) ) );
30
  $this->documentation = 'http://codex.mycred.me/chapter-ii/import-data/import-cubepoints/';
31
 
32
  }
85
 
86
  $cubepoints = $wpdb->prefix . 'cp';
87
  if ( $wpdb->get_var( "SHOW TABLES LIKE '{$cubepoints}';" ) != $cubepoints ) {
88
+ echo '<div class="error notice notice-error"><p>' . esc_html__( 'Could not find a CubePoints installation.', 'mycred' ) . '</p></div>';
89
  return false;
90
  }
91
 
162
 
163
  global $wpdb;
164
 
165
+ $action = isset( $_POST['action'] ) ? sanitize_key( wp_unslash( $_POST['action'] ) ) : '';
166
+ $point_type = isset( $_POST['type'] ) ? sanitize_key( wp_unslash( $_POST['type'] ) ) : '';
167
  $cubepoints = $wpdb->prefix . 'cp';
168
 
169
  $show_greet = true;
346
  // Show Result
347
  if ( $this->imported == 0 ) {
348
 
349
+ echo '<div class="error notice notice-error is-dismissible"><p>' . ( ( $action == 'balance' ) ? esc_html__( 'No balances were imported.', 'mycred' ) : esc_html__( 'No log entries were imported!', 'mycred' ) ) . '</p></div>';
350
 
351
  }
352
  else {
353
 
354
  $show_greet = false;
355
+ echo '<div class="updated notice notice-success is-dismissible"><p>' . sprintf( esc_html__( 'Import complete - A total of <strong>%d</strong> balances were successfully imported. <strong>%d</strong> was skipped.', 'mycred' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) . '</p></div>';
356
+ echo '<p><a href="' . esc_url( admin_url( 'users.php' ) ) . '" class="button button-large button-primary">' . esc_html__( 'View Users', 'mycred' ) . '</a></p>';
357
 
358
  }
359
 
373
  if ( MYCRED_DEFAULT_LABEL === 'myCRED' )
374
  $label .= ' <a href="' . $this->documentation . '" target="_blank" class="page-title-action">' . __( 'Documentation', 'mycred' ) . '</a>';
375
 
376
+ echo '<div class="wrap"><h1>' . wp_kses_post( $label ) . '</h1>';
377
 
378
  }
379
 
includes/importers/mycred-log-entries.php CHANGED
@@ -25,7 +25,8 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
25
  public function __construct() {
26
 
27
  $this->import_page = MYCRED_SLUG . '-import-log';
28
- $this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) strip_tags( trim( $_POST['delimiter'] ) );
 
29
  $this->documentation = 'http://codex.mycred.me/chapter-ii/import-data/importing-log-entries/';
30
 
31
  }
@@ -108,13 +109,13 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
108
 
109
  } else {
110
 
111
- if ( file_exists( ABSPATH . $_POST['file_url'] ) ) {
112
 
113
- $this->file_url = esc_attr( $_POST['file_url'] );
114
 
115
  } else {
116
 
117
- echo '<div class="error notice notice-error is-dismissible"><p>' . __( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
118
  return false;
119
 
120
  }
@@ -139,7 +140,7 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
139
  // Make sure the file exists
140
  if ( ! is_file( $file ) ) {
141
 
142
- echo '<div class="error notice notice-error is-dismissible"><p>' . __( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
143
  return true;
144
 
145
  }
@@ -201,7 +202,7 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
201
 
202
  } else {
203
 
204
- echo '<div class="error notice notice-error is-dismissible"><p>' . __( 'Invalid CSV file. Please consult the documentation for further assistance.', 'mycred' ) . '</p></div>';
205
 
206
  }
207
 
@@ -210,8 +211,8 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
210
  }
211
 
212
  if ( $ran ) {
213
- echo '<div class="updated notice notice-success is-dismissible"><p>' . sprintf( __( 'Import complete - A total of <strong>%d</strong> log entries were successfully imported. <strong>%d</strong> was skipped.', 'mycred' ), $this->imported, $this->skipped ) . '</p></div>';
214
- echo '<p><a href="' . admin_url( 'admin.php?page=' . MYCRED_SLUG ) . '" class="button button-large button-primary">' . __( 'View Log', 'mycred' ) . '</a></p>';
215
  }
216
 
217
  do_action( 'import_end' );
@@ -240,7 +241,7 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
240
  if ( MYCRED_DEFAULT_LABEL === 'myCRED' )
241
  $label .= ' <a href="' . $this->documentation . '" target="_blank" class="page-title-action">' . __( 'Documentation', 'mycred' ) . '</a>';
242
 
243
- echo '<div class="wrap"><h1>' . $label . '</h1>';
244
 
245
  }
246
 
@@ -270,7 +271,7 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
270
  if ( ! empty( $upload_dir['error'] ) ) :
271
 
272
  ?>
273
- <div class="error notice notice-error"><p><?php echo $upload_dir['error']; ?></p></div>
274
  <?php
275
 
276
  else :
@@ -286,8 +287,8 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
286
  <td>
287
  <input type="file" id="upload" name="import" size="25" />
288
  <input type="hidden" name="action" value="save" />
289
- <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
290
- <small><?php printf( __( 'Maximum size: %s', 'mycred' ), $size ); ?></small>
291
  </td>
292
  </tr>
293
  <tr>
@@ -295,7 +296,7 @@ if ( ! class_exists( 'myCRED_Importer_Log_Entires' ) ) :
295
  <label for="file_url"><?php esc_html_e( 'OR enter path to file:', 'mycred' ); ?></label>
296
  </th>
297
  <td>
298
- <?php echo ABSPATH . ' '; ?><input type="text" id="file_url" name="file_url" size="25" />
299
  </td>
300
  </tr>
301
  <tr>
25
  public function __construct() {
26
 
27
  $this->import_page = MYCRED_SLUG . '-import-log';
28
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
29
+ $this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) strip_tags( trim( sanitize_text_field( $_POST['delimiter'] ) ) );
30
  $this->documentation = 'http://codex.mycred.me/chapter-ii/import-data/importing-log-entries/';
31
 
32
  }
109
 
110
  } else {
111
 
112
+ if ( file_exists( ABSPATH . sanitize_text_field( wp_unslash( $_POST['file_url'] ) ) ) ) {
113
 
114
+ $this->file_url = sanitize_text_field( wp_unslash( $_POST['file_url'] ) );
115
 
116
  } else {
117
 
118
+ echo '<div class="error notice notice-error is-dismissible"><p>' . esc_html__( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
119
  return false;
120
 
121
  }
140
  // Make sure the file exists
141
  if ( ! is_file( $file ) ) {
142
 
143
+ echo '<div class="error notice notice-error is-dismissible"><p>' . esc_html__( 'The file does not exist or could not be read.', 'mycred' ) . '</p></div>';
144
  return true;
145
 
146
  }
202
 
203
  } else {
204
 
205
+ echo '<div class="error notice notice-error is-dismissible"><p>' . esc_html__( 'Invalid CSV file. Please consult the documentation for further assistance.', 'mycred' ) . '</p></div>';
206
 
207
  }
208
 
211
  }
212
 
213
  if ( $ran ) {
214
+ echo '<div class="updated notice notice-success is-dismissible"><p>' . sprintf( esc_html__( 'Import complete - A total of <strong>%d</strong> log entries were successfully imported. <strong>%d</strong> was skipped.', 'mycred' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) . '</p></div>';
215
+ echo '<p><a href="' . esc_url( admin_url( 'admin.php?page=' . MYCRED_SLUG ) ) . '" class="button button-large button-primary">' . esc_html__( 'View Log', 'mycred' ) . '</a></p>';
216
  }
217
 
218
  do_action( 'import_end' );
241
  if ( MYCRED_DEFAULT_LABEL === 'myCRED' )
242
  $label .= ' <a href="' . $this->documentation . '" target="_blank" class="page-title-action">' . __( 'Documentation', 'mycred' ) . '</a>';
243
 
244
+ echo '<div class="wrap"><h1>' . wp_kses_post( $label ) . '</h1>';
245
 
246
  }
247
 
271
  if ( ! empty( $upload_dir['error'] ) ) :
272
 
273
  ?>
274
+ <div class="error notice notice-error"><p><?php echo esc_html( $upload_dir['error'] ); ?></p></div>
275
  <?php
276
 
277
  else :
287
  <td>
288
  <input type="file" id="upload" name="import" size="25" />
289
  <input type="hidden" name="action" value="save" />
290
+ <input type="hidden" name="max_file_size" value="<?php echo esc_attr( $bytes ); ?>" />
291
+ <small><?php printf( esc_html__( 'Maximum size: %s', 'mycred' ), esc_html( $size ) ); ?></small>
292
  </td>
293
  </tr>
294
  <tr>
296
  <label for="file_url"><?php esc_html_e( 'OR enter path to file:', 'mycred' ); ?></label>
297
  </th>
298
  <td>
299
+ <?php echo esc_html( ABSPATH ) . ' '; ?><input type="text" id="file_url" name="file_url" size="25" />
300
  </td>
301
  </tr>
302
  <tr>
includes/mycred-about.php CHANGED
@@ -30,7 +30,7 @@ function mycred_about_header() {
30
  padding-top: 40px;
31
  }
32
  #mycred-welcome .intro .mycred-logo {
33
- background: url('<?php echo plugins_url( 'assets/images/mycred-icon.png', myCRED_THIS ); ?>') no-repeat center center;
34
  background-size: 95px;
35
  display: block;
36
  margin: auto;
@@ -331,7 +331,7 @@ b, strong {
331
  </div>
332
 
333
  <div class="block">
334
- <h1><?php printf( __( 'Welcome to %s %s', 'mycred' ), $name, myCRED_VERSION ); ?></h1>
335
  <h6>Thank you for choosing myCred - the most powerful points management system for WordPress. Build and manage a broad range of digital rewards, including points, ranks, and badges on your WordPress-powered website.
336
  </h6>
337
  </div>
@@ -356,7 +356,7 @@ if ( !is_mycred_ready() ) {
356
 
357
  <div class="button-wrap mycred-clear">
358
  <div class="left">
359
- <a href="<?php echo admin_url( 'plugins.php?page=' . MYCRED_SLUG . '-setup&mycred_tour_guide=1' ) ?>" id="first_setup" onclick="startTour()" class="mycred-btn mycred-btn-block mycred-btn-lg mycred-btn-orange mycred-footer-btn">
360
  Setup myCred
361
  </a>
362
 
@@ -394,7 +394,7 @@ function mycred_about_page() {
394
 
395
  ?>
396
 
397
- <img src="<?php echo plugins_url( 'assets/images/about/welcome.png', myCRED_THIS ); ?>" alt="Welcome" class="video-thumbnail">
398
 
399
  <div class="block">
400
 
@@ -403,7 +403,7 @@ function mycred_about_page() {
403
  <?php
404
  if ( !is_mycred_ready() ) {
405
  ?>
406
- <a href="<?php echo admin_url( 'plugins.php?page=' . MYCRED_SLUG . '-setup&mycred_tour_guide=1' ) ?>" id="first_setup" onclick="startTour()" class="mycred-btn mycred-btn-block mycred-btn-lg mycred-btn-orange">
407
  Setup myCred
408
  </a>
409
  <?php
@@ -429,61 +429,61 @@ function mycred_about_page() {
429
  <div class="feature-list mycred-clear">
430
 
431
  <div class="feature-block first">
432
- <img src="<?php echo plugins_url( 'assets/images/about/account.png', myCRED_THIS ); ?>">
433
  <h5>Account History</h5>
434
  <p>A central log records your user's points whenever they perform an action.</p>
435
  </div>
436
 
437
  <div class="feature-block last">
438
- <img src="<?php echo plugins_url( 'assets/images/about/points-management.png', myCRED_THIS ); ?>">
439
  <h5>Points Management</h5>
440
  <p>Adjust your user's balance by adding or removing points with or without a log entry.</p>
441
  </div>
442
 
443
  <div class="feature-block first">
444
- <img src="<?php echo plugins_url( 'assets/images/about/automatic-points.png', myCRED_THIS ); ?>">
445
  <h5>Automatic Points</h5>
446
  <p>Automatically award or deduct points from your user’s balance.</p>
447
  </div>
448
 
449
  <div class="feature-block last">
450
- <img src="<?php echo plugins_url( 'assets/images/about/multi-points.png', myCRED_THIS ); ?>">
451
  <h5>Multiple Point Types</h5>
452
  <p>Create multiple point types through the admin area to manage things easily.</p>
453
  </div>
454
 
455
  <div class="feature-block first">
456
- <img src="<?php echo plugins_url( 'assets/images/about/convert-points.png', myCRED_THIS ); ?>">
457
  <h5>Convert Points to Cash</h5>
458
  <p>Users can redeem myCred points for real money.</p>
459
  </div>
460
 
461
  <div class="feature-block last">
462
- <img src="<?php echo plugins_url( 'assets/images/about/multi-site-support.png', myCRED_THIS ); ?>">
463
  <h5>Multi-Site Support</h5>
464
  <p>Choose between using a unique myCred installation or centralize balances across your network.</p>
465
  </div>
466
 
467
  <div class="feature-block first">
468
- <img src="<?php echo plugins_url( 'assets/images/about/leaderboards.png', myCRED_THIS ); ?>">
469
  <h5>Leaderboards</h5>
470
  <p>Generate leaderboards based on your user’s balance or points history.</p>
471
  </div>
472
 
473
  <div class="feature-block last">
474
- <img src="<?php echo plugins_url( 'assets/images/about/badges.png', myCRED_THIS ); ?>">
475
  <h5>Badges</h5>
476
  <p>Award badges to your users based on their points history.</p>
477
  </div>
478
 
479
  <div class="feature-block first">
480
- <img src="<?php echo plugins_url( 'assets/images/about/buy-points.png', myCRED_THIS ); ?>">
481
  <h5>Buy Points</h5>
482
  <p>Users can purchase points using real money using popular payment gateways.</p>
483
  </div>
484
 
485
  <div class="feature-block last">
486
- <img src="<?php echo plugins_url( 'assets/images/about/sell-content.png', myCRED_THIS ); ?>">
487
  <h5>Sell Content</h5>
488
  <p>Sell access to the content field of posts/pages or custom post types on your website.</p>
489
  </div>
@@ -535,15 +535,16 @@ function mycred_about_page() {
535
  <div class="block">
536
  <h2>Change Log</h2>
537
  <ul>
538
- <li><strong>NEW</strong> - Introduced a "Bulk Assign" tool for awarding/revoking points, badges, and ranks.</li>
539
- <li><strong>NEW</strong> - Introduced a new feature "Exclude by user role" admin can exclude any user role from the specific point type.</li>
540
- <li><strong>NEW</strong> - Introduced a timeframe attribute in [mycred_my_balance_converted] shortcode. Now you can show users converted balance of a given timeframe today, yesterday, this week, this month, last month.</li>
541
- <li><strong>FIX</strong> - Sometimes user's ranks were not updating automatically.</li>
542
- <li><strong>FIX</strong> - Membership page layout issues.</li>
543
- <li><strong>FIX</strong> - Points conversion not working when using arrows to increase or decrease the amount in [mycred_cashcred] shortcode.</li>
544
- <li><strong>FIX</strong> - buyCred payment dialog couldn’t load on the subsite.</li>
545
- <li><strong>FIX</strong> - After deleting the badge their data will keep existing on the user's meta.</li>
546
- <li><strong>FIX</strong> - "this-week" value not working in [mycred_leaderboard] timeframe attribute when the week starts other than "Monday" in your WordPress setting.</li>
 
547
  </ul>
548
  </div>
549
  </div><!-- /.mycred-change-log -->
@@ -554,18 +555,18 @@ function mycred_about_page() {
554
  <h1>Testimonials</h1>
555
 
556
  <div class="testimonial-block mycred-clear">
557
- <img src="<?php echo plugins_url( 'assets/images/about/56826.png', myCRED_THIS ); ?>">
558
  <p>myCred is pretty solid WordPress plugin. You can do almost anything with it. myCred offers a great developer codex along with hooks, and filters. The versatile collection of addons is just amazing.</p>
559
  <p><strong>Wooegg</strong></p>
560
  </div>
561
 
562
  <div class="testimonial-block mycred-clear">
563
- <img src="<?php echo plugins_url( 'assets/images/about/56826.png', myCRED_THIS ); ?>">
564
  <p>MyCred might be free but the add-ons it offers are absolutely incredible! myCred is the best points system for WordPress, period.</p>
565
  <p><strong>Rongenius</strong></p>
566
  </div>
567
  <div class="testimonial-block mycred-clear">
568
- <img src="<?php echo plugins_url( 'assets/images/about/56826.png', myCRED_THIS ); ?>">
569
  <p>myCred is highly optimized and there are a lot of functions and short codes available to customize its structure. Special congratulations to its creators!</p>
570
  <p><strong>Miladesmaili</strong></p>
571
  </div>
30
  padding-top: 40px;
31
  }
32
  #mycred-welcome .intro .mycred-logo {
33
+ background: url('<?php echo esc_url( plugins_url( 'assets/images/mycred-icon.png', myCRED_THIS ) ); ?>') no-repeat center center;
34
  background-size: 95px;
35
  display: block;
36
  margin: auto;
331
  </div>
332
 
333
  <div class="block">
334
+ <h1><?php printf( esc_html__( 'Welcome to %s %s', 'mycred' ), esc_html( $name ), esc_html( myCRED_VERSION ) ); ?></h1>
335
  <h6>Thank you for choosing myCred - the most powerful points management system for WordPress. Build and manage a broad range of digital rewards, including points, ranks, and badges on your WordPress-powered website.
336
  </h6>
337
  </div>
356
 
357
  <div class="button-wrap mycred-clear">
358
  <div class="left">
359
+ <a href="<?php echo esc_url( admin_url( 'plugins.php?page=' . MYCRED_SLUG . '-setup&mycred_tour_guide=1' ) ); ?>" id="first_setup" onclick="startTour()" class="mycred-btn mycred-btn-block mycred-btn-lg mycred-btn-orange mycred-footer-btn">
360
  Setup myCred
361
  </a>
362
 
394
 
395
  ?>
396
 
397
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/welcome.png', myCRED_THIS ) ); ?>" alt="Welcome" class="video-thumbnail">
398
 
399
  <div class="block">
400
 
403
  <?php
404
  if ( !is_mycred_ready() ) {
405
  ?>
406
+ <a href="<?php echo esc_url( admin_url( 'plugins.php?page=' . MYCRED_SLUG . '-setup&mycred_tour_guide=1' ) ); ?>" id="first_setup" onclick="startTour()" class="mycred-btn mycred-btn-block mycred-btn-lg mycred-btn-orange">
407
  Setup myCred
408
  </a>
409
  <?php
429
  <div class="feature-list mycred-clear">
430
 
431
  <div class="feature-block first">
432
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/account.png', myCRED_THIS ) ); ?>">
433
  <h5>Account History</h5>
434
  <p>A central log records your user's points whenever they perform an action.</p>
435
  </div>
436
 
437
  <div class="feature-block last">
438
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/points-management.png', myCRED_THIS ) ); ?>">
439
  <h5>Points Management</h5>
440
  <p>Adjust your user's balance by adding or removing points with or without a log entry.</p>
441
  </div>
442
 
443
  <div class="feature-block first">
444
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/automatic-points.png', myCRED_THIS ) ); ?>">
445
  <h5>Automatic Points</h5>
446
  <p>Automatically award or deduct points from your user’s balance.</p>
447
  </div>
448
 
449
  <div class="feature-block last">
450
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/multi-points.png', myCRED_THIS ) ); ?>">
451
  <h5>Multiple Point Types</h5>
452
  <p>Create multiple point types through the admin area to manage things easily.</p>
453
  </div>
454
 
455
  <div class="feature-block first">
456
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/convert-points.png', myCRED_THIS ) ); ?>">
457
  <h5>Convert Points to Cash</h5>
458
  <p>Users can redeem myCred points for real money.</p>
459
  </div>
460
 
461
  <div class="feature-block last">
462
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/multi-site-support.png', myCRED_THIS ) ); ?>">
463
  <h5>Multi-Site Support</h5>
464
  <p>Choose between using a unique myCred installation or centralize balances across your network.</p>
465
  </div>
466
 
467
  <div class="feature-block first">
468
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/leaderboards.png', myCRED_THIS ) ); ?>">
469
  <h5>Leaderboards</h5>
470
  <p>Generate leaderboards based on your user’s balance or points history.</p>
471
  </div>
472
 
473
  <div class="feature-block last">
474
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/badges.png', myCRED_THIS ) ); ?>">
475
  <h5>Badges</h5>
476
  <p>Award badges to your users based on their points history.</p>
477
  </div>
478
 
479
  <div class="feature-block first">
480
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/buy-points.png', myCRED_THIS ) ); ?>">
481
  <h5>Buy Points</h5>
482
  <p>Users can purchase points using real money using popular payment gateways.</p>
483
  </div>
484
 
485
  <div class="feature-block last">
486
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/sell-content.png', myCRED_THIS ) ); ?>">
487
  <h5>Sell Content</h5>
488
  <p>Sell access to the content field of posts/pages or custom post types on your website.</p>
489
  </div>
535
  <div class="block">
536
  <h2>Change Log</h2>
537
  <ul>
538
+ <li><strong>NEW</strong> - Added minimum points reminder email notification for central deposit.</li>
539
+ <li><strong>NEW</strong> - Added points automatically to the central account after the specified interval. (Schedule Deposit)</li>
540
+ <li><strong>NEW</strong> - Added "No Available Balance" email notification for central deposit.</li>
541
+ <li><strong>FIX</strong> - buyCred purchase reward hook setup did not appear properly in mycred_hook_table.</li>
542
+ <li><strong>FIX</strong> - Typo fixes in wooCommerce product reward reference.</li>
543
+ <li><strong>FIX</strong> - The "Insufficient Funds Warning" message did not appear according to the myCred transfer setting.</li>
544
+ <li><strong>FIX</strong> - Product Reward refund was not working.</li>
545
+ <li><strong>FIX</strong> - user_id attribute was not working in mycred_show_if shortcode.</li>
546
+ <li><strong>FIX</strong> - License was not working when using subdirectory in multisite network.</li>
547
+ <li><strong>FIX</strong> - Fixed security vulnerabilities.</li>
548
  </ul>
549
  </div>
550
  </div><!-- /.mycred-change-log -->
555
  <h1>Testimonials</h1>
556
 
557
  <div class="testimonial-block mycred-clear">
558
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/56826.png', myCRED_THIS ) ); ?>">
559
  <p>myCred is pretty solid WordPress plugin. You can do almost anything with it. myCred offers a great developer codex along with hooks, and filters. The versatile collection of addons is just amazing.</p>
560
  <p><strong>Wooegg</strong></p>
561
  </div>
562
 
563
  <div class="testimonial-block mycred-clear">
564
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/56826.png', myCRED_THIS ) ); ?>">
565
  <p>MyCred might be free but the add-ons it offers are absolutely incredible! myCred is the best points system for WordPress, period.</p>
566
  <p><strong>Rongenius</strong></p>
567
  </div>
568
  <div class="testimonial-block mycred-clear">
569
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/about/56826.png', myCRED_THIS ) ); ?>">
570
  <p>myCred is highly optimized and there are a lot of functions and short codes available to customize its structure. Special congratulations to its creators!</p>
571
  <p><strong>Miladesmaili</strong></p>
572
  </div>
includes/mycred-blocks/mycred-blocks.php CHANGED
@@ -57,7 +57,8 @@ final class MyCred_Gutenberg {
57
  esc_html__('"%1$s" requires "%2$s" to be installed and activated.', 'mycred'), '<b>' . esc_html__('myCRED for Gutenberg', 'mycred') . '</b>', '<b>' . esc_html__('myCRED', 'mycred') . '</b>'
58
  );
59
 
60
- printf('<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message);
 
61
  }
62
 
63
  public function includes() {
57
  esc_html__('"%1$s" requires "%2$s" to be installed and activated.', 'mycred'), '<b>' . esc_html__('myCRED for Gutenberg', 'mycred') . '</b>', '<b>' . esc_html__('myCRED', 'mycred') . '</b>'
58
  );
59
 
60
+ printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', esc_html( $message ) );
61
+
62
  }
63
 
64
  public function includes() {
includes/mycred-install.php CHANGED
@@ -75,7 +75,7 @@ if ( ! class_exists( 'myCRED_Install' ) ) :
75
  // Not empty $message means there are issues
76
  if ( ! empty( $message ) ) {
77
 
78
- die( __( 'Sorry but your WordPress installation does not reach the minimum requirements for running myCRED. The following errors were given:', 'mycred' ) . "\n" . implode( "\n", $message ) );
79
 
80
  }
81
 
75
  // Not empty $message means there are issues
76
  if ( ! empty( $message ) ) {
77
 
78
+ die( esc_html__( 'Sorry but your WordPress installation does not reach the minimum requirements for running myCRED. The following errors were given:', 'mycred' ) . "\n" . esc_html( implode( "\n", $message ) ) );
79
 
80
  }
81
 
includes/mycred-nav-menu.php CHANGED
@@ -82,18 +82,18 @@ if ( ! class_exists( 'myCRED_Nav_Menu' ) ) :
82
 
83
  public function mycred_nav_menu_list( $meta_key, $point_type_label, $nav_menu_placeholder, $type ) {?>
84
  <li>
85
- <input type="hidden" class="menu-item-title" name="menu-item[<?php echo $nav_menu_placeholder;?>][menu-item-title]" value="<?php echo ( $type == 'rank' ? '%rank_title% %rank_logo%' : '%balance%' );?>">
86
- <input type="hidden" class="menu-item-db-id" name="menu-item[<?php echo $nav_menu_placeholder;?>][menu-item-db-id]" value="0" />
87
- <input type="hidden" class="menu-item-object-id" name="menu-item[<?php echo $nav_menu_placeholder;?>][menu-item-object-id]" value="1" />
88
- <input type="hidden" class="menu-item-object" name="menu-item[<?php echo $nav_menu_placeholder;?>][menu-item-object]" value="mycred_menu_<?php echo $type;?>" />
89
- <input type="hidden" class="menu-item-type" name="menu-item[<?php echo $nav_menu_placeholder;?>][menu-item-type]" value="<?php echo $meta_key;?>" />
90
- <input type="hidden" id="menu-item[<?php echo $nav_menu_placeholder;?>][menu-item-nonce]" value="<?php echo esc_attr( wp_create_nonce( 'mycred-menu-nonce' ) ); ?>" />
91
  <label class="menu-item-title">
92
  <input type="checkbox"
93
  class="menu-item-checkbox"
94
- name="menu-item[<?php echo $nav_menu_placeholder;?>][menu-item-object-id]"
95
- value="<?php echo $meta_key?>"
96
- /> <?php echo $point_type_label.( $type == 'rank' ? ' Rank' : ' Balance' );?>
97
  </label>
98
  </li><?php
99
  }
82
 
83
  public function mycred_nav_menu_list( $meta_key, $point_type_label, $nav_menu_placeholder, $type ) {?>
84
  <li>
85
+ <input type="hidden" class="menu-item-title" name="menu-item[<?php echo esc_attr( $nav_menu_placeholder );?>][menu-item-title]" value="<?php echo ( $type == 'rank' ? '%rank_title% %rank_logo%' : '%balance%' );?>">
86
+ <input type="hidden" class="menu-item-db-id" name="menu-item[<?php echo esc_attr( $nav_menu_placeholder );?>][menu-item-db-id]" value="0" />
87
+ <input type="hidden" class="menu-item-object-id" name="menu-item[<?php echo esc_attr( $nav_menu_placeholder );?>][menu-item-object-id]" value="1" />
88
+ <input type="hidden" class="menu-item-object" name="menu-item[<?php echo esc_attr( $nav_menu_placeholder );?>][menu-item-object]" value="mycred_menu_<?php echo esc_attr( $type );?>" />
89
+ <input type="hidden" class="menu-item-type" name="menu-item[<?php echo esc_attr( $nav_menu_placeholder );?>][menu-item-type]" value="<?php echo esc_attr( $meta_key );?>" />
90
+ <input type="hidden" id="menu-item[<?php echo esc_attr( $nav_menu_placeholder );?>][menu-item-nonce]" value="<?php echo esc_attr( wp_create_nonce( 'mycred-menu-nonce' ) ); ?>" />
91
  <label class="menu-item-title">
92
  <input type="checkbox"
93
  class="menu-item-checkbox"
94
+ name="menu-item[<?php echo esc_attr( $nav_menu_placeholder );?>][menu-item-object-id]"
95
+ value="<?php echo esc_attr( $meta_key );?>"
96
+ /> <?php echo esc_html( $point_type_label . ( $type == 'rank' ? ' Rank' : ' Balance' ) );?>
97
  </label>
98
  </li><?php
99
  }
includes/mycred-overview.php CHANGED
@@ -111,11 +111,11 @@ div.overview-module-wrap div.mycred-type .overview .section strong { padding: 0
111
 
112
  <div class="type-icon"><div class="dashicons dashicons-star-filled"></div></div>
113
 
114
- <span class="type-label"><?php echo $mycred->plural(); ?></span>
115
 
116
  <?php do_action( 'mycred_overview_total_' . $point_type, $point_type, $total, $data ); ?>
117
 
118
- <a href="<?php echo $url; ?>" title="<?php esc_attr_e( 'Total amount in circulation', 'mycred' ); ?>"><?php echo $mycred->format_creds( $total ); ?></a>
119
 
120
  </div>
121
  <div class="overview clear">
@@ -126,7 +126,7 @@ div.overview-module-wrap div.mycred-type .overview .section strong { padding: 0
126
 
127
  <?php do_action( 'mycred_overview_awarded_' . $point_type, $point_type, $total, $data ); ?>
128
 
129
- <a href="<?php echo esc_url( $awarded_url ); ?>"><?php echo $mycred->format_creds( $awarded ); ?></a>
130
 
131
  </p>
132
  </div>
@@ -137,7 +137,7 @@ div.overview-module-wrap div.mycred-type .overview .section strong { padding: 0
137
 
138
  <?php do_action( 'mycred_overview_deducted_' . $point_type, $point_type, $total, $data ); ?>
139
 
140
- <a href="<?php echo esc_url( $deducted_url ); ?>"><?php echo $mycred->format_creds( $deducted ); ?></a>
141
 
142
  </p>
143
  </div>
111
 
112
  <div class="type-icon"><div class="dashicons dashicons-star-filled"></div></div>
113
 
114
+ <span class="type-label"><?php echo esc_html( $mycred->plural() ); ?></span>
115
 
116
  <?php do_action( 'mycred_overview_total_' . $point_type, $point_type, $total, $data ); ?>
117
 
118
+ <a href="<?php echo esc_url( $url ); ?>" title="<?php esc_attr_e( 'Total amount in circulation', 'mycred' ); ?>"><?php echo esc_html( $mycred->format_creds( $total ) ); ?></a>
119
 
120
  </div>
121
  <div class="overview clear">
126
 
127
  <?php do_action( 'mycred_overview_awarded_' . $point_type, $point_type, $total, $data ); ?>
128
 
129
+ <a href="<?php echo esc_url( $awarded_url ); ?>"><?php echo esc_html( $mycred->format_creds( $awarded ) ); ?></a>
130
 
131
  </p>
132
  </div>
137
 
138
  <?php do_action( 'mycred_overview_deducted_' . $point_type, $point_type, $total, $data ); ?>
139
 
140
+ <a href="<?php echo esc_url( $deducted_url ); ?>"><?php echo esc_html( $mycred->format_creds( $deducted ) ); ?></a>
141
 
142
  </p>
143
  </div>
includes/mycred-remote.php CHANGED
@@ -547,13 +547,13 @@ if ( ! function_exists( 'mycred_remote_init' ) ) :
547
  if ( $valid === true ) {
548
  // Run request
549
  $remote->process();
550
- die( $remote->reply );
551
  }
552
 
553
  // Request failed validation
554
  else {
555
  $reply = ( ! $prefs['debug'] ) ? '' : $valid;
556
- die( $reply );
557
  }
558
 
559
  }
@@ -586,7 +586,7 @@ if ( ! function_exists( 'mycred_remote_activate_row' ) ) :
586
  <label class="subheader" for=""><?php esc_html_e( 'Allow Remote Access', 'mycred' ); ?></label>
587
  <ol id="myCRED-actions-cred">
588
  <li>
589
- <input type="checkbox" name="mycred_pref_core[allow_remote]" id="myCRED-General-remote"<?php if ( $settings['enabled'] ) echo ' checked="checked"'; echo $block; ?> value="1" /> <?php if ( ! empty( $disabled_message ) ) { ?><span class="description"><?php echo $disabled_message; ?></span><?php } ?></li>
590
  </ol>
591
  <?php
592
 
@@ -619,18 +619,18 @@ if ( ! function_exists( 'mycred_remote_settings_page' ) ) :
619
  </li>
620
  <li>
621
  <label><?php esc_html_e( 'Key Length', 'mycred' ); ?></label>
622
- <div class="h2" style="line-height: 30px; color:<?php if ( $key_length == 0 ) echo 'gray'; elseif ( $key_length >= 12 ) echo 'green'; ?>">(<span id="mycred-length-counter"><?php echo $key_length; ?></span>)</span></div>
623
  </li>
624
  <li>
625
  <label>&nbsp;</label><br />
626
  <input type="button" id="mycred-generate-api-key" value="<?php esc_attr_e( 'Generate New Key', 'mycred' ); ?>" class="button button-large button-primary" />
627
  </li>
628
- <li class="block"><p><strong><?php esc_html_e( 'Warning!', 'mycred' ); ?></strong> <?php echo $mycred_general->core->template_tags_general( __( 'Keep this key safe! Those you share this key with will be able to remotely deduct / add / transfer %plural%!', 'mycred' ) ); ?></p></li>
629
  </ol>
630
  <label class="subheader"><?php esc_html_e( 'Incoming URI', 'mycred' ); ?></label>
631
  <ol id="myCRED-remote-api-uri">
632
  <li>
633
- <div class="h2"><?php echo site_url() . '/'; ?> <input type="text" name="mycred_pref_core[remote][uri]" id="myCRED-remote-uri" value="<?php echo esc_attr( $settings['uri'] ); ?>" /> /</div>
634
  <span class="description"><?php esc_html_e( 'The incoming call address. Remote calls made to any other URL will be ignored.', 'mycred' ); ?></span>
635
  </li>
636
  </ol>
547
  if ( $valid === true ) {
548
  // Run request
549
  $remote->process();
550
+ die( esc_html( $remote->reply ) );
551
  }
552
 
553
  // Request failed validation
554
  else {
555
  $reply = ( ! $prefs['debug'] ) ? '' : $valid;
556
+ die( esc_html( $reply ) );
557
  }
558
 
559
  }
586
  <label class="subheader" for=""><?php esc_html_e( 'Allow Remote Access', 'mycred' ); ?></label>
587
  <ol id="myCRED-actions-cred">
588
  <li>
589
+ <input type="checkbox" name="mycred_pref_core[allow_remote]" id="myCRED-General-remote"<?php if ( $settings['enabled'] ) echo ' checked="checked"'; echo wp_kses_post( $block ); ?> value="1" /> <?php if ( ! empty( $disabled_message ) ) { ?><span class="description"><?php echo esc_html( $disabled_message ); ?></span><?php } ?></li>
590
  </ol>
591
  <?php
592
 
619
  </li>
620
  <li>
621
  <label><?php esc_html_e( 'Key Length', 'mycred' ); ?></label>
622
+ <div class="h2" style="line-height: 30px; color:<?php if ( $key_length == 0 ) echo 'gray'; elseif ( $key_length >= 12 ) echo 'green'; ?>">(<span id="mycred-length-counter"><?php echo esc_html( $key_length ); ?></span>)</span></div>
623
  </li>
624
  <li>
625
  <label>&nbsp;</label><br />
626
  <input type="button" id="mycred-generate-api-key" value="<?php esc_attr_e( 'Generate New Key', 'mycred' ); ?>" class="button button-large button-primary" />
627
  </li>
628
+ <li class="block"><p><strong><?php esc_html_e( 'Warning!', 'mycred' ); ?></strong> <?php echo esc_html( $mycred_general->core->template_tags_general( __( 'Keep this key safe! Those you share this key with will be able to remotely deduct / add / transfer %plural%!', 'mycred' ) ) ); ?></p></li>
629
  </ol>
630
  <label class="subheader"><?php esc_html_e( 'Incoming URI', 'mycred' ); ?></label>
631
  <ol id="myCRED-remote-api-uri">
632
  <li>
633
+ <div class="h2"><?php echo esc_url( site_url() . '/' ); ?> <input type="text" name="mycred_pref_core[remote][uri]" id="myCRED-remote-uri" value="<?php echo esc_attr( $settings['uri'] ); ?>" /> /</div>
634
  <span class="description"><?php esc_html_e( 'The incoming call address. Remote calls made to any other URL will be ignored.', 'mycred' ); ?></span>
635
  </li>
636
  </ol>
includes/shortcodes/mycred_exchange.php CHANGED
@@ -50,30 +50,30 @@ if ( ! function_exists( 'mycred_render_shortcode_exchange' ) ) :
50
  ?>
51
  <div class="mycred-exchange">
52
 
53
- <?php echo $content; ?>
54
 
55
  <?php if ( isset( $mycred_exchange['message'] ) ) : ?>
56
- <div class="alert alert-<?php if ( $mycred_exchange['success'] ) echo 'success'; else echo 'warning'; ?>"><?php echo $mycred_exchange['message']; ?></div>
57
  <?php endif; ?>
58
 
59
  <form action="" method="post" class="form">
60
  <div class="row">
61
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 mycred-exchange-current-balance">
62
  <div class="form-group">
63
- <label><?php printf( __( 'Your current %s balance', 'mycred' ), $mycred_from->singular() ); ?></label>
64
- <p class="form-control-static"><?php echo $mycred_from->format_creds( $balance ); ?></p>
65
  </div>
66
  </div>
67
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 mycred-exchange-current-amount">
68
  <div class="form-group">
69
  <label for="mycred-exchange-amount"><?php esc_html_e( 'Amount', 'mycred' ); ?></label>
70
- <input type="text" size="20" placeholder="<?php printf( __( 'Minimum %s', 'mycred' ), $mycred_from->format_creds( $min ) ); ?>" value="" class="form-control" id="mycred-exchange-amount" name="mycred_exchange[amount]" />
71
  </div>
72
  </div>
73
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 mycred-exchange-current-rate">
74
  <div class="form-group">
75
  <label><?php esc_html_e( 'Exchange Rate', 'mycred' ); ?></label>
76
- <p class="form-control-static"><?php printf( __( '1 %s = <span class="rate">%s</span> %s', 'mycred' ), $mycred_from->singular(), $rate, ( ( $rate == 1 ) ? $mycred_to->singular() : $mycred_to->plural() ) ); ?></p>
77
  </div>
78
  </div>
79
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12mycred-exchange-current-submit">
@@ -82,8 +82,8 @@ if ( ! function_exists( 'mycred_render_shortcode_exchange' ) ) :
82
  </div>
83
  </div>
84
  </div>
85
- <input type="hidden" name="mycred_exchange[token]" value="<?php echo $token; ?>" />
86
- <input type="hidden" name="mycred_exchange[nonce]" value="<?php echo wp_create_nonce( 'mycred-exchange' ); ?>" />
87
  </form>
88
 
89
  </div>
@@ -107,10 +107,12 @@ add_shortcode( MYCRED_SLUG . '_exchange', 'mycred_render_shortcode_exchange' );
107
  if ( ! function_exists( 'mycred_catch_exchange_requests' ) ) :
108
  function mycred_catch_exchange_requests() {
109
 
110
- if ( ! isset( $_POST['mycred_exchange']['nonce'] ) || ! wp_verify_nonce( $_POST['mycred_exchange']['nonce'], 'mycred-exchange' ) ) return;
 
 
111
 
112
  // Decode token
113
- $token = mycred_verify_token( $_POST['mycred_exchange']['token'], 5 );
114
  if ( $token === false ) return;
115
 
116
  global $mycred_exchange;
@@ -159,7 +161,7 @@ if ( ! function_exists( 'mycred_catch_exchange_requests' ) ) :
159
  }
160
 
161
  // Prep Amount
162
- $amount = abs( $_POST['mycred_exchange']['amount'] );
163
  $amount = $mycred_from->number( $amount );
164
 
165
  // Make sure we are sending more then minimum
50
  ?>
51
  <div class="mycred-exchange">
52
 
53
+ <?php echo wp_kses_post( $content ); ?>
54
 
55
  <?php if ( isset( $mycred_exchange['message'] ) ) : ?>
56
+ <div class="alert alert-<?php if ( $mycred_exchange['success'] ) echo 'success'; else echo 'warning'; ?>"><?php echo esc_html( $mycred_exchange['message'] ); ?></div>
57
  <?php endif; ?>
58
 
59
  <form action="" method="post" class="form">
60
  <div class="row">
61
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 mycred-exchange-current-balance">
62
  <div class="form-group">
63
+ <label><?php printf( esc_html__( 'Your current %s balance', 'mycred' ), esc_html( $mycred_from->singular() ) ); ?></label>
64
+ <p class="form-control-static"><?php echo esc_html( $mycred_from->format_creds( $balance ) ); ?></p>
65
  </div>
66
  </div>
67
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 mycred-exchange-current-amount">
68
  <div class="form-group">
69
  <label for="mycred-exchange-amount"><?php esc_html_e( 'Amount', 'mycred' ); ?></label>
70
+ <input type="text" size="20" placeholder="<?php printf( esc_attr__( 'Minimum %s', 'mycred' ), esc_attr( $mycred_from->format_creds( $min ) ) ); ?>" value="" class="form-control" id="mycred-exchange-amount" name="mycred_exchange[amount]" />
71
  </div>
72
  </div>
73
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 mycred-exchange-current-rate">
74
  <div class="form-group">
75
  <label><?php esc_html_e( 'Exchange Rate', 'mycred' ); ?></label>
76
+ <p class="form-control-static"><?php printf( wp_kses_post( '1 %s = <span class="rate">%s</span> %s', 'mycred' ), esc_html( $mycred_from->singular() ), esc_html( $rate ), ( ( $rate == 1 ) ? esc_html( $mycred_to->singular() ) : esc_html( $mycred_to->plural() ) ) ); ?></p>
77
  </div>
78
  </div>
79
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12mycred-exchange-current-submit">
82
  </div>
83
  </div>
84
  </div>
85
+ <input type="hidden" name="mycred_exchange[token]" value="<?php echo esc_attr( $token ); ?>" />
86
+ <input type="hidden" name="mycred_exchange[nonce]" value="<?php echo esc_attr( wp_create_nonce( 'mycred-exchange' ) ); ?>" />
87
  </form>
88
 
89
  </div>
107
  if ( ! function_exists( 'mycred_catch_exchange_requests' ) ) :
108
  function mycred_catch_exchange_requests() {
109
 
110
+ if ( ! isset( $_POST['mycred_exchange']['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['mycred_exchange']['nonce'] ) ), 'mycred-exchange' ) ) return;
111
+
112
+ $post_token = isset( $_POST['mycred_exchange']['token'] ) ? sanitize_text_field( wp_unslash( $_POST['mycred_exchange']['token'] ) ) : false;
113
 
114
  // Decode token
115
+ $token = mycred_verify_token( $post_token, 5 );
116
  if ( $token === false ) return;
117
 
118
  global $mycred_exchange;
161
  }
162
 
163
  // Prep Amount
164
+ $amount = isset( $_POST['mycred_exchange']['amount'] ) ? abs( sanitize_text_field( wp_unslash( $_POST['mycred_exchange']['amount'] ) ) ) : 0;
165
  $amount = $mycred_from->number( $amount );
166
 
167
  // Make sure we are sending more then minimum
includes/shortcodes/mycred_hook_table.php CHANGED
@@ -33,6 +33,7 @@ if ( ! function_exists( 'mycred_render_shortcode_hook_table' ) ) :
33
  $applicable = array();
34
 
35
  $hooks = get_option( $prefs_key, false );
 
36
  if ( isset( $hooks['active'] ) && ! empty( $hooks['active'] ) ) {
37
 
38
  foreach ( $hooks['active'] as $active_hook_id ) {
@@ -77,7 +78,7 @@ if ( ! function_exists( 'mycred_render_shortcode_hook_table' ) ) :
77
 
78
  ?>
79
  <div class="table-responsive">
80
- <table class="table mycred-hook-table hook-table-<?php echo $id; ?>">
81
  <thead>
82
  <tr>
83
  <th class="column-instance" style="width: 60%;"><?php esc_html_e( 'Instance', 'mycred' ); ?></th>
@@ -85,57 +86,86 @@ if ( ! function_exists( 'mycred_render_shortcode_hook_table' ) ) :
85
  <th class="column-limit" style="width: 20%;"><?php esc_html_e( 'Limit', 'mycred' ); ?></th>
86
  </tr>
87
  </thead>
88
- <tbody>
89
- <?php
90
 
91
  foreach ( $applicable as $id => $prefs ) {
 
 
92
 
93
- $log = $mycred->template_tags_general( $prefs['log'] );
94
-
95
- $log = strip_tags( $log );
96
- $log = str_replace( array( '%user_id%', '%user_name%', '%user_name_en%', '%display_name%', '%user_profile_url%', '%user_profile_link%', '%user_nicename%', '%user_email%', '%user_url%', '%balance%', '%balance_f%' ), $user, $log );
97
- $log = str_replace( array( '%post_title%', '%post_url%', '%link_with_title%', '%post_type%' ), $post, $log );
98
- $log = str_replace( array( 'comment_id', 'c_post_id', 'c_post_title', 'c_post_url', 'c_link_with_title' ), $comment, $log );
99
- $log = str_replace( array( '%cred%', '%cred_f%' ), $amount, $log );
100
- $log = apply_filters( 'mycred_hook_table_log', $log, $id, $prefs, $atts );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
- $limit = '';
103
- if ( isset( $prefs['limit'] ) )
104
- $limit = $prefs['limit'];
105
 
106
- if( $id == "approved" ) {
107
- if ( isset( $hooks["hook_prefs"]["comments"]["limits"] ) ) {
108
- $approved_limits = $hooks["hook_prefs"]["comments"]["limits"];
109
- if( (int) $approved_limits["per_post"] > 0 && (int) $approved_limits["per_day"] > 0 ) {
110
-
111
- $limit = sprintf( __( 'Maximum %s times per post and Maximum %s times per day', 'mycred' ), $approved_limits["per_post"], $approved_limits["per_day"] );
112
- }
113
- elseif( (int) $approved_limits["per_post"] > 0 && (int) $approved_limits["per_day"] < 1 ) {
114
-
115
- $limit = sprintf( __( 'Maximum %s times per post', 'mycred' ), $approved_limits["per_post"] );
116
- }
117
- elseif( (int) $approved_limits["per_post"] < 1 && (int) $approved_limits["per_day"] > 0 ) {
118
-
119
- $limit = sprintf( __( 'Maximum %s times per day', 'mycred' ), $approved_limits["per_day"] );
120
- }
121
- else {
122
- $limit = __('No limit', 'mycred');
123
- }
124
- }
125
- }
126
- else {
127
- $limit = mycred_translate_limit_code( $limit, $id, $mycred );
128
- }
129
-
130
- $creds = apply_filters( 'mycred_hook_table_creds', $mycred->format_creds( $prefs['creds'] ), $id, $prefs, $atts );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
- ?>
133
- <tr>
134
- <td class="column-instance"><?php echo $log; ?></td>
135
- <td class="column-amount"><?php echo $creds; ?></td>
136
- <td class="column-limit"><?php echo $limit; ?></td>
137
- </tr>
138
- <?php
139
 
140
  }
141
 
@@ -147,7 +177,7 @@ if ( ! function_exists( 'mycred_render_shortcode_hook_table' ) ) :
147
 
148
  }
149
  else {
150
- echo '<p>' . $nothing . '</p>';
151
  }
152
 
153
  $content = ob_get_contents();
33
  $applicable = array();
34
 
35
  $hooks = get_option( $prefs_key, false );
36
+
37
  if ( isset( $hooks['active'] ) && ! empty( $hooks['active'] ) ) {
38
 
39
  foreach ( $hooks['active'] as $active_hook_id ) {
78
 
79
  ?>
80
  <div class="table-responsive">
81
+ <table class="table mycred-hook-table hook-table-<?php echo esc_attr( $id ); ?>">
82
  <thead>
83
  <tr>
84
  <th class="column-instance" style="width: 60%;"><?php esc_html_e( 'Instance', 'mycred' ); ?></th>
86
  <th class="column-limit" style="width: 20%;"><?php esc_html_e( 'Limit', 'mycred' ); ?></th>
87
  </tr>
88
  </thead>
89
+ <tbody><?php
 
90
 
91
  foreach ( $applicable as $id => $prefs ) {
92
+
93
+ if( is_array( $prefs['creds'] ) ){ ?>
94
 
95
+ <tr>
96
+
97
+ <?php
98
+ foreach ( $prefs['log'] as $key => $value ) {
99
+
100
+ $log = $mycred->template_tags_general( $value );
101
+ $log = strip_tags( $log );
102
+ $log = str_replace( array( '%user_id%', '%user_name%', '%user_name_en%', '%display_name%', '%user_profile_url%', '%user_profile_link%', '%user_nicename%', '%user_email%', '%user_url%', '%balance%', '%balance_f%' ), $user, $log );
103
+ $log = str_replace( array( '%post_title%', '%post_url%', '%link_with_title%', '%post_type%' ), $post, $log );
104
+ $log = str_replace( array( 'comment_id', 'c_post_id', 'c_post_title', 'c_post_url', 'c_link_with_title' ), $comment, $log );
105
+ $log = str_replace( array( '%cred%', '%cred_f%' ), $amount, $log );
106
+
107
+ $cred = $mycred->format_creds( $prefs['creds'][$key] );
108
+ $limit = '';
109
+ $limit = mycred_translate_limit_code( $limit, $id, $mycred );?>
110
+
111
+ <tr>
112
+ <td class="column-instance"><?php echo esc_html( $log ); ?></td>
113
+ <td class="column-amount"><?php echo esc_html( $cred ); ?></td>
114
+ <td class="column-limit"><?php echo esc_html( $limit ); ?></td>
115
+ </tr><?php
116
+ }
117
+ ?>
118
+ </tr><?php
119
 
120
+ }
121
+ else {
 
122
 
123
+ $log = $mycred->template_tags_general( $prefs['log'] );
124
+ $log = strip_tags( $log );
125
+ $log = str_replace( array( '%user_id%', '%user_name%', '%user_name_en%', '%display_name%', '%user_profile_url%', '%user_profile_link%', '%user_nicename%', '%user_email%', '%user_url%', '%balance%', '%balance_f%' ), $user, $log );
126
+ $log = str_replace( array( '%post_title%', '%post_url%', '%link_with_title%', '%post_type%' ), $post, $log );
127
+ $log = str_replace( array( 'comment_id', 'c_post_id', 'c_post_title', 'c_post_url', 'c_link_with_title' ), $comment, $log );
128
+ $log = str_replace( array( '%cred%', '%cred_f%' ), $amount, $log );
129
+ $log = apply_filters( 'mycred_hook_table_log', $log, $id, $prefs, $atts );
130
+
131
+ $limit = '';
132
+ if ( isset( $prefs['limit'] ) )
133
+ $limit = $prefs['limit'];
134
+
135
+ if( $id == "approved" ) {
136
+ if ( isset( $hooks["hook_prefs"]["comments"]["limits"] ) ) {
137
+ $approved_limits = $hooks["hook_prefs"]["comments"]["limits"];
138
+ if( (int) $approved_limits["per_post"] > 0 && (int) $approved_limits["per_day"] > 0 ) {
139
+
140
+ $limit = sprintf( __( 'Maximum %s times per post and Maximum %s times per day', 'mycred' ), $approved_limits["per_post"], $approved_limits["per_day"] );
141
+ }
142
+ elseif( (int) $approved_limits["per_post"] > 0 && (int) $approved_limits["per_day"] < 1 ) {
143
+
144
+ $limit = sprintf( __( 'Maximum %s times per post', 'mycred' ), $approved_limits["per_post"] );
145
+ }
146
+ elseif( (int) $approved_limits["per_post"] < 1 && (int) $approved_limits["per_day"] > 0 ) {
147
+
148
+ $limit = sprintf( __( 'Maximum %s times per day', 'mycred' ), $approved_limits["per_day"] );
149
+ }
150
+ else {
151
+ $limit = __('No limit', 'mycred');
152
+ }
153
+ }
154
+ }
155
+ else {
156
+ $limit = mycred_translate_limit_code( $limit, $id, $mycred );
157
+ }
158
+
159
+ $creds = apply_filters( 'mycred_hook_table_creds', $mycred->format_creds( $prefs['creds'] ), $id, $prefs, $atts );
160
+ ?>
161
+ <tr>
162
+ <td class="column-instance"><?php echo esc_html( $log ); ?></td>
163
+ <td class="column-amount"><?php echo esc_html( $creds ); ?></td>
164
+ <td class="column-limit"><?php echo esc_html( $limit ); ?></td>
165
+ </tr>
166
+ <?php
167
 
168
+ }
 
 
 
 
 
 
169
 
170
  }
171
 
177
 
178
  }
179
  else {
180
+ echo '<p>' . esc_html( $nothing ) . '</p>';
181
  }
182
 
183
  $content = ob_get_contents();
includes/shortcodes/mycred_send.php CHANGED
@@ -86,15 +86,15 @@ if ( ! function_exists( 'mycred_shortcode_send_points_ajax' ) ) :
86
 
87
  $point_type = MYCRED_DEFAULT_TYPE_KEY;
88
  if ( isset( $_POST['type'] ) )
89
- $point_type = sanitize_text_field( $_POST['type'] );
90
 
91
  // Make sure the type exists
92
  if ( ! mycred_point_type_exists( $point_type ) ) die();
93
 
94
  // Prep
95
- $recipient = (int) sanitize_text_field( $_POST['recipient'] );
96
- $reference = sanitize_text_field( $_POST['reference'] );
97
- $log_entry = strip_tags( trim( $_POST['log'] ), '<a>' );
98
 
99
  // No sending to ourselves
100
  if ( $user_id == $recipient )
@@ -103,7 +103,7 @@ if ( ! function_exists( 'mycred_shortcode_send_points_ajax' ) ) :
103
  $mycred = mycred( $point_type );
104
 
105
  // Prep amount
106
- $amount = sanitize_text_field( $_POST['amount'] );
107
  $amount = $mycred->number( abs( $amount ) );
108
 
109
  // Check solvency
86
 
87
  $point_type = MYCRED_DEFAULT_TYPE_KEY;
88
  if ( isset( $_POST['type'] ) )
89
+ $point_type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
90
 
91
  // Make sure the type exists
92
  if ( ! mycred_point_type_exists( $point_type ) ) die();
93
 
94
  // Prep
95
+ $recipient = isset( $_POST['recipient'] ) ? absint( $_POST['recipient'] ) : 0;
96
+ $reference = isset( $_POST['reference'] ) ? sanitize_text_field( wp_unslash( $_POST['reference'] ) ) : '';
97
+ $log_entry = isset( $_POST['log'] ) ? sanitize_text_field( wp_unslash( $_POST['log'] ) ) : '';
98
 
99
  // No sending to ourselves
100
  if ( $user_id == $recipient )
103
  $mycred = mycred( $point_type );
104
 
105
  // Prep amount
106
+ $amount = isset( $_POST['amount'] ) ? sanitize_text_field( wp_unslash( $_POST['amount'] ) ) : 0;
107
  $amount = $mycred->number( abs( $amount ) );
108
 
109
  // Check solvency
includes/shortcodes/mycred_show_if.php CHANGED
@@ -33,12 +33,6 @@ if ( ! function_exists( 'mycred_render_shortcode_show_if' ) ) :
33
 
34
  // Get the user ID
35
  $user_id = mycred_get_user_id( $user_id );
36
-
37
- if ( is_user_logged_in() && $user_id == get_current_user_id() )
38
- return $content;
39
-
40
- if ( ! is_user_logged_in() && $user_id == 'current' )
41
- return $content;
42
 
43
  // You can only use AND or OR for comparisons
44
  if ( ! in_array( $comp, array( 'AND', 'OR' ) ) )
33
 
34
  // Get the user ID
35
  $user_id = mycred_get_user_id( $user_id );
 
 
 
 
 
 
36
 
37
  // You can only use AND or OR for comparisons
38
  if ( ! in_array( $comp, array( 'AND', 'OR' ) ) )
includes/shortcodes/mycred_video.php CHANGED
@@ -103,7 +103,7 @@ if ( ! function_exists( 'mycred_render_shortcode_video' ) ) :
103
  if ( is_user_logged_in() ) :
104
 
105
  ?>
106
- <script type="text/javascript">function mycred_vvideo_v<?php echo $video_id; ?>( state ) { duration[ "<?php echo $video_id; ?>" ] = state.target.getDuration(); mycred_view_video( "<?php echo $video_id; ?>", state.data, "<?php echo $logic; ?>", "<?php echo $interval; ?>", "<?php echo $key; ?>", "<?php echo $ctype; ?>" , "<?php echo mycred_encode_values($streaming); ?>" , "<?php echo mycred_encode_values($duration); ?>" ); }</script>
107
  <?php
108
 
109
  endif;
103
  if ( is_user_logged_in() ) :
104
 
105
  ?>
106
+ <script type="text/javascript">function mycred_vvideo_v<?php echo esc_attr( $video_id ); ?>( state ) { duration[ "<?php echo esc_attr( $video_id ); ?>" ] = state.target.getDuration(); mycred_view_video( "<?php echo esc_attr( $video_id ); ?>", state.data, "<?php echo esc_attr( $logic ); ?>", "<?php echo esc_attr( $interval ); ?>", "<?php echo esc_attr( $key ); ?>", "<?php echo esc_attr( $ctype ); ?>" , "<?php echo esc_attr( mycred_encode_values( $streaming ) ); ?>" , "<?php echo esc_attr( mycred_encode_values( $duration ) ); ?>" ); }</script>
107
  <?php
108
 
109
  endif;
includes/widgets/mycred-widget-balance.php CHANGED
@@ -51,11 +51,11 @@ if ( ! class_exists( 'myCRED_Widget_Balance' ) ) :
51
  $mycred = mycred( $instance['type'] );
52
 
53
  // Start
54
- echo $before_widget;
55
 
56
  // Title
57
  if ( ! empty( $instance['title'] ) )
58
- echo $before_title . $instance['title'] . $after_title;
59
 
60
  $layout = $mycred->template_tags_amount( $instance['cred_format'], $balance->current );
61
  $layout = $mycred->template_tags_user( $layout, false, wp_get_current_user() );
@@ -79,7 +79,7 @@ if ( ! class_exists( 'myCRED_Widget_Balance' ) ) :
79
 
80
  // Title
81
  if ( ! empty( $instance['history_title'] ) )
82
- echo $before_title . $mycred->template_tags_general( $instance['history_title'] ) . $after_title;
83
 
84
  // Organized List
85
  echo '<ol class="myCRED-history">';
@@ -101,7 +101,7 @@ if ( ! class_exists( 'myCRED_Widget_Balance' ) ) :
101
  else $class = 'entry-row';
102
 
103
  // Output list item
104
- echo '<li class="' . $class . '">' . $layout . '</li>';
105
 
106
  }
107
  echo '</ol>';
@@ -113,7 +113,7 @@ if ( ! class_exists( 'myCRED_Widget_Balance' ) ) :
113
  }
114
 
115
  // End
116
- echo $after_widget;
117
 
118
  }
119
 
@@ -123,21 +123,21 @@ if ( ! class_exists( 'myCRED_Widget_Balance' ) ) :
123
  // If we want to show a message, then do so
124
  if ( $instance['show_visitors'] ) {
125
 
126
- echo $before_widget;
127
 
128
  $mycred = mycred( $instance['type'] );
129
 
130
  // Title
131
  if ( ! empty( $instance['title'] ) )
132
- echo $before_title . $instance['title'] . $after_title;
133
 
134
  $message = $instance['message'];
135
  $message = $mycred->template_tags_general( $message );
136
  $message = $mycred->allowed_tags( $message );
137
 
138
- echo '<div class="myCRED-my-balance-message"><p>' . nl2br( $message ) . '</p></div>';
139
 
140
- echo $after_widget;
141
 
142
  }
143
 
@@ -191,7 +191,7 @@ div.mycred-hidden.ex-field { display: block; }
191
  <p class="myCRED-widget-field">
192
  <label for="<?php echo esc_attr( $this->get_field_id( 'cred_format' ) ); ?>"><?php esc_html_e( 'Balance Layout', 'mycred' ); ?>:</label>
193
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'cred_format' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'cred_format' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $cred_format ); ?></textarea>
194
- <small><?php echo $mycred->available_template_tags( array( 'general', 'amount', 'user' ) ); ?></small>
195
  </p>
196
  <?php if ( MYCRED_ENABLE_LOGGING ) : ?>
197
  <!-- History -->
@@ -210,7 +210,7 @@ div.mycred-hidden.ex-field { display: block; }
210
  <p class="myCRED-widget-field">
211
  <label for="<?php echo esc_attr( $this->get_field_id( 'history_format' ) ); ?>"><?php esc_html_e( 'Row layout', 'mycred' ); ?>:</label>
212
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'history_format' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'history_format' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $history_entry ); ?></textarea>
213
- <small><?php echo $mycred->available_template_tags( array( 'general', 'widget' ) ); ?></small>
214
  </p>
215
  </div>
216
  <?php else : ?>
@@ -227,7 +227,7 @@ div.mycred-hidden.ex-field { display: block; }
227
  <p class="myCRED-widget-field">
228
  <label for="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>"><?php esc_html_e( 'Message', 'mycred' ); ?>:</label>
229
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'message' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $message ); ?></textarea>
230
- <small><?php echo $mycred->available_template_tags( array( 'general', 'amount' ) ); ?></small>
231
  </p>
232
  </div>
233
  <!-- Widget Admin Scripting -->
51
  $mycred = mycred( $instance['type'] );
52
 
53
  // Start
54
+ echo wp_kses_post( $before_widget );
55
 
56
  // Title
57
  if ( ! empty( $instance['title'] ) )
58
+ echo wp_kses_post( $before_title . $instance['title'] . $after_title );
59
 
60
  $layout = $mycred->template_tags_amount( $instance['cred_format'], $balance->current );
61
  $layout = $mycred->template_tags_user( $layout, false, wp_get_current_user() );
79
 
80
  // Title
81
  if ( ! empty( $instance['history_title'] ) )
82
+ echo wp_kses_post( $before_title . $mycred->template_tags_general( $instance['history_title'] ) . $after_title );
83
 
84
  // Organized List
85
  echo '<ol class="myCRED-history">';
101
  else $class = 'entry-row';
102
 
103
  // Output list item
104
+ echo '<li class="' . esc_attr( $class ) . '">' . wp_kses_post( $layout ) . '</li>';
105
 
106
  }
107
  echo '</ol>';
113
  }
114
 
115
  // End
116
+ echo wp_kses_post( $after_widget );
117
 
118
  }
119
 
123
  // If we want to show a message, then do so
124
  if ( $instance['show_visitors'] ) {
125
 
126
+ echo wp_kses_post( $before_widget );
127
 
128
  $mycred = mycred( $instance['type'] );
129
 
130
  // Title
131
  if ( ! empty( $instance['title'] ) )
132
+ echo wp_kses_post( $before_title . $instance['title'] . $after_title );
133
 
134
  $message = $instance['message'];
135
  $message = $mycred->template_tags_general( $message );
136
  $message = $mycred->allowed_tags( $message );
137
 
138
+ echo '<div class="myCRED-my-balance-message"><p>' . wp_kses_post( nl2br( $message ) ) . '</p></div>';
139
 
140
+ echo wp_kses_post( $after_widget );
141
 
142
  }
143
 
191
  <p class="myCRED-widget-field">
192
  <label for="<?php echo esc_attr( $this->get_field_id( 'cred_format' ) ); ?>"><?php esc_html_e( 'Balance Layout', 'mycred' ); ?>:</label>
193
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'cred_format' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'cred_format' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $cred_format ); ?></textarea>
194
+ <small><?php echo wp_kses_post( $mycred->available_template_tags( array( 'general', 'amount', 'user' ) ) ); ?></small>
195
  </p>
196
  <?php if ( MYCRED_ENABLE_LOGGING ) : ?>
197
  <!-- History -->
210
  <p class="myCRED-widget-field">
211
  <label for="<?php echo esc_attr( $this->get_field_id( 'history_format' ) ); ?>"><?php esc_html_e( 'Row layout', 'mycred' ); ?>:</label>
212
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'history_format' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'history_format' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $history_entry ); ?></textarea>
213
+ <small><?php echo wp_kses_post( $mycred->available_template_tags( array( 'general', 'widget' ) ) ); ?></small>
214
  </p>
215
  </div>
216
  <?php else : ?>
227
  <p class="myCRED-widget-field">
228
  <label for="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>"><?php esc_html_e( 'Message', 'mycred' ); ?>:</label>
229
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'message' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $message ); ?></textarea>
230
+ <small><?php echo wp_kses_post( $mycred->available_template_tags( array( 'general', 'amount' ) ) ); ?></small>
231
  </p>
232
  </div>
233
  <!-- Widget Admin Scripting -->
includes/widgets/mycred-widget-leaderboard.php CHANGED
@@ -102,16 +102,16 @@ if ( ! class_exists( 'myCRED_Widget_Leaderboard' ) ) :
102
  $args['current'] = $instance['current'];
103
  }
104
 
105
- echo $before_widget;
106
 
107
  // Title
108
  if ( ! empty( $instance['title'] ) )
109
- echo $before_title . $mycred->template_tags_general( $instance['title'] ) . $after_title;
110
 
111
- echo mycred_render_shortcode_leaderboard( $args );
112
 
113
  // Footer
114
- echo $after_widget;
115
 
116
  }
117
 
@@ -207,7 +207,7 @@ if ( ! class_exists( 'myCRED_Widget_Leaderboard' ) ) :
207
  <p class="myCRED-widget-field">
208
  <label for="<?php echo esc_attr( $this->get_field_id( 'row_layout' ) ); ?>"><?php esc_html_e( 'Row layout', 'mycred' ); ?>:</label>
209
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'row_layout' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'row_layout' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $row_layout ); ?></textarea>
210
- <small><?php echo $mycred->available_template_tags( array( 'general', 'balance' ) ); ?></small>
211
  </p>
212
  <p class="myCRED-widget-field">
213
  <label for="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>"><?php esc_html_e( 'Offset', 'mycred' ); ?>:</label>
@@ -225,9 +225,9 @@ if ( ! class_exists( 'myCRED_Widget_Leaderboard' ) ) :
225
  );
226
 
227
  foreach ( $options as $value => $label ) {
228
- echo '<option value="' . $value . '"';
229
  if ( $order == $value ) echo ' selected="selected"';
230
- echo '>' . $label . '</option>';
231
  }
232
 
233
  ?>
102
  $args['current'] = $instance['current'];
103
  }
104
 
105
+ echo wp_kses_post( $before_widget );
106
 
107
  // Title
108
  if ( ! empty( $instance['title'] ) )
109
+ echo wp_kses_post( $before_title . $mycred->template_tags_general( $instance['title'] ) . $after_title );
110
 
111
+ echo wp_kses_post( mycred_render_shortcode_leaderboard( $args ) );
112
 
113
  // Footer
114
+ echo wp_kses_post( $after_widget );
115
 
116
  }
117
 
207
  <p class="myCRED-widget-field">
208
  <label for="<?php echo esc_attr( $this->get_field_id( 'row_layout' ) ); ?>"><?php esc_html_e( 'Row layout', 'mycred' ); ?>:</label>
209
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'row_layout' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'row_layout' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $row_layout ); ?></textarea>
210
+ <small><?php echo wp_kses_post( $mycred->available_template_tags( array( 'general', 'balance' ) ) ); ?></small>
211
  </p>
212
  <p class="myCRED-widget-field">
213
  <label for="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>"><?php esc_html_e( 'Offset', 'mycred' ); ?>:</label>
225
  );
226
 
227
  foreach ( $options as $value => $label ) {
228
+ echo '<option value="' . esc_attr( $value ) . '"';
229
  if ( $order == $value ) echo ' selected="selected"';
230
+ echo '>' . esc_html( $label ) . '</option>';
231
  }
232
 
233
  ?>
includes/widgets/mycred-widget-wallet.php CHANGED
@@ -48,11 +48,11 @@ if ( ! class_exists( 'myCRED_Widget_Wallet' ) ) :
48
  if ( ! isset( $account->point_types ) || empty( $account->point_types ) ) return;
49
 
50
  // Start
51
- echo $before_widget;
52
 
53
  // Title
54
  if ( ! empty( $instance['title'] ) )
55
- echo $before_title . $instance['title'] . $after_title;
56
 
57
  $current_user = wp_get_current_user();
58
 
@@ -73,25 +73,25 @@ if ( ! class_exists( 'myCRED_Widget_Wallet' ) ) :
73
  }
74
 
75
  // End
76
- echo $after_widget;
77
 
78
  }
79
 
80
  // Visitor
81
  elseif ( ! is_user_logged_in() && $instance['show_visitors'] ) {
82
 
83
- echo $before_widget;
84
 
85
  // Title
86
  if ( ! empty( $instance['title'] ) )
87
- echo $before_title . $instance['title'] . $after_title;
88
 
89
  $message = $instance['message'];
90
  $message = $mycred->template_tags_general( $message );
91
 
92
- echo '<div class="myCRED-wallet-message"><p>' . wptexturize( $message ) . '</p></div>';
93
 
94
- echo $after_widget;
95
 
96
  }
97
 
@@ -128,7 +128,7 @@ if ( ! class_exists( 'myCRED_Widget_Wallet' ) ) :
128
  <p class="myCRED-widget-field">
129
  <label for="<?php echo esc_attr( $this->get_field_id( 'row' ) ); ?>"><?php esc_html_e( 'Row Layout', 'mycred' ); ?>:</label>
130
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'row' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'row' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $row_template ); ?></textarea>
131
- <small><?php echo $mycred->available_template_tags( array( 'general', 'amount' ) ); ?></small>
132
  </p>
133
 
134
  <!-- Show to Visitors -->
@@ -139,7 +139,7 @@ if ( ! class_exists( 'myCRED_Widget_Wallet' ) ) :
139
  <p class="myCRED-widget-field">
140
  <label for="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>"><?php esc_html_e( 'Message', 'mycred' ); ?>:</label>
141
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'message' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $message ); ?></textarea>
142
- <small><?php echo $mycred->available_template_tags( array( 'general', 'amount' ) ); ?></small>
143
  </p>
144
  </div>
145
  <!-- Widget Admin Scripting -->
48
  if ( ! isset( $account->point_types ) || empty( $account->point_types ) ) return;
49
 
50
  // Start
51
+ echo wp_kses_post( $before_widget );
52
 
53
  // Title
54
  if ( ! empty( $instance['title'] ) )
55
+ echo wp_kses_post( $before_title . $instance['title'] . $after_title );
56
 
57
  $current_user = wp_get_current_user();
58
 
73
  }
74
 
75
  // End
76
+ echo wp_kses_post( $after_widget );
77
 
78
  }
79
 
80
  // Visitor
81
  elseif ( ! is_user_logged_in() && $instance['show_visitors'] ) {
82
 
83
+ echo wp_kses_post( $before_widget );
84
 
85
  // Title
86
  if ( ! empty( $instance['title'] ) )
87
+ echo wp_kses_post( $before_title . $instance['title'] . $after_title );
88
 
89
  $message = $instance['message'];
90
  $message = $mycred->template_tags_general( $message );
91
 
92
+ echo '<div class="myCRED-wallet-message"><p>' . esc_html( wptexturize( $message ) ) . '</p></div>';
93
 
94
+ echo wp_kses_post( $after_widget );
95
 
96
  }
97
 
128
  <p class="myCRED-widget-field">
129
  <label for="<?php echo esc_attr( $this->get_field_id( 'row' ) ); ?>"><?php esc_html_e( 'Row Layout', 'mycred' ); ?>:</label>
130
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'row' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'row' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $row_template ); ?></textarea>
131
+ <small><?php echo wp_kses_post( $mycred->available_template_tags( array( 'general', 'amount' ) ) ); ?></small>
132
  </p>
133
 
134
  <!-- Show to Visitors -->
139
  <p class="myCRED-widget-field">
140
  <label for="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>"><?php esc_html_e( 'Message', 'mycred' ); ?>:</label>
141
  <textarea name="<?php echo esc_attr( $this->get_field_name( 'message' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'message' ) ); ?>" rows="3" cols="20" class="widefat"><?php echo esc_attr( $message ); ?></textarea>
142
+ <small><?php echo wp_kses_post( $mycred->available_template_tags( array( 'general', 'amount' ) ) ); ?></small>
143
  </p>
144
  </div>
145
  <!-- Widget Admin Scripting -->
membership/mycred-connect-membership.php CHANGED
@@ -149,14 +149,10 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
149
  <p>If you need to build a custom feature, simply <a href="https://objectsws.atlassian.net/servicedesk/customer/portal/11/create/92">submit a request</a> on our myCred website.</p>
150
  <hr>
151
 
152
- <h2>myCred Add-ons Update:</h2>
153
- <p>For our users' convenience and their site optimization, we made a unified license system for individual and membership users. <a href="<?php echo admin_url('options.php?page=mycred-update'); ?>">Click here to update your add-ons</a></p>
154
- <hr>
155
-
156
  <h2>myCred Log References:</h2>
157
  <div class="row mycred-all-references-list">
158
  <?php foreach ( $references as $key => $entry ):?>
159
- <div class="col-md-6 mb-2"><code><?php echo $key;?></code> - <?php echo $entry;?></div>
160
  <?php endforeach;?>
161
  </div>
162
 
@@ -183,7 +179,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
183
  <div class="themes">
184
  <div class="theme active mycred-treasure-pack">
185
  <div class="mycred-treasure-pack-content">
186
- <img src="<?php echo plugins_url( 'assets/images/treasures/badges.png', myCRED_THIS );?>" alt="Treasure Badges">
187
  <h3>Badges</h3>
188
  <p>40 unique and beautifully designed Badge designs available in Gold, Silver and Bronze.</p>
189
  </div>
@@ -196,7 +192,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
196
  </div>
197
  <div class="theme active mycred-treasure-pack">
198
  <div class="mycred-treasure-pack-content">
199
- <img src="<?php echo plugins_url( 'assets/images/treasures/rank.png', myCRED_THIS );?>" alt="Treasure Ranks">
200
  <h3>Ranks</h3>
201
  <p>40 unique and beautifully designed virtual Ranks are available in Red, Silver and Gold.</p>
202
  </div>
@@ -209,7 +205,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
209
  </div>
210
  <div class="theme active mycred-treasure-pack">
211
  <div class="mycred-treasure-pack-content">
212
- <img src="<?php echo plugins_url( 'assets/images/treasures/currency.png', myCRED_THIS );?>" alt="Treasure Currencies">
213
  <h3>Currency</h3>
214
  <p>17 unique and beautifully designed Currency designs available in Gold, Silver & Bronze.</p>
215
  </div>
@@ -222,7 +218,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
222
  </div>
223
  <div class="theme active mycred-treasure-pack">
224
  <div class="mycred-treasure-pack-content">
225
- <img src="<?php echo plugins_url( 'assets/images/treasures/learning.png', myCRED_THIS );?>" alt="Treasure Learning">
226
  <h3>Learning</h3>
227
  <p>30 unique and beautifully designed Learning icons are available in four different shapes.</p>
228
  </div>
@@ -235,7 +231,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
235
  </div>
236
  <div class="theme active mycred-treasure-pack">
237
  <div class="mycred-treasure-pack-content">
238
- <img src="<?php echo plugins_url( 'assets/images/treasures/fitness.png', myCRED_THIS );?>" alt="Treasure Fitness">
239
  <h3>Fitness</h3>
240
  <p>30 unique and beautifully designed Fitness icons are available in three different shapes.</p>
241
  </div>
@@ -248,7 +244,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
248
  </div>
249
  <div class="theme active mycred-treasure-pack">
250
  <div class="mycred-treasure-pack-content">
251
- <img src="<?php echo plugins_url( 'assets/images/treasures/gems.png', myCRED_THIS );?>" alt="Treasure Gems">
252
  <h3>Gems</h3>
253
  <p>500 unique and beautifully designed gem icons are available in four different shapes.</p>
254
  </div>
@@ -292,7 +288,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
292
 
293
  ?>
294
 
295
- <input type="text" name="mmc_lincense_key" class="mmc_lincense_key" placeholder="<?php esc_attr_e( 'Add Your License key', 'mycred' ); ?>" value="<?php echo $membership_key?>">
296
  <input type="submit" class="mmc_save_license button-primary" value="Save"/>
297
  <div class="mmc_license_link"><a href="https://mycred.me/redirect-to-membership/" target="_blank"><span class="dashicons dashicons-editor-help"></span><?php esc_html_e('Click here to get your License Key','mycred') ?></a>
298
  </div>
@@ -317,7 +313,7 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
317
 
318
  if( !isset($_POST['mmc_lincense_key']) ) return;
319
 
320
- $license_key = sanitize_text_field( $_POST['mmc_lincense_key'] );
321
 
322
  if( isset( $license_key ) ) {
323
 
149
  <p>If you need to build a custom feature, simply <a href="https://objectsws.atlassian.net/servicedesk/customer/portal/11/create/92">submit a request</a> on our myCred website.</p>
150
  <hr>
151
 
 
 
 
 
152
  <h2>myCred Log References:</h2>
153
  <div class="row mycred-all-references-list">
154
  <?php foreach ( $references as $key => $entry ):?>
155
+ <div class="col-md-6 mb-2"><code><?php echo esc_html( $key );?></code> - <?php echo esc_html( $entry );?></div>
156
  <?php endforeach;?>
157
  </div>
158
 
179
  <div class="themes">
180
  <div class="theme active mycred-treasure-pack">
181
  <div class="mycred-treasure-pack-content">
182
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/treasures/badges.png', myCRED_THIS ) );?>" alt="Treasure Badges">
183
  <h3>Badges</h3>
184
  <p>40 unique and beautifully designed Badge designs available in Gold, Silver and Bronze.</p>
185
  </div>
192
  </div>
193
  <div class="theme active mycred-treasure-pack">
194
  <div class="mycred-treasure-pack-content">
195
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/treasures/rank.png', myCRED_THIS ) );?>" alt="Treasure Ranks">
196
  <h3>Ranks</h3>
197
  <p>40 unique and beautifully designed virtual Ranks are available in Red, Silver and Gold.</p>
198
  </div>
205
  </div>
206
  <div class="theme active mycred-treasure-pack">
207
  <div class="mycred-treasure-pack-content">
208
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/treasures/currency.png', myCRED_THIS ) );?>" alt="Treasure Currencies">
209
  <h3>Currency</h3>
210
  <p>17 unique and beautifully designed Currency designs available in Gold, Silver & Bronze.</p>
211
  </div>
218
  </div>
219
  <div class="theme active mycred-treasure-pack">
220
  <div class="mycred-treasure-pack-content">
221
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/treasures/learning.png', myCRED_THIS ) );?>" alt="Treasure Learning">
222
  <h3>Learning</h3>
223
  <p>30 unique and beautifully designed Learning icons are available in four different shapes.</p>
224
  </div>
231
  </div>
232
  <div class="theme active mycred-treasure-pack">
233
  <div class="mycred-treasure-pack-content">
234
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/treasures/fitness.png', myCRED_THIS ) );?>" alt="Treasure Fitness">
235
  <h3>Fitness</h3>
236
  <p>30 unique and beautifully designed Fitness icons are available in three different shapes.</p>
237
  </div>
244
  </div>
245
  <div class="theme active mycred-treasure-pack">
246
  <div class="mycred-treasure-pack-content">
247
+ <img src="<?php echo esc_url( plugins_url( 'assets/images/treasures/gems.png', myCRED_THIS ) );?>" alt="Treasure Gems">
248
  <h3>Gems</h3>
249
  <p>500 unique and beautifully designed gem icons are available in four different shapes.</p>
250
  </div>
288
 
289
  ?>
290
 
291
+ <input type="text" name="mmc_lincense_key" class="mmc_lincense_key" placeholder="<?php esc_attr_e( 'Add Your License key', 'mycred' ); ?>" value="<?php echo esc_attr( $membership_key );?>">
292
  <input type="submit" class="mmc_save_license button-primary" value="Save"/>
293
  <div class="mmc_license_link"><a href="https://mycred.me/redirect-to-membership/" target="_blank"><span class="dashicons dashicons-editor-help"></span><?php esc_html_e('Click here to get your License Key','mycred') ?></a>
294
  </div>
313
 
314
  if( !isset($_POST['mmc_lincense_key']) ) return;
315
 
316
+ $license_key = sanitize_text_field( wp_unslash( $_POST['mmc_lincense_key'] ) );
317
 
318
  if( isset( $license_key ) ) {
319
 
membership/subscription-functions.php CHANGED
@@ -27,7 +27,7 @@ if( ! function_exists('mycred_is_valid_license_key') ) :
27
  $request_args = array(
28
  'body' => array(
29
  'license_key' => $key,
30
- 'site' => site_url(),
31
  'api-key' => md5( get_bloginfo( 'url' ) )
32
  ),
33
  'timeout' => 12
27
  $request_args = array(
28
  'body' => array(
29
  'license_key' => $key,
30
+ 'site' => get_bloginfo( 'url' ),
31
  'api-key' => md5( get_bloginfo( 'url' ) )
32
  ),
33
  'timeout' => 12
modules/mycred-module-addons.php CHANGED
@@ -44,10 +44,10 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
44
  public function module_admin_init() {
45
 
46
  // Handle actions
47
- if ( isset( $_GET['addon_action'] ) && isset( $_GET['addon_id'] ) && isset( $_GET['_token'] ) && wp_verify_nonce( $_GET['_token'], 'mycred-activate-deactivate-addon' ) && $this->core->user_is_point_admin() ) {
48
 
49
- $addon_id = sanitize_text_field( $_GET['addon_id'] );
50
- $action = sanitize_text_field( $_GET['addon_action'] );
51
 
52
  $this->get();
53
  if ( array_key_exists( $addon_id, $this->installed ) ) {
@@ -95,9 +95,9 @@ if ( ! class_exists( 'myCRED_Addons_Module' ) ) :
95
  public function all_activate_deactivate() {
96
 
97
  // Handle actions
98
- if ( isset( $_GET['addon_all_action'] ) && isset( $_GET['_token'] ) && wp_verify_nonce( $_GET['_token'], 'mycred-activate-deactivate-addon') && $this->core->user_is_point_admin() ) {
99
 
100
- $action = sanitize_text_field( $_GET['addon_all_action'] );
101
 
102
  if ( $action == 'activate' ) {
103
 
@@ -499,7 +499,7 @@ $premium_addons_url = get_mycred_addon_page_url('premium_addons');
499
  </div>
500
  <?php
501
  if( !isset( $_GET['mycred_addons'] ) ){ ?>
502
- <div class="mycred-addon-switch" data-activation-url="<?php echo $activate_url ?>" data-deactivation-url="<?php echo $deactivate_url ?>">
503
  <!-- Rounded switch -->
504
  <label for="mycred-addons-checkbox" class="mycred-addons-switch">
505
  <input type="checkbox" name="mycred-addons-checkbox" id="mycred-addons-checkbox" <?php echo $this->check_all_addons() ? 'checked' : ''; ?> >
@@ -512,9 +512,9 @@ $premium_addons_url = get_mycred_addon_page_url('premium_addons');
512
  <div class="clear"></div>
513
  <div class="addons-main-nav">
514
  <h2 class="nav-tab-wrapper">
515
- <a href="<?php echo admin_url('admin.php?page=mycred-addons') ?>" class="nav-tab <?php echo !isset( $_GET['mycred_addons'] ) ? 'nav-tab-active' : ''; ?>">Built-in Addons</a>
516
- <a href="<?php echo $free_addons_url ?>" class="nav-tab <?php echo ( isset( $_GET['mycred_addons'] ) && $_GET['mycred_addons'] == 'free_addons' ) ? 'nav-tab-active' : ''; ?>">Free Addons</a>
517
- <a href="<?php echo $premium_addons_url ?>" class="nav-tab <?php echo ( isset( $_GET['mycred_addons'] ) && $_GET['mycred_addons'] == 'premium_addons' ) ? 'nav-tab-active' : ''; ?>">Premium Addons</a>
518
  </h2>
519
  </div>
520
  </div>
@@ -524,10 +524,10 @@ $premium_addons_url = get_mycred_addon_page_url('premium_addons');
524
  if ( isset( $_GET['activated'] ) ) {
525
 
526
  if ( $_GET['activated'] == 1 )
527
- echo '<div id="message" class="updated"><p>' . __( 'Add-on Activated', 'mycred' ) . '</p></div>';
528
 
529
  elseif ( $_GET['activated'] == 0 )
530
- echo '<div id="message" class="error"><p>' . __( 'Add-on Deactivated', 'mycred' ) . '</p></div>';
531
 
532
  }
533
 
@@ -591,16 +591,16 @@ if ( isset( $_GET['mycred_addons'] ) )
591
  <div class="theme inactive" tabindex="0" aria-describedby="badges-action badges-name">
592
 
593
  <div class="theme-screenshot">
594
- <img src="<?php echo $data['screenshot']; ?>" width="384px" height="288px" alt="">
595
  </div>
596
 
597
  <div class="theme-id-container">
598
 
599
- <h2 class="theme-name" id="badges-name"><?php echo $data['name']; ?></h2>
600
 
601
  <div class="theme-actions">
602
 
603
- <a href="<?php echo $data['addon_url']; ?>" title="Install" target="_blank" class="button button-primary mycred-action badges">Install</a>
604
  </div>
605
 
606
  </div>
@@ -667,16 +667,16 @@ if ( isset( $_GET['mycred_addons'] ) )
667
  <div class="theme inactive" tabindex="0" aria-describedby="badges-action badges-name">
668
 
669
  <div class="theme-screenshot">
670
- <img src="<?php echo $data['screenshot']; ?>" width="384px" height="288px" alt="">
671
  </div>
672
 
673
  <div class="theme-id-container">
674
 
675
- <h2 class="theme-name" id="badges-name"><?php echo $data['name']; ?></h2>
676
 
677
  <div class="theme-actions">
678
 
679
- <a href="<?php echo $data['addon_url']; ?>" title="Install" target="_blank" class="button button-primary mycred-action badges">Install</a>
680
  </div>
681
 
682
  </div>
@@ -697,16 +697,16 @@ else
697
 
698
  foreach ( $installed as $key => $data ) {
699
 
700
- $aria_action = esc_attr( $key . '-action' );
701
- $aria_name = esc_attr( $key . '-name' );
702
 
703
  ?>
704
- <div class="theme<?php if ( $this->is_active( $key ) ) echo ' active'; else echo ' inactive'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
705
 
706
  <?php if ( $data['screenshot'] != '' ) : ?>
707
 
708
  <div class="theme-screenshot">
709
- <img src="<?php echo $data['screenshot']; ?>" alt="" />
710
  </div>
711
 
712
  <?php else : ?>
@@ -715,23 +715,23 @@ else
715
 
716
  <?php endif; ?>
717
 
718
- <a class="more-details" id="<?php echo $aria_action; ?>" href="<?php echo $data['addon_url']; ?>" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a>
719
 
720
  <div class="theme-id-container">
721
 
722
  <?php if ( $this->is_active( $key ) ) : ?>
723
 
724
- <h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $this->core->template_tags_general( $data['name'] ); ?></h2>
725
 
726
  <?php else : ?>
727
 
728
- <h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $this->core->template_tags_general( $data['name'] ); ?></h2>
729
 
730
  <?php endif; ?>
731
 
732
  <div class="theme-actions">
733
 
734
- <?php echo $this->activate_deactivate( $key ); ?>
735
 
736
  </div>
737
 
44
  public function module_admin_init() {
45
 
46
  // Handle actions
47
+ if ( isset( $_GET['addon_action'] ) && isset( $_GET['addon_id'] ) && isset( $_GET['_token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_token'] ) ), 'mycred-activate-deactivate-addon' ) && $this->core->user_is_point_admin() ) {
48
 
49
+ $addon_id = sanitize_text_field( wp_unslash( $_GET['addon_id'] ) );
50
+ $action = sanitize_text_field( wp_unslash( $_GET['addon_action'] ) );
51
 
52
  $this->get();
53
  if ( array_key_exists( $addon_id, $this->installed ) ) {
95
  public function all_activate_deactivate() {
96
 
97
  // Handle actions
98
+ if ( isset( $_GET['addon_all_action'] ) && isset( $_GET['_token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_token'] ) ), 'mycred-activate-deactivate-addon') && $this->core->user_is_point_admin() ) {
99
 
100
+ $action = sanitize_text_field( wp_unslash( $_GET['addon_all_action'] ) );
101
 
102
  if ( $action == 'activate' ) {
103
 
499
  </div>
500
  <?php
501
  if( !isset( $_GET['mycred_addons'] ) ){ ?>
502
+ <div class="mycred-addon-switch" data-activation-url="<?php echo esc_url( $activate_url ); ?>" data-deactivation-url="<?php echo esc_attr( $deactivate_url ); ?>">
503
  <!-- Rounded switch -->
504
  <label for="mycred-addons-checkbox" class="mycred-addons-switch">
505
  <input type="checkbox" name="mycred-addons-checkbox" id="mycred-addons-checkbox" <?php echo $this->check_all_addons() ? 'checked' : ''; ?> >
512
  <div class="clear"></div>
513
  <div class="addons-main-nav">
514
  <h2 class="nav-tab-wrapper">
515
+ <a href="<?php echo esc_url( admin_url('admin.php?page=mycred-addons') ); ?>" class="nav-tab <?php echo !isset( $_GET['mycred_addons'] ) ? 'nav-tab-active' : ''; ?>">Built-in Addons</a>
516
+ <a href="<?php echo esc_url( $free_addons_url ); ?>" class="nav-tab <?php echo ( isset( $_GET['mycred_addons'] ) && $_GET['mycred_addons'] == 'free_addons' ) ? 'nav-tab-active' : ''; ?>">Free Addons</a>
517
+ <a href="<?php echo esc_url( $premium_addons_url ); ?>" class="nav-tab <?php echo ( isset( $_GET['mycred_addons'] ) && $_GET['mycred_addons'] == 'premium_addons' ) ? 'nav-tab-active' : ''; ?>">Premium Addons</a>
518
  </h2>
519
  </div>
520
  </div>
524
  if ( isset( $_GET['activated'] ) ) {
525
 
526
  if ( $_GET['activated'] == 1 )
527
+ echo '<div id="message" class="updated"><p>' . esc_html__( 'Add-on Activated', 'mycred' ) . '</p></div>';
528
 
529
  elseif ( $_GET['activated'] == 0 )
530
+ echo '<div id="message" class="error"><p>' . esc_html__( 'Add-on Deactivated', 'mycred' ) . '</p></div>';
531
 
532
  }
533
 
591
  <div class="theme inactive" tabindex="0" aria-describedby="badges-action badges-name">
592
 
593
  <div class="theme-screenshot">
594
+ <img src="<?php echo esc_url( $data['screenshot'] ); ?>" width="384px" height="288px" alt="">
595
  </div>
596
 
597
  <div class="theme-id-container">
598
 
599
+ <h2 class="theme-name" id="badges-name"><?php echo esc_html( $data['name'] ); ?></h2>
600
 
601
  <div class="theme-actions">
602
 
603
+ <a href="<?php echo esc_url( $data['addon_url'] ); ?>" title="Install" target="_blank" class="button button-primary mycred-action badges">Install</a>
604
  </div>
605
 
606
  </div>
667
  <div class="theme inactive" tabindex="0" aria-describedby="badges-action badges-name">
668
 
669
  <div class="theme-screenshot">
670
+ <img src="<?php echo esc_url( $data['screenshot'] ); ?>" width="384px" height="288px" alt="">
671
  </div>
672
 
673
  <div class="theme-id-container">
674
 
675
+ <h2 class="theme-name" id="badges-name"><?php echo esc_html( $data['name'] ); ?></h2>
676
 
677
  <div class="theme-actions">
678
 
679
+ <a href="<?php echo esc_url( $data['addon_url'] ); ?>" title="Install" target="_blank" class="button button-primary mycred-action badges">Install</a>
680
  </div>
681
 
682
  </div>
697
 
698
  foreach ( $installed as $key => $data ) {
699
 
700
+ $aria_action = $key . '-action';
701
+ $aria_name = $key . '-name';
702
 
703
  ?>
704
+ <div class="theme<?php if ( $this->is_active( $key ) ) echo ' active'; else echo ' inactive'; ?>" tabindex="0" aria-describedby="<?php echo esc_attr( $aria_action ) . ' ' . esc_attr( $aria_name ); ?>">
705
 
706
  <?php if ( $data['screenshot'] != '' ) : ?>
707
 
708
  <div class="theme-screenshot">
709
+ <img src="<?php echo esc_url( $data['screenshot'] ); ?>" alt="" />
710
  </div>
711
 
712
  <?php else : ?>
715
 
716
  <?php endif; ?>
717
 
718
+ <a class="more-details" id="<?php echo esc_attr( $aria_action ); ?>" href="<?php echo esc_url( $data['addon_url'] ); ?>" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a>
719
 
720
  <div class="theme-id-container">
721
 
722
  <?php if ( $this->is_active( $key ) ) : ?>
723
 
724
+ <h2 class="theme-name" id="<?php echo esc_attr( $aria_name ); ?>"><?php echo esc_html( $this->core->template_tags_general( $data['name'] ) ); ?></h2>
725
 
726
  <?php else : ?>
727
 
728
+ <h2 class="theme-name" id="<?php echo esc_attr( $aria_name ); ?>"><?php echo esc_html( $this->core->template_tags_general( $data['name'] ) ); ?></h2>
729
 
730
  <?php endif; ?>
731
 
732
  <div class="theme-actions">
733
 
734
+ <?php echo wp_kses_post( $this->activate_deactivate( $key ) ); ?>
735
 
736
  </div>
737
 
modules/mycred-module-br-social-share.php CHANGED
@@ -62,50 +62,50 @@ if ( ! class_exists( 'myCRED_Module_OB_Social_Share' ) ) :
62
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
63
  <div class="form-group">
64
  <div class="checkbox" style="padding-top: 4px;">
65
- <label for="<?php echo $this->field_id( 'enable_open_badge_ss' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_open_badge_ss' ) ?>" id="<?php echo $this->field_id( 'enable_open_badge_ss' ) ?>" <?php checked( $settings['enable_open_badge_ss'], 1 ); ?> value="1">Enable Open Badge Social Sharing</label>
66
  </div>
67
  </div>
68
  </div>
69
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
70
  <div class="form-group">
71
  <div class="checkbox" style="padding-top: 4px;">
72
- <label for="<?php echo $this->field_id( 'enable_fb' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_fb' ) ?>" id="<?php echo $this->field_id( 'enable_fb' ) ?>" <?php checked( $settings['enable_fb'], 1 ); ?> value="1">Show Facebook button</label>
73
  </div>
74
  </div>
75
  <div class="form-group">
76
  <div class="checkbox" style="padding-top: 4px;">
77
- <label for="<?php echo $this->field_id( 'enable_twitter' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_twitter' ) ?>" id="<?php echo $this->field_id( 'enable_twitter' ) ?>" <?php checked( $settings['enable_twitter'], 1 ); ?> value="1">Show Twitter button</label>
78
  </div>
79
  </div>
80
  <div class="form-group">
81
  <div class="checkbox" style="padding-top: 4px;">
82
- <label for="<?php echo $this->field_id( 'enable_li' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_li' ) ?>" id="<?php echo $this->field_id( 'enable_li' ) ?>" <?php checked( $settings['enable_li'], 1 ); ?> value="1">Show LinkedIn button</label>
83
  </div>
84
  </div>
85
  <div class="form-group">
86
  <div class="checkbox" style="padding-top: 4px;">
87
- <label for="<?php echo $this->field_id( 'enable_pt' ) ?>"><input type="checkbox" name="<?php echo $this->field_name( 'enable_pt' ) ?>" id="<?php echo $this->field_id( 'enable_pt' ) ?>" <?php checked( $settings['enable_pt'], 1 ); ?> value="1">Show Pinterest button</label>
88
  </div>
89
  </div>
90
  </div>
91
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
92
  <h3>Social Sharing button style</h3>
93
  <div class="clearfix">
94
- <input type="radio" name="<?php echo $this->field_name( 'button_style' ) ?>" <?php echo $this->is_checked( 'button_style' ) ? 'checked' : ''; ?> value="button_style">Button Style<br>
95
  <button class="mycred-social-icons mycred-social-icon-facebook"><a href="javascript:void(0)">facebook</a></button>
96
  <button class="mycred-social-icons mycred-social-icon-twitter"><a href="javascript:void(0)">twitter</a></button>
97
  <button class="mycred-social-icons mycred-social-icon-linkedin"><a href="javascript:void(0)">linkedin</a></button>
98
  <button class="mycred-social-icons mycred-social-icon-pinterest"><a href="javascript:void(0)">pinterest</a></button>
99
  </div>
100
  <div class="clearfix">
101
- <input type="radio" name="<?php echo $this->field_name( 'button_style' ) ?>" <?php echo $this->is_checked( 'icon_style' ) ? 'checked' : ''; ?> value="icon_style">Icon Style<br>
102
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-facebook"></a>
103
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-twitter"></a>
104
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-linkedin"></a>
105
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-pinterest"></a>
106
  </div>
107
  <div class="clearfix">
108
- <input type="radio" name="<?php echo $this->field_name( 'button_style' ) ?>" <?php echo $this->is_checked( 'text_style' ) ? 'checked' : ''; ?> value="text_style">Text Style<br>
109
  <button class="facebook social-text"><a href="javascript:void(0)">facebook</a></button>
110
  <button class="twitter social-text"><a href="javascript:void(0)">twitter</a></button>
111
  <button class="linkedin social-text"><a href="javascript:void(0)">linkedin</a></button>
62
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
63
  <div class="form-group">
64
  <div class="checkbox" style="padding-top: 4px;">
65
+ <label for="<?php echo esc_attr( $this->field_id( 'enable_open_badge_ss' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'enable_open_badge_ss' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'enable_open_badge_ss' ) ); ?>" <?php checked( $settings['enable_open_badge_ss'], 1 ); ?> value="1">Enable Open Badge Social Sharing</label>
66
  </div>
67
  </div>
68
  </div>
69
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
70
  <div class="form-group">
71
  <div class="checkbox" style="padding-top: 4px;">
72
+ <label for="<?php echo esc_attr( $this->field_id( 'enable_fb' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'enable_fb' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'enable_fb' ) ); ?>" <?php checked( $settings['enable_fb'], 1 ); ?> value="1">Show Facebook button</label>
73
  </div>
74
  </div>
75
  <div class="form-group">
76
  <div class="checkbox" style="padding-top: 4px;">
77
+ <label for="<?php echo esc_attr( $this->field_id( 'enable_twitter' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'enable_twitter' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'enable_twitter' ) ); ?>" <?php checked( $settings['enable_twitter'], 1 ); ?> value="1">Show Twitter button</label>
78
  </div>
79
  </div>
80
  <div class="form-group">
81
  <div class="checkbox" style="padding-top: 4px;">
82
+ <label for="<?php echo esc_attr( $this->field_id( 'enable_li' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'enable_li' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'enable_li' ) ); ?>" <?php checked( $settings['enable_li'], 1 ); ?> value="1">Show LinkedIn button</label>
83
  </div>
84
  </div>
85
  <div class="form-group">
86
  <div class="checkbox" style="padding-top: 4px;">
87
+ <label for="<?php echo esc_attr( $this->field_id( 'enable_pt' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'enable_pt' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'enable_pt' ) ); ?>" <?php checked( $settings['enable_pt'], 1 ); ?> value="1">Show Pinterest button</label>
88
  </div>
89
  </div>
90
  </div>
91
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
92
  <h3>Social Sharing button style</h3>
93
  <div class="clearfix">
94
+ <input type="radio" name="<?php echo esc_attr( $this->field_name( 'button_style' ) ); ?>" <?php echo $this->is_checked( 'button_style' ) ? 'checked' : ''; ?> value="button_style">Button Style<br>
95
  <button class="mycred-social-icons mycred-social-icon-facebook"><a href="javascript:void(0)">facebook</a></button>
96
  <button class="mycred-social-icons mycred-social-icon-twitter"><a href="javascript:void(0)">twitter</a></button>
97
  <button class="mycred-social-icons mycred-social-icon-linkedin"><a href="javascript:void(0)">linkedin</a></button>
98
  <button class="mycred-social-icons mycred-social-icon-pinterest"><a href="javascript:void(0)">pinterest</a></button>
99
  </div>
100
  <div class="clearfix">
101
+ <input type="radio" name="<?php echo esc_attr( $this->field_name( 'button_style' ) ); ?>" <?php echo $this->is_checked( 'icon_style' ) ? 'checked' : ''; ?> value="icon_style">Icon Style<br>
102
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-facebook"></a>
103
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-twitter"></a>
104
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-linkedin"></a>
105
  <a href="javascript:void(0)" class="mycred-social-icons mycred-social-icon-pinterest"></a>
106
  </div>
107
  <div class="clearfix">
108
+ <input type="radio" name="<?php echo esc_attr( $this->field_name( 'button_style' ) ); ?>" <?php echo $this->is_checked( 'text_style' ) ? 'checked' : ''; ?> value="text_style">Text Style<br>
109
  <button class="facebook social-text"><a href="javascript:void(0)">facebook</a></button>
110
  <button class="twitter social-text"><a href="javascript:void(0)">twitter</a></button>
111
  <button class="linkedin social-text"><a href="javascript:void(0)">linkedin</a></button>
modules/mycred-module-buddypress.php CHANGED
@@ -57,7 +57,7 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
57
 
58
  $this->selected_type = MYCRED_DEFAULT_TYPE_KEY;
59
  if ( isset( $_GET['show-ctype'] ) ) {
60
- $selected = sanitize_text_field( $_GET['show-ctype'] );
61
  if ( array_key_exists( $selected, $this->point_types ) )
62
  $this->selected_type = $selected;
63
  }
@@ -134,7 +134,7 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
134
 
135
  }
136
 
137
- echo apply_filters( 'mycred_bp_profile_details', $output, $balance, $this );
138
 
139
  do_action('mycred_buddypress_profile_details');
140
 
@@ -195,7 +195,7 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
195
 
196
  }
197
 
198
- echo apply_filters( 'mycred_bp_profile_header', $output, $this->buddypress['balance_template'], $this );
199
 
200
  do_action('mycred_buddypress_profile_header');
201
 
@@ -322,7 +322,7 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
322
  $title = bp_word_or_name( $me, $others, false, false );
323
  $title = $this->core->template_tags_general( $title );
324
 
325
- echo apply_filters( 'mycred_br_history_page_title', $title, $this );
326
 
327
  }
328
 
@@ -337,8 +337,8 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
337
 
338
  $mycred_types = mycred_get_types();
339
  $type = MYCRED_DEFAULT_TYPE_KEY;
340
- if ( isset( $_REQUEST['show-ctype'] ) && array_key_exists( $_REQUEST['show-ctype'], $mycred_types ) )
341
- $type = $_REQUEST['show-ctype'];
342
 
343
  $args = array(
344
  'user_id' => bp_displayed_user_id(),
@@ -347,7 +347,7 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
347
  );
348
 
349
  if ( isset( $_GET['paged'] ) && $_GET['paged'] != '' )
350
- $args['paged'] = $_GET['paged'];
351
 
352
  if ( isset( $bp->canonical_stack['action'] ) && $bp->canonical_stack['action'] != $this->buddypress['history_url'] )
353
  $args['time'] = $bp->canonical_stack['action'];
@@ -395,8 +395,82 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
395
 
396
  $output = ob_get_contents();
397
  ob_end_clean();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
 
399
- echo apply_filters( 'mycred_bp_history_page', $output, $this );
400
 
401
  }
402
 
@@ -433,7 +507,7 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
433
  }
434
 
435
  ?>
436
- <h4><span class="dashicons dashicons-admin-plugins static"></span><label><?php echo apply_filters( 'mycred_bp_change_text', 'BuddyPress' ); ?></label></h4>
437
  <div class="body" style="display:none;">
438
 
439
  <?php do_action( 'mycred_bp_before_settings', $this ); ?>
@@ -441,14 +515,14 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
441
  <div class="row">
442
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
443
  <div class="form-group">
444
- <label for="<?php echo $this->field_id( 'balance_location' ); ?>"><?php echo $this->core->template_tags_general( __( '%singular% Balance', 'mycred' ) ); ?></label>
445
- <select name="<?php echo $this->field_name( 'balance_location' ); ?>" id="<?php echo $this->field_id( 'balance_location' ); ?>" class="form-control">
446
  <?php
447
 
448
  foreach ( $balance_locations as $location => $description ) {
449
- echo '<option value="' . $location . '"';
450
  if ( isset( $settings['balance_location'] ) && $settings['balance_location'] == $location ) echo ' selected="selected"';
451
- echo '>' . $description . '</option>';
452
  }
453
 
454
  ?>
@@ -456,15 +530,15 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
456
  </div>
457
  <div class="form-group">
458
  <div class="checkbox">
459
- <label for="<?php echo $this->field_id( array( 'visibility' => 'balance' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'visibility' => 'balance' ) ); ?>" id="<?php echo $this->field_id( array( 'visibility' => 'balance' ) ); ?>" <?php checked( $settings['visibility']['balance'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Members and visitors can view other members %_singular% balance.', 'mycred' ) ); ?></label>
460
  </div>
461
  </div>
462
  </div>
463
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
464
  <div class="form-group">
465
- <label for="<?php echo $this->field_id( 'balance_template' ); ?>"><?php esc_html_e( 'Template', 'mycred' ); ?></label>
466
- <input type="text" name="<?php echo $this->field_name( 'balance_template' ); ?>" id="<?php echo $this->field_id( 'balance_template' ); ?>" value="<?php echo esc_attr( $settings['balance_template'] ); ?>" class="form-control" />
467
- <p><span class="description"><?php echo $this->core->available_template_tags( array( 'general', 'balance' ) ); ?></span></p>
468
  </div>
469
  </div>
470
  </div>
@@ -472,34 +546,34 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
472
  <div class="row">
473
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
474
  <div class="form-group">
475
- <label for="<?php echo $this->field_id( 'history_location' ); ?>"><?php echo $this->core->template_tags_general( __( '%plural% History', 'mycred' ) ); ?></label>
476
- <select name="<?php echo $this->field_name( 'history_location' ); ?>" id="<?php echo $this->field_id( 'history_location' ); ?>" class="form-control">
477
  <?php
478
 
479
  foreach ( $history_locations as $location => $description ) {
480
- echo '<option value="' . $location . '"';
481
  if ( isset( $settings['history_location'] ) && $settings['history_location'] == $location ) echo ' selected="selected"';
482
- echo '>' . $description . '</option>';
483
  }
484
 
485
  ?>
486
  </select>
487
  </div>
488
  <div class="form-group">
489
- <label for="<?php echo $this->field_id( array( 'visibility' => 'history' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'visibility' => 'history' ) ); ?>" id="<?php echo $this->field_id( array( 'visibility' => 'history' ) ); ?>" <?php checked( $settings['visibility']['history'], 1 ); ?> value="1" /> <?php echo $this->core->template_tags_general( __( 'Members can view each others %_plural% history.', 'mycred' ) ); ?></label>
490
  </div>
491
  </div>
492
  <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
493
  <div class="form-group">
494
- <label for="<?php echo $this->field_id( array( 'history_menu_title' => 'me' ) ); ?>"><?php esc_html_e( 'Menu Title', 'mycred' ); ?></label>
495
- <input type="text" name="<?php echo $this->field_name( array( 'history_menu_title' => 'me' ) ); ?>" id="<?php echo $this->field_id( array( 'history_menu_title' => 'me' ) ); ?>" value="<?php echo esc_attr( $settings['history_menu_title']['me'] ); ?>" class="form-control" />
496
  <p><span class="description"><?php esc_html_e( 'Title shown to me', 'mycred' ); ?></span></p>
497
  </div>
498
  </div>
499
  <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
500
  <div class="form-group">
501
  <label>&nbsp;</label>
502
- <input type="text" name="<?php echo $this->field_name( array( 'history_menu_title' => 'others' ) ); ?>" id="<?php echo $this->field_id( array( 'history_menu_title' => 'others' ) ); ?>" value="<?php echo esc_attr( $settings['history_menu_title']['others'] ); ?>" class="form-control" />
503
  <p><span class="description"><?php esc_html_e( 'Title shown to others. Use %s to show the first name.', 'mycred' ); ?></span></p>
504
  </div>
505
  </div>
@@ -508,22 +582,22 @@ if ( ! class_exists( 'myCRED_BuddyPress_Module' ) ) :
508
  <div class="row">
509
  <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
510
  <div class="form-group">
511
- <label for="<?php echo $this->field_id( 'history_menu_pos' ); ?>"><?php esc_html_e( 'Menu Position', 'mycred' ); ?></label>
512
- <input type="text" name="<?php echo $this->field_name( 'history_menu_pos' ); ?>" id="<?php echo $this->field_id( 'history_menu_pos' ); ?>" value="<?php echo esc_attr( $settings['history_menu_pos'] ); ?>" class="form-control" />
513
- <p><span class="description"><?php printf( '%s %s', __( 'Current menu positions:', 'mycred' ), implode( ', ', $bp_nav_positions ) ); ?></span></p>
514
  </div>
515
  </div>
516
  <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
517
  <div class="form-group">
518
- <label for="<?php echo $this->field_id( 'history_url' ); ?>"><?php esc_html_e( 'History URL slug', 'mycred' ); ?></label>
519
- <input type="text" name="<?php echo $this->field_name( 'history_url' ); ?>" id="<?php echo $this->field_id( 'history_url' ); ?>" value="<?php echo esc_attr( $settings['history_url'] ); ?>" class="form-control" />
520
  <p><span class="description"><?php esc_html_e( 'The history page slug. Must be URL friendly.', 'mycred' ); ?></span></p>
521
  </div>
522
  </div>
523
  <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
524
  <div class="form-group">
525
- <label for="<?php echo $this->field_id( 'history_num' ); ?>"><?php esc_html_e( 'Number of history entries to show', 'mycred' ); ?></label>
526
- <input type="text" name="<?php echo $this->field_name( 'history_num' ); ?>" id="<?php echo $this->field_id( 'history_num' ); ?>" value="<?php echo esc_attr( $settings['history_num'] ); ?>" class="form-control" />
527
  </div>
528
  </div>
529
  </div>
57
 
58
  $this->selected_type = MYCRED_DEFAULT_TYPE_KEY;
59
  if ( isset( $_GET['show-ctype'] ) ) {
60
+ $selected = sanitize_text_field( wp_unslash( $_GET['show-ctype'] ) );
61
  if ( array_key_exists( $selected, $this->point_types ) )
62
  $this->selected_type = $selected;
63
  }
134
 
135
  }
136
 
137
+ echo wp_kses_post( apply_filters( 'mycred_bp_profile_details', $output, $balance, $this ) );
138
 
139
  do_action('mycred_buddypress_profile_details');
140
 
195
 
196
  }
197
 
198
+ echo wp_kses_post( apply_filters( 'mycred_bp_profile_header', $output, $this->buddypress['balance_template'], $this ) );
199
 
200
  do_action('mycred_buddypress_profile_header');
201
 
322
  $title = bp_word_or_name( $me, $others, false, false );
323
  $title = $this->core->template_tags_general( $title );
324
 
325
+ echo wp_kses_post( apply_filters( 'mycred_br_history_page_title', $title, $this ) );
326
 
327
  }
328
 
337
 
338
  $mycred_types = mycred_get_types();
339
  $type = MYCRED_DEFAULT_TYPE_KEY;
340
+ if ( isset( $_REQUEST['show-ctype'] ) && array_key_exists( sanitize_text_field( wp_unslash( $_REQUEST['show-ctype'] ) ), $mycred_types ) )
341
+ $type = sanitize_text_field( wp_unslash( $_REQUEST['show-ctype'] ) );
342
 
343
  $args = array(
344
  'user_id' => bp_displayed_user_id(),
347
  );
348
 
349
  if ( isset( $_GET['paged'] ) && $_GET['paged'] != '' )
350
+ $args['paged'] = sanitize_text_field( wp_unslash( $_GET['paged'] ) );
351
 
352
  if ( isset( $bp->canonical_stack['action'] ) && $bp->canonical_stack['action'] != $this->buddypress['history_url'] )
353
  $args['time'] = $bp->canonical_stack['action'];
395
 
396
  $output = ob_get_contents();
397
  ob_end_clean();
398
+
399
+ $allowed_html = array(
400
+ 'form' => array(
401
+ 'action' => array(),
402
+ 'id' => array(),
403
+ 'method' => array(),
404
+ 'class' => array(),
405
+ 'role' => array()
406
+ ),
407
+ 'label' => array(
408
+ 'for' => array(),
409
+ 'class' => array()
410
+ ),
411
+ 'input' => array(
412
+ 'type' => array(),
413
+ 'class' => array(),
414
+ 'value' => array(),
415
+ 'id' => array(),
416
+ 'name' => array(),
417
+ 'size' => array(),
418
+ 'aria-describedby' => array()
419
+ ),
420
+ 'style' => array(
421
+ 'type' => array()
422
+ ),
423
+ 'select' => array(
424
+ 'name' => array(),
425
+ 'id' => array(),
426
+ 'style' => array()
427
+ ),
428
+ 'option' => array(
429
+ 'value' => array(),
430
+ 'selected' => array()
431
+ ),
432
+ 'div' => array(
433
+ 'class' => array()
434
+ ),
435
+ 'h2' => array(
436
+ 'class' => array()
437
+ ),
438
+ 'span' => array(
439
+ 'class' => array(),
440
+ 'aria-hidden' => array()
441
+ ),
442
+ 'a' => array(
443
+ 'class' => array(),
444
+ 'href' => array()
445
+ ),
446
+ 'br' => array(
447
+ 'class' => array()
448
+ ),
449
+ 'table' => array(
450
+ 'class' => array(),
451
+ 'cellspacing' => array()
452
+ ),
453
+ 'thead' => array(),
454
+ 'tbody' => array(
455
+ 'id' => array()
456
+ ),
457
+ 'tr' => array(
458
+ 'class' => array(),
459
+ 'id' => array()
460
+ ),
461
+ 'th' => array(
462
+ 'scope' => array(),
463
+ 'id' => array(),
464
+ 'class' => array()
465
+ ),
466
+ 'td' => array(
467
+ 'class' => array(),
468
+ 'data-colname' => array()
469
+ ),
470
+ 'tfoot' => array(),
471
+ );
472
 
473
+ echo wp_kses( apply_filters( 'mycred_bp_history_page', $output, $this ), $allowed_html );
474
 
475
  }
476
 
507
  }
508
 
509
  ?>
510
+ <h4><span class="dashicons dashicons-admin-plugins static"></span><label><?php echo esc_html( apply_filters( 'mycred_bp_change_text', 'BuddyPress' ) ); ?></label></h4>
511
  <div class="body" style="display:none;">
512
 
513
  <?php do_action( 'mycred_bp_before_settings', $this ); ?>
515
  <div class="row">
516
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
517
  <div class="form-group">
518
+ <label for="<?php echo esc_attr( $this->field_id( 'balance_location' ) ); ?>"><?php echo esc_html( $this->core->template_tags_general( __( '%singular% Balance', 'mycred' ) ) ); ?></label>
519
+ <select name="<?php echo esc_attr( $this->field_name( 'balance_location' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'balance_location' ) ); ?>" class="form-control">
520
  <?php
521
 
522
  foreach ( $balance_locations as $location => $description ) {
523
+ echo '<option value="' . esc_attr( $location ) . '"';
524
  if ( isset( $settings['balance_location'] ) && $settings['balance_location'] == $location ) echo ' selected="selected"';
525
+ echo '>' . esc_html( $description ) . '</option>';
526
  }
527
 
528
  ?>
530
  </div>
531
  <div class="form-group">
532
  <div class="checkbox">
533
+ <label for="<?php echo esc_attr( $this->field_id( array( 'visibility' => 'balance' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'visibility' => 'balance' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'visibility' => 'balance' ) ) ); ?>" <?php checked( $settings['visibility']['balance'], 1 ); ?> value="1" /> <?php echo esc_html( $this->core->template_tags_general( __( 'Members and visitors can view other members %_singular% balance.', 'mycred' ) ) ); ?></label>
534
  </div>
535
  </div>
536
  </div>
537
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
538
  <div class="form-group">
539
+ <label for="<?php echo esc_attr( $this->field_id( 'balance_template' ) ); ?>"><?php esc_html_e( 'Template', 'mycred' ); ?></label>
540
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'balance_template' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'balance_template' ) ); ?>" value="<?php echo esc_attr( $settings['balance_template'] ); ?>" class="form-control" />
541
+ <p><span class="description"><?php echo wp_kses_post( $this->core->available_template_tags( array( 'general', 'balance' ) ) ); ?></span></p>
542
  </div>
543
  </div>
544
  </div>
546
  <div class="row">
547
  <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
548
  <div class="form-group">
549
+ <label for="<?php echo esc_attr( $this->field_id( 'history_location' ) ); ?>"><?php echo esc_html( $this->core->template_tags_general( __( '%plural% History', 'mycred' ) ) ); ?></label>
550
+ <select name="<?php echo esc_attr( $this->field_name( 'history_location' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'history_location' ) ); ?>" class="form-control">
551
  <?php
552
 
553
  foreach ( $history_locations as $location => $description ) {
554
+ echo '<option value="' . esc_attr( $location ) . '"';
555
  if ( isset( $settings['history_location'] ) && $settings['history_location'] == $location ) echo ' selected="selected"';
556
+ echo '>' . esc_html( $description ) . '</option>';
557
  }
558
 
559
  ?>
560
  </select>
561
  </div>
562
  <div class="form-group">
563
+ <label for="<?php echo esc_attr( $this->field_id( array( 'visibility' => 'history' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'visibility' => 'history' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'visibility' => 'history' ) ) ); ?>" <?php checked( $settings['visibility']['history'], 1 ); ?> value="1" /> <?php echo esc_html( $this->core->template_tags_general( __( 'Members can view each others %_plural% history.', 'mycred' ) ) ); ?></label>
564
  </div>
565
  </div>
566
  <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
567
  <div class="form-group">
568
+ <label for="<?php echo esc_attr( $this->field_id( array( 'history_menu_title' => 'me' ) ) ); ?>"><?php esc_html_e( 'Menu Title', 'mycred' ); ?></label>
569
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'history_menu_title' => 'me' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'history_menu_title' => 'me' ) ) ); ?>" value="<?php echo esc_attr( $settings['history_menu_title']['me'] ); ?>" class="form-control" />
570
  <p><span class="description"><?php esc_html_e( 'Title shown to me', 'mycred' ); ?></span></p>
571
  </div>
572
  </div>
573
  <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
574
  <div class="form-group">
575
  <label>&nbsp;</label>
576
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'history_menu_title' => 'others' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'history_menu_title' => 'others' ) ) ); ?>" value="<?php echo esc_attr( $settings['history_menu_title']['others'] ); ?>" class="form-control" />
577
  <p><span class="description"><?php esc_html_e( 'Title shown to others. Use %s to show the first name.', 'mycred' ); ?></span></p>
578
  </div>
579
  </div>
582
  <div class="row">
583
  <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
584
  <div class="form-group">
585
+ <label for="<?php echo esc_attr( $this->field_id( 'history_menu_pos' ) ); ?>"><?php esc_html_e( 'Menu Position', 'mycred' ); ?></label>
586
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'history_menu_pos' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'history_menu_pos' ) ); ?>" value="<?php echo esc_attr( $settings['history_menu_pos'] ); ?>" class="form-control" />
587
+ <p><span class="description"><?php printf( '%s %s', esc_html__( 'Current menu positions:', 'mycred' ) , esc_html( implode( ', ', $bp_nav_positions ) ) ); ?></span></p>
588
  </div>
589
  </div>
590
  <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
591
  <div class="form-group">
592
+ <label for="<?php echo esc_attr( $this->field_id( 'history_url' ) ); ?>"><?php esc_html_e( 'History URL slug', 'mycred' ); ?></label>
593
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'history_url' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'history_url' ) ); ?>" value="<?php echo esc_attr( $settings['history_url'] ); ?>" class="form-control" />
594
  <p><span class="description"><?php esc_html_e( 'The history page slug. Must be URL friendly.', 'mycred' ); ?></span></p>
595
  </div>
596
  </div>
597
  <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
598
  <div class="form-group">
599
+ <label for="<?php echo esc_attr( $this->field_id( 'history_num' ) ); ?>"><?php esc_html_e( 'Number of history entries to show', 'mycred' ); ?></label>
600
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'history_num' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'history_num' ) ); ?>" value="<?php echo esc_attr( $settings['history_num'] ); ?>" class="form-control" />
601
  </div>
602
  </div>
603
  </div>
modules/mycred-module-caching.php CHANGED
@@ -199,7 +199,7 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
199
 
200
  check_ajax_referer( 'mycred-clear-cache', 'token' );
201
 
202
- $cache = sanitize_key( $_POST['cache'] );
203
 
204
  $this->clear_cache( $cache );
205
 
@@ -259,16 +259,16 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
259
  <div class="form-group">
260
  <label><?php esc_html_e( 'History', 'mycred' ); ?></label>
261
  <div class="radio">
262
- <label for="<?php echo $this->field_id( 'caching-off' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'history' ) ); ?>" id="<?php echo $this->field_id( 'caching-off' ); ?>"<?php checked( $this->caching['history'], 'off' ); ?> value="off" /> <?php esc_html_e( 'No caching', 'mycred' ); ?></label>
263
  </div>
264
  <div class="radio">
265
- <label for="<?php echo $this->field_id( 'caching-event' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'history' ) ); ?>" id="<?php echo $this->field_id( 'caching-event' ); ?>"<?php checked( $this->caching['history'], 'event' ); ?> value="event" /> <?php esc_html_e( 'Clear cache each time a users balance changes', 'mycred' ); ?></label>
266
  </div>
267
  <div class="radio">
268
- <label for="<?php echo $this->field_id( 'caching-day' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'history' ) ); ?>" id="<?php echo $this->field_id( 'caching-day' ); ?>"<?php checked( $this->caching['history'], 'day' ); ?> value="day" /> <?php esc_html_e( 'Clear cache once a day', 'mycred' ); ?></label>
269
  </div>
270
  <div class="radio">
271
- <label for="<?php echo $this->field_id( 'caching-manual' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'history' ) ); ?>" id="<?php echo $this->field_id( 'caching-manual' ); ?>"<?php checked( $this->caching['history'], 'manual' ); ?> value="manual" /> <?php esc_html_e( 'Clear cache manually', 'mycred' ); ?></label>
272
  </div>
273
  <hr />
274
  <button type="button" data-cache="history" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button clear-type-cache-button"<?php if ( $this->caching['history'] == 'off' ) echo ' disabled="disabled"'; ?> id=""><?php esc_html_e( 'Clear Cache Now', 'mycred' ); ?></button>
@@ -278,16 +278,16 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
278
  <div class="form-group">
279
  <label><?php esc_html_e( 'Leaderboards', 'mycred' ); ?></label>
280
  <div class="radio">
281
- <label for="<?php echo $this->field_id( 'leaderboard-caching-off' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'leaderboards' ) ); ?>" id="<?php echo $this->field_id( 'leaderboard-caching-off' ); ?>"<?php checked( $this->caching['leaderboards'], 'off' ); ?> value="off" /> <?php esc_html_e( 'No caching', 'mycred' ); ?></label>
282
  </div>
283
  <div class="radio">
284
- <label for="<?php echo $this->field_id( 'leaderboard-caching-event' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'leaderboards' ) ); ?>" id="<?php echo $this->field_id( 'leaderboard-caching-event' ); ?>"<?php checked( $this->caching['leaderboards'], 'event' ); ?> value="event" /> <?php esc_html_e( 'Clear cache each time a users balance changes', 'mycred' ); ?></label>
285
  </div>
286
  <div class="radio">
287
- <label for="<?php echo $this->field_id( 'leaderboard-caching-day' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'leaderboards' ) ); ?>" id="<?php echo $this->field_id( 'leaderboard-caching-day' ); ?>"<?php checked( $this->caching['leaderboards'], 'day' ); ?> value="day" /> <?php esc_html_e( 'Clear cache once a day', 'mycred' ); ?></label>
288
  </div>
289
  <div class="radio">
290
- <label for="<?php echo $this->field_id( 'leaderboard-caching-manual' ); ?>"><input type="radio" name="<?php echo $this->field_name( array( 'caching', 'leaderboards' ) ); ?>" id="<?php echo $this->field_id( 'leaderboard-caching-manual' ); ?>"<?php checked( $this->caching['leaderboards'], 'manual' ); ?> value="manual" /> <?php esc_html_e( 'Clear cache manually', 'mycred' ); ?></label>
291
  </div>
292
  <hr />
293
  <button type="button" data-cache="leaderboards" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button clear-type-cache-button"<?php if ( $this->caching['leaderboards'] == 'off' ) echo ' disabled="disabled"'; ?> id=""><?php esc_html_e( 'Clear Cache Now', 'mycred' ); ?></button>
@@ -295,12 +295,12 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
295
  </div>
296
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
297
  <div class="form-group">
298
- <label for="<?php echo $this->field_id( 'auto-delete' ); ?>"><?php esc_html_e( 'Auto Delete Log Entries', 'mycred' ); ?></label>
299
  <?php if ( ! MYCRED_ENABLE_LOGGING ) : ?>
300
  <p><span class="description"><?php esc_html_e( 'Log disabled', 'mycred' ); ?></span></p>
301
  <?php else : ?>
302
- <input type="text" name="<?php echo $this->field_name( array( 'caching', 'autodelete' ) ); ?>" id="<?php echo $this->field_id( 'auto-delete' ); ?>" value="<?php echo esc_attr( $this->caching['autodelete'] ); ?>" placeholder="days" class="form-control" />
303
- <p><span class="description"><?php printf( _x( "Option to automatically delete log entries after certain number of days. Please read the %s before using this feature as it's use has consequences! Use zero to disable.", 'documentation', 'mycred' ), sprintf( '<a href="http://codex.mycred.me/chapter-i/caching/" target="_blank">%s</a>', __( 'documentation', 'mycred' ) ) ); ?></span></p>
304
  <?php endif; ?>
305
  </div>
306
  </div>
@@ -309,12 +309,12 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
309
  <div class="row">
310
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
311
  <div class="form-group">
312
- <label for="<?php echo $this->field_id( 'auto-delete' ); ?>"><?php esc_html_e( 'Auto Delete Log Entries', 'mycred' ); ?></label>
313
  <?php if ( ! MYCRED_ENABLE_LOGGING ) : ?>
314
  <p><span class="description"><?php esc_html_e( 'Log disabled', 'mycred' ); ?></span></p>
315
  <?php else : ?>
316
- <input type="text" name="<?php echo $this->field_name( array( 'caching', 'autodelete' ) ); ?>" id="<?php echo $this->field_id( 'auto-delete' ); ?>" value="<?php echo esc_attr( $this->caching['autodelete'] ); ?>" placeholder="days" class="form-control" />
317
- <p><span class="description"><?php printf( _x( "Option to automatically delete log entries after certain number of days. Please read the %s before using this feature as it's use has consequences! Use zero to disable.", 'documentation', 'mycred' ), sprintf( '<a href="http://codex.mycred.me/chapter-i/caching/" target="_blank">%s</a>', __( 'documentation', 'mycred' ) ) ); ?></span></p>
318
  <?php endif; ?>
319
  </div>
320
  </div>
199
 
200
  check_ajax_referer( 'mycred-clear-cache', 'token' );
201
 
202
+ $cache = isset( $_POST['cache'] ) ? sanitize_key( $_POST['cache'] ) : '';
203
 
204
  $this->clear_cache( $cache );
205
 
259
  <div class="form-group">
260
  <label><?php esc_html_e( 'History', 'mycred' ); ?></label>
261
  <div class="radio">
262
+ <label for="<?php echo esc_attr( $this->field_id( 'caching-off' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'history' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'caching-off' ) ); ?>"<?php checked( $this->caching['history'], 'off' ); ?> value="off" /> <?php esc_html_e( 'No caching', 'mycred' ); ?></label>
263
  </div>
264
  <div class="radio">
265
+ <label for="<?php echo esc_attr( $this->field_id( 'caching-event' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'history' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'caching-event' ) ); ?>"<?php checked( $this->caching['history'], 'event' ); ?> value="event" /> <?php esc_html_e( 'Clear cache each time a users balance changes', 'mycred' ); ?></label>
266
  </div>
267
  <div class="radio">
268
+ <label for="<?php echo esc_attr( $this->field_id( 'caching-day' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'history' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'caching-day' ) ); ?>"<?php checked( $this->caching['history'], 'day' ); ?> value="day" /> <?php esc_html_e( 'Clear cache once a day', 'mycred' ); ?></label>
269
  </div>
270
  <div class="radio">
271
+ <label for="<?php echo esc_attr( $this->field_id( 'caching-manual' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'history' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'caching-manual' ) ); ?>"<?php checked( $this->caching['history'], 'manual' ); ?> value="manual" /> <?php esc_html_e( 'Clear cache manually', 'mycred' ); ?></label>
272
  </div>
273
  <hr />
274
  <button type="button" data-cache="history" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button clear-type-cache-button"<?php if ( $this->caching['history'] == 'off' ) echo ' disabled="disabled"'; ?> id=""><?php esc_html_e( 'Clear Cache Now', 'mycred' ); ?></button>
278
  <div class="form-group">
279
  <label><?php esc_html_e( 'Leaderboards', 'mycred' ); ?></label>
280
  <div class="radio">
281
+ <label for="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-off' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'leaderboards' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-off' ) ); ?>"<?php checked( $this->caching['leaderboards'], 'off' ); ?> value="off" /> <?php esc_html_e( 'No caching', 'mycred' ); ?></label>
282
  </div>
283
  <div class="radio">
284
+ <label for="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-event' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'leaderboards' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-event' ) ); ?>"<?php checked( $this->caching['leaderboards'], 'event' ); ?> value="event" /> <?php esc_html_e( 'Clear cache each time a users balance changes', 'mycred' ); ?></label>
285
  </div>
286
  <div class="radio">
287
+ <label for="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-day' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'leaderboards' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-day' ) ); ?>"<?php checked( $this->caching['leaderboards'], 'day' ); ?> value="day" /> <?php esc_html_e( 'Clear cache once a day', 'mycred' ); ?></label>
288
  </div>
289
  <div class="radio">
290
+ <label for="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-manual' ) ); ?>"><input type="radio" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'leaderboards' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'leaderboard-caching-manual' ) ); ?>"<?php checked( $this->caching['leaderboards'], 'manual' ); ?> value="manual" /> <?php esc_html_e( 'Clear cache manually', 'mycred' ); ?></label>
291
  </div>
292
  <hr />
293
  <button type="button" data-cache="leaderboards" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button clear-type-cache-button"<?php if ( $this->caching['leaderboards'] == 'off' ) echo ' disabled="disabled"'; ?> id=""><?php esc_html_e( 'Clear Cache Now', 'mycred' ); ?></button>
295
  </div>
296
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
297
  <div class="form-group">
298
+ <label for="<?php echo esc_attr( $this->field_id( 'auto-delete' ) ); ?>"><?php esc_html_e( 'Auto Delete Log Entries', 'mycred' ); ?></label>
299
  <?php if ( ! MYCRED_ENABLE_LOGGING ) : ?>
300
  <p><span class="description"><?php esc_html_e( 'Log disabled', 'mycred' ); ?></span></p>
301
  <?php else : ?>
302
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'autodelete' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'auto-delete' ) ); ?>" value="<?php echo esc_attr( $this->caching['autodelete'] ); ?>" placeholder="days" class="form-control" />
303
+ <p><span class="description"><?php printf( esc_html__( "Option to automatically delete log entries after certain number of days. Please read the %s before using this feature as it's use has consequences! Use zero to disable.", 'documentation', 'mycred' ), sprintf( '<a href="http://codex.mycred.me/chapter-i/caching/" target="_blank">%s</a>', esc_html__( 'documentation', 'mycred' ) ) ); ?></span></p>
304
  <?php endif; ?>
305
  </div>
306
  </div>
309
  <div class="row">
310
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
311
  <div class="form-group">
312
+ <label for="<?php echo esc_attr( $this->field_id( 'auto-delete' ) ); ?>"><?php esc_html_e( 'Auto Delete Log Entries', 'mycred' ); ?></label>
313
  <?php if ( ! MYCRED_ENABLE_LOGGING ) : ?>
314
  <p><span class="description"><?php esc_html_e( 'Log disabled', 'mycred' ); ?></span></p>
315
  <?php else : ?>
316
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'caching', 'autodelete' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'auto-delete' ) ); ?>" value="<?php echo esc_attr( $this->caching['autodelete'] ); ?>" placeholder="days" class="form-control" />
317
+ <p><span class="description"><?php printf( esc_html__( "Option to automatically delete log entries after certain number of days. Please read the %s before using this feature as it's use has consequences! Use zero to disable.", 'documentation', 'mycred' ), sprintf( '<a href="http://codex.mycred.me/chapter-i/caching/" target="_blank">%s</a>', esc_html__( 'documentation', 'mycred' ) ) ); ?></span></p>
318
  <?php endif; ?>
319
  </div>
320
  </div>
modules/mycred-module-export.php CHANGED
@@ -140,7 +140,7 @@ if ( ! class_exists( 'myCRED_Export_Module' ) ) :
140
  if ( mycred_is_valid_export_url() ) {
141
 
142
  $args = array();
143
- $export_set = sanitize_key( $_GET['set'] );
144
 
145
  if ( $this->export['front_format'] === 'raw' || ( $this->export['front_format'] === 'both' && isset( $_GET['raw'] ) && $_GET['raw'] == 1 ) )
146
  $args['raw'] = true;
@@ -174,7 +174,7 @@ if ( ! class_exists( 'myCRED_Export_Module' ) ) :
174
  do_action( 'mycred_do_admin_export', $point_type, $this );
175
 
176
  // Bulk action - export selected log entries
177
- if ( isset( $_GET['action'] ) && substr( $_GET['action'], 0, 6 ) == 'export' && isset( $_GET['entry'] ) ) {
178
 
179
  $args = array();
180
 
@@ -196,7 +196,7 @@ if ( ! class_exists( 'myCRED_Export_Module' ) ) :
196
  // Use of an export url
197
  if ( mycred_is_valid_export_url( true ) ) {
198
 
199
- $export_set = sanitize_key( $_GET['set'] );
200
  $export_options = mycred_get_log_exports();
201
  $search_args = mycred_get_search_args();
202
 
@@ -305,7 +305,7 @@ if ( ! class_exists( 'myCRED_Export_Module' ) ) :
305
  if ( $id === 'search' && ! empty( $search_args ) )
306
  $url = add_query_arg( $search_args, $url );
307
 
308
- echo '<a href="' . esc_url( $url ) . '" class="' . $data['class'] . '">' . $data['label'] . '</a> ';
309
 
310
  }
311
 
@@ -339,7 +339,7 @@ jQuery(function($) {
339
 
340
  ?>
341
  <div style="display:none;" class="clear" id="export-log-history">
342
- <strong><?php esc_html_e( 'Export', 'mycred' ); ?>:</strong>
343
  <div>
344
  <?php
345
 
@@ -352,7 +352,7 @@ jQuery(function($) {
352
  $url = mycred_get_export_url( $id, $raw );
353
  if ( $url === false ) continue;
354
 
355
- echo '<a href="' . esc_url( $url ) . '" class="' . $data['class'] . '">' . $data['my_label'] . '</a> ';
356
 
357
  }
358
 
@@ -397,9 +397,9 @@ jQuery(function($) {
397
  <?php
398
 
399
  foreach ( $enabled_disabled as $value => $label ) {
400
- echo '<option value="' . $value . '"';
401
  if ( $this->export['front'] == $value ) echo ' selected="selected"';
402
- echo '>' . $label . '</option>';
403
  }
404
 
405
  ?>
@@ -413,9 +413,9 @@ jQuery(function($) {
413
  <?php
414
 
415
  foreach ( $export_formats as $value => $label ) {
416
- echo '<option value="' . $value . '"';
417
  if ( $this->export['front_format'] == $value ) echo ' selected="selected"';
418
- echo '>' . $label . '</option>';
419
  }
420
 
421
  ?>
@@ -426,14 +426,14 @@ jQuery(function($) {
426
  <div class="form-group">
427
  <label for="mycred-export-prefs-front-end-name"><?php esc_html_e( 'File Name', 'mycred' ); ?></label>
428
  <input type="text" class="form-control" name="mycred_pref_core[export][front_name]" id="mycred-export-prefs-front-end-name" value="<?php echo esc_attr( $this->export['front_name'] ); ?>" />
429
- <p><span class="description"><?php echo '<code>%point_type%</code> = ' . __( 'Point Type', 'mycred' ) . ', <code>%username%</code> = ' . __( 'Username', 'mycred' ); ?></span></p>
430
  </div>
431
  </div>
432
  </div>
433
 
434
  <div class="row">
435
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
436
- <p><span class="description"><?php echo str_replace( 'mycred_history', '<a href="http://codex.mycred.me/shortcodes/mycred_history/" target="_blank">mycred_history</a>', __( 'If enabled, users will only be able to export their own log entries! Export tools becomes available wherever you are using the mycred_history shortcode or in the users profile.', 'mycred' ) ); ?></span></p>
437
  </div>
438
  </div>
439
 
@@ -445,9 +445,9 @@ jQuery(function($) {
445
  <?php
446
 
447
  foreach ( $enabled_disabled as $value => $label ) {
448
- echo '<option value="' . $value . '"';
449
  if ( $this->export['admin'] == $value ) echo ' selected="selected"';
450
- echo '>' . $label . '</option>';
451
  }
452
 
453
  ?>
@@ -461,9 +461,9 @@ jQuery(function($) {
461
  <?php
462
 
463
  foreach ( $export_formats as $value => $label ) {
464
- echo '<option value="' . $value . '"';
465
  if ( $this->export['admin_format'] == $value ) echo ' selected="selected"';
466
- echo '>' . $label . '</option>';
467
  }
468
 
469
  ?>
@@ -474,7 +474,7 @@ jQuery(function($) {
474
  <div class="form-group">
475
  <label for="mycred-export-prefs-admin-end-name"><?php esc_html_e( 'File Name', 'mycred' ); ?></label>
476
  <input type="text" class="form-control" name="mycred_pref_core[export][admin_name]" id="mycred-export-prefs-admin-end-name" value="<?php echo esc_attr( $this->export['admin_name'] ); ?>" />
477
- <p><span class="description"><?php echo '<code>%point_type%</code> = ' . __( 'Point Type', 'mycred' ) . ', <code>%username%</code> = ' . __( 'Username', 'mycred' ); ?></span></p>
478
  </div>
479
  </div>
480
  </div>
140
  if ( mycred_is_valid_export_url() ) {
141
 
142
  $args = array();
143
+ $export_set = isset( $_GET['set'] ) ? sanitize_key( $_GET['set'] ) : '';
144
 
145
  if ( $this->export['front_format'] === 'raw' || ( $this->export['front_format'] === 'both' && isset( $_GET['raw'] ) && $_GET['raw'] == 1 ) )
146
  $args['raw'] = true;
174
  do_action( 'mycred_do_admin_export', $point_type, $this );
175
 
176
  // Bulk action - export selected log entries
177
+ if ( isset( $_GET['action'] ) && substr( sanitize_key( $_GET['action'] ), 0, 6 ) == 'export' && isset( $_GET['entry'] ) ) {
178
 
179
  $args = array();
180
 
196
  // Use of an export url
197
  if ( mycred_is_valid_export_url( true ) ) {
198
 
199
+ $export_set = isset( $_GET['set'] ) ? sanitize_key( $_GET['set'] ) : '';
200
  $export_options = mycred_get_log_exports();
201
  $search_args = mycred_get_search_args();
202
 
305
  if ( $id === 'search' && ! empty( $search_args ) )
306
  $url = add_query_arg( $search_args, $url );
307
 
308
+ echo '<a href="' . esc_url( $url ) . '" class="' . esc_attr( $data['class'] ) . '">' . esc_html( $data['label'] ) . '</a> ';
309
 
310
  }
311
 
339
 
340
  ?>
341
  <div style="display:none;" class="clear" id="export-log-history">
342
+ <strong><?php esc_html_e( 'Export123', 'mycred' ); ?>:</strong>
343
  <div>
344
  <?php
345
 
352
  $url = mycred_get_export_url( $id, $raw );
353
  if ( $url === false ) continue;
354
 
355
+ echo '<a href="' . esc_url( $url ) . '" class="' . esc_attr( $data['class'] ) . '">' . esc_html( $data['my_label'] ) . '</a> ';
356
 
357
  }
358
 
397
  <?php
398
 
399
  foreach ( $enabled_disabled as $value => $label ) {
400
+ echo '<option value="' . esc_attr( $value ). '"';
401
  if ( $this->export['front'] == $value ) echo ' selected="selected"';
402
+ echo '>' . esc_html( $label ). '</option>';
403
  }
404
 
405
  ?>
413
  <?php
414
 
415
  foreach ( $export_formats as $value => $label ) {
416
+ echo '<option value="' . esc_attr( $value ) . '"';
417
  if ( $this->export['front_format'] == $value ) echo ' selected="selected"';
418
+ echo '>' . esc_html( $label ) . '</option>';
419
  }
420
 
421
  ?>
426
  <div class="form-group">
427
  <label for="mycred-export-prefs-front-end-name"><?php esc_html_e( 'File Name', 'mycred' ); ?></label>
428
  <input type="text" class="form-control" name="mycred_pref_core[export][front_name]" id="mycred-export-prefs-front-end-name" value="<?php echo esc_attr( $this->export['front_name'] ); ?>" />
429
+ <p><span class="description"><?php echo '<code>%point_type%</code> = ' . esc_html__( 'Point Type', 'mycred' ) . ', <code>%username%</code> = ' . esc_html__( 'Username', 'mycred' ); ?></span></p>
430
  </div>
431
  </div>
432
  </div>
433
 
434
  <div class="row">
435
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
436
+ <p><span class="description"><?php echo wp_kses_post( str_replace( 'mycred_history', '<a href="http://codex.mycred.me/shortcodes/mycred_history/" target="_blank">mycred_history</a>', esc_html__( 'If enabled, users will only be able to export their own log entries! Export tools becomes available wherever you are using the mycred_history shortcode or in the users profile.', 'mycred' ) ) ); ?></span></p>
437
  </div>
438
  </div>
439
 
445
  <?php
446
 
447
  foreach ( $enabled_disabled as $value => $label ) {
448
+ echo '<option value="' . esc_attr( $value ) . '"';
449
  if ( $this->export['admin'] == $value ) echo ' selected="selected"';
450
+ echo '>' . esc_html( $label ) . '</option>';
451
  }
452
 
453
  ?>
461
  <?php
462
 
463
  foreach ( $export_formats as $value => $label ) {
464
+ echo '<option value="' . esc_attr( $value ) . '"';
465
  if ( $this->export['admin_format'] == $value ) echo ' selected="selected"';
466
+ echo '>' . esc_attr( $label ) . '</option>';
467
  }
468
 
469
  ?>
474
  <div class="form-group">
475
  <label for="mycred-export-prefs-admin-end-name"><?php esc_html_e( 'File Name', 'mycred' ); ?></label>
476
  <input type="text" class="form-control" name="mycred_pref_core[export][admin_name]" id="mycred-export-prefs-admin-end-name" value="<?php echo esc_attr( $this->export['admin_name'] ); ?>" />
477
+ <p><span class="description"><?php echo '<code>%point_type%</code> = ' . esc_html__( 'Point Type', 'mycred' ) . ', <code>%username%</code> = ' . esc_html__( 'Username', 'mycred' ); ?></span></p>
478
  </div>
479
  </div>
480
  </div>
modules/mycred-module-hooks.php CHANGED
@@ -320,11 +320,11 @@ if ( ! class_exists( 'myCRED_Hooks_Module' ) ) :
320
  foreach ( $installed as $key => $data ) {
321
 
322
  ?>
323
- <div id="widget-mycred-hook_<?php echo $key; ?>" class="widget ui-draggable"<?php if ( $this->is_active( $key ) ) echo ' style="display: none;"'; ?>>
324
  <div class="widget-top">
325
  <div class="widget-title-action"></div>
326
  <div class="widget-title ui-draggable-handle">
327
- <h3><?php echo $this->core->template_tags_general( $data['title'] ); ?></h3>
328
  </div>
329
  </div>
330
  <div class="widget-inside mycred-metabox">
@@ -334,22 +334,22 @@ if ( ! class_exists( 'myCRED_Hooks_Module' ) ) :
334
  <?php $this->call( 'preferences', $data['callback'] ); ?>
335
 
336
  </div>
337
- <input type="hidden" name="widget-id" class="widget-id" value="<?php echo $key; ?>" />
338
- <input type="hidden" name="id_base" class="id_base" value="<?php echo $key; ?>" />
339
  <input type="hidden" name="add_new" class="add_new" value="single" />
340
  <div class="widget-control-actions">
341
  <div class="alignleft">
342
  <a class="widget-control-remove" href="#remove"><?php esc_html_e( 'Delete', 'mycred' ); ?></a> | <a class="widget-control-close" href="#close"><?php esc_html_e( 'Close', 'mycred' ); ?></a><?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && array_key_exists( 'documentation', $data ) && ! empty( $data['documentation'] ) ) : ?> | <a class="hook-documentation" href="<?php echo esc_url( $data['documentation'] ); ?>" target="_blank">Hook Documentation</a><?php endif; ?>
343
  </div>
344
  <div class="alignright">
345
- <input type="submit" name="savewidget" id="widget-mycred-hook-<?php echo $key; ?>-__i__-savewidget" class="button button-primary widget-control-save right" value="<?php esc_attr_e( 'Save', 'mycred' ); ?>" />
346
  <span class="spinner"></span>
347
  </div>
348
  <br class="clear" />
349
  </div>
350
  </form>
351
  </div>
352
- <div class="widget-description"><?php echo nl2br( $this->core->template_tags_general( $data['description'] ) ); ?></div>
353
  </div>
354
  <?php
355
 
@@ -438,11 +438,11 @@ jQuery(function($) {
438
  if ( ! $this->is_active( $key ) ) continue;
439
 
440
  ?>
441
- <div id="widget-mycred-hook_<?php echo $key; ?>" class="widget" style="z-index: auto;">
442
  <div class="widget-top">
443
  <div class="widget-title-action"></div>
444
  <div class="widget-title ui-draggable-handle">
445
- <h3><?php echo $this->core->template_tags_general( $data['title'] ); ?></h3>
446
  </div>
447
  </div>
448
  <div class="widget-inside mycred-metabox">
@@ -452,22 +452,22 @@ jQuery(function($) {
452
  <?php $this->call( 'preferences', $data['callback'] ); ?>
453
 
454
  </div>
455
- <input type="hidden" name="widget-id" class="widget-id" value="<?php echo $key; ?>" />
456
- <input type="hidden" name="id_base" class="id_base" value="<?php echo $key; ?>" />
457
  <input type="hidden" name="add_new" class="add_new" value="single" />
458
  <div class="widget-control-actions">
459
  <div class="alignleft">
460
  <a class="widget-control-remove" href="#remove"><?php esc_html_e( 'Delete', 'mycred' ); ?></a> | <a class="widget-control-close" href="#close"><?php esc_html_e( 'Close', 'mycred' ); ?></a><?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && array_key_exists( 'documentation', $data ) && ! empty( $data['documentation'] ) ) : ?> | <a class="hook-documentation" href="<?php echo esc_url( $data['documentation'] ); ?>" target="_blank">Hook Documentation</a><?php endif; ?>
461
  </div>
462
  <div class="alignright">
463
- <input type="submit" name="savewidget" id="widget-mycred-hook-<?php echo $key; ?>-__i__-savewidget" class="button button-primary widget-control-save right" value="<?php esc_attr_e( 'Save', 'mycred' ); ?>" />
464
  <span class="spinner"></span>
465
  </div>
466
  <br class="clear" />
467
  </div>
468
  </form>
469
  </div>
470
- <div class="widget-description"><?php echo nl2br( $this->core->template_tags_general( $data['description'] ) ); ?></div>
471
  </div>
472
  <?php
473
 
@@ -508,8 +508,8 @@ jQuery(function($) {
508
 
509
  if ( ! isset( $_POST['sidebars'] ) ) die;
510
 
511
- $ctype = sanitize_key( $_POST['ctype'] );
512
- $option_id = sanitize_key( $_POST['option_id'] );
513
  if ( $ctype !== $this->mycred_type ) return;
514
 
515
  $installed = $this->get();
@@ -583,10 +583,10 @@ jQuery(function($) {
583
 
584
  check_ajax_referer( 'manage-mycred-hooks', 'savewidgets' );
585
 
586
- $sidebar = sanitize_text_field( $_POST['sidebar'] );
587
- $hook_id = sanitize_key( $_POST['id_base'] );
588
- $ctype = sanitize_key( $_POST['ctype'] );
589
- $option_id = sanitize_key( $_POST['option_id'] );
590
  $hook_prefs = false;
591
 
592
  if ( $ctype !== $this->mycred_type ) return;
320
  foreach ( $installed as $key => $data ) {
321
 
322
  ?>
323
+ <div id="widget-mycred-hook_<?php echo esc_attr( $key ); ?>" class="widget ui-draggable"<?php if ( $this->is_active( $key ) ) echo ' style="display: none;"'; ?>>
324
  <div class="widget-top">
325
  <div class="widget-title-action"></div>
326
  <div class="widget-title ui-draggable-handle">
327
+ <h3><?php echo esc_html( $this->core->template_tags_general( $data['title'] ) ); ?></h3>
328
  </div>
329
  </div>
330
  <div class="widget-inside mycred-metabox">
334
  <?php $this->call( 'preferences', $data['callback'] ); ?>
335
 
336
  </div>
337
+ <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr( $key ); ?>" />
338
+ <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $key ); ?>" />
339
  <input type="hidden" name="add_new" class="add_new" value="single" />
340
  <div class="widget-control-actions">
341
  <div class="alignleft">
342
  <a class="widget-control-remove" href="#remove"><?php esc_html_e( 'Delete', 'mycred' ); ?></a> | <a class="widget-control-close" href="#close"><?php esc_html_e( 'Close', 'mycred' ); ?></a><?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && array_key_exists( 'documentation', $data ) && ! empty( $data['documentation'] ) ) : ?> | <a class="hook-documentation" href="<?php echo esc_url( $data['documentation'] ); ?>" target="_blank">Hook Documentation</a><?php endif; ?>
343
  </div>
344
  <div class="alignright">
345
+ <input type="submit" name="savewidget" id="widget-mycred-hook-<?php echo esc_attr( $key ); ?>-__i__-savewidget" class="button button-primary widget-control-save right" value="<?php esc_attr_e( 'Save', 'mycred' ); ?>" />
346
  <span class="spinner"></span>
347
  </div>
348
  <br class="clear" />
349
  </div>
350
  </form>
351
  </div>
352
+ <div class="widget-description"><?php echo wp_kses_post( nl2br( $this->core->template_tags_general( $data['description'] ) ) ); ?></div>
353
  </div>
354
  <?php
355
 
438
  if ( ! $this->is_active( $key ) ) continue;
439
 
440
  ?>
441
+ <div id="widget-mycred-hook_<?php echo esc_attr( $key ); ?>" class="widget" style="z-index: auto;">
442
  <div class="widget-top">
443
  <div class="widget-title-action"></div>
444
  <div class="widget-title ui-draggable-handle">
445
+ <h3><?php echo esc_html( $this->core->template_tags_general( $data['title'] ) ); ?></h3>
446
  </div>
447
  </div>
448
  <div class="widget-inside mycred-metabox">
452
  <?php $this->call( 'preferences', $data['callback'] ); ?>
453
 
454
  </div>
455
+ <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr( $key ); ?>" />
456
+ <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $key ); ?>" />
457
  <input type="hidden" name="add_new" class="add_new" value="single" />
458
  <div class="widget-control-actions">
459
  <div class="alignleft">
460
  <a class="widget-control-remove" href="#remove"><?php esc_html_e( 'Delete', 'mycred' ); ?></a> | <a class="widget-control-close" href="#close"><?php esc_html_e( 'Close', 'mycred' ); ?></a><?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' && array_key_exists( 'documentation', $data ) && ! empty( $data['documentation'] ) ) : ?> | <a class="hook-documentation" href="<?php echo esc_url( $data['documentation'] ); ?>" target="_blank">Hook Documentation</a><?php endif; ?>
461
  </div>
462
  <div class="alignright">
463
+ <input type="submit" name="savewidget" id="widget-mycred-hook-<?php echo esc_attr( $key ); ?>-__i__-savewidget" class="button button-primary widget-control-save right" value="<?php esc_attr_e( 'Save', 'mycred' ); ?>" />
464
  <span class="spinner"></span>
465
  </div>
466
  <br class="clear" />
467
  </div>
468
  </form>
469
  </div>
470
+ <div class="widget-description"><?php echo wp_kses_post( nl2br( $this->core->template_tags_general( $data['description'] ) ) ); ?></div>
471
  </div>
472
  <?php
473
 
508
 
509
  if ( ! isset( $_POST['sidebars'] ) ) die;
510
 
511
+ $ctype = isset( $_POST['ctype'] ) ? sanitize_key( $_POST['ctype'] ) : '';
512
+ $option_id = isset( $_POST['option_id'] ) ? sanitize_key( $_POST['option_id'] ) : '';
513
  if ( $ctype !== $this->mycred_type ) return;
514
 
515
  $installed = $this->get();
583
 
584
  check_ajax_referer( 'manage-mycred-hooks', 'savewidgets' );
585
 
586
+ $sidebar = isset( $_POST['sidebar'] ) ? sanitize_text_field( wp_unslash( $_POST['sidebar'] ) ) : '';
587
+ $hook_id = isset( $_POST['id_base'] ) ? sanitize_key( $_POST['id_base'] ) : '';
588
+ $ctype = isset( $_POST['ctype'] ) ? sanitize_key( $_POST['ctype'] ) : '';
589
+ $option_id = isset( $_POST['option_id'] ) ? sanitize_key( $_POST['option_id'] ) : '';
590
  $hook_prefs = false;
591
 
592
  if ( $ctype !== $this->mycred_type ) return;
modules/mycred-module-log.php CHANGED
@@ -226,11 +226,11 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
226
  if ( ! $this->core->user_is_point_admin() )
227
  wp_send_json_error( 'Access denied' );
228
 
229
- $row_id = absint( $_POST['row'] );
230
  if ( $row_id === 0 )
231
  wp_send_json_error( 'Unknown Row ID' );
232
 
233
- $point_type = sanitize_key( $_POST['ctype'] );
234
  if ( ! mycred_point_type_exists( $point_type ) )
235
  wp_send_json_error( 'Unknown Point Type' );
236
 
@@ -272,18 +272,18 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
272
  wp_send_json_error( array( 'message' => 'Access denied' ) );
273
 
274
  // Make sure we handle our own point type only
275
- $point_type = sanitize_key( $_POST['ctype'] );
276
  if ( ! mycred_point_type_exists( $point_type ) )
277
  wp_send_json_error( array( 'message' => 'Unknown point type' ) );
278
 
279
  if ( $point_type !== $this->mycred_type ) return;
280
 
281
  // We need a row id
282
- $entry_id = absint( $_POST['rowid'] );
283
  if ( $entry_id === 0 )
284
  wp_send_json_error( array( 'message' => 'Invalid Log Entry' ) );
285
 
286
- $screen = sanitize_key( $_POST['screen'] );
287
 
288
  // Parse form submission
289
  parse_str( $_POST['form'], $post );
@@ -396,7 +396,7 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
396
  if ( substr( $screen->id, 0, ( 14 + strlen( MYCRED_SLUG ) ) ) != 'toplevel_page_' . MYCRED_SLUG ) return;
397
 
398
  if ( isset( $_GET['deleted'] ) && isset( $_GET['ctype'] ) && $_GET['ctype'] == $this->mycred_type )
399
- echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( _n( '1 Entry Deleted', '%d Entries Deleted', absint( $_GET['deleted'] ), 'mycred' ), absint( $_GET['deleted'] ) ) . '</p><button type="button" class="notice-dismiss"></button></div>';
400
 
401
  }
402
 
@@ -427,8 +427,8 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
427
  return;
428
 
429
  }
430
-
431
- $settings_key = 'mycred_epp_' . $_GET['page'];
432
 
433
  // Update Entries per page option
434
  if ( isset( $_REQUEST['wp_screen_options']['option'] ) && isset( $_REQUEST['wp_screen_options']['value'] ) ) {
@@ -513,12 +513,12 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
513
  public function screen_options() {
514
 
515
  $this->screen_actions();
516
-
517
  // Prep Per Page
518
  $args = array(
519
  'label' => __( 'Entries', 'mycred' ),
520
  'default' => 10,
521
- 'option' => 'mycred_epp_' . $_GET['page']
522
  );
523
  add_screen_option( 'per_page', $args );
524
 
@@ -585,10 +585,11 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
585
 
586
  // Search Results
587
  if ( isset( $_GET['s'] ) && ! empty( $_GET['s'] ) )
588
- $search_for = ' <span class="subtitle">' . __( 'Search results for', 'mycred' ) . ' "' . sanitize_text_field( $_GET['s'] ) . '"</span>';
589
 
590
  elseif ( isset( $_GET['time'] ) && $_GET['time'] != '' ) {
591
- $time = urldecode( $_GET['time'] );
 
592
  $check = explode( ',', $time );
593
  $search_for = ' <span class="subtitle">' . sprintf( _x( 'Log entries from %s', 'e.g. Log entries from April 12th 2016', 'mycred' ), date( 'F jS Y', $check[0] ) ) . '</span>';
594
  }
@@ -596,7 +597,7 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
596
  else
597
  $search_for = '';
598
 
599
- echo $title . ' ' . $search_for;
600
 
601
  }
602
 
@@ -610,7 +611,9 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
610
  // Security
611
  if ( ! $this->core->user_is_point_editor() ) wp_die( 'Access Denied' );
612
 
613
- $per_page = mycred_get_user_meta( $this->current_user_id, 'mycred_epp_' . $_GET['page'], '', true );
 
 
614
  if ( $per_page == '' ) $per_page = 10;
615
 
616
  $name = mycred_label( true );
@@ -645,7 +648,7 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
645
  // Exchange Shortcode
646
  $extensions = get_loaded_extensions();
647
  if ( ! in_array( 'mcrypt', $extensions ) && ! defined( 'MYCRED_DISABLE_PROTECTION' ) )
648
- echo '<div id="message" class="error below-h2"><p>' . __( 'Warning. The required Mcrypt PHP Library is not installed on this server! Certain hooks and shortcodes will not work correctly!', 'mycred' ) . '</p></div>';
649
 
650
  // Filter by dates
651
  $log->filter_dates( admin_url( 'admin.php?page=' . $this->screen_id ) );
@@ -655,7 +658,7 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
655
  <?php do_action( 'mycred_top_log_page', $this ); ?>
656
 
657
  <form method="get" action="">
658
- <input type="hidden" name="page" value="<?php echo $this->screen_id; ?>" />
659
  <?php
660
 
661
  if ( array_key_exists( 'user', $search_args ) )
@@ -719,8 +722,10 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
719
 
720
  // Security
721
  if ( ! is_user_logged_in() ) wp_die( 'Access Denied' );
722
-
723
- $per_page = mycred_get_user_meta( $this->current_user_id, 'mycred_epp_' . $_GET['page'], '', true );
 
 
724
  if ( $per_page == '' ) $per_page = 10;
725
 
726
  $search_args = mycred_get_search_args();
@@ -746,12 +751,12 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
746
  <div class="wrap" id="myCRED-wrap">
747
  <h1><?php $this->page_title( sprintf( __( 'My %s History', 'mycred' ), $this->core->plural() ) ); ?></h1>
748
 
749
- <?php $log->filter_dates( admin_url( 'users.php?page=' . $_GET['page'] ) ); ?>
750
 
751
  <?php do_action( 'mycred_top_my_log_page', $this ); ?>
752
 
753
  <form method="get" action="" name="mycred-mylog-form" novalidate>
754
- <input type="hidden" name="page" value="<?php echo esc_attr( $_GET['page'] ); ?>" />
755
  <?php
756
 
757
  if ( array_key_exists( 's', $search_args ) )
@@ -973,7 +978,7 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
973
  ?>
974
  <div id="edit-mycred-log-entry" style="display: none;">
975
  <div class="mycred-container">
976
- <?php if ( $name == 'myCRED' ) : ?><img id="mycred-token-sitting" class="hidden-sm hidden-xs" src="<?php echo plugins_url( 'assets/images/token-sitting.png', myCRED_THIS ); ?>" alt="Token looking on" /><?php endif; ?>
977
  <form class="form" method="post" action="" id="mycred-editor-form">
978
  <input type="hidden" name="mycred_manage_log[id]" value="" id="mycred-edit-log-id" />
979
 
@@ -987,7 +992,7 @@ if ( ! class_exists( 'myCRED_Log_Module' ) ) :
987
  <div id="mycred-date-to-show"></div>
988
  </div>
989
  <div class="col-lg-2 col-md-2 col-sm-4 col-xs-12">
990
- <label><?php echo $this->core->plural(); ?></label>
991
  <input type="text" name="mycred_manage_log[creds]" id="mycred-creds-to-show" class="form-control" placeholder="" value="" />
992
  </div>
993
  <div class="col-lg-4 col-md-4 col-sm-8 col-xs-12">
226
  if ( ! $this->core->user_is_point_admin() )
227
  wp_send_json_error( 'Access denied' );
228
 
229
+ $row_id = isset( $_POST['row'] ) ? absint( $_POST['row'] ) : 0;
230
  if ( $row_id === 0 )
231
  wp_send_json_error( 'Unknown Row ID' );
232
 
233
+ $point_type = isset( $_POST['ctype'] ) ? sanitize_key( $_POST['ctype'] ) : '';
234
  if ( ! mycred_point_type_exists( $point_type ) )
235
  wp_send_json_error( 'Unknown Point Type' );
236
 
272
  wp_send_json_error( array( 'message' => 'Access denied' ) );
273
 
274
  // Make sure we handle our own point type only
275
+ $point_type = isset( $_POST['ctype'] ) ? sanitize_key( $_POST['ctype'] ) : '';
276
  if ( ! mycred_point_type_exists( $point_type ) )
277
  wp_send_json_error( array( 'message' => 'Unknown point type' ) );
278
 
279
  if ( $point_type !== $this->mycred_type ) return;
280
 
281
  // We need a row id
282
+ $entry_id = isset( $_POST['rowid'] ) ? absint( $_POST['rowid'] ) : 0;
283
  if ( $entry_id === 0 )
284
  wp_send_json_error( array( 'message' => 'Invalid Log Entry' ) );
285
 
286
+ $screen = isset( $_POST['screen'] ) ? sanitize_key( $_POST['screen'] ) : '';
287
 
288
  // Parse form submission
289
  parse_str( $_POST['form'], $post );
396
  if ( substr( $screen->id, 0, ( 14 + strlen( MYCRED_SLUG ) ) ) != 'toplevel_page_' . MYCRED_SLUG ) return;
397
 
398
  if ( isset( $_GET['deleted'] ) && isset( $_GET['ctype'] ) && $_GET['ctype'] == $this->mycred_type )
399
+ echo '<div id="message" class="updated notice is-dismissible"><p>' . esc_html( sprintf( _n( '1 Entry Deleted', '%d Entries Deleted', absint( $_GET['deleted'] ), 'mycred' ), absint( $_GET['deleted'] ) ) ) . '</p><button type="button" class="notice-dismiss"></button></div>';
400
 
401
  }
402
 
427
  return;
428
 
429
  }
430
+ $get_page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
431
+ $settings_key = 'mycred_epp_' . $get_page;
432
 
433
  // Update Entries per page option
434
  if ( isset( $_REQUEST['wp_screen_options']['option'] ) && isset( $_REQUEST['wp_screen_options']['value'] ) ) {
513
  public function screen_options() {
514
 
515
  $this->screen_actions();
516
+ $get_page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
517
  // Prep Per Page
518
  $args = array(
519
  'label' => __( 'Entries', 'mycred' ),
520
  'default' => 10,
521
+ 'option' => 'mycred_epp_' . $get_page
522
  );
523
  add_screen_option( 'per_page', $args );
524
 
585
 
586
  // Search Results
587
  if ( isset( $_GET['s'] ) && ! empty( $_GET['s'] ) )
588
+ $search_for = ' <span class="subtitle">' . __( 'Search results for', 'mycred' ) . ' "' . sanitize_text_field( wp_unslash( $_GET['s'] ) ) . '"</span>';
589
 
590
  elseif ( isset( $_GET['time'] ) && $_GET['time'] != '' ) {
591
+
592
+ $time = urldecode( sanitize_text_field( wp_unslash( $_GET['time'] ) ) );
593
  $check = explode( ',', $time );
594
  $search_for = ' <span class="subtitle">' . sprintf( _x( 'Log entries from %s', 'e.g. Log entries from April 12th 2016', 'mycred' ), date( 'F jS Y', $check[0] ) ) . '</span>';
595
  }
597
  else
598
  $search_for = '';
599
 
600
+ echo wp_kses_post( $title ) . ' ' . wp_kses_post( $search_for );
601
 
602
  }
603
 
611
  // Security
612
  if ( ! $this->core->user_is_point_editor() ) wp_die( 'Access Denied' );
613
 
614
+ $get_page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
615
+
616
+ $per_page = mycred_get_user_meta( $this->current_user_id, 'mycred_epp_' . $get_page, '', true );
617
  if ( $per_page == '' ) $per_page = 10;
618
 
619
  $name = mycred_label( true );
648
  // Exchange Shortcode
649
  $extensions = get_loaded_extensions();
650
  if ( ! in_array( 'mcrypt', $extensions ) && ! defined( 'MYCRED_DISABLE_PROTECTION' ) )
651
+ echo '<div id="message" class="error below-h2"><p>' . esc_html__( 'Warning. The required Mcrypt PHP Library is not installed on this server! Certain hooks and shortcodes will not work correctly!', 'mycred' ) . '</p></div>';
652
 
653
  // Filter by dates
654
  $log->filter_dates( admin_url( 'admin.php?page=' . $this->screen_id ) );
658
  <?php do_action( 'mycred_top_log_page', $this ); ?>
659
 
660
  <form method="get" action="">
661
+ <input type="hidden" name="page" value="<?php echo esc_attr( $this->screen_id ); ?>" />
662
  <?php
663
 
664
  if ( array_key_exists( 'user', $search_args ) )
722
 
723
  // Security
724
  if ( ! is_user_logged_in() ) wp_die( 'Access Denied' );
725
+
726
+ $get_page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
727
+
728
+ $per_page = mycred_get_user_meta( $this->current_user_id, 'mycred_epp_' . $get_page, '', true );
729
  if ( $per_page == '' ) $per_page = 10;
730
 
731
  $search_args = mycred_get_search_args();
751
  <div class="wrap" id="myCRED-wrap">
752
  <h1><?php $this->page_title( sprintf( __( 'My %s History', 'mycred' ), $this->core->plural() ) ); ?></h1>
753
 
754
+ <?php $log->filter_dates( admin_url( 'users.php?page=' . $get_page ) ); ?>
755
 
756
  <?php do_action( 'mycred_top_my_log_page', $this ); ?>
757
 
758
  <form method="get" action="" name="mycred-mylog-form" novalidate>
759
+ <input type="hidden" name="page" value="<?php echo esc_attr( $get_page ); ?>" />
760
  <?php
761
 
762
  if ( array_key_exists( 's', $search_args ) )
978
  ?>
979
  <div id="edit-mycred-log-entry" style="display: none;">
980
  <div class="mycred-container">
981
+ <?php if ( $name == 'myCRED' ) : ?><img id="mycred-token-sitting" class="hidden-sm hidden-xs" src="<?php echo esc_url( plugins_url( 'assets/images/token-sitting.png', myCRED_THIS ) ); ?>" alt="Token looking on" /><?php endif; ?>
982
  <form class="form" method="post" action="" id="mycred-editor-form">
983
  <input type="hidden" name="mycred_manage_log[id]" value="" id="mycred-edit-log-id" />
984
 
992
  <div id="mycred-date-to-show"></div>
993
  </div>
994
  <div class="col-lg-2 col-md-2 col-sm-4 col-xs-12">
995
+ <label><?php echo esc_html( $this->core->plural() ); ?></label>
996
  <input type="text" name="mycred_manage_log[creds]" id="mycred-creds-to-show" class="form-control" placeholder="" value="" />
997
  </div>
998
  <div class="col-lg-4 col-md-4 col-sm-8 col-xs-12">
modules/mycred-module-management.php CHANGED
@@ -205,8 +205,8 @@ if ( ! class_exists( 'myCRED_Management_Module' ) ) :
205
  // Security
206
  check_ajax_referer( 'mycred-get-ledger', 'token' );
207
 
208
- $user_id = absint( $_POST['userid'] );
209
- $type = sanitize_key( $_POST['type'] );
210
 
211
  if ( ! mycred_point_type_exists( $type ) )
212
  $type = MYCRED_DEFAULT_TYPE_KEY;
205
  // Security
206
  check_ajax_referer( 'mycred-get-ledger', 'token' );
207
 
208
+ $user_id = isset( $_POST['userid'] ) ? absint( $_POST['userid'] ) : 0;
209
+ $type = isset( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
210
 
211
  if ( ! mycred_point_type_exists( $type ) )
212
  $type = MYCRED_DEFAULT_TYPE_KEY;
modules/mycred-module-network.php CHANGED
@@ -138,7 +138,7 @@ if ( ! class_exists( 'myCRED_Network_Module' ) ) :
138
 
139
  if ( mycred_is_site_blocked( $blog_id ) ) {
140
 
141
- echo '<span class="dashicons dashicons-warning"></span><div class="row-actions"><span class="info" style="color: #666">' . __( 'Blocked', 'mycred' ) . '</span></div>';
142
 
143
  }
144
  else {
@@ -146,14 +146,14 @@ if ( ! class_exists( 'myCRED_Network_Module' ) ) :
146
  if ( ! $this->settings['master'] ) {
147
 
148
  if ( get_blog_option( $blog_id, 'mycred_setup_completed', false ) !== false )
149
- echo '<span class="dashicons dashicons-yes" style="color: green;"></span><div class="row-actions"><span class="info" style="color: #666">' . __( 'Installed', 'mycred' ) . '</span></div>';
150
  else
151
- echo '<span class="dashicons dashicons-minus"></span><div class="row-actions"><span class="info" style="color: #666">' . __( 'Not Installed', 'mycred' ) . '</span></div>';
152
 
153
  }
154
  else {
155
 
156
- echo '<span class="dashicons dashicons-yes"' . ( $blog_id == 1 ? ' style="color: green;"' : '' ) . '></span><div class="row-actions"><span class="info" style="color: #666">' . ( $blog_id == 1 ? __( 'Master Template', 'mycred' ) : __( 'Enabled', 'mycred' ) ) . '</span></div>';
157
 
158
  }
159
 
@@ -238,7 +238,7 @@ h4.ui-accordion-header:before { content: "<?php esc_attr_e( 'click to open', 'my
238
 
239
  ?>
240
  <div class="wrap mycred-metabox" id="myCRED-wrap">
241
- <h1><?php printf( __( '%s Network', 'mycred' ), $name ); ?><?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/chapter-i/multisites/" class="page-title-action" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
242
  <?php
243
 
244
  if ( wp_is_large_network() ) {
@@ -254,11 +254,11 @@ h4.ui-accordion-header:before { content: "<?php esc_attr_e( 'click to open', 'my
254
  // Inform user that myCRED has not yet been setup
255
  $setup = get_blog_option( 1, 'mycred_setup_completed', false );
256
  if ( $setup === false )
257
- echo '<div class="error"><p>' . sprintf( __( 'Note! %s has not yet been setup.', 'mycred' ), $name ) . '</p></div>';
258
 
259
  // Settings Updated
260
  if ( isset( $_GET['settings-updated'] ) )
261
- echo '<div class="updated"><p>' . __( 'Settings Updated', 'mycred' ) . '</p></div>';
262
 
263
  ?>
264
  <form method="post" action="<?php echo admin_url( 'options.php' ); ?>" class="form" name="mycred-core-settings-form" novalidate>
138
 
139
  if ( mycred_is_site_blocked( $blog_id ) ) {
140
 
141
+ echo '<span class="dashicons dashicons-warning"></span><div class="row-actions"><span class="info" style="color: #666">' . esc_html__( 'Blocked', 'mycred' ) . '</span></div>';
142
 
143
  }
144
  else {
146
  if ( ! $this->settings['master'] ) {
147
 
148
  if ( get_blog_option( $blog_id, 'mycred_setup_completed', false ) !== false )
149
+ echo '<span class="dashicons dashicons-yes" style="color: green;"></span><div class="row-actions"><span class="info" style="color: #666">' . esc_html__( 'Installed', 'mycred' ) . '</span></div>';
150
  else
151
+ echo '<span class="dashicons dashicons-minus"></span><div class="row-actions"><span class="info" style="color: #666">' . esc_html__( 'Not Installed', 'mycred' ) . '</span></div>';
152
 
153
  }
154
  else {
155
 
156
+ echo '<span class="dashicons dashicons-yes"' . ( $blog_id == 1 ? ' style="color: green;"' : '' ) . '></span><div class="row-actions"><span class="info" style="color: #666">' . ( $blog_id == 1 ? esc_html__( 'Master Template', 'mycred' ) : esc_html__( 'Enabled', 'mycred' ) ) . '</span></div>';
157
 
158
  }
159
 
238
 
239
  ?>
240
  <div class="wrap mycred-metabox" id="myCRED-wrap">
241
+ <h1><?php printf( esc_html__( '%s Network', 'mycred' ), $name ); ?><?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/chapter-i/multisites/" class="page-title-action" target="_blank"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
242
  <?php
243
 
244
  if ( wp_is_large_network() ) {
254
  // Inform user that myCRED has not yet been setup
255
  $setup = get_blog_option( 1, 'mycred_setup_completed', false );
256
  if ( $setup === false )
257
+ echo '<div class="error"><p>' . sprintf( esc_html__( 'Note! %s has not yet been setup.', 'mycred' ), $name ) . '</p></div>';
258
 
259
  // Settings Updated
260
  if ( isset( $_GET['settings-updated'] ) )
261
+ echo '<div class="updated"><p>' . esc_html__( 'Settings Updated', 'mycred' ) . '</p></div>';
262
 
263
  ?>
264
  <form method="post" action="<?php echo admin_url( 'options.php' ); ?>" class="form" name="mycred-core-settings-form" novalidate>
modules/mycred-module-settings.php CHANGED
@@ -165,13 +165,13 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
165
  global $wpdb;
166
 
167
  // Log Template
168
- $log = sanitize_text_field( $_POST['log_temp'] );
169
 
170
  // Type
171
  if ( ! isset( $_POST['type'] ) )
172
  wp_send_json_error( 'Missing point type' );
173
 
174
- $type = sanitize_text_field( $_POST['type'] );
175
 
176
  // Identify users by
177
  switch ( $_POST['identify'] ) {
@@ -505,7 +505,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
505
  if ( $this->is_main_type ) {
506
 
507
  ?>
508
- <div><input type="number" min="0" max="20" id="mycred-adjust-decimal-places" class="form-control" value="<?php echo esc_attr( $this->core->format['decimals'] ); ?>" data-org="<?php echo $this->core->format['decimals']; ?>" size="8" /> <input type="button" style="display:none;" id="mycred-update-log-decimals" class="button button-primary button-large" value="<?php esc_attr_e( 'Update Database', 'mycred' ); ?>" /></div>
509
  <?php
510
 
511
  }
@@ -523,24 +523,24 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
523
  else {
524
 
525
  ?>
526
- <select name="<?php echo $this->field_name( array( 'format' => 'decimals' ) ); ?>" id="<?php echo $this->field_id( array( 'format' => 'decimals' ) ); ?>" class="form-control">
527
  <?php
528
 
529
  echo '<option value="0"';
530
  if ( $this->core->format['decimals'] == 0 ) echo ' selected="selected"';
531
- echo '>' . __( 'No decimals', 'mycred' ) . '</option>';
532
 
533
  for ( $i = 1 ; $i <= $default->format['decimals'] ; $i ++ ) {
534
- echo '<option value="' . $i . '"';
535
  if ( $this->core->format['decimals'] == $i ) echo ' selected="selected"';
536
- echo '>' . $i . ' - 0.' . str_pad( '0', $i, '0' ) . '</option>';
537
  }
538
 
539
  $url = add_query_arg( array( 'page' => MYCRED_SLUG . '-settings', 'open-tab' => 0 ), admin_url( 'admin.php' ) );
540
 
541
  ?>
542
  </select>
543
- <p><span class="description"><?php printf( __( '<a href="%s">Click here</a> to change your default point types setup.', 'mycred' ), esc_url( $url ) ); ?></span></p>
544
  <?php
545
 
546
  }
@@ -596,6 +596,66 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
596
  'multiple' => 'multiple'
597
  );
598
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
  ?>
600
  <div class="wrap mycred-metabox" id="myCRED-wrap">
601
  <h1><?php esc_html_e( 'Settings', 'mycred' ); if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/" target="_blank" class="page-title-action"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
@@ -603,7 +663,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
603
  <?php $this->update_notice(); ?>
604
 
605
  <?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?>
606
- <p id="mycred-thank-you-text"><?php printf( __( 'Thank you for using %s. If you have a moment, please leave a %s.', 'mycred' ), mycred_label(), sprintf( '<a href="https://wordpress.org/support/plugin/mycred/reviews/?rate=5#new-post" target="_blank">%s</a>', __( 'review', 'mycred' ) ) ); ?><span id="mycred-social-media"><?php echo implode( ' ', $social ); ?></span></p>
607
  <?php endif; ?>
608
 
609
  <form method="post" action="options.php" class="form" name="mycred-core-settings-form" novalidate>
@@ -620,14 +680,14 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
620
  <div class="row">
621
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
622
  <div class="form-group">
623
- <label for="<?php echo $this->field_id( array( 'name' => 'singular' ) ); ?>"><?php esc_html_e( 'Singular', 'mycred' ); ?></label>
624
- <input type="text" name="<?php echo $this->field_name( array( 'name' => 'singular' ) ); ?>" id="<?php echo $this->field_id( array( 'name' => 'singular' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->name['singular'] ); ?>" />
625
  </div>
626
  </div>
627
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
628
  <div class="form-group">
629
- <label for="<?php echo $this->field_id( array( 'name' => 'plural' ) ); ?>"><?php esc_html_e( 'Plural', 'mycred' ); ?></label>
630
- <input type="text" name="<?php echo $this->field_name( array( 'name' => 'plural' ) ); ?>" id="<?php echo $this->field_id( array( 'name' => 'plural' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->name['plural'] ); ?>" />
631
  </div>
632
  </div>
633
  </div>
@@ -638,15 +698,15 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
638
  <div class="row">
639
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
640
  <div class="form-group">
641
- <label for="<?php echo $this->field_id( 'before' ); ?>"><?php esc_html_e( 'Prefix', 'mycred' ); ?></label>
642
- <input type="text" name="<?php echo $this->field_name( 'before' ); ?>" id="<?php echo $this->field_id( 'before' ); ?>" class="form-control" value="<?php echo esc_attr( $this->core->before ); ?>" />
643
  </div>
644
  </div>
645
  <div class="col-lg-5 col-md-5 col-sm-12 col-xs-12">
646
  <div class="form-group">
647
- <label for="<?php echo $this->field_id( array( 'format' => 'separators' ) ); ?>-thousand"><?php esc_html_e( 'Separators', 'mycred' ); ?></label>
648
  <div class="form-inline">
649
- <label>1</label> <input type="text" name="<?php echo $this->field_name( array( 'format' => 'separators' ) ); ?>[thousand]" id="<?php echo $this->field_id( array( 'format' => 'separators' ) ); ?>-thousand" placeholder="," class="form-control" size="2" value="<?php echo esc_attr( $this->core->format['separators']['thousand'] ); ?>" /> <label>000</label> <input type="text" name="<?php echo $this->field_name( array( 'format' => 'separators' ) ); ?>[decimal]" id="<?php echo $this->field_id( array( 'format' => 'separators' ) ); ?>-decimal" placeholder="." class="form-control" size="2" value="<?php echo esc_attr( $this->core->format['separators']['decimal'] ); ?>" /> <label>00</label>
650
  </div>
651
  </div>
652
  </div>
@@ -658,8 +718,8 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
658
  </div>
659
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
660
  <div class="form-group">
661
- <label for="<?php echo $this->field_id( 'after' ); ?>"><?php esc_html_e( 'Suffix', 'mycred' ); ?></label>
662
- <input type="text" name="<?php echo $this->field_name( 'after' ); ?>" id="<?php echo $this->field_id( 'after' ); ?>" class="form-control" value="<?php echo esc_attr( $this->core->after ); ?>" />
663
  </div>
664
  </div>
665
  </div>
@@ -676,43 +736,44 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
676
  <div class="row">
677
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
678
  <div class="form-group">
679
- <label for="<?php echo $this->field_id( array( 'caps' => 'creds' ) ); ?>"><?php esc_html_e( 'Point Editors', 'mycred' ); ?></label>
680
- <input type="text" name="<?php echo $this->field_name( array( 'caps' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'caps' => 'creds' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->caps['creds'] ); ?>" />
681
  <p><span class="description"><?php esc_html_e( 'The capability of users who can edit balances.', 'mycred' ); ?></span></p>
682
  </div>
683
  </div>
684
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
685
  <div class="form-group">
686
- <label for="<?php echo $this->field_id( array( 'caps' => 'plugin' ) ); ?>"><?php esc_html_e( 'Point Administrators', 'mycred' ); ?></label>
687
- <input type="text" name="<?php echo $this->field_name( array( 'caps' => 'plugin' ) ); ?>" id="<?php echo $this->field_id( array( 'caps' => 'plugin' ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->caps['plugin'] ); ?>" />
688
  <p><span class="description"><?php esc_html_e( 'The capability of users who can edit settings.', 'mycred' ); ?></span></p>
689
  </div>
690
  </div>
691
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
692
  <div class="form-group">
693
  <?php if ( ! isset( $this->core->max ) ) $this->core->max(); ?>
694
- <label for="<?php echo $this->field_id( 'max' ); ?>"><?php esc_html_e( 'Max. Amount', 'mycred' ); ?></label>
695
- <input type="text" name="<?php echo $this->field_name( 'max' ); ?>" id="<?php echo $this->field_id( 'max' ); ?>" class="form-control" value="<?php echo esc_attr( $this->core->max ); ?>" />
696
  <p><span class="description"><?php esc_html_e( 'The maximum amount allowed to be paid out in a single instance.', 'mycred' ); ?></span></p>
697
  </div>
698
  </div>
699
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
700
  <div class="form-group">
701
- <label for="<?php echo $excluded_ids_args['id']; ?>"><?php esc_html_e( 'Exclude Users', 'mycred' ); ?></label>
702
  <?php echo mycred_create_select2( $all_users, $excluded_ids_args, $excluded_ids ); ?>
 
703
  </div>
704
  <div class="form-group">
705
  <div class="checkbox">
706
- <label for="<?php echo $this->field_id( array( 'exclude' => 'cred_editors' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'exclude' => 'cred_editors' ) ); ?>" id="<?php echo $this->field_id( array( 'exclude' => 'cred_editors' ) ); ?>"<?php checked( $this->core->exclude['cred_editors'], 1 ); ?> value="1" /> <?php esc_html_e( 'Exclude point editors', 'mycred' ); ?></label>
707
  </div>
708
  <div class="checkbox">
709
- <label for="<?php echo $this->field_id( array( 'exclude' => 'plugin_editors' ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'exclude' => 'plugin_editors' ) ); ?>" id="<?php echo $this->field_id( array( 'exclude' => 'plugin_editors' ) ); ?>"<?php checked( $this->core->exclude['plugin_editors'], 1 ); ?> value="1" /> <?php esc_html_e( 'Exclude point administrators', 'mycred' ); ?></label>
710
  </div>
711
  </div>
712
  </div>
713
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
714
  <div class="form-group">
715
- <label for="<?php echo $roles_args['id']; ?>"><?php esc_html_e( 'Exclude by User Role', 'mycred' ); ?></label>
716
  <?php echo mycred_create_select2( $roles, $roles_args, $excluded_roles ); ?>
717
  </div>
718
  </div>
@@ -738,7 +799,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
738
  $image_url = wp_get_attachment_url( $attachment_id );
739
 
740
  if( property_exists( $this->core, 'attachment_id' ) && $this->get_point_image( $this->core->attachment_id , $this->field_name( 'attachment_id' )) )
741
- echo $this->get_point_image( $this->core->attachment_id , $this->field_name( 'attachment_id' ));
742
  elseif( !$attachment_id )
743
  {
744
  ?>
@@ -748,8 +809,9 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
748
  }
749
  else
750
  {
751
- echo "<img src='{$image_url}' />";
752
- echo "<input type='hidden' value='{$attachment_id}' name='".$this->field_name( 'attachment_id' )."' />";
 
753
  }
754
  ?>
755
  </div>
@@ -763,7 +825,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
763
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
764
  <h3><?php esc_html_e( 'Other Settings', 'mycred' ); ?></h3>
765
  <div class="form-group">
766
- <label for="<?php echo $this->field_id( 'delete_user' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'delete_user' ); ?>" id="<?php echo $this->field_id( 'delete_user' ); ?>" <?php checked( $delete_user, 1 ); ?> value="1" /> <?php esc_html_e( 'Delete log entries when user is deleted.', 'mycred' ); ?></label>
767
  </div>
768
  </div>
769
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -795,7 +857,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
795
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
796
  <div class="form-group">
797
  <label><?php esc_html_e( 'Entries', 'mycred' ); ?></label>
798
- <h1><?php echo $total_rows; ?></h1>
799
  </div>
800
  </div>
801
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
@@ -803,7 +865,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
803
  <label><?php esc_html_e( 'Actions', 'mycred' ); ?></label>
804
  <div>
805
  <?php if ( ( ! mycred_centralize_log() ) || ( mycred_centralize_log() && $GLOBALS['blog_id'] == 1 ) ) : ?>
806
- <button type="button" id="mycred-manage-action-empty-log" data-type="<?php echo $this->mycred_type; ?>" class="button button-large large <?php if ( $total_rows == 0 ) echo '"disabled="disabled'; else echo 'button-primary'; ?>"><?php esc_html_e( 'Empty Log', 'mycred' ); ?></button>
807
  <?php endif; ?>
808
  </div>
809
  </div>
@@ -814,21 +876,21 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
814
  <div class="col-lg-5 col-md-5 col-sm-12 col-xs-12">
815
  <div class="form-group">
816
  <label><?php esc_html_e( 'Balance Meta Key', 'mycred' ); ?></label>
817
- <h1><?php echo $this->core->cred_id; ?></h1>
818
  </div>
819
  </div>
820
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
821
  <div class="form-group">
822
  <label><?php esc_html_e( 'Users', 'mycred' ); ?></label>
823
- <h1><?php echo $this->core->count_members(); ?></h1>
824
  </div>
825
  </div>
826
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
827
  <div class="form-group">
828
  <label><?php esc_html_e( 'Actions', 'mycred' ); ?></label>
829
  <div>
830
- <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 esc_html_e( 'Set all to zero', 'mycred' ); ?></button>
831
- <button type="button" id="mycred-export-users-points" data-type="<?php echo $this->mycred_type; ?>" class="button button-large large"><?php esc_html_e( 'Export Balances', 'mycred' ); ?></button>
832
  </div>
833
  </div>
834
  </div>
@@ -866,7 +928,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
866
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
867
  <div class="form-group">
868
  <label><?php esc_html_e( 'Label', 'mycred' ); ?></label>
869
- <input type="text" disabled="disabled" class="form-control" value="<?php echo strip_tags( $label ); ?>" class="readonly" />
870
  </div>
871
  </div>
872
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
@@ -892,7 +954,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
892
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
893
  <div class="form-group">
894
  <label><?php esc_html_e( 'Label', 'mycred' ); ?></label>
895
- <input type="text" name="mycred_pref_core[types][<?php echo esc_attr( $type ); ?>][label]" value="<?php echo strip_tags( $label ); ?>" class="form-control" />
896
  </div>
897
  </div>
898
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
@@ -977,7 +1039,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
977
  ) );
978
 
979
  foreach ( $identify as $id => $label )
980
- echo '<option value="' . $id . '">' . $label . '</option>';
981
 
982
  ?>
983
  </select>
@@ -988,14 +1050,14 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
988
  <div class="form-group">
989
  <label><?php esc_html_e( 'Import Log Entry', 'mycred' ); ?></label>
990
  <input type="text" id="mycred-export-log-template" value="" class="regular-text form-control" />
991
- <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>
992
  </div>
993
  </div>
994
  </div>
995
 
996
  <div class="row last">
997
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right">
998
- <input type="button" id="mycred-run-exporter" value="<?php esc_attr_e( 'Export', 'mycred' ); ?>" data-type="<?php echo $this->mycred_type; ?>" class="button button-large button-primary" />
999
  </div>
1000
  </div>
1001
  </div>
165
  global $wpdb;
166
 
167
  // Log Template
168
+ $log = isset( $_POST['log_temp'] ) ? sanitize_text_field( wp_unslash( $_POST['log_temp'] ) ) : '';
169
 
170
  // Type
171
  if ( ! isset( $_POST['type'] ) )
172
  wp_send_json_error( 'Missing point type' );
173
 
174
+ $type = isset( $_POSt['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';
175
 
176
  // Identify users by
177
  switch ( $_POST['identify'] ) {
505
  if ( $this->is_main_type ) {
506
 
507
  ?>
508
+ <div><input type="number" min="0" max="20" id="mycred-adjust-decimal-places" class="form-control" value="<?php echo esc_attr( $this->core->format['decimals'] ); ?>" data-org="<?php echo esc_attr( $this->core->format['decimals'] ); ?>" size="8" /> <input type="button" style="display:none;" id="mycred-update-log-decimals" class="button button-primary button-large" value="<?php esc_attr_e( 'Update Database', 'mycred' ); ?>" /></div>
509
  <?php
510
 
511
  }
523
  else {
524
 
525
  ?>
526
+ <select name="<?php echo esc_attr( $this->field_name( array( 'format' => 'decimals' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'format' => 'decimals' ) ) ); ?>" class="form-control">
527
  <?php
528
 
529
  echo '<option value="0"';
530
  if ( $this->core->format['decimals'] == 0 ) echo ' selected="selected"';
531
+ echo '>' . esc_html__( 'No decimals', 'mycred' ) . '</option>';
532
 
533
  for ( $i = 1 ; $i <= $default->format['decimals'] ; $i ++ ) {
534
+ echo '<option value="' . esc_attr( $i ) . '"';
535
  if ( $this->core->format['decimals'] == $i ) echo ' selected="selected"';
536
+ echo '>' . esc_html( $i ) . ' - 0.' . esc_html( str_pad( '0', $i, '0' ) ) . '</option>';
537
  }
538
 
539
  $url = add_query_arg( array( 'page' => MYCRED_SLUG . '-settings', 'open-tab' => 0 ), admin_url( 'admin.php' ) );
540
 
541
  ?>
542
  </select>
543
+ <p><span class="description"><?php printf( esc_html__( '<a href="%s">Click here</a> to change your default point types setup.', 'mycred' ), esc_url( $url ) ); ?></span></p>
544
  <?php
545
 
546
  }
596
  'multiple' => 'multiple'
597
  );
598
 
599
+ $allowed_html = array(
600
+ 'input' => array(
601
+ 'class' => array(),
602
+ 'type' => array(),
603
+ 'tabindex' => array(),
604
+ 'autocorrect' => array(),
605
+ 'autocapitalize' => array(),
606
+ 'spellcheck' => array(),
607
+ 'role' => array(),
608
+ 'aria-autocomplete' => array(),
609
+ 'autocomplete' => array(),
610
+ 'aria-describedby' => array(),
611
+ 'placeholder' => array(),
612
+ 'style' => array()
613
+ ),
614
+ 'span' => array(
615
+ 'class' => array(),
616
+ 'dir' => array(),
617
+ 'data-select2-id' => array(),
618
+ 'style' => array(),
619
+ 'aria-hidden' => array(),
620
+ 'role' => array(),
621
+ 'tabindex' => array(),
622
+ 'aria-haspopup' => array(),
623
+ 'aria-expanded' => array(),
624
+ 'aria-disabled' => array()
625
+ ),
626
+ 'ul' => array(
627
+ 'class' => array(),
628
+ 'id' => array()
629
+ ),
630
+ 'li' => array(
631
+ 'class' => array(),
632
+ 'title' => array(),
633
+ 'data-select2-id' => array(),
634
+ ),
635
+ 'button' => array(
636
+ 'class' => array(),
637
+ 'type' => array(),
638
+ 'title' => array(),
639
+ 'tabindex' => array(),
640
+ 'aria-label' => array(),
641
+ 'aria-describedby' => array(),
642
+ ),
643
+ 'select' => array(
644
+ 'name' => array(),
645
+ 'id' => array(),
646
+ 'class' => array(),
647
+ 'style' => array(),
648
+ 'multiple' => array(),
649
+ 'data-select2-id' => array(),
650
+ 'tabindex' => array(),
651
+ 'aria-hidden' => array()
652
+ ),
653
+ 'option' => array(
654
+ 'value' => array(),
655
+ 'selected' => array()
656
+ )
657
+ );
658
+
659
  ?>
660
  <div class="wrap mycred-metabox" id="myCRED-wrap">
661
  <h1><?php esc_html_e( 'Settings', 'mycred' ); if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?> <a href="http://codex.mycred.me/" target="_blank" class="page-title-action"><?php esc_html_e( 'Documentation', 'mycred' ); ?></a><?php endif; ?></h1>
663
  <?php $this->update_notice(); ?>
664
 
665
  <?php if ( MYCRED_DEFAULT_LABEL === 'myCRED' ) : ?>
666
+ <p id="mycred-thank-you-text"><?php printf( esc_html__( 'Thank you for using %s. If you have a moment, please leave a %s.', 'mycred' ), esc_html_e( mycred_label() ), sprintf( '<a href="https://wordpress.org/support/plugin/mycred/reviews/?rate=5#new-post" target="_blank">%s</a>', esc_html__( 'review', 'mycred' ) ) ); ?><span id="mycred-social-media"><?php echo implode( ' ', $social ) ; ?></span></p>
667
  <?php endif; ?>
668
 
669
  <form method="post" action="options.php" class="form" name="mycred-core-settings-form" novalidate>
680
  <div class="row">
681
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
682
  <div class="form-group">
683
+ <label for="<?php echo esc_attr( $this->field_id( array( 'name' => 'singular' ) ) ); ?>"><?php esc_html_e( 'Singular', 'mycred' ); ?></label>
684
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'name' => 'singular' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'name' => 'singular' ) ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->name['singular'] ); ?>" />
685
  </div>
686
  </div>
687
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
688
  <div class="form-group">
689
+ <label for="<?php echo esc_attr( $this->field_id( array( 'name' => 'plural' ) ) ); ?>"><?php esc_html_e( 'Plural', 'mycred' ); ?></label>
690
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'name' => 'plural' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'name' => 'plural' ) ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->name['plural'] ); ?>" />
691
  </div>
692
  </div>
693
  </div>
698
  <div class="row">
699
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
700
  <div class="form-group">
701
+ <label for="<?php echo esc_attr( $this->field_id( 'before' ) ); ?>"><?php esc_html_e( 'Prefix', 'mycred' ); ?></label>
702
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'before' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'before' ) ); ?>" class="form-control" value="<?php echo esc_attr( $this->core->before ); ?>" />
703
  </div>
704
  </div>
705
  <div class="col-lg-5 col-md-5 col-sm-12 col-xs-12">
706
  <div class="form-group">
707
+ <label for="<?php echo esc_attr( $this->field_id( array( 'format' => 'separators' ) ) ); ?>-thousand"><?php esc_html_e( 'Separators', 'mycred' ); ?></label>
708
  <div class="form-inline">
709
+ <label>1</label> <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'format' => 'separators' ) ) ); ?>[thousand]" id="<?php echo esc_attr( $this->field_id( array( 'format' => 'separators' ) ) ); ?>-thousand" placeholder="," class="form-control" size="2" value="<?php echo esc_attr( $this->core->format['separators']['thousand'] ); ?>" /> <label>000</label> <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'format' => 'separators' ) ) ); ?>[decimal]" id="<?php echo esc_attr( $this->field_id( array( 'format' => 'separators' ) ) ); ?>-decimal" placeholder="." class="form-control" size="2" value="<?php echo esc_attr( $this->core->format['separators']['decimal'] ); ?>" /> <label>00</label>
710
  </div>
711
  </div>
712
  </div>
718
  </div>
719
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
720
  <div class="form-group">
721
+ <label for="<?php echo esc_attr( $this->field_id( 'after' ) ); ?>"><?php esc_html_e( 'Suffix', 'mycred' ); ?></label>
722
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'after' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'after' ) ); ?>" class="form-control" value="<?php echo esc_attr( $this->core->after ); ?>" />
723
  </div>
724
  </div>
725
  </div>
736
  <div class="row">
737
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
738
  <div class="form-group">
739
+ <label for="<?php echo esc_attr( $this->field_id( array( 'caps' => 'creds' ) ) ); ?>"><?php esc_html_e( 'Point Editors', 'mycred' ); ?></label>
740
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'caps' => 'creds' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'caps' => 'creds' ) ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->caps['creds'] ); ?>" />
741
  <p><span class="description"><?php esc_html_e( 'The capability of users who can edit balances.', 'mycred' ); ?></span></p>
742
  </div>
743
  </div>
744
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
745
  <div class="form-group">
746
+ <label for="<?php echo esc_attr( $this->field_id( array( 'caps' => 'plugin' ) ) ); ?>"><?php esc_html_e( 'Point Administrators', 'mycred' ); ?></label>
747
+ <input type="text" name="<?php echo esc_attr( $this->field_name( array( 'caps' => 'plugin' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'caps' => 'plugin' ) ) ); ?>" class="form-control" placeholder="<?php esc_attr_e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->core->caps['plugin'] ); ?>" />
748
  <p><span class="description"><?php esc_html_e( 'The capability of users who can edit settings.', 'mycred' ); ?></span></p>
749
  </div>
750
  </div>
751
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
752
  <div class="form-group">
753
  <?php if ( ! isset( $this->core->max ) ) $this->core->max(); ?>
754
+ <label for="<?php echo esc_attr( $this->field_id( 'max' ) ); ?>"><?php esc_html_e( 'Max. Amount', 'mycred' ); ?></label>
755
+ <input type="text" name="<?php echo esc_attr( $this->field_name( 'max' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'max' ) ); ?>" class="form-control" value="<?php echo esc_attr( $this->core->max ); ?>" />
756
  <p><span class="description"><?php esc_html_e( 'The maximum amount allowed to be paid out in a single instance.', 'mycred' ); ?></span></p>
757
  </div>
758
  </div>
759
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
760
  <div class="form-group">
761
+ <label for="<?php echo esc_attr( $excluded_ids_args['id'] ); ?>"><?php esc_html_e( 'Exclude Users', 'mycred' ); ?></label>
762
  <?php echo mycred_create_select2( $all_users, $excluded_ids_args, $excluded_ids ); ?>
763
+ <?php //echo wp_kses( mycred_create_select2( $all_users, $excluded_ids_args, $excluded_ids ), $allowed_html ); ?>
764
  </div>
765
  <div class="form-group">
766
  <div class="checkbox">
767
+ <label for="<?php echo esc_attr( $this->field_id( array( 'exclude' => 'cred_editors' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'exclude' => 'cred_editors' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'exclude' => 'cred_editors' ) ) ); ?>"<?php checked( $this->core->exclude['cred_editors'], 1 ); ?> value="1" /> <?php esc_html_e( 'Exclude point editors', 'mycred' ); ?></label>
768
  </div>
769
  <div class="checkbox">
770
+ <label for="<?php echo esc_attr( $this->field_id( array( 'exclude' => 'plugin_editors' ) ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( array( 'exclude' => 'plugin_editors' ) ) ); ?>" id="<?php echo esc_attr( $this->field_id( array( 'exclude' => 'plugin_editors' ) ) ); ?>"<?php checked( $this->core->exclude['plugin_editors'], 1 ); ?> value="1" /> <?php esc_html_e( 'Exclude point administrators', 'mycred' ); ?></label>
771
  </div>
772
  </div>
773
  </div>
774
  <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
775
  <div class="form-group">
776
+ <label for="<?php echo esc_attr( $roles_args['id'] ); ?>"><?php esc_html_e( 'Exclude by User Role', 'mycred' ); ?></label>
777
  <?php echo mycred_create_select2( $roles, $roles_args, $excluded_roles ); ?>
778
  </div>
779
  </div>
799
  $image_url = wp_get_attachment_url( $attachment_id );
800
 
801
  if( property_exists( $this->core, 'attachment_id' ) && $this->get_point_image( $this->core->attachment_id , $this->field_name( 'attachment_id' )) )
802
+ echo wp_kses_post( $this->get_point_image( $this->core->attachment_id , $this->field_name( 'attachment_id' ) ) );
803
  elseif( !$attachment_id )
804
  {
805
  ?>
809
  }
810
  else
811
  {
812
+
813
+ echo "<img src='". esc_url( $image_url ) ."' />";
814
+ echo "<input type='hidden' value='". esc_attr( $attachment_id ) ."' name='".esc_attr( $this->field_name( 'attachment_id' ) )."' />";
815
  }
816
  ?>
817
  </div>
825
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
826
  <h3><?php esc_html_e( 'Other Settings', 'mycred' ); ?></h3>
827
  <div class="form-group">
828
+ <label for="<?php echo esc_attr( $this->field_id( 'delete_user' ) ); ?>"><input type="checkbox" name="<?php echo esc_attr( $this->field_name( 'delete_user' ) ); ?>" id="<?php echo esc_attr( $this->field_id( 'delete_user' ) ); ?>" <?php checked( $delete_user, 1 ); ?> value="1" /> <?php esc_html_e( 'Delete log entries when user is deleted.', 'mycred' ); ?></label>
829
  </div>
830
  </div>
831
  <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
857
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
858
  <div class="form-group">
859
  <label><?php esc_html_e( 'Entries', 'mycred' ); ?></label>
860
+ <h1><?php echo esc_html( $total_rows ); ?></h1>
861
  </div>
862
  </div>
863
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
865
  <label><?php esc_html_e( 'Actions', 'mycred' ); ?></label>
866
  <div>
867
  <?php if ( ( ! mycred_centralize_log() ) || ( mycred_centralize_log() && $GLOBALS['blog_id'] == 1 ) ) : ?>
868
+ <button type="button" id="mycred-manage-action-empty-log" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button button-large large <?php if ( $total_rows == 0 ) echo '"disabled="disabled'; else echo 'button-primary'; ?>"><?php esc_html_e( 'Empty Log', 'mycred' ); ?></button>
869
  <?php endif; ?>
870
  </div>
871
  </div>
876
  <div class="col-lg-5 col-md-5 col-sm-12 col-xs-12">
877
  <div class="form-group">
878
  <label><?php esc_html_e( 'Balance Meta Key', 'mycred' ); ?></label>
879
+ <h1><?php echo esc_html( $this->core->cred_id ); ?></h1>
880
  </div>
881
  </div>
882
  <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
883
  <div class="form-group">
884
  <label><?php esc_html_e( 'Users', 'mycred' ); ?></label>
885
+ <h1><?php echo esc_html( $this->core->count_members() ); ?></h1>
886
  </div>
887
  </div>
888
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
889
  <div class="form-group">
890
  <label><?php esc_html_e( 'Actions', 'mycred' ); ?></label>
891
  <div>
892
+ <button type="button" id="mycred-manage-action-reset-accounts" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button button-large large <?php if ( $reset_block ) echo '" disabled="disabled'; else echo 'button-primary'; ?>"><?php esc_html_e( 'Set all to zero', 'mycred' ); ?></button>
893
+ <button type="button" id="mycred-export-users-points" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button button-large large"><?php esc_html_e( 'Export Balances', 'mycred' ); ?></button>
894
  </div>
895
  </div>
896
  </div>
928
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
929
  <div class="form-group">
930
  <label><?php esc_html_e( 'Label', 'mycred' ); ?></label>
931
+ <input type="text" disabled="disabled" class="form-control" value="<?php echo esc_attr( strip_tags( $label ) ); ?>" class="readonly" />
932
  </div>
933
  </div>
934
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
954
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
955
  <div class="form-group">
956
  <label><?php esc_html_e( 'Label', 'mycred' ); ?></label>
957
+ <input type="text" name="mycred_pref_core[types][<?php echo esc_attr( $type ); ?>][label]" value="<?php echo esc_attr( strip_tags( $label ) ); ?>" class="form-control" />
958
  </div>
959
  </div>
960
  <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
1039
  ) );
1040
 
1041
  foreach ( $identify as $id => $label )
1042
+ echo '<option value="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</option>';
1043
 
1044
  ?>
1045
  </select>
1050
  <div class="form-group">
1051
  <label><?php esc_html_e( 'Import Log Entry', 'mycred' ); ?></label>
1052
  <input type="text" id="mycred-export-log-template" value="" class="regular-text form-control" />
1053
+ <span class="description"><?php echo sprintf( esc_html__( 'Optional log entry to use if you intend to import this file in a different %s installation.', 'mycred' ), esc_html( mycred_label() ) ); ?></span>
1054
  </div>
1055
  </div>
1056
  </div>
1057
 
1058
  <div class="row last">
1059
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right">
1060
+ <input type="button" id="mycred-run-exporter" value="<?php esc_attr_e( 'Export', 'mycred' ); ?>" data-type="<?php echo esc_attr( $this->mycred_type ); ?>" class="button button-large button-primary" />
1061
  </div>
1062
  </div>
1063
  </div>
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.4.5.4
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.4.5.4';
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.4.5.4' ); }
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.4.5.4' ); }
65
 
66
  /**
67
  * Get
@@ -82,7 +82,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
82
  if ( ! defined( $name ) )
83
  define( $name, $value );
84
  elseif ( ! $definable && defined( $name ) )
85
- _doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '2.4.5.4' );
86
  }
87
 
88
  /**
@@ -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.4.5.4' );
98
  }
99
 
100
  /**
@@ -635,7 +635,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
635
  // Styles
636
  wp_register_style( 'mycred-front', plugins_url( 'assets/css/mycred-front.css', myCRED_THIS ), array(), $this->version, 'all' );
637
  wp_register_style( 'mycred-admin', plugins_url( 'assets/css/mycred-admin.css', myCRED_THIS ), array(), $this->version, 'all' );
638
- wp_register_style( 'mycred-buttons', plugins_url( 'assets/css/mycred-buttons.css', myCRED_THIS ), array(), $this->version, 'all' );
639
  wp_register_style( 'mycred-edit-balance', plugins_url( 'assets/css/mycred-edit-balance.css', myCRED_THIS ), array(), $this->version, 'all' );
640
  wp_register_style( 'mycred-edit-log', plugins_url( 'assets/css/mycred-edit-log.css', myCRED_THIS ), array(), $this->version, 'all' );
641
  wp_register_style( 'mycred-bootstrap-grid', plugins_url( 'assets/css/bootstrap-grid.css', myCRED_THIS ), array(), $this->version, 'all' );
3
  * Plugin Name: myCred
4
  * Plugin URI: https://mycred.me
5
  * Description: An adaptive points management system for WordPress powered websites.
6
+ * Version: 2.4.6
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.4.6';
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.4.6' ); }
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.4.6' ); }
65
 
66
  /**
67
  * Get
82
  if ( ! defined( $name ) )
83
  define( $name, $value );
84
  elseif ( ! $definable && defined( $name ) )
85
+ _doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '2.4.6' );
86
  }
87
 
88
  /**
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.4.6' );
98
  }
99
 
100
  /**
635
  // Styles
636
  wp_register_style( 'mycred-front', plugins_url( 'assets/css/mycred-front.css', myCRED_THIS ), array(), $this->version, 'all' );
637
  wp_register_style( 'mycred-admin', plugins_url( 'assets/css/mycred-admin.css', myCRED_THIS ), array(), $this->version, 'all' );
638
+ wp_register_style( 'mycred-buttons', plugins_url( 'assets/css/mycred-buttons.css', myCRED_THIS ), array(), $this->version, 'all' );
639
  wp_register_style( 'mycred-edit-balance', plugins_url( 'assets/css/mycred-edit-balance.css', myCRED_THIS ), array(), $this->version, 'all' );
640
  wp_register_style( 'mycred-edit-log', plugins_url( 'assets/css/mycred-edit-log.css', myCRED_THIS ), array(), $this->version, 'all' );
641
  wp_register_style( 'mycred-bootstrap-grid', plugins_url( 'assets/css/bootstrap-grid.css', myCRED_THIS ), array(), $this->version, 'all' );
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: 6.0
6
- Stable tag: 2.4.5.4
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -30,6 +30,19 @@ myCred allows **THREE different ways** through which you can award your users:
30
 
31
  * **Badges -** Boost your users' participation by rewarding them for their exceptional performance.
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  **Latest update - myCred v2.4.4**
34
 
35
  **myCred v2.4.4** includes several new features and enhancements. The most prominent addition is the ability to set a transfer fee when exchanging points between members. Other new features include Gutenberg block support and the ability to set a range for minimum and maximum fees. Version 2.4.4 is available now from the WordPress Plugin Directory.
@@ -303,6 +316,21 @@ You can find a list of [frequently asked questions](https://mycred.me/about/faq/
303
 
304
  == Upgrade Notice ==
305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  = 2.4.5 =
307
  Code improvement.
308
 
@@ -375,11 +403,23 @@ The banking module have been replaced by Central deposite module, and interest r
375
 
376
  == Changelog ==
377
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  = 2.4.5.4 =
379
  - **FIX** - Rank publish or update not working correctly.
380
 
381
  = 2.4.5.3 =
382
- - **FIX** - Sell content issues in manual pages/posts
383
 
384
  = 2.4.5.2 =
385
  - **FIX** - Sell Content settings not being saved.
3
  Tags: badges, gamification, loyalty, points, rewards
4
  Requires at least: 4.8
5
  Tested up to: 6.0
6
+ Stable tag: 2.4.6
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
30
 
31
  * **Badges -** Boost your users' participation by rewarding them for their exceptional performance.
32
 
33
+ **myCred v2.4.6 update - Schedule Deposit in Central Deposit**
34
+
35
+ We have added new functionality in the Central deposit built-in Addon where admin can schedule the points deposit to the central account automatically after the specified interval.
36
+
37
+ = Features =
38
+
39
+ * **Set Starting from** - Setup the starting date
40
+ * **Interval (in days)** - Deposit points after x days interval.
41
+ * **Amount** - The amount of points to be scheduled.
42
+ * **Recurring** - Enabling this options will deposit the amount recursively after the defined interval. We have also added two new email triggers for Central deposit.
43
+ * Added Email notification on Minimum balance in central deposit.
44
+ * Added Email notification on No balance Left in central deposit.
45
+
46
  **Latest update - myCred v2.4.4**
47
 
48
  **myCred v2.4.4** includes several new features and enhancements. The most prominent addition is the ability to set a transfer fee when exchanging points between members. Other new features include Gutenberg block support and the ability to set a range for minimum and maximum fees. Version 2.4.4 is available now from the WordPress Plugin Directory.
316
 
317
  == Upgrade Notice ==
318
 
319
+ = 2.4.6 =
320
+ New features and Bug fixes.
321
+
322
+ = 2.4.5.4 =
323
+ Bug fixes.
324
+
325
+ = 2.4.5.3 =
326
+ Bug fixes.
327
+
328
+ = 2.4.5.2 =
329
+ Bug fixes.
330
+
331
+ = 2.4.5.1 =
332
+ Bug fixes.
333
+
334
  = 2.4.5 =
335
  Code improvement.
336
 
403
 
404
  == Changelog ==
405
 
406
+ = 2.4.6 =
407
+ - **NEW** - Added minimum points reminder email notification for central deposit.
408
+ - **NEW** - Added points automatically to the central account after the specified interval. (Schedule Deposit)
409
+ - **NEW** - Added "No Available Balance" email notification for central deposit.
410
+ - **FIX** - buyCred purchase reward hook setup did not appear properly in mycred_hook_table.
411
+ - **FIX** - Typo fixes in wooCommerce product reward reference.
412
+ - **FIX** - The "Insufficient Funds Warning" message did not appear according to the myCred transfer setting.
413
+ - **FIX** - Product Reward refund was not working.
414
+ - **FIX** - user_id attribute was not working in mycred_show_if shortcode.
415
+ - **FIX** - License was not working when using subdirectory in multisite network.
416
+ - **FIX** - Fixed security vulnerabilities.
417
+
418
  = 2.4.5.4 =
419
  - **FIX** - Rank publish or update not working correctly.
420
 
421
  = 2.4.5.3 =
422
+ - **FIX** - Sell content issues in manual pages/posts.
423
 
424
  = 2.4.5.2 =
425
  - **FIX** - Sell Content settings not being saved.