Version Description
Bug fixes release.
=
Download this release
Release Info
Developer | wpexpertsio |
Plugin | myCRED |
Version | 1.8.13 |
Comparing to | |
See all releases |
Code changes from version 1.8.12 to 1.8.13
- addons/badges/assets/js/edit-badge.js +1 -1
- addons/badges/includes/mycred-badge-object.php +18 -16
- addons/badges/myCRED-addon-badges.php +3 -1
- addons/buy-creds/assets/css/admin-style.css +15 -0
- addons/buy-creds/assets/js/admin-script.js +19 -0
- addons/buy-creds/includes/buycred-reward-hook.php +219 -0
- addons/buy-creds/includes/buycred-reward.php +79 -0
- addons/buy-creds/includes/buycred-shortcodes.php +3 -3
- addons/buy-creds/myCRED-addon-buy-creds.php +1 -0
- addons/gateway/carts/mycred-woocommerce.php +4 -1
- addons/ranks/myCRED-addon-ranks.php +26 -17
- addons/stats/includes/mycred-stats-functions.php +1 -1
- addons/transfer/assets/js/mycred-transfer.js +3 -1
- assets/css/admin-subscription.css +333 -3
- assets/css/mycred-front.css +1 -1
- assets/images/mycred-membership-activated.png +0 -0
- includes/hooks/external/mycred-hook-bbPress.php +49 -7
- includes/hooks/external/mycred-hook-woocommerce.php +47 -31
- includes/hooks/mycred-hook-referrals.php +2 -0
- includes/mycred-nav-menu.php +179 -0
- includes/shortcodes/mycred_leaderboard_position.php +2 -2
- includes/shortcodes/mycred_my_balance_converted.php +11 -9
- membership/mycred-connect-membership.php +543 -2
- membership/subscription-functions.php +30 -4
- modules/mycred-module-caching.php +4 -2
- mycred.php +7 -6
- readme.txt +187 -160
addons/badges/assets/js/edit-badge.js
CHANGED
@@ -9,7 +9,7 @@ jQuery(function($){
|
|
9 |
|
10 |
var TotalBadgeLevels = 1;
|
11 |
var TotalRequirements = 1;
|
12 |
-
var UsedtoCompare = '
|
13 |
|
14 |
var PointTypeSelect = $( 'select#badge-select-point-type' );
|
15 |
var ReferenceSelect = $( 'select#badge-select-reference' );
|
9 |
|
10 |
var TotalBadgeLevels = 1;
|
11 |
var TotalRequirements = 1;
|
12 |
+
var UsedtoCompare = $( '#badge-requirement-compare a.selected' ).data( 'do' );
|
13 |
|
14 |
var PointTypeSelect = $( 'select#badge-select-point-type' );
|
15 |
var ReferenceSelect = $( 'select#badge-select-reference' );
|
addons/badges/includes/mycred-badge-object.php
CHANGED
@@ -352,21 +352,27 @@ if ( ! class_exists( 'myCRED_Badge' ) ) :
|
|
352 |
$this->current_level = $new_level;
|
353 |
}
|
354 |
|
355 |
-
$
|
356 |
-
mycred_update_user_meta( $user_id, $this->user_meta_key, '', $new_level );
|
357 |
|
358 |
-
|
359 |
-
|
|
|
|
|
360 |
|
361 |
-
|
|
|
362 |
|
363 |
-
|
364 |
|
365 |
-
|
|
|
|
|
366 |
|
367 |
-
|
368 |
-
|
369 |
-
|
|
|
|
|
370 |
|
371 |
return true;
|
372 |
|
@@ -394,7 +400,7 @@ if ( ! class_exists( 'myCRED_Badge' ) ) :
|
|
394 |
|
395 |
if( $exec ) {
|
396 |
|
397 |
-
$mycred->
|
398 |
'badge_reward',
|
399 |
$this->user_id,
|
400 |
$reward['amount'],
|
@@ -404,8 +410,6 @@ if ( ! class_exists( 'myCRED_Badge' ) ) :
|
|
404 |
$reward['type']
|
405 |
);
|
406 |
|
407 |
-
$mycred->update_users_balance( $this->user_id, $reward['amount'], $reward['type'] );
|
408 |
-
|
409 |
do_action( 'mycred_badge_rewardes', $this->user_id, $previous_level, $new_level, $reward, $this );
|
410 |
|
411 |
}
|
@@ -432,7 +436,7 @@ if ( ! class_exists( 'myCRED_Badge' ) ) :
|
|
432 |
|
433 |
if( $exec ) {
|
434 |
|
435 |
-
$mycred->
|
436 |
'badge_reward',
|
437 |
$this->user_id,
|
438 |
$reward['amount'],
|
@@ -442,8 +446,6 @@ if ( ! class_exists( 'myCRED_Badge' ) ) :
|
|
442 |
$reward['type']
|
443 |
);
|
444 |
|
445 |
-
$mycred->update_users_balance( $this->user_id, $reward['amount'], $reward['type'] );
|
446 |
-
|
447 |
do_action( 'mycred_badge_rewardes', $this->user_id, $previous_level, $new_level, $reward, $this );
|
448 |
|
449 |
}
|
352 |
$this->current_level = $new_level;
|
353 |
}
|
354 |
|
355 |
+
$execute = apply_filters( 'mycred_badge_assign', true, $user_id, $new_level, $this );
|
|
|
356 |
|
357 |
+
if ( $execute ) {
|
358 |
+
|
359 |
+
$new_level = apply_filters( 'mycred_badge_user_value', $new_level, $user_id, $this->post_id );
|
360 |
+
mycred_update_user_meta( $user_id, $this->user_meta_key, '', $new_level );
|
361 |
|
362 |
+
// Need to update counter with new assignments
|
363 |
+
if ( $new_level == 0 ) {
|
364 |
|
365 |
+
$this->earnedby ++;
|
366 |
|
367 |
+
mycred_update_post_meta( $this->post_id, 'total-users-with-badge', $this->earnedby );
|
368 |
+
|
369 |
+
}
|
370 |
|
371 |
+
$this->payout_reward( $previous_level, $new_level );
|
372 |
+
|
373 |
+
do_action( 'mycred_after_badge_assign', $user_id, $this->post_id, $new_level );
|
374 |
+
|
375 |
+
}
|
376 |
|
377 |
return true;
|
378 |
|
400 |
|
401 |
if( $exec ) {
|
402 |
|
403 |
+
$mycred->add_creds(
|
404 |
'badge_reward',
|
405 |
$this->user_id,
|
406 |
$reward['amount'],
|
410 |
$reward['type']
|
411 |
);
|
412 |
|
|
|
|
|
413 |
do_action( 'mycred_badge_rewardes', $this->user_id, $previous_level, $new_level, $reward, $this );
|
414 |
|
415 |
}
|
436 |
|
437 |
if( $exec ) {
|
438 |
|
439 |
+
$mycred->add_creds(
|
440 |
'badge_reward',
|
441 |
$this->user_id,
|
442 |
$reward['amount'],
|
446 |
$reward['type']
|
447 |
);
|
448 |
|
|
|
|
|
449 |
do_action( 'mycred_badge_rewardes', $this->user_id, $previous_level, $new_level, $reward, $this );
|
450 |
|
451 |
}
|
addons/badges/myCRED-addon-badges.php
CHANGED
@@ -653,7 +653,7 @@ th#badge-users { width: 10%; }
|
|
653 |
public function level_template( $level = 0 ) {
|
654 |
|
655 |
if ( $level == 0 )
|
656 |
-
return '<div class="row badge-level" id="mycred-badge-level{{level}}" data-level="{{level}}"><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">{{addlevelbutton}}<div class="level-image"><div class="level-image-wrapper image-wrapper {{emptylevelimage}}">{{levelimage}}</div><div class="level-image-actions"><button type="button" class="button button-secondary change-level-image" data-level="{{level}}">{{levelimagebutton}}</button></div></div><div class="label-field"><input type="text" placeholder="{{levelplaceholder}}" name="mycred_badge[levels][{{level}}][label]" value="{{levellabel}}" /></div></div><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><div class="req-title">{{requirementslabel}}<div class="pull-right" id="badge-requirement-compare"><a href="javascript:void(0);" data-do="AND" class="{{adnselected}}">AND</a> / <a href="javascript:void(0);" data-do="OR" class="{{orselected}}">OR</a><input type="hidden" name="mycred_badge[levels][{{level}}][compare]" value="
|
657 |
|
658 |
return '<div class="row badge-level" id="mycred-badge-level{{level}}" data-level="{{level}}"><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">{{removelevelbutton}}<div class="level-image"><div class="level-image-wrapper image-wrapper {{emptylevelimage}}">{{levelimage}}</div><div class="level-image-actions"><button type="button" class="button button-secondary change-level-image" data-level="{{level}}">{{levelimagebutton}}</button></div></div><div class="label-field"><input type="text" placeholder="{{levelplaceholder}}" name="mycred_badge[levels][{{level}}][label]" value="{{levellabel}}" /></div></div><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><div class="req-title">{{requirementslabel}}</div><div class="level-requirements">{{{requirements}}}</div></div><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">{{rewards}}</div></div>';
|
659 |
|
@@ -883,6 +883,8 @@ jQuery(function($) {
|
|
883 |
$template = str_replace( '{{adnselected}}', ( ( $setup['compare'] === 'AND' ) ? 'selected' : '' ), $template );
|
884 |
$template = str_replace( '{{orselected}}', ( ( $setup['compare'] === 'OR' ) ? 'selected' : '' ), $template );
|
885 |
|
|
|
|
|
886 |
//$requirement = $this->requirements_template( 1 );
|
887 |
|
888 |
$total_requirements = count( $setup['requires'] );
|
653 |
public function level_template( $level = 0 ) {
|
654 |
|
655 |
if ( $level == 0 )
|
656 |
+
return '<div class="row badge-level" id="mycred-badge-level{{level}}" data-level="{{level}}"><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">{{addlevelbutton}}<div class="level-image"><div class="level-image-wrapper image-wrapper {{emptylevelimage}}">{{levelimage}}</div><div class="level-image-actions"><button type="button" class="button button-secondary change-level-image" data-level="{{level}}">{{levelimagebutton}}</button></div></div><div class="label-field"><input type="text" placeholder="{{levelplaceholder}}" name="mycred_badge[levels][{{level}}][label]" value="{{levellabel}}" /></div></div><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><div class="req-title">{{requirementslabel}}<div class="pull-right" id="badge-requirement-compare"><a href="javascript:void(0);" data-do="AND" class="{{adnselected}}">AND</a> / <a href="javascript:void(0);" data-do="OR" class="{{orselected}}">OR</a><input type="hidden" name="mycred_badge[levels][{{level}}][compare]" value="{{badge_compare_andor}}" /></div></div><div class="level-requirements">{{{requirements}}}</div></div><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">{{rewards}}</div></div>';
|
657 |
|
658 |
return '<div class="row badge-level" id="mycred-badge-level{{level}}" data-level="{{level}}"><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">{{removelevelbutton}}<div class="level-image"><div class="level-image-wrapper image-wrapper {{emptylevelimage}}">{{levelimage}}</div><div class="level-image-actions"><button type="button" class="button button-secondary change-level-image" data-level="{{level}}">{{levelimagebutton}}</button></div></div><div class="label-field"><input type="text" placeholder="{{levelplaceholder}}" name="mycred_badge[levels][{{level}}][label]" value="{{levellabel}}" /></div></div><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><div class="req-title">{{requirementslabel}}</div><div class="level-requirements">{{{requirements}}}</div></div><div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">{{rewards}}</div></div>';
|
659 |
|
883 |
$template = str_replace( '{{adnselected}}', ( ( $setup['compare'] === 'AND' ) ? 'selected' : '' ), $template );
|
884 |
$template = str_replace( '{{orselected}}', ( ( $setup['compare'] === 'OR' ) ? 'selected' : '' ), $template );
|
885 |
|
886 |
+
$template = str_replace( '{{badge_compare_andor}}', ( ( isset($setup['compare']) && !empty($setup['compare']) ) ? $setup['compare'] : 'AND' ), $template );
|
887 |
+
|
888 |
//$requirement = $this->requirements_template( 1 );
|
889 |
|
890 |
$total_requirements = count( $setup['requires'] );
|
addons/buy-creds/assets/css/admin-style.css
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mycred-metabox .widget-content .hook-instance .specific-hook-actions {
|
2 |
+
margin-bottom: 12px !important;
|
3 |
+
}
|
4 |
+
|
5 |
+
.mycred-metabox .widget-content .hook-instance:last-child .specific-hook-actions {
|
6 |
+
margin-bottom: 0px !important;
|
7 |
+
}
|
8 |
+
|
9 |
+
.mycred-metabox .widget-content .hook-instance .specific-hook-actions .mycred-add-specific-hook {
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
.mycred-metabox .widget-content .hook-instance:last-child .specific-hook-actions .mycred-add-specific-hook {
|
14 |
+
display: initial;
|
15 |
+
}
|
addons/buy-creds/assets/js/admin-script.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function () {
|
2 |
+
jQuery(document).on( 'click', '.mycred-add-specific-hook', function() {
|
3 |
+
var hook = jQuery(this).closest('.hook-instance').clone();
|
4 |
+
hook.find('input.buycred-reward-creds').val('10');
|
5 |
+
hook.find('input.buycred-reward-log').val('Reward for Buying %plural%.');
|
6 |
+
hook.find('select.buycred-reward-min').val('1');
|
7 |
+
hook.find('input.buycred-reward-max').val('10');
|
8 |
+
jQuery(this).closest('.widget-content').append( hook );
|
9 |
+
});
|
10 |
+
jQuery(document).on( 'click', '.mycred-remove-specific-hook', function() {
|
11 |
+
var container = jQuery(this).closest('.widget-content');
|
12 |
+
if ( container.find('.hook-instance').length > 1 ) {
|
13 |
+
var dialog = confirm("Are you sure you want to remove this hook?");
|
14 |
+
if (dialog == true) {
|
15 |
+
jQuery(this).closest('.hook-instance').remove();
|
16 |
+
}
|
17 |
+
}
|
18 |
+
});
|
19 |
+
});
|
addons/buy-creds/includes/buycred-reward-hook.php
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'MYCRED_PURCHASE' ) ) exit;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* myCRED_Addons_Module class
|
6 |
+
* @since 0.1
|
7 |
+
* @version 1.1.1
|
8 |
+
*/
|
9 |
+
if ( ! class_exists( 'myCRED_buyCRED_Reward_Hook' ) ) :
|
10 |
+
class myCRED_buyCRED_Reward_Hook extends myCRED_Hook {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Construct
|
14 |
+
*/
|
15 |
+
function __construct( $hook_prefs, $type = MYCRED_DEFAULT_TYPE_KEY ) {
|
16 |
+
|
17 |
+
parent::__construct( array(
|
18 |
+
'id' => 'buycred_reward',
|
19 |
+
'defaults' => array(
|
20 |
+
'creds' => array(),
|
21 |
+
'log' => array(),
|
22 |
+
'min' => array(),
|
23 |
+
'max' => array()
|
24 |
+
)
|
25 |
+
), $hook_prefs, $type );
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Run
|
31 |
+
* @since 1.8
|
32 |
+
* @version 1.0
|
33 |
+
*/
|
34 |
+
public function run() {
|
35 |
+
|
36 |
+
add_filter( 'mycred_add_finished', array( $this, 'assign_buycred_reward' ), 20, 3 );
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Page Load
|
42 |
+
* @since 1.8
|
43 |
+
* @version 1.0
|
44 |
+
*/
|
45 |
+
public function assign_buycred_reward( $result, $request, $mycred ) {
|
46 |
+
|
47 |
+
extract( $request );
|
48 |
+
|
49 |
+
if ( ! $result || strpos( $ref, 'buy_creds_with' ) === false ) return $result;;
|
50 |
+
|
51 |
+
// Make sure user is not excluded
|
52 |
+
if ( $this->core->exclude_user( $user_id ) ) return;
|
53 |
+
|
54 |
+
if (
|
55 |
+
! empty( $this->prefs['creds'] ) &&
|
56 |
+
! empty( $this->prefs['log'] ) &&
|
57 |
+
! empty( $this->prefs['min'] ) &&
|
58 |
+
! empty( $this->prefs['max'] )
|
59 |
+
) {
|
60 |
+
|
61 |
+
|
62 |
+
$threshold = array();
|
63 |
+
|
64 |
+
foreach ( $this->prefs['creds'] as $key => $value ) {
|
65 |
+
|
66 |
+
if (
|
67 |
+
floatval( $amount ) >= floatval( $this->prefs['min'][$key] ) &&
|
68 |
+
floatval( $amount ) <= floatval( $this->prefs['max'][$key] )
|
69 |
+
) {
|
70 |
+
array_push( $threshold, $key );
|
71 |
+
}
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( ! empty( $threshold ) ) {
|
76 |
+
|
77 |
+
$hook_index = end( $threshold );
|
78 |
+
|
79 |
+
// Execute
|
80 |
+
$this->core->add_creds(
|
81 |
+
'buycred_reward',
|
82 |
+
$user_id,
|
83 |
+
$this->prefs['creds'][$hook_index],
|
84 |
+
$this->prefs['log'][$hook_index],
|
85 |
+
$ref_id,
|
86 |
+
$data,
|
87 |
+
$this->mycred_type
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
92 |
+
|
93 |
+
return $result;
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Preference for Anniversary Hook
|
99 |
+
* @since 1.8
|
100 |
+
* @version 1.0
|
101 |
+
*/
|
102 |
+
public function preferences() {
|
103 |
+
|
104 |
+
$prefs = $this->prefs;
|
105 |
+
|
106 |
+
if ( count( $prefs['creds'] ) > 0 ) {
|
107 |
+
$hooks = $this->buycred_reward_arrange_data( $prefs );
|
108 |
+
$this->buycred_reward_setting( $hooks, $this );
|
109 |
+
}
|
110 |
+
else {
|
111 |
+
$default_data = array(
|
112 |
+
array(
|
113 |
+
'creds' => '10',
|
114 |
+
'log' => 'Reward for Buying %plural%.',
|
115 |
+
'min' => '1',
|
116 |
+
'max' => '10'
|
117 |
+
)
|
118 |
+
);
|
119 |
+
$this->buycred_reward_setting( $default_data, $this );
|
120 |
+
}
|
121 |
+
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Sanitize Preferences
|
126 |
+
*/
|
127 |
+
public function sanitise_preferences( $data ) {
|
128 |
+
|
129 |
+
$new_data = array();
|
130 |
+
|
131 |
+
foreach ( $data as $data_key => $data_value ) {
|
132 |
+
foreach ( $data_value as $key => $value) {
|
133 |
+
if ( $data_key == 'creds' ) {
|
134 |
+
$new_data[$data_key][$key] = ( !empty( $value ) ) ? floatval( $value ) : 10;
|
135 |
+
}
|
136 |
+
else if ( $data_key == 'log' ) {
|
137 |
+
$new_data[$data_key][$key] = ( !empty( $value ) ) ? sanitize_text_field( $value ) : 'Reward for Buying %plural%.';
|
138 |
+
}
|
139 |
+
else if ( $data_key == 'min' ) {
|
140 |
+
$new_data[$data_key][$key] = ( !empty( $value ) ) ? floatval( $value ) : 1;
|
141 |
+
}
|
142 |
+
else if ( $data_key == 'max' ) {
|
143 |
+
$new_data[$data_key][$key] = ( !empty( $value ) ) ? floatval( $value ) : 1;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
return $new_data;
|
148 |
+
}
|
149 |
+
|
150 |
+
public function buycred_reward_arrange_data( $data ){
|
151 |
+
$hook_data = array();
|
152 |
+
foreach ( $data['creds'] as $key => $value ) {
|
153 |
+
$hook_data[$key]['creds'] = $data['creds'][$key];
|
154 |
+
$hook_data[$key]['log'] = $data['log'][$key];
|
155 |
+
$hook_data[$key]['min'] = $data['min'][$key];
|
156 |
+
$hook_data[$key]['max'] = $data['max'][$key];
|
157 |
+
}
|
158 |
+
return $hook_data;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function buycred_reward_setting( $data ){
|
162 |
+
|
163 |
+
foreach ( $data as $hook ):?>
|
164 |
+
<div class="hook-instance">
|
165 |
+
<div class="row">
|
166 |
+
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
167 |
+
<div class="form-group">
|
168 |
+
<label>Reward <?php echo $this->core->plural(); ?></label>
|
169 |
+
<input type="text" name="<?php echo $this->name( $this->mycred_type, 'creds' ); ?>" value="<?php echo $this->core->number( $hook['creds'] ); ?>" class="form-control buycred-reward-creds" />
|
170 |
+
</div>
|
171 |
+
</div>
|
172 |
+
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
173 |
+
<div class="form-group">
|
174 |
+
<label><?php _e( 'Log Template', 'mycred' ); ?></label>
|
175 |
+
<input type="text" name="<?php echo $this->name( $this->mycred_type, 'log' ); ?>" placeholder="<?php _e( 'required', 'mycred' ); ?>" value="<?php echo esc_attr( $hook['log'] ); ?>" class="form-control buycred-reward-log" />
|
176 |
+
<span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>
|
177 |
+
</div>
|
178 |
+
</div>
|
179 |
+
</div>
|
180 |
+
<div class="row">
|
181 |
+
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
182 |
+
<div class="form-group">
|
183 |
+
<label><?php _e( 'Minimum', 'mycred' ); ?></label>
|
184 |
+
<input type="text" name="<?php echo $this->name( $this->mycred_type, 'min' ); ?>" value="<?php echo $this->core->number( $hook['min'] ); ?>" class="form-control buycred-reward-min" />
|
185 |
+
</div>
|
186 |
+
</div>
|
187 |
+
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
188 |
+
<div class="form-group">
|
189 |
+
<label><?php _e( 'Maximium', 'mycred' ); ?></label>
|
190 |
+
<input type="text" name="<?php echo $this->name( $this->mycred_type, 'max' ); ?>" value="<?php echo $this->core->number( $hook['max'] ); ?>" class="form-control buycred-reward-max" />
|
191 |
+
</div>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
+
<div class="row">
|
195 |
+
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
196 |
+
<div class="form-group specific-hook-actions textright">
|
197 |
+
<button class="button button-small mycred-add-specific-hook" type="button">Add More</button>
|
198 |
+
<button class="button button-small mycred-remove-specific-hook" type="button">Remove</button>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
</div>
|
202 |
+
</div>
|
203 |
+
<?php
|
204 |
+
endforeach;
|
205 |
+
}
|
206 |
+
|
207 |
+
public function name( $type, $attr ){
|
208 |
+
|
209 |
+
$hook_prefs_key = 'mycred_pref_hooks';
|
210 |
+
|
211 |
+
if ( $type != MYCRED_DEFAULT_TYPE_KEY ) {
|
212 |
+
$hook_prefs_key = 'mycred_pref_hooks_'.$type;
|
213 |
+
}
|
214 |
+
|
215 |
+
return "{$hook_prefs_key}[hook_prefs][buycred_reward][{$attr}][]";
|
216 |
+
}
|
217 |
+
|
218 |
+
}
|
219 |
+
endif;
|
addons/buy-creds/includes/buycred-reward.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'MYCRED_PURCHASE' ) ) exit;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* myCRED_buyCRED_Module class
|
6 |
+
* @since 0.1
|
7 |
+
* @version 1.4.1
|
8 |
+
*/
|
9 |
+
if ( ! class_exists( 'myCRED_buyCRED_Reward' ) ) :
|
10 |
+
class myCRED_buyCRED_Reward {
|
11 |
+
|
12 |
+
// Instnace
|
13 |
+
protected static $_instance = NULL;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Construct
|
17 |
+
*/
|
18 |
+
function __construct() {
|
19 |
+
|
20 |
+
add_action( 'mycred_admin_enqueue', array( $this, 'register_assets' ) );
|
21 |
+
add_filter( 'mycred_setup_hooks', array( $this, 'register_buycred_reward_hook' ), 10, 2 );
|
22 |
+
add_action( 'mycred_load_hooks', array( $this, 'load_buycred_reward_hook' ) );
|
23 |
+
add_filter( 'mycred_all_references', array( $this, 'register_buycred_reward_refrence' ) );
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Setup Instance
|
29 |
+
* @since 1.7
|
30 |
+
* @version 1.0
|
31 |
+
*/
|
32 |
+
public static function instance() {
|
33 |
+
if ( is_null( self::$_instance ) ) {
|
34 |
+
self::$_instance = new self();
|
35 |
+
}
|
36 |
+
return self::$_instance;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Register Assets
|
41 |
+
* @since 1.8
|
42 |
+
* @version 1.0
|
43 |
+
*/
|
44 |
+
public function register_assets() {
|
45 |
+
|
46 |
+
wp_enqueue_style( 'buycred-admin-style', plugins_url( 'assets/css/admin-style.css', MYCRED_PURCHASE ), array(), MYCRED_PURCHASE_VERSION, 'all' );
|
47 |
+
wp_enqueue_script( 'buycred-admin-script', plugins_url( 'assets/js/admin-script.js', MYCRED_PURCHASE ), array( 'jquery' ), MYCRED_PURCHASE_VERSION, 'all' );
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
public function load_buycred_reward_hook() {
|
52 |
+
require_once MYCRED_BUYCRED_INCLUDES_DIR . 'buycred-reward-hook.php';
|
53 |
+
}
|
54 |
+
|
55 |
+
public function register_buycred_reward_hook( $installed ) {
|
56 |
+
|
57 |
+
$installed['buycred_reward'] = array(
|
58 |
+
'title' => __('Reward for Buying %plural%', 'mycred'),
|
59 |
+
'description' => __('Adds a myCred hook for buyCred reward.', 'mycred'),
|
60 |
+
'callback' => array('myCRED_buyCRED_Reward_Hook')
|
61 |
+
);
|
62 |
+
|
63 |
+
return $installed;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
public function register_buycred_reward_refrence( $list ) {
|
68 |
+
|
69 |
+
$list['buycred_reward'] = __('Reward for buyCRED Purchase', 'mycred');
|
70 |
+
return $list;
|
71 |
+
}
|
72 |
+
|
73 |
+
}
|
74 |
+
endif;
|
75 |
+
|
76 |
+
function mycred_buycred_reward_init() {
|
77 |
+
return myCRED_buyCRED_Reward::instance();
|
78 |
+
}
|
79 |
+
mycred_buycred_reward_init();
|
addons/buy-creds/includes/buycred-shortcodes.php
CHANGED
@@ -21,8 +21,10 @@ if ( ! function_exists( 'mycred_render_buy_points' ) ) :
|
|
21 |
'login' => $settings['login']
|
22 |
), $atts, MYCRED_SLUG . '_buy' ) );
|
23 |
|
|
|
|
|
24 |
// If we are not logged in
|
25 |
-
if ( ! is_user_logged_in() ) return $
|
26 |
|
27 |
global $mycred_modules, $buycred_sale, $post;
|
28 |
|
@@ -41,8 +43,6 @@ if ( ! function_exists( 'mycred_render_buy_points' ) ) :
|
|
41 |
if ( ! in_array( $ctype, $settings['types'] ) )
|
42 |
$ctype = $settings['types'][0];
|
43 |
|
44 |
-
$mycred = mycred( $ctype );
|
45 |
-
|
46 |
$args = array();
|
47 |
$args['mycred_buy'] = $gateway;
|
48 |
$classes[] = $gateway;
|
21 |
'login' => $settings['login']
|
22 |
), $atts, MYCRED_SLUG . '_buy' ) );
|
23 |
|
24 |
+
$mycred = mycred( $ctype );
|
25 |
+
|
26 |
// If we are not logged in
|
27 |
+
if ( ! is_user_logged_in() ) return $mycred->template_tags_general( $login );
|
28 |
|
29 |
global $mycred_modules, $buycred_sale, $post;
|
30 |
|
43 |
if ( ! in_array( $ctype, $settings['types'] ) )
|
44 |
$ctype = $settings['types'][0];
|
45 |
|
|
|
|
|
46 |
$args = array();
|
47 |
$args['mycred_buy'] = $gateway;
|
48 |
$classes[] = $gateway;
|
addons/buy-creds/myCRED-addon-buy-creds.php
CHANGED
@@ -28,6 +28,7 @@ require_once MYCRED_BUYCRED_ABSTRACT_DIR . 'mycred-abstract-payment-gateway.php'
|
|
28 |
|
29 |
require_once MYCRED_BUYCRED_INCLUDES_DIR . 'buycred-functions.php';
|
30 |
require_once MYCRED_BUYCRED_INCLUDES_DIR . 'buycred-shortcodes.php';
|
|
|
31 |
|
32 |
/**
|
33 |
* Load Built-in Gateways
|
28 |
|
29 |
require_once MYCRED_BUYCRED_INCLUDES_DIR . 'buycred-functions.php';
|
30 |
require_once MYCRED_BUYCRED_INCLUDES_DIR . 'buycred-shortcodes.php';
|
31 |
+
require_once MYCRED_BUYCRED_INCLUDES_DIR . 'buycred-reward.php';
|
32 |
|
33 |
/**
|
34 |
* Load Built-in Gateways
|
addons/gateway/carts/mycred-woocommerce.php
CHANGED
@@ -27,11 +27,14 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
|
|
27 |
$this->has_fields = true;
|
28 |
$this->method_title = mycred_label();
|
29 |
$this->method_description = __( 'Let users pay using points.', 'mycred' );
|
30 |
-
|
|
|
31 |
'products',
|
32 |
'refunds'
|
33 |
);
|
34 |
|
|
|
|
|
35 |
if ( ! $this->use_exchange() )
|
36 |
$this->mycred_type = get_woocommerce_currency();
|
37 |
|
27 |
$this->has_fields = true;
|
28 |
$this->method_title = mycred_label();
|
29 |
$this->method_description = __( 'Let users pay using points.', 'mycred' );
|
30 |
+
|
31 |
+
$gateway_suppots = array(
|
32 |
'products',
|
33 |
'refunds'
|
34 |
);
|
35 |
|
36 |
+
$this->supports = apply_filters( 'mycred_woocommerce_gateway_supports', $gateway_suppots );
|
37 |
+
|
38 |
if ( ! $this->use_exchange() )
|
39 |
$this->mycred_type = get_woocommerce_currency();
|
40 |
|
addons/ranks/myCRED-addon-ranks.php
CHANGED
@@ -190,11 +190,20 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
190 |
* @since 1.8
|
191 |
* @version 1.0
|
192 |
*/
|
193 |
-
public function is_manual_mode() {
|
194 |
|
195 |
$manual_mode = false;
|
196 |
-
|
197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
|
199 |
return $manual_mode;
|
200 |
|
@@ -575,14 +584,14 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
575 |
*/
|
576 |
public function balance_adjustment( $result, $request, $mycred ) {
|
577 |
|
578 |
-
// Manual mode
|
579 |
-
if ( $this->is_manual_mode() ) return $result;
|
580 |
-
|
581 |
// If the result was declined
|
582 |
if ( $result === false ) return $result;
|
583 |
|
584 |
extract( $request );
|
585 |
|
|
|
|
|
|
|
586 |
// If ranks for this type is based on total and this is not a admin adjustment
|
587 |
if ( mycred_rank_based_on_total( $type ) && $amount < 0 && $ref != 'manual' )
|
588 |
return $result;
|
@@ -619,7 +628,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
619 |
|
620 |
}
|
621 |
|
622 |
-
if ( $this->is_manual_mode() ) return;
|
623 |
|
624 |
// Publishing or trashing of ranks
|
625 |
if ( ( $new_status == 'publish' && $old_status != 'publish' ) || ( $new_status == 'trash' && $old_status != 'trash' ) ) {
|
@@ -1008,7 +1017,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
1008 |
$rank_title = $users_rank->title;
|
1009 |
|
1010 |
// In manual mode we want to show a dropdown menu so an admin can adjust a users rank
|
1011 |
-
if ( $this->is_manual_mode() && mycred_is_admin( NULL, $point_type ) ) {
|
1012 |
|
1013 |
$ranks = mycred_get_ranks( 'publish', '-1', 'DESC', $point_type );
|
1014 |
echo '<div class="balance-desc current-rank"><select name="rank-' . $point_type . '" id="mycred-rank">';
|
@@ -1020,7 +1029,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
1020 |
|
1021 |
foreach ( $ranks as $rank ) {
|
1022 |
echo '<option value="' . $rank->post_id . '"';
|
1023 |
-
if ( $users_rank->post_id == $rank->post_id ) echo ' selected="selected"';
|
1024 |
echo '>' . $rank->title . '</option>';
|
1025 |
}
|
1026 |
|
@@ -1042,10 +1051,10 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
1042 |
*/
|
1043 |
public function save_manual_rank( $user_id ) {
|
1044 |
|
1045 |
-
|
|
|
1046 |
|
1047 |
-
$
|
1048 |
-
foreach ( $point_types as $type_key => $label ) {
|
1049 |
|
1050 |
if ( isset( $_POST[ 'rank-' . $type_key ] ) && mycred_is_admin( NULL, $type_key ) ) {
|
1051 |
|
@@ -1053,13 +1062,14 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
1053 |
$users_rank = mycred_get_users_rank( $user_id, $type_key );
|
1054 |
|
1055 |
$rank = false;
|
|
|
1056 |
if ( $_POST[ 'rank-' . $type_key ] != '' )
|
1057 |
$rank = absint( $_POST[ 'rank-' . $type_key ] );
|
1058 |
|
1059 |
// Save users rank if a valid rank id is provided and it differs from the users current one
|
1060 |
-
if ( $rank !== false && $rank > 0 && $users_rank
|
1061 |
mycred_save_users_rank( $user_id, $rank, $type_key );
|
1062 |
-
|
1063 |
// Delete users rank
|
1064 |
elseif ( $rank === false ) {
|
1065 |
|
@@ -1072,7 +1082,6 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
1072 |
}
|
1073 |
|
1074 |
}
|
1075 |
-
|
1076 |
}
|
1077 |
|
1078 |
}
|
@@ -1506,7 +1515,7 @@ if ( ! class_exists( 'myCRED_Ranks_Module' ) ) :
|
|
1506 |
wp_cache_delete( 'ranks-published-' . $point_type, MYCRED_SLUG );
|
1507 |
wp_cache_delete( 'ranks-published-count-' . $point_type, MYCRED_SLUG );
|
1508 |
|
1509 |
-
if ( ! $this->is_manual_mode() )
|
1510 |
mycred_assign_ranks( $point_type );
|
1511 |
|
1512 |
}
|
@@ -1851,7 +1860,7 @@ jQuery(function($){
|
|
1851 |
</li>
|
1852 |
<li>
|
1853 |
<label><?php _e( 'Actions', 'mycred' ); ?></label>
|
1854 |
-
<div class="h2"><input type="button" id="mycred-manage-action-reset-ranks" data-type="<?php echo $mycred->mycred_type; ?>" value="<?php _e( 'Remove All Ranks', 'mycred' ); ?>" class="button button-large large <?php if ( $reset_block ) echo '" disabled="disabled'; else echo 'button-primary'; ?>" /><?php if ( ! $this->is_manual_mode() ) : ?> <input type="button" id="mycred-manage-action-assign-ranks" data-type="<?php echo $mycred->mycred_type; ?>" value="<?php _e( 'Assign Ranks to Users', 'mycred' ); ?>" class="button button-large large <?php if ( $reset_block ) echo '" disabled="disabled'; ?>" /></div><?php endif; ?>
|
1855 |
</li>
|
1856 |
</ol>
|
1857 |
<?php
|
190 |
* @since 1.8
|
191 |
* @version 1.0
|
192 |
*/
|
193 |
+
public function is_manual_mode( $type_id ) {
|
194 |
|
195 |
$manual_mode = false;
|
196 |
+
|
197 |
+
$point_type = 'mycred_pref_core';
|
198 |
+
|
199 |
+
if ( $type_id != MYCRED_DEFAULT_TYPE_KEY ) {
|
200 |
+
$point_type = 'mycred_pref_core_' . $type_id;
|
201 |
+
}
|
202 |
+
|
203 |
+
$setting = mycred_get_option( $point_type );
|
204 |
+
|
205 |
+
if ( ! empty( $setting['rank']['base'] ) && $setting['rank']['base'] == 'manual' )
|
206 |
+
$manual_mode = $setting['rank']['base'];
|
207 |
|
208 |
return $manual_mode;
|
209 |
|
584 |
*/
|
585 |
public function balance_adjustment( $result, $request, $mycred ) {
|
586 |
|
|
|
|
|
|
|
587 |
// If the result was declined
|
588 |
if ( $result === false ) return $result;
|
589 |
|
590 |
extract( $request );
|
591 |
|
592 |
+
// Manual mode
|
593 |
+
if ( $this->is_manual_mode( $type ) ) return $result;
|
594 |
+
|
595 |
// If ranks for this type is based on total and this is not a admin adjustment
|
596 |
if ( mycred_rank_based_on_total( $type ) && $amount < 0 && $ref != 'manual' )
|
597 |
return $result;
|
628 |
|
629 |
}
|
630 |
|
631 |
+
if ( $this->is_manual_mode( $point_type ) ) return;
|
632 |
|
633 |
// Publishing or trashing of ranks
|
634 |
if ( ( $new_status == 'publish' && $old_status != 'publish' ) || ( $new_status == 'trash' && $old_status != 'trash' ) ) {
|
1017 |
$rank_title = $users_rank->title;
|
1018 |
|
1019 |
// In manual mode we want to show a dropdown menu so an admin can adjust a users rank
|
1020 |
+
if ( $this->is_manual_mode( $point_type ) && mycred_is_admin( NULL, $point_type ) ) {
|
1021 |
|
1022 |
$ranks = mycred_get_ranks( 'publish', '-1', 'DESC', $point_type );
|
1023 |
echo '<div class="balance-desc current-rank"><select name="rank-' . $point_type . '" id="mycred-rank">';
|
1029 |
|
1030 |
foreach ( $ranks as $rank ) {
|
1031 |
echo '<option value="' . $rank->post_id . '"';
|
1032 |
+
if ( ! empty( $users_rank ) && $users_rank->post_id == $rank->post_id ) echo ' selected="selected"';
|
1033 |
echo '>' . $rank->title . '</option>';
|
1034 |
}
|
1035 |
|
1051 |
*/
|
1052 |
public function save_manual_rank( $user_id ) {
|
1053 |
|
1054 |
+
$point_types = mycred_get_types();
|
1055 |
+
foreach ( $point_types as $type_key => $label ) {
|
1056 |
|
1057 |
+
if ( $this->is_manual_mode( $type_key ) ) {
|
|
|
1058 |
|
1059 |
if ( isset( $_POST[ 'rank-' . $type_key ] ) && mycred_is_admin( NULL, $type_key ) ) {
|
1060 |
|
1062 |
$users_rank = mycred_get_users_rank( $user_id, $type_key );
|
1063 |
|
1064 |
$rank = false;
|
1065 |
+
|
1066 |
if ( $_POST[ 'rank-' . $type_key ] != '' )
|
1067 |
$rank = absint( $_POST[ 'rank-' . $type_key ] );
|
1068 |
|
1069 |
// Save users rank if a valid rank id is provided and it differs from the users current one
|
1070 |
+
if ( $rank !== false && $rank > 0 && $users_rank->rank_id != $rank )
|
1071 |
mycred_save_users_rank( $user_id, $rank, $type_key );
|
1072 |
+
|
1073 |
// Delete users rank
|
1074 |
elseif ( $rank === false ) {
|
1075 |
|
1082 |
}
|
1083 |
|
1084 |
}
|
|
|
1085 |
}
|
1086 |
|
1087 |
}
|
1515 |
wp_cache_delete( 'ranks-published-' . $point_type, MYCRED_SLUG );
|
1516 |
wp_cache_delete( 'ranks-published-count-' . $point_type, MYCRED_SLUG );
|
1517 |
|
1518 |
+
if ( ! $this->is_manual_mode( $point_type ) )
|
1519 |
mycred_assign_ranks( $point_type );
|
1520 |
|
1521 |
}
|
1860 |
</li>
|
1861 |
<li>
|
1862 |
<label><?php _e( 'Actions', 'mycred' ); ?></label>
|
1863 |
+
<div class="h2"><input type="button" id="mycred-manage-action-reset-ranks" data-type="<?php echo $mycred->mycred_type; ?>" value="<?php _e( 'Remove All Ranks', 'mycred' ); ?>" class="button button-large large <?php if ( $reset_block ) echo '" disabled="disabled'; else echo 'button-primary'; ?>" /><?php if ( ! $this->is_manual_mode( $mycred->mycred_type ) ) : ?> <input type="button" id="mycred-manage-action-assign-ranks" data-type="<?php echo $mycred->mycred_type; ?>" value="<?php _e( 'Assign Ranks to Users', 'mycred' ); ?>" class="button button-large large <?php if ( $reset_block ) echo '" disabled="disabled'; ?>" /></div><?php endif; ?>
|
1864 |
</li>
|
1865 |
</ol>
|
1866 |
<?php
|
addons/stats/includes/mycred-stats-functions.php
CHANGED
@@ -835,7 +835,7 @@ if ( ! function_exists( 'mycred_get_users_history_data' ) ) :
|
|
835 |
$selects = array();
|
836 |
|
837 |
foreach ( $periods as $row => $setup )
|
838 |
-
$selects[] = $wpdb->prepare( '
|
839 |
|
840 |
$select = implode( ', ' . "\n", $selects );
|
841 |
|
835 |
$selects = array();
|
836 |
|
837 |
foreach ( $periods as $row => $setup )
|
838 |
+
$selects[] = $wpdb->prepare( 'SUM( CASE WHEN time BETWEEN %d AND %d THEN creds END) AS period%d', $setup['from'], $setup['until'], $row );
|
839 |
|
840 |
$select = implode( ', ' . "\n", $selects );
|
841 |
|
addons/transfer/assets/js/mycred-transfer.js
CHANGED
@@ -79,10 +79,11 @@
|
|
79 |
url : myCREDTransfer.ajaxurl,
|
80 |
beforeSend : function() {
|
81 |
|
82 |
-
$( formid + 'input.form-control' ).each(function(index){
|
83 |
$(this).attr( 'disabled', 'disabled' );
|
84 |
});
|
85 |
|
|
|
86 |
submitbutton.val( myCREDTransfer.working );
|
87 |
|
88 |
},
|
@@ -94,6 +95,7 @@
|
|
94 |
$(this).removeAttr( 'disabled' );
|
95 |
});
|
96 |
|
|
|
97 |
submitbutton.val( buttonlabel );
|
98 |
|
99 |
if ( response.success !== undefined ) {
|
79 |
url : myCREDTransfer.ajaxurl,
|
80 |
beforeSend : function() {
|
81 |
|
82 |
+
$( formid + ' input.form-control' ).each(function(index){
|
83 |
$(this).attr( 'disabled', 'disabled' );
|
84 |
});
|
85 |
|
86 |
+
submitbutton.attr( 'disabled', 'disabled' );
|
87 |
submitbutton.val( myCREDTransfer.working );
|
88 |
|
89 |
},
|
95 |
$(this).removeAttr( 'disabled' );
|
96 |
});
|
97 |
|
98 |
+
submitbutton.removeAttr( 'disabled', 'disabled' );
|
99 |
submitbutton.val( buttonlabel );
|
100 |
|
101 |
if ( response.success !== undefined ) {
|
assets/css/admin-subscription.css
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
.mmc_welcome{ margin: 12px;padding: 50px 10px;border-radius: 10px;text-align: center;width: 500p }
|
3 |
.mmc_title{ text-align: center;font-size: 30px;font-weight: 100; line-height: 35px; }
|
4 |
.mmc_welcome .mmc_lincense_key{ width: 404px;border-radius: 6px;font-size: 17px;padding: 9px 14px;margin-top: 30px }
|
5 |
-
.mmc_welcome .mmc_save_license{ font-size: 12px;height:
|
6 |
-
.mmc_welcome_content form{ width:
|
7 |
.mmc_welcome_content a{ text-align: left }
|
8 |
.mmc_license_link a{ text-decoration: none }
|
9 |
.mmc_license_link{ text-align: left;margin: 5px 0px}
|
@@ -19,4 +19,334 @@
|
|
19 |
.mycred-review-ul { margin: 0; padding: 0; }
|
20 |
.mycred-review-ul li { display: inline-block; margin-right: 15px; }
|
21 |
.mycred-review-ul li a { display: inline-block; color: #10738B; text-decoration: none; padding-left: 26px; position: relative; }
|
22 |
-
.mycred-review-ul li a span { position: absolute; left: 0; top: -2px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
.mmc_welcome{ margin: 12px;padding: 50px 10px;border-radius: 10px;text-align: center;width: 500p }
|
3 |
.mmc_title{ text-align: center;font-size: 30px;font-weight: 100; line-height: 35px; }
|
4 |
.mmc_welcome .mmc_lincense_key{ width: 404px;border-radius: 6px;font-size: 17px;padding: 9px 14px;margin-top: 30px }
|
5 |
+
.mmc_welcome .mmc_save_license{ font-size: 12px;height: 52px;width: 100px;font-size: 20px }
|
6 |
+
.mmc_welcome_content form{ width: 512px;margin: 0 auto }
|
7 |
.mmc_welcome_content a{ text-align: left }
|
8 |
.mmc_license_link a{ text-decoration: none }
|
9 |
.mmc_license_link{ text-align: left;margin: 5px 0px}
|
19 |
.mycred-review-ul { margin: 0; padding: 0; }
|
20 |
.mycred-review-ul li { display: inline-block; margin-right: 15px; }
|
21 |
.mycred-review-ul li a { display: inline-block; color: #10738B; text-decoration: none; padding-left: 26px; position: relative; }
|
22 |
+
.mycred-review-ul li a span { position: absolute; left: 0; top: -2px; }
|
23 |
+
|
24 |
+
|
25 |
+
.membership-license-activated{
|
26 |
+
float: left;
|
27 |
+
position: absolute;
|
28 |
+
margin-left: 370px;
|
29 |
+
margin-top: 44px;
|
30 |
+
font-size: 28px;
|
31 |
+
color: #15b915;
|
32 |
+
}
|
33 |
+
.membership-license-inactive{
|
34 |
+
float: left;
|
35 |
+
position: absolute;
|
36 |
+
margin-left: 370px;
|
37 |
+
margin-top: 44px;
|
38 |
+
font-size: 28px;
|
39 |
+
color: #b91515;
|
40 |
+
}
|
41 |
+
.mycred-addon-network-active{
|
42 |
+
pointer-events: none;
|
43 |
+
cursor: default;
|
44 |
+
}
|
45 |
+
|
46 |
+
/** myCred Membership Table **/
|
47 |
+
.mmc_table{/* background-color:#FFF; */ padding: 0 20px 0 20px;}
|
48 |
+
.mmc_table_column{background-color:#FFF;}
|
49 |
+
.mmc_table .mmc_table_plan {
|
50 |
+
font-size: 18px;
|
51 |
+
font-weight: bold;
|
52 |
+
color: rgba(89, 40, 158, 1);
|
53 |
+
text-align: center;
|
54 |
+
line-height: 24px;
|
55 |
+
-webkit-transform: scale(1);
|
56 |
+
-ms-transform: scale(1);
|
57 |
+
transform: scale(1);
|
58 |
+
margin: 11% 0;
|
59 |
+
text-transform: uppercase;
|
60 |
+
}
|
61 |
+
.mmc_table .mmc_table_pricing_worth {
|
62 |
+
color: #999;
|
63 |
+
font-weight: normal;
|
64 |
+
text-align:center;
|
65 |
+
margin-bottom: 0px;
|
66 |
+
font-size: 20px;
|
67 |
+
-webkit-text-decoration-line: line-through;
|
68 |
+
text-decoration-line: line-through;
|
69 |
+
text-decoration-color: red;
|
70 |
+
}
|
71 |
+
|
72 |
+
.mmc_table .mmc_table_pricing_current {
|
73 |
+
font-size: 48px;
|
74 |
+
font-weight: bold;
|
75 |
+
color: rgba(89, 40, 158, 1);
|
76 |
+
text-align: center;
|
77 |
+
line-height: 24px;
|
78 |
+
-webkit-transform: scale(1);
|
79 |
+
-ms-transform: scale(1);
|
80 |
+
transform: scale(1);
|
81 |
+
margin: 3% 0 14% 0;
|
82 |
+
}
|
83 |
+
|
84 |
+
.mmc_table .mmc_table_pricing .mmc_table_pricing_dollar_sign{
|
85 |
+
font-size: 26px;
|
86 |
+
vertical-align: super;
|
87 |
+
}
|
88 |
+
|
89 |
+
.mmc_table .mmc_table_plan_sites {
|
90 |
+
font-size: 16px;
|
91 |
+
color: rgba(136, 0, 255, 1);
|
92 |
+
text-align: center;
|
93 |
+
line-height: 24px;
|
94 |
+
-webkit-transform: scale(1);
|
95 |
+
-ms-transform: scale(1);
|
96 |
+
transform: scale(1);
|
97 |
+
margin: 11% 0;
|
98 |
+
font-weight: normal;
|
99 |
+
margin: 3% 0;
|
100 |
+
margin-bottom: 0 !important;
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
.mmc_table .mmc_table_plan_billed{
|
105 |
+
color: #999ea9;
|
106 |
+
font-size: 12px;
|
107 |
+
font-weight: 100;
|
108 |
+
line-height: 20px;
|
109 |
+
margin-bottom: 10px;
|
110 |
+
font-style: italic;
|
111 |
+
text-align: center;
|
112 |
+
margin-top: 0px;
|
113 |
+
}
|
114 |
+
|
115 |
+
.mmc_table .mmc_table_addon_details li{
|
116 |
+
position: relative;
|
117 |
+
display: block;
|
118 |
+
padding: 8px 25px;
|
119 |
+
margin-bottom: -1px;
|
120 |
+
background-color: #ffffff;
|
121 |
+
border: none;
|
122 |
+
font-size: 16px;
|
123 |
+
color: rgba(89, 40, 158, 1) !important;
|
124 |
+
text-align: center;
|
125 |
+
line-height: 24px;
|
126 |
+
-webkit-transform: scale(1);
|
127 |
+
-ms-transform: scale(1);
|
128 |
+
transform: scale(1);
|
129 |
+
}
|
130 |
+
|
131 |
+
.mmc_table .mmc_table_get_started{
|
132 |
+
text-align:center;
|
133 |
+
margin-bottom: 30px;
|
134 |
+
}
|
135 |
+
.mmc_table .mmc_table_get_started a{
|
136 |
+
font-size: 14px;
|
137 |
+
font-weight: bold;
|
138 |
+
color: rgba(255, 255, 255, 1) !important;
|
139 |
+
text-align: center;
|
140 |
+
line-height: 19px;
|
141 |
+
-webkit-transform: scale(1);
|
142 |
+
-ms-transform: scale(1);
|
143 |
+
transform: scale(1);
|
144 |
+
background: rgba(106, 0, 255, 1);
|
145 |
+
border-radius: 25px;
|
146 |
+
cursor: pointer !important;
|
147 |
+
text-decoration: none !important;
|
148 |
+
margin: 10% 0 0 0;
|
149 |
+
display: block;
|
150 |
+
padding: 10px 40px;
|
151 |
+
}
|
152 |
+
|
153 |
+
.mmc_table .border-right{
|
154 |
+
border-right: 1px solid #ccc;
|
155 |
+
}
|
156 |
+
|
157 |
+
.mmc_table .mmc_table_most_popular{
|
158 |
+
color: white;
|
159 |
+
background: #ff6f41;
|
160 |
+
padding: 8px 0px 6px 0px;
|
161 |
+
position: absolute;
|
162 |
+
top: -20px;
|
163 |
+
z-index: 99;
|
164 |
+
width: 150px;
|
165 |
+
text-align: center;
|
166 |
+
right: 0;
|
167 |
+
left: 0;
|
168 |
+
margin: 0 auto;
|
169 |
+
font-size: 16px;
|
170 |
+
line-height: 22px;
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
div#tabs_package_1 {
|
175 |
+
width: auto;
|
176 |
+
display: block;
|
177 |
+
float: none;
|
178 |
+
text-align: center;
|
179 |
+
margin-bottom: 50px;
|
180 |
+
}
|
181 |
+
|
182 |
+
#tabs_package_1 a {
|
183 |
+
padding: 8px 10px;
|
184 |
+
height: 45px;
|
185 |
+
line-height: 42px;
|
186 |
+
color: #000;
|
187 |
+
text-decoration: none;
|
188 |
+
text-transform: uppercase;
|
189 |
+
position: relative;
|
190 |
+
}
|
191 |
+
|
192 |
+
#tabs_package_1 a sup {
|
193 |
+
background: #f05d3e;
|
194 |
+
width: 97px;
|
195 |
+
/* height: 30px; */
|
196 |
+
word-break: break-all;
|
197 |
+
overflow: hidden;
|
198 |
+
padding: 10px 1px;
|
199 |
+
position: absolute;
|
200 |
+
top: -20px;
|
201 |
+
color: #FFF;
|
202 |
+
font-size: 12px;
|
203 |
+
line-height: 14px;
|
204 |
+
right: 10px;
|
205 |
+
border-radius: 10px 10px 0px 0px;
|
206 |
+
margin: -6px;
|
207 |
+
display:none;
|
208 |
+
}
|
209 |
+
#tabs_package_1 a.active_pkg {
|
210 |
+
color: #000!important;
|
211 |
+
font-weight: bold;
|
212 |
+
color: purple !important;
|
213 |
+
text-decoration:underline;
|
214 |
+
}
|
215 |
+
.radio_btns_pkg{
|
216 |
+
width: 480px;
|
217 |
+
background-color: #f7f7f7;
|
218 |
+
border-radius: 50px;
|
219 |
+
color: black;
|
220 |
+
margin: 0 auto;
|
221 |
+
box-shadow: 2px 2px 5px #272727;
|
222 |
+
}
|
223 |
+
div#tabs_package_1 {
|
224 |
+
position: relative;
|
225 |
+
}
|
226 |
+
#tabs_package_1 .switch_btn {
|
227 |
+
position: relative;
|
228 |
+
display: inline-block;
|
229 |
+
width: 60px;
|
230 |
+
height: 34px;
|
231 |
+
margin-bottom:0px;
|
232 |
+
}
|
233 |
+
|
234 |
+
#tabs_package_1 .switch_btn input {
|
235 |
+
opacity: 0;
|
236 |
+
width: 0;
|
237 |
+
height: 0;
|
238 |
+
}
|
239 |
+
#tabs_package_1 .slider_btn {
|
240 |
+
position: absolute;
|
241 |
+
cursor: pointer;
|
242 |
+
top: 0;
|
243 |
+
left: 0;
|
244 |
+
right: 0;
|
245 |
+
bottom: 0;
|
246 |
+
background-color: #894be0!important;
|
247 |
+
-webkit-transition: .4s;
|
248 |
+
transition: .4s;
|
249 |
+
}
|
250 |
+
|
251 |
+
#tabs_package_1 .slider_btn:before {
|
252 |
+
position: absolute;
|
253 |
+
content: "";
|
254 |
+
height: 26px;
|
255 |
+
width: 26px;
|
256 |
+
left: 4px;
|
257 |
+
bottom: 4px;
|
258 |
+
background-color: white;
|
259 |
+
-webkit-transition: .4s;
|
260 |
+
transition: .4s;
|
261 |
+
}
|
262 |
+
.join_one_year,
|
263 |
+
.join_three_year{
|
264 |
+
margin-bottom: 50px;
|
265 |
+
}
|
266 |
+
#tabs_package_1 input:checked + #tabs_package_1 .slider_btn {
|
267 |
+
background-color: #894be0!important;
|
268 |
+
}
|
269 |
+
|
270 |
+
#tabs_package_1 input:checked + .slider_btn:before {
|
271 |
+
-webkit-transform: translateX(26px);
|
272 |
+
-ms-transform: translateX(26px);
|
273 |
+
transform: translateX(26px);
|
274 |
+
}
|
275 |
+
#tabs_package_1 .radio_btns_pkg{
|
276 |
+
line-height:34px;
|
277 |
+
}
|
278 |
+
/* Rounded sliders */
|
279 |
+
#tabs_package_1 .slider_btn.round {
|
280 |
+
border-radius: 34px;
|
281 |
+
}
|
282 |
+
|
283 |
+
#tabs_package_1 .slider_btn.round:before {
|
284 |
+
border-radius: 50%;
|
285 |
+
}
|
286 |
+
.show_cont{
|
287 |
+
display:block!important;
|
288 |
+
}
|
289 |
+
.hide_cont{
|
290 |
+
display:none!important;
|
291 |
+
}
|
292 |
+
.row.mycred-money-back {
|
293 |
+
display: none;
|
294 |
+
}
|
295 |
+
@media (max-width: 510px) {
|
296 |
+
div#tabs_package_1{
|
297 |
+
margin-bottom: 30px;
|
298 |
+
}
|
299 |
+
#tabs_package_1 .radio_btns_pkg{
|
300 |
+
width: 100%!important;
|
301 |
+
}
|
302 |
+
}
|
303 |
+
@media (max-width: 440px) {
|
304 |
+
#tabs_package_1 a sup{
|
305 |
+
margin: 0px;
|
306 |
+
width:80px;
|
307 |
+
padding:3px 1px;
|
308 |
+
}
|
309 |
+
|
310 |
+
#tabs_package_1 a{
|
311 |
+
display: block;
|
312 |
+
}
|
313 |
+
#tabs_package_1 a sup{
|
314 |
+
top: 0px;
|
315 |
+
right: 70px;
|
316 |
+
height:auto;
|
317 |
+
}
|
318 |
+
}
|
319 |
+
.three_year {
|
320 |
+
display: none;
|
321 |
+
}
|
322 |
+
.mmc_table .mmc_table_get_started a.three_year{
|
323 |
+
display: none;
|
324 |
+
}
|
325 |
+
|
326 |
+
.mmc-addons .theme .theme-screenshot img {
|
327 |
+
/* height: 100%; */
|
328 |
+
width: 75%;
|
329 |
+
text-align: center;
|
330 |
+
margin: 0 auto;
|
331 |
+
}
|
332 |
+
|
333 |
+
.mmc-addons .theme .theme-screenshot {
|
334 |
+
display: block;
|
335 |
+
overflow: hidden;
|
336 |
+
position: relative;
|
337 |
+
-webkit-backface-visibility: hidden;
|
338 |
+
transition: opacity .2s ease-in-out;
|
339 |
+
background-color: white;
|
340 |
+
text-align: center;
|
341 |
+
}
|
342 |
+
|
343 |
+
.mmc-addons .theme .theme-screenshot:after {
|
344 |
+
padding-top: 0%;
|
345 |
+
}
|
346 |
+
|
347 |
+
.mmc-addons .theme .theme-screenshot img {
|
348 |
+
margin: 0 auto;
|
349 |
+
display: block;
|
350 |
+
float: none;
|
351 |
+
position: relative!important;
|
352 |
+
}
|
assets/css/mycred-front.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.widget .myCRED-rank { float:right; }.widget .myCRED-rank span { padding-right:4px; color:gray; }.widget .myCRED-balance { display:block; margin-bottom:24px; text-align:center; font-size:larger; }.widget .myCRED-leaderboard .cred { float:right; }.widget .myCRED-leaderboard .first-item { font-size:110%; }.widget .myCRED-history { padding:0; margin:0; list-style-type:none; }.widget .myCRED-history .creds { float:right; padding: 0; clear:left; }
|
1 |
+
.widget .myCRED-rank { float:right; }.widget .myCRED-rank span { padding-right:4px; color:gray; }.widget .myCRED-balance { display:block; margin-bottom:24px; text-align:center; font-size:larger; }.widget .myCRED-leaderboard .cred { float:right; }.widget .myCRED-leaderboard .first-item { font-size:110%; }.widget .myCRED-history { padding:0; margin:0; list-style-type:none; }.widget .myCRED-history .creds { float:right; padding: 0; clear:left; } .mycred-nav-menu-item img { display: inline-block; }
|
assets/images/mycred-membership-activated.png
ADDED
Binary file
|
includes/hooks/external/mycred-hook-bbPress.php
CHANGED
@@ -208,7 +208,7 @@ function mycred_load_bbpress_hook() {
|
|
208 |
if ( $this->over_hook_limit( 'new_forum', 'new_forum', $forum_author ) ) return;
|
209 |
|
210 |
// Make sure this is unique event
|
211 |
-
if ( $this->
|
212 |
|
213 |
// Execute
|
214 |
$this->core->add_creds(
|
@@ -234,7 +234,7 @@ function mycred_load_bbpress_hook() {
|
|
234 |
$forum_author = bbp_get_forum_author_id( $forum_id );
|
235 |
|
236 |
// If gained, points, deduct
|
237 |
-
if ( $this->
|
238 |
|
239 |
// Execute
|
240 |
$this->core->add_creds(
|
@@ -270,7 +270,7 @@ function mycred_load_bbpress_hook() {
|
|
270 |
if ( $this->over_hook_limit( 'new_topic', 'new_forum_topic', $topic_author ) ) return;
|
271 |
|
272 |
// Make sure this is unique event
|
273 |
-
if ( $this->
|
274 |
|
275 |
// Execute
|
276 |
$this->core->add_creds(
|
@@ -296,7 +296,7 @@ function mycred_load_bbpress_hook() {
|
|
296 |
$topic_author = bbp_get_topic_author_id( $topic_id );
|
297 |
|
298 |
// If gained, points, deduct
|
299 |
-
if ( $this->
|
300 |
|
301 |
// Execute
|
302 |
$this->core->add_creds(
|
@@ -332,7 +332,7 @@ function mycred_load_bbpress_hook() {
|
|
332 |
|
333 |
// Make sure this is a unique event (favorite not from same user)
|
334 |
$data = array( 'ref_user' => $user_id, 'ref_type' => 'post' );
|
335 |
-
if ( $this->
|
336 |
|
337 |
// Execute
|
338 |
$this->core->add_creds(
|
@@ -364,7 +364,7 @@ function mycred_load_bbpress_hook() {
|
|
364 |
if ( $this->over_hook_limit( 'new_reply', 'new_forum_reply', $reply_author ) ) return;
|
365 |
|
366 |
// Make sure this is unique event
|
367 |
-
if ( $this->
|
368 |
|
369 |
// Execute
|
370 |
$this->core->add_creds(
|
@@ -390,7 +390,7 @@ function mycred_load_bbpress_hook() {
|
|
390 |
$reply_author = bbp_get_reply_author_id( $reply_id );
|
391 |
|
392 |
// If gained, points, deduct
|
393 |
-
if ( $this->
|
394 |
|
395 |
// Execute
|
396 |
$this->core->add_creds(
|
@@ -659,6 +659,48 @@ function mycred_load_bbpress_hook() {
|
|
659 |
return $data;
|
660 |
}
|
661 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
662 |
}
|
663 |
|
664 |
}
|
208 |
if ( $this->over_hook_limit( 'new_forum', 'new_forum', $forum_author ) ) return;
|
209 |
|
210 |
// Make sure this is unique event
|
211 |
+
if ( $this->bbpress_has_entry( 'new_forum', $forum_id, $forum_author ) ) return;
|
212 |
|
213 |
// Execute
|
214 |
$this->core->add_creds(
|
234 |
$forum_author = bbp_get_forum_author_id( $forum_id );
|
235 |
|
236 |
// If gained, points, deduct
|
237 |
+
if ( $this->bbpress_has_entry( 'new_forum', $forum_id, $forum_author ) ) {
|
238 |
|
239 |
// Execute
|
240 |
$this->core->add_creds(
|
270 |
if ( $this->over_hook_limit( 'new_topic', 'new_forum_topic', $topic_author ) ) return;
|
271 |
|
272 |
// Make sure this is unique event
|
273 |
+
if ( $this->bbpress_has_entry( 'new_forum_topic', $topic_id, $topic_author ) ) return;
|
274 |
|
275 |
// Execute
|
276 |
$this->core->add_creds(
|
296 |
$topic_author = bbp_get_topic_author_id( $topic_id );
|
297 |
|
298 |
// If gained, points, deduct
|
299 |
+
if ( $this->bbpress_has_entry( 'new_forum_topic', $topic_id, $topic_author ) ) {
|
300 |
|
301 |
// Execute
|
302 |
$this->core->add_creds(
|
332 |
|
333 |
// Make sure this is a unique event (favorite not from same user)
|
334 |
$data = array( 'ref_user' => $user_id, 'ref_type' => 'post' );
|
335 |
+
if ( $this->bbpress_has_entry( 'topic_favorited', $topic_id, $topic_author, $data ) ) return;
|
336 |
|
337 |
// Execute
|
338 |
$this->core->add_creds(
|
364 |
if ( $this->over_hook_limit( 'new_reply', 'new_forum_reply', $reply_author ) ) return;
|
365 |
|
366 |
// Make sure this is unique event
|
367 |
+
if ( $this->bbpress_has_entry( 'new_forum_reply', $reply_id, $reply_author ) ) return;
|
368 |
|
369 |
// Execute
|
370 |
$this->core->add_creds(
|
390 |
$reply_author = bbp_get_reply_author_id( $reply_id );
|
391 |
|
392 |
// If gained, points, deduct
|
393 |
+
if ( $this->bbpress_has_entry( 'new_forum_reply', $reply_id, $reply_author ) ) {
|
394 |
|
395 |
// Execute
|
396 |
$this->core->add_creds(
|
659 |
return $data;
|
660 |
}
|
661 |
|
662 |
+
public function bbpress_has_entry($reference = NULL, $ref_id = NULL, $user_id = NULL, $data = NULL, $type = MYCRED_DEFAULT_TYPE_KEY){
|
663 |
+
$has_entry = false;
|
664 |
+
if ( ! MYCRED_ENABLE_LOGGING ) return $has_entry;
|
665 |
+
|
666 |
+
if ( ! $has_entry && $user_id !== NULL) {
|
667 |
+
|
668 |
+
global $wpdb;
|
669 |
+
|
670 |
+
$wheres = array();
|
671 |
+
|
672 |
+
if ( $reference !== NULL )
|
673 |
+
$wheres[] = $wpdb->prepare( "ref = %s", $reference );
|
674 |
+
|
675 |
+
if ( $ref_id !== NULL )
|
676 |
+
$wheres[] = $wpdb->prepare( "ref_id = %d", $ref_id );
|
677 |
+
|
678 |
+
if ( $user_id !== NULL )
|
679 |
+
$wheres[] = $wpdb->prepare( "user_id = %d", $user_id );
|
680 |
+
|
681 |
+
// if ( $data !== NULL )
|
682 |
+
// $wheres[] = $wpdb->prepare( "data = %s", maybe_serialize( $data ) );
|
683 |
+
|
684 |
+
if ( $type === NULL ) $type = $this->get_point_type_key();
|
685 |
+
$wheres[] = $wpdb->prepare( "ctype = %s", $type );
|
686 |
+
|
687 |
+
$where = implode( ' AND ', $wheres );
|
688 |
+
|
689 |
+
if ( ! empty( $wheres ) ) {
|
690 |
+
|
691 |
+
$check = $wpdb->get_var( "SELECT id FROM {$wpdb->prefix}myCRED_log WHERE {$where};" );
|
692 |
+
if ( $check !== NULL )
|
693 |
+
$has_entry = true;
|
694 |
+
|
695 |
+
}
|
696 |
+
|
697 |
+
}
|
698 |
+
|
699 |
+
return $has_entry;
|
700 |
+
|
701 |
+
|
702 |
+
}
|
703 |
+
|
704 |
}
|
705 |
|
706 |
}
|
includes/hooks/external/mycred-hook-woocommerce.php
CHANGED
@@ -47,15 +47,17 @@ endif;
|
|
47 |
*/
|
48 |
if ( ! function_exists( 'mycred_woo_add_product_metabox' ) ) :
|
49 |
function mycred_woo_add_product_metabox() {
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
59 |
|
60 |
}
|
61 |
endif;
|
@@ -67,35 +69,38 @@ endif;
|
|
67 |
*/
|
68 |
if ( ! function_exists( 'mycred_woo_product_metabox' ) ) :
|
69 |
function mycred_woo_product_metabox( $post ) {
|
|
|
|
|
|
|
|
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
$types = mycred_get_types();
|
74 |
-
$prefs = (array) mycred_get_post_meta( $post->ID, 'mycred_reward', true );
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
87 |
|
88 |
-
|
89 |
|
90 |
-
|
91 |
|
92 |
-
?>
|
93 |
-
<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>
|
94 |
-
<div class="mycred-woo-wrap" id="reward-<?php echo $point_type; ?>" style="display:<?php if ( $setup == '' ) echo 'none'; else echo 'block'; ?>">
|
95 |
-
|
96 |
-
</div>
|
97 |
-
<?php
|
98 |
|
|
|
99 |
}
|
100 |
|
101 |
?>
|
@@ -143,6 +148,17 @@ if ( ! function_exists( 'mycred_woo_add_product_variation_detail' ) ) :
|
|
143 |
}
|
144 |
|
145 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
<div class="" id="mycred_woo_vaiation">
|
147 |
<?php
|
148 |
|
@@ -253,7 +269,7 @@ endif;
|
|
253 |
*/
|
254 |
if ( ! function_exists( 'mycred_woo_payout_rewards' ) ) :
|
255 |
function mycred_woo_payout_rewards( $order_id ) {
|
256 |
-
|
257 |
// Get Order
|
258 |
$order = wc_get_order( $order_id );
|
259 |
|
47 |
*/
|
48 |
if ( ! function_exists( 'mycred_woo_add_product_metabox' ) ) :
|
49 |
function mycred_woo_add_product_metabox() {
|
50 |
+
$product = wc_get_product( get_the_ID() );
|
51 |
+
if( $product->is_type( 'simple' ) ) {
|
52 |
+
add_meta_box(
|
53 |
+
'mycred_woo_sales_setup',
|
54 |
+
mycred_label(),
|
55 |
+
'mycred_woo_product_metabox',
|
56 |
+
'product',
|
57 |
+
'side',
|
58 |
+
'high'
|
59 |
+
);
|
60 |
+
}
|
61 |
|
62 |
}
|
63 |
endif;
|
69 |
*/
|
70 |
if ( ! function_exists( 'mycred_woo_product_metabox' ) ) :
|
71 |
function mycred_woo_product_metabox( $post ) {
|
72 |
+
|
73 |
+
$product = wc_get_product( get_the_ID() );
|
74 |
+
if( $product->is_type( 'simple' ) ) {
|
75 |
+
if ( ! current_user_can( apply_filters( 'mycred_woo_reward_cap', 'edit_others_posts' ) ) ) return;
|
76 |
|
77 |
+
$types = mycred_get_types();
|
78 |
+
$prefs = (array) mycred_get_post_meta( $post->ID, 'mycred_reward', true );
|
|
|
|
|
79 |
|
80 |
+
foreach ( $types as $point_type => $point_type_label ) {
|
81 |
+
if ( ! array_key_exists( $point_type, $prefs ) )
|
82 |
+
$prefs[ $point_type ] = '';
|
83 |
+
}
|
84 |
|
85 |
+
$count = 0;
|
86 |
+
$cui = get_current_user_id();
|
87 |
+
foreach ( $types as $point_type => $point_type_label ) {
|
88 |
|
89 |
+
$count ++;
|
90 |
+
$mycred = mycred( $point_type );
|
91 |
|
92 |
+
if ( ! $mycred->user_is_point_admin( $cui ) ) continue;
|
93 |
|
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 |
|
103 |
+
}
|
104 |
}
|
105 |
|
106 |
?>
|
148 |
}
|
149 |
|
150 |
?>
|
151 |
+
<style type="text/css">
|
152 |
+
#mycred_woo_sales_setup .inside { margin: 0; padding: 0; }
|
153 |
+
#mycred_woo_sales_setup .inside > p { padding: 12px; margin: 0; border-top: 1px solid #ddd; }
|
154 |
+
#mycred_woo_sales_setup .inside > p.first { border-top: none; }
|
155 |
+
#mycred_woo_sales_setup .inside .mycred-woo-wrap { padding: 6px 12px; line-height: 27px; text-align: right; border-top: 1px solid #ddd; background-color: #F5F5F5; }
|
156 |
+
#mycred_woo_sales_setup .inside .mycred-woo-wrap label { display: block; font-weight: bold; float: left; }
|
157 |
+
#mycred_woo_sales_setup .inside .mycred-woo-wrap input { width: 50%; }
|
158 |
+
#mycred_woo_sales_setup .inside .mycred-woo-wrap p { margin: 0; padding: 0 12px; font-style: italic; text-align: center; }
|
159 |
+
#mycred_woo_vaiation .box { display: block; float: left; width: 49%; margin-right: 1%; margin-bottom: 12px; }
|
160 |
+
#mycred_woo_vaiation .box input { display: block; width: 100%; }
|
161 |
+
</style>
|
162 |
<div class="" id="mycred_woo_vaiation">
|
163 |
<?php
|
164 |
|
269 |
*/
|
270 |
if ( ! function_exists( 'mycred_woo_payout_rewards' ) ) :
|
271 |
function mycred_woo_payout_rewards( $order_id ) {
|
272 |
+
|
273 |
// Get Order
|
274 |
$order = wc_get_order( $order_id );
|
275 |
|
includes/hooks/mycred-hook-referrals.php
CHANGED
@@ -194,6 +194,8 @@ if ( ! class_exists( 'myCRED_Hook_Affiliate' ) ) :
|
|
194 |
|
195 |
// Check for exclusion
|
196 |
if ( $this->core->exclude_user( $user_id ) ) return;
|
|
|
|
|
197 |
|
198 |
// If it is my profile or other members allowed to view eachothers profiles or if we are admins
|
199 |
if ( bp_is_my_profile() || mycred_is_admin() ) {
|
194 |
|
195 |
// Check for exclusion
|
196 |
if ( $this->core->exclude_user( $user_id ) ) return;
|
197 |
+
|
198 |
+
$users_ref_link = '';
|
199 |
|
200 |
// If it is my profile or other members allowed to view eachothers profiles or if we are admins
|
201 |
if ( bp_is_my_profile() || mycred_is_admin() ) {
|
includes/mycred-nav-menu.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'myCRED_VERSION' ) ) exit;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* myCred Menu
|
6 |
+
* Menu Items in Wordpress menu
|
7 |
+
* @since 1.9
|
8 |
+
* @version 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! class_exists( 'myCRED_Nav_Menu' ) ) :
|
12 |
+
class myCRED_Nav_Menu {
|
13 |
+
|
14 |
+
// Instnace
|
15 |
+
protected static $_instance = NULL;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Setup Instance
|
19 |
+
* @since 1.9
|
20 |
+
* @version 1.0
|
21 |
+
*/
|
22 |
+
public static function instance() {
|
23 |
+
if ( is_null( self::$_instance ) ) {
|
24 |
+
self::$_instance = new self();
|
25 |
+
}
|
26 |
+
return self::$_instance;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Construct
|
31 |
+
*/
|
32 |
+
public function __construct() {
|
33 |
+
|
34 |
+
add_action( 'admin_head-nav-menus.php', array( $this, 'setup_mycred_nav_menu' ) );
|
35 |
+
add_filter( 'walker_nav_menu_start_el', array( $this, 'display_mycred_menu_items' ), 20, 2 );
|
36 |
+
add_filter( 'wp_setup_nav_menu_item', array( $this, 'setup_item' ), 10, 1 );
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setup_mycred_nav_menu() {
|
41 |
+
|
42 |
+
add_meta_box(
|
43 |
+
'mycred-nav-menu-section',
|
44 |
+
__( 'myCred', 'mycred' ),
|
45 |
+
array( $this, 'mycred_nav_menu_meta_box' ),
|
46 |
+
'nav-menus',
|
47 |
+
'side',
|
48 |
+
'default'
|
49 |
+
);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function mycred_nav_menu_meta_box() {
|
53 |
+
|
54 |
+
global $_nav_menu_placeholder, $nav_menu_selected_id;
|
55 |
+
|
56 |
+
$nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1 );
|
57 |
+
|
58 |
+
$mycred_types = mycred_get_types();?>
|
59 |
+
|
60 |
+
<div id="mycred-menu" class="posttypediv">
|
61 |
+
|
62 |
+
<div id="tabs-panel-posttype-mycred" class="tabs-panel tabs-panel-active">
|
63 |
+
<ul id="mycred-menu-list" class="categorychecklist form-no-clear">
|
64 |
+
<?php
|
65 |
+
foreach ( $mycred_types as $key => $value ) {
|
66 |
+
$this->mycred_nav_menu_list( $key, $value, $nav_menu_placeholder, 'balance' );
|
67 |
+
$nav_menu_placeholder--;
|
68 |
+
$this->mycred_nav_menu_list( $key, $value, $nav_menu_placeholder, 'rank' );
|
69 |
+
$nav_menu_placeholder--;
|
70 |
+
}
|
71 |
+
?>
|
72 |
+
</ul>
|
73 |
+
</div>
|
74 |
+
<p class="button-controls">
|
75 |
+
<span class="add-to-menu">
|
76 |
+
<input type="submit"<?php if ( function_exists( 'wp_nav_menu_disabled_check' ) ) : wp_nav_menu_disabled_check( $nav_menu_selected_id ); endif; ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu', 'mycred' ); ?>" name="add-custom-menu-item" id="submit-mycred-menu" />
|
77 |
+
<span class="spinner"></span>
|
78 |
+
</span>
|
79 |
+
</p>
|
80 |
+
</div><?php
|
81 |
+
}
|
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 |
+
}
|
100 |
+
|
101 |
+
public function display_mycred_menu_items( $item_output, $item ) {
|
102 |
+
|
103 |
+
$template = $item->title;
|
104 |
+
|
105 |
+
if ( ! is_object( $item ) || ! isset( $item->object ) ) {
|
106 |
+
return $item_output;
|
107 |
+
}
|
108 |
+
if ( 'mycred_menu_balance' === $item->object ) {
|
109 |
+
|
110 |
+
$balance = do_shortcode( '[mycred_my_balance wrapper=0 title_el="" balance_el="" type="'.$item->type.'"]' );
|
111 |
+
$balance = '<span class="mycred-nav-balance">'.$balance.'</span>';
|
112 |
+
|
113 |
+
$template = str_replace( '%balance%', $balance, $template );
|
114 |
+
$item_output = $template;
|
115 |
+
|
116 |
+
}
|
117 |
+
else if ( 'mycred_menu_rank' === $item->object ) {
|
118 |
+
|
119 |
+
$account_object = mycred_get_account( get_current_user_id() );
|
120 |
+
$rank_object = $account_object->balance[ $item->type ]->rank;
|
121 |
+
if ( $rank_object !== false ) {
|
122 |
+
|
123 |
+
$rank_title = '<span class="mycred-nav-rank-title">'.$rank_object->title.'</span>';
|
124 |
+
|
125 |
+
$template = str_replace( '%rank_title%', $rank_title, $template );
|
126 |
+
|
127 |
+
$rank_logo = '';
|
128 |
+
|
129 |
+
if ( $rank_object->has_logo ) {
|
130 |
+
$rank_logo = mycred_get_rank_logo( $rank_object->post_id, 24 );
|
131 |
+
}
|
132 |
+
|
133 |
+
$template = str_replace( '%rank_logo%', $rank_logo, $template );
|
134 |
+
|
135 |
+
$item_output = $template;
|
136 |
+
|
137 |
+
}
|
138 |
+
else {
|
139 |
+
$item_output = '';
|
140 |
+
}
|
141 |
+
}
|
142 |
+
return '<div class="mycred-nav-menu-item">'.$item_output.'</div>';
|
143 |
+
}
|
144 |
+
|
145 |
+
public function setup_item( $item ) {
|
146 |
+
|
147 |
+
$types = array( 'mycred_menu_balance', 'mycred_menu_rank' );
|
148 |
+
|
149 |
+
if ( is_object( $item ) && in_array( $item->object, $types ) && ! empty( $item->type ) ) {
|
150 |
+
|
151 |
+
if ( $types[0] === $item->object ) {
|
152 |
+
$label = __( 'myCred %s Balance', 'mycred' );
|
153 |
+
}
|
154 |
+
elseif ( $types[1] === $item->object ) {
|
155 |
+
$label = __( 'myCred %s Rank', 'mycred' );
|
156 |
+
}
|
157 |
+
|
158 |
+
$singular_name = '';
|
159 |
+
|
160 |
+
$point_type = mycred( $item->type );
|
161 |
+
|
162 |
+
if ( ! empty( $point_type ) && ! empty( $point_type->core['name']['singular'] ) ) {
|
163 |
+
$singular_name = $point_type->core['name']['singular'];
|
164 |
+
}
|
165 |
+
|
166 |
+
$item->type_label = str_replace( '%s', $singular_name, $label );
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
+
return $item;
|
171 |
+
}
|
172 |
+
|
173 |
+
}
|
174 |
+
endif;
|
175 |
+
|
176 |
+
function mycred_nav_menu() {
|
177 |
+
return myCRED_Nav_Menu::instance();
|
178 |
+
}
|
179 |
+
mycred_nav_menu();
|
includes/shortcodes/mycred_leaderboard_position.php
CHANGED
@@ -33,9 +33,9 @@ if ( ! function_exists( 'mycred_render_shortcode_leaderbaord_position' ) ) :
|
|
33 |
$leaderboard = mycred_get_leaderboard( $args );
|
34 |
|
35 |
// Query the users position
|
36 |
-
$position = $leaderboard->get_users_current_position( $user_id, $missing );
|
37 |
|
38 |
-
if ( $position != $missing && $suffix == 1 )
|
39 |
$position = mycred_ordinal_suffix( $position, true );
|
40 |
|
41 |
return $position;
|
33 |
$leaderboard = mycred_get_leaderboard( $args );
|
34 |
|
35 |
// Query the users position
|
36 |
+
$position = $leaderboard->get_users_current_position( $user_id, $args['missing'] );
|
37 |
|
38 |
+
if ( $position != $args['missing'] && $args['suffix'] == 1 )
|
39 |
$position = mycred_ordinal_suffix( $position, true );
|
40 |
|
41 |
return $position;
|
includes/shortcodes/mycred_my_balance_converted.php
CHANGED
@@ -12,10 +12,11 @@ if ( ! function_exists( 'mycred_render_shortcode_my_balance_converted' ) ) :
|
|
12 |
function mycred_render_shortcode_my_balance_converted( $atts, $content = '' ) {
|
13 |
|
14 |
extract( shortcode_atts( array(
|
15 |
-
'ctype'
|
16 |
-
'rate'
|
17 |
-
'prefix'
|
18 |
-
'suffix'
|
|
|
19 |
), $atts, MYCRED_SLUG . '_my_balance_converted' ) );
|
20 |
|
21 |
$output = '';
|
@@ -43,15 +44,16 @@ if ( ! function_exists( 'mycred_render_shortcode_my_balance_converted' ) ) :
|
|
43 |
$output = '<div class="mycred-my-balance-converted-wrapper">';
|
44 |
|
45 |
if ( ! empty( $prefix ) )
|
46 |
-
$output .= '<span class="mycred-my-balance-converted-prefix">'
|
47 |
|
48 |
if( floatval( $rate ) == 0 ) $rate = 1;
|
49 |
|
50 |
-
$
|
|
|
|
|
51 |
|
52 |
if ( ! empty( $suffix ) )
|
53 |
-
$output .= '<span class="mycred-my-balance-converted-suffix">'
|
54 |
-
|
55 |
|
56 |
$output .= '</div>';
|
57 |
|
@@ -59,4 +61,4 @@ if ( ! function_exists( 'mycred_render_shortcode_my_balance_converted' ) ) :
|
|
59 |
|
60 |
}
|
61 |
endif;
|
62 |
-
add_shortcode( MYCRED_SLUG . '_my_balance_converted', 'mycred_render_shortcode_my_balance_converted' );
|
12 |
function mycred_render_shortcode_my_balance_converted( $atts, $content = '' ) {
|
13 |
|
14 |
extract( shortcode_atts( array(
|
15 |
+
'ctype' => MYCRED_DEFAULT_TYPE_KEY,
|
16 |
+
'rate' => 1,
|
17 |
+
'prefix' => '',
|
18 |
+
'suffix' => '',
|
19 |
+
'decimal' => 1
|
20 |
), $atts, MYCRED_SLUG . '_my_balance_converted' ) );
|
21 |
|
22 |
$output = '';
|
44 |
$output = '<div class="mycred-my-balance-converted-wrapper">';
|
45 |
|
46 |
if ( ! empty( $prefix ) )
|
47 |
+
$output .= '<span class="mycred-my-balance-converted-prefix">'.esc_attr( $prefix ).'</span>';
|
48 |
|
49 |
if( floatval( $rate ) == 0 ) $rate = 1;
|
50 |
|
51 |
+
$converted_balance = floatval( $balance->current ) * floatval( $rate );
|
52 |
+
|
53 |
+
$output .= number_format( $converted_balance, intval( $decimal ), '.', '' );
|
54 |
|
55 |
if ( ! empty( $suffix ) )
|
56 |
+
$output .= '<span class="mycred-my-balance-converted-suffix">'.esc_attr( $suffix ).'</span>';
|
|
|
57 |
|
58 |
$output .= '</div>';
|
59 |
|
61 |
|
62 |
}
|
63 |
endif;
|
64 |
+
add_shortcode( MYCRED_SLUG . '_my_balance_converted', 'mycred_render_shortcode_my_balance_converted' );
|
membership/mycred-connect-membership.php
CHANGED
@@ -21,11 +21,13 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
|
|
21 |
add_action( 'admin_menu', array( $this, 'mycred_membership_menu' ) );
|
22 |
add_action( 'init', array( $this, 'add_styles' ) );
|
23 |
add_action( 'mycred_admin_init', array( $this, 'mycred_review_notice' ) );
|
|
|
24 |
}
|
25 |
|
26 |
function add_styles() {
|
27 |
|
28 |
-
wp_register_style('admin-subscription-css', plugins_url( 'assets/css/admin-subscription.css', myCRED_THIS ), array(), '1.
|
|
|
29 |
wp_enqueue_style('admin-subscription-css');
|
30 |
}
|
31 |
|
@@ -52,12 +54,34 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
|
|
52 |
<div class="mmc_welcome_content">
|
53 |
<div class="mmc_title"><?php _e( 'Welcome to myCred Membership Club', 'mycred' ); ?></div>
|
54 |
<form action="#" method="post">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
<input type="text" name="mmc_lincense_key" class="mmc_lincense_key" placeholder="<?php _e( 'Add Your Membership License', 'mycred' ); ?>" value="<?php echo $membership_key?>">
|
56 |
<input type="submit" class="mmc_save_license button-primary" value="Save"/>
|
57 |
-
<div class="mmc_license_link"><a href="
|
58 |
</form>
|
59 |
</div>
|
|
|
60 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
</div>
|
62 |
<?php
|
63 |
}
|
@@ -186,6 +210,523 @@ if ( ! class_exists( 'myCRED_Connect_Membership' ) ) :
|
|
186 |
<?php
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
190 |
endif;
|
191 |
|
21 |
add_action( 'admin_menu', array( $this, 'mycred_membership_menu' ) );
|
22 |
add_action( 'init', array( $this, 'add_styles' ) );
|
23 |
add_action( 'mycred_admin_init', array( $this, 'mycred_review_notice' ) );
|
24 |
+
add_action( 'mycred_admin_init', array( $this, 'membership_addon_actions' ) );
|
25 |
}
|
26 |
|
27 |
function add_styles() {
|
28 |
|
29 |
+
wp_register_style('admin-subscription-css', plugins_url( 'assets/css/admin-subscription.css', myCRED_THIS ), array(), '1.2', 'all');
|
30 |
+
wp_enqueue_style( 'mycred-bootstrap-grid' );
|
31 |
wp_enqueue_style('admin-subscription-css');
|
32 |
}
|
33 |
|
54 |
<div class="mmc_welcome_content">
|
55 |
<div class="mmc_title"><?php _e( 'Welcome to myCred Membership Club', 'mycred' ); ?></div>
|
56 |
<form action="#" method="post">
|
57 |
+
<?php
|
58 |
+
if(mycred_is_membership_active()) {
|
59 |
+
echo '<span class="dashicons dashicons-yes-alt membership-license-activated"></span>';
|
60 |
+
} else if(!mycred_is_membership_active() && !empty(mycred_get_membership_key())){
|
61 |
+
// if membership is not active in current site and the membership key is entered
|
62 |
+
echo '<span class="dashicons dashicons-dismiss membership-license-inactive"></span>';
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
?>
|
67 |
+
|
68 |
<input type="text" name="mmc_lincense_key" class="mmc_lincense_key" placeholder="<?php _e( 'Add Your Membership License', 'mycred' ); ?>" value="<?php echo $membership_key?>">
|
69 |
<input type="submit" class="mmc_save_license button-primary" value="Save"/>
|
70 |
+
<div class="mmc_license_link"><a href="https://mycred.me/redirect-to-membership/" target="_blank"><span class="dashicons dashicons-editor-help"></span><?php _e('Click here to get your Membership License','mycred') ?></a></div>
|
71 |
</form>
|
72 |
</div>
|
73 |
+
|
74 |
</div>
|
75 |
+
|
76 |
+
<?php
|
77 |
+
if(mycred_is_membership_active()){
|
78 |
+
$this->mycred_display_membership_addons();
|
79 |
+
}
|
80 |
+
else{
|
81 |
+
$this->mycred_display_membership_table();
|
82 |
+
}
|
83 |
+
|
84 |
+
?>
|
85 |
</div>
|
86 |
<?php
|
87 |
}
|
210 |
<?php
|
211 |
}
|
212 |
|
213 |
+
public function mycred_display_membership_table(){
|
214 |
+
|
215 |
+
|
216 |
+
$membership_plans = $this->membership_get_plans();
|
217 |
+
|
218 |
+
if(!empty($membership_plans) && ! isset( $addons['code'])){
|
219 |
+
?>
|
220 |
+
<script>
|
221 |
+
jQuery(document).ready(function () {
|
222 |
+
jQuery("span.slider_btn.round").click(function(){
|
223 |
+
jQuery(".show_one_year").toggleClass("active_pkg");
|
224 |
+
jQuery(".show_three_year").toggleClass("active_pkg");
|
225 |
+
});
|
226 |
+
|
227 |
+
jQuery("span.slider_btn.round").click(function(){
|
228 |
+
jQuery(".three_year").toggleClass("show_cont");
|
229 |
+
jQuery(".one_year").toggleClass("hide");
|
230 |
+
jQuery(".three_year").toggleClass("hide");
|
231 |
+
jQuery(".one_year").toggleClass("hide_cont");
|
232 |
+
jQuery(".one_year").toggleClass("show_cont");
|
233 |
+
});
|
234 |
+
|
235 |
+
jQuery(".show_three_year").click(function(){
|
236 |
+
jQuery(".switch_btn input").prop("checked", true);
|
237 |
+
jQuery(".show_one_year").removeClass("active_pkg");
|
238 |
+
jQuery(".show_three_year").addClass("active_pkg");
|
239 |
+
jQuery("div.three_year").addClass("show_cont");
|
240 |
+
jQuery("span.three_year").addClass("show_cont");
|
241 |
+
jQuery(".one_year").addClass("hide");
|
242 |
+
jQuery(".three_year").removeClass("hide");
|
243 |
+
jQuery("div.one_year").addClass("hide_cont");
|
244 |
+
});
|
245 |
+
jQuery(".show_one_year").click(function(){
|
246 |
+
jQuery(".switch_btn input").prop("checked", false);
|
247 |
+
jQuery(".show_one_year").addClass("active_pkg");
|
248 |
+
jQuery(".show_three_year").removeClass("active_pkg");
|
249 |
+
|
250 |
+
jQuery("div.three_year").removeClass("show_cont");
|
251 |
+
jQuery("span.three_year").removeClass("show_cont");
|
252 |
+
jQuery(".one_year").removeClass("hide");
|
253 |
+
jQuery(".three_year").addClass("hide");
|
254 |
+
jQuery("div.one_year").removeClass("hide_cont");
|
255 |
+
|
256 |
+
});
|
257 |
+
});
|
258 |
+
</script>
|
259 |
+
<div class="mmc_table row">
|
260 |
+
<div class="col-lg-12">
|
261 |
+
<div id="tabs_package_1">
|
262 |
+
<div class="radio_btns_pkg">
|
263 |
+
<a href="javascript:void(0);" class="show_one_year active_pkg">One Year Package</a>
|
264 |
+
<label class="switch_btn">
|
265 |
+
<input type="checkbox">
|
266 |
+
<span class="slider_btn round"></span>
|
267 |
+
</label>
|
268 |
+
<a href="javascript:void(0);" class="show_three_year">Three Years Package <sup>With Discount</sup></a>
|
269 |
+
</div>
|
270 |
+
</div>
|
271 |
+
</div>
|
272 |
+
<div class="col-lg-1 col-md-1 hidden-sm hidden-xs"></div>
|
273 |
+
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12 mmc_table_column border-right">
|
274 |
+
<div class="mmc_table_plan">AGENCY</div>
|
275 |
+
|
276 |
+
<div class="mmc_table_pricing">
|
277 |
+
<p class="mmc_table_pricing_worth one_year">Worth $10000+</p>
|
278 |
+
<p class="mmc_table_pricing_current one_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[52250]['price']; ?></p>
|
279 |
+
<p class="mmc_table_pricing_worth three_year">Worth $30000+</p>
|
280 |
+
<p class="mmc_table_pricing_current three_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[54091]['price']; ?></p>
|
281 |
+
</div>
|
282 |
+
<div class="mmc_table_plan_details">
|
283 |
+
<p class="mmc_table_plan_sites">unlimited sites</p>
|
284 |
+
<p class="mmc_table_plan_billed one_year">billed yearly until cancelled</p>
|
285 |
+
<p class="mmc_table_plan_billed three_year">billed 3 years until cancelled</p>
|
286 |
+
</div>
|
287 |
+
<div class="mmc_table_addon_details">
|
288 |
+
<ul>
|
289 |
+
<li>All Enhancement addons</li>
|
290 |
+
<li>All integrations</li>
|
291 |
+
<li>Store Gateway addons</li>
|
292 |
+
<li>Gamification Addons</li>
|
293 |
+
</ul>
|
294 |
+
</div>
|
295 |
+
<div class="mmc_table_get_started">
|
296 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=52250" target="_blank" class="one_year"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
297 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=54091" target="_blank" class="three_year"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
298 |
+
</div>
|
299 |
+
</div>
|
300 |
+
|
301 |
+
|
302 |
+
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12 mmc_table_column border-right">
|
303 |
+
<div class="mmc_table_plan">BUSINESS</div>
|
304 |
+
|
305 |
+
<div class="mmc_table_pricing">
|
306 |
+
<p class="mmc_table_pricing_worth one_year">Worth $5000+</p>
|
307 |
+
<p class="mmc_table_pricing_current one_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[52251]['price']; ?></p>
|
308 |
+
<p class="mmc_table_pricing_worth three_year">Worth $15000+</p>
|
309 |
+
<p class="mmc_table_pricing_current three_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[54089]['price']; ?></p>
|
310 |
+
</div>
|
311 |
+
<div class="mmc_table_plan_details">
|
312 |
+
<p class="mmc_table_plan_sites">upto 5 sites</p>
|
313 |
+
<p class="mmc_table_plan_billed one_year">billed yearly until cancelled</p>
|
314 |
+
<p class="mmc_table_plan_billed three_year">billed 3 years until cancelled</p>
|
315 |
+
</div>
|
316 |
+
<div class="mmc_table_addon_details">
|
317 |
+
<ul>
|
318 |
+
<li>All Enhancement addons</li>
|
319 |
+
<li>All integrations</li>
|
320 |
+
<li>Store Gateway addons</li>
|
321 |
+
<li>Gamification Addons</li>
|
322 |
+
</ul>
|
323 |
+
</div>
|
324 |
+
<div class="mmc_table_get_started">
|
325 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=52251" target="_blank" class="one_year"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
326 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=54089" target="_blank" class="three_year"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
327 |
+
</div>
|
328 |
+
</div>
|
329 |
+
|
330 |
+
|
331 |
+
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12 mmc_table_column border-right">
|
332 |
+
<div class="mmc_table_most_popular">Most Popular</div>
|
333 |
+
<div class="mmc_table_plan">PROFESSIONAL</div>
|
334 |
+
|
335 |
+
<div class="mmc_table_pricing">
|
336 |
+
<p class="mmc_table_pricing_worth one_year">Worth $2000+</p>
|
337 |
+
<p class="mmc_table_pricing_current one_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[52496]['price']; ?></p>
|
338 |
+
<p class="mmc_table_pricing_worth three_year">Worth $6000+</p>
|
339 |
+
<p class="mmc_table_pricing_current three_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[54090]['price']; ?></p>
|
340 |
+
</div>
|
341 |
+
<div class="mmc_table_plan_details">
|
342 |
+
<p class="mmc_table_plan_sites">3 sites</p>
|
343 |
+
<p class="mmc_table_plan_billed one_year">billed yearly until cancelled</p>
|
344 |
+
<p class="mmc_table_plan_billed three_year">billed 3 years until cancelled</p>
|
345 |
+
</div>
|
346 |
+
<div class="mmc_table_addon_details">
|
347 |
+
<ul>
|
348 |
+
<li>All Enhancement addons</li>
|
349 |
+
<li>All integrations</li>
|
350 |
+
<li>Store Gateway addons</li>
|
351 |
+
<li>Gamification Addons</li>
|
352 |
+
</ul>
|
353 |
+
</div>
|
354 |
+
<div class="mmc_table_get_started">
|
355 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=52496" class="one_year" target="_blank"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
356 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=54090" class="three_year" target="_blank"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
357 |
+
</div>
|
358 |
+
</div>
|
359 |
+
|
360 |
+
|
361 |
+
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12 mmc_table_column">
|
362 |
+
<div class="mmc_table_plan">STARTER</div>
|
363 |
+
|
364 |
+
<div class="mmc_table_pricing">
|
365 |
+
<p class="mmc_table_pricing_worth one_year">Worth $500+</p>
|
366 |
+
<p class="mmc_table_pricing_current one_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[52495]['price']; ?></p>
|
367 |
+
<p class="mmc_table_pricing_worth three_year">Worth $1500+</p>
|
368 |
+
<p class="mmc_table_pricing_current three_year"><span class="mmc_table_pricing_dollar_sign">$</span><?php echo $membership_plans[54088]['price']; ?></p>
|
369 |
+
</div>
|
370 |
+
<div class="mmc_table_plan_details">
|
371 |
+
<p class="mmc_table_plan_sites">1 site</p>
|
372 |
+
<p class="mmc_table_plan_billed one_year">billed yearly until cancelled</p>
|
373 |
+
<p class="mmc_table_plan_billed three_year">billed 3 years until cancelled</p>
|
374 |
+
</div>
|
375 |
+
<div class="mmc_table_addon_details">
|
376 |
+
<ul>
|
377 |
+
<li>Basic enhancement addons</li>
|
378 |
+
<li>Basic Integrations</li>
|
379 |
+
<li>-</li>
|
380 |
+
<li>-</li>
|
381 |
+
</ul>
|
382 |
+
</div>
|
383 |
+
<div class="mmc_table_get_started">
|
384 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=52495" target="_blank" class="one_year"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
385 |
+
<a href="https://www.mycred.me/cart/?add-to-cart=52249&variation_id=54088" target="_blank" class="three_year"> <?php _e( 'Get Started', 'mycred' ); ?></a>
|
386 |
+
</div>
|
387 |
+
</div>
|
388 |
+
<div class="col-lg-1 col-md-1 hidden-sm hidden-xs"></div>
|
389 |
+
</div>
|
390 |
+
<?php
|
391 |
+
}
|
392 |
+
}
|
393 |
+
|
394 |
+
public function mycred_display_membership_addons(){
|
395 |
+
|
396 |
+
$addons = $this->get_membership_addons();
|
397 |
+
?>
|
398 |
+
<style type="text/css">
|
399 |
+
.theme-browser .theme:focus, .theme-browser .theme:hover { cursor: default !important; }
|
400 |
+
.theme-browser .theme:hover .more-details { opacity: 1; }
|
401 |
+
.theme-browser .theme:hover a.more-details, .theme-browser .theme:hover a.more-details:hover { text-decoration: none; }
|
402 |
+
.theme-browser .theme .theme-screenshot img { height: 100%; }
|
403 |
+
</style>
|
404 |
+
<div class="theme-browser mmc-addons" >
|
405 |
+
<?php
|
406 |
+
|
407 |
+
// Messages
|
408 |
+
if ( isset( $_GET['success'] ) ) {
|
409 |
+
|
410 |
+
if ( $_GET['success'] == 1 ){
|
411 |
+
|
412 |
+
if( $_GET['addon_action'] == 'activate' ){
|
413 |
+
|
414 |
+
echo '<div id="message" class="updated"><p>' . __( 'Add-on Activated', 'mycred' ) . '</p></div>';
|
415 |
+
|
416 |
+
} else if ( $_GET['addon_action'] == 'deactivate' ){
|
417 |
+
|
418 |
+
echo '<div id="message" class="updated"><p>' . __( 'Add-on Deactivated', 'mycred' ) . '</p></div>';
|
419 |
+
|
420 |
+
} else if ( $_GET['addon_action'] == 'install' ){
|
421 |
+
|
422 |
+
echo '<div id="message" class="updated"><p>' . __( 'Add-on Installed', 'mycred' ) . '</p></div>';
|
423 |
+
|
424 |
+
}
|
425 |
+
|
426 |
+
}
|
427 |
+
|
428 |
+
|
429 |
+
elseif ( $_GET['success'] == 0 ){
|
430 |
+
echo '<div id="message" class="error"><p>' . __( 'Could Not Perform Desired Action', 'mycred' ) . '</p></div>';
|
431 |
+
}
|
432 |
+
|
433 |
+
|
434 |
+
}
|
435 |
+
|
436 |
+
?>
|
437 |
+
<div class="themes">
|
438 |
+
<?php
|
439 |
+
|
440 |
+
// Loop though addons
|
441 |
+
if ( ! empty( $addons ) && ! isset( $addons['code']) ) {
|
442 |
+
|
443 |
+
foreach ( $addons as $addon ) {
|
444 |
+
|
445 |
+
$screenshot = '';
|
446 |
+
if(isset($addon['addon_image']) && !empty($addon['addon_image'])){
|
447 |
+
$screenshot = $addon['addon_image'];
|
448 |
+
}
|
449 |
+
|
450 |
+
$addon_url = '';
|
451 |
+
if(isset($addon['addon_image']) && !empty($addon['addon_url'])){
|
452 |
+
$addon_url = $addon['addon_url'];
|
453 |
+
}
|
454 |
+
|
455 |
+
$aria_action = esc_attr( $addon['slug'] . '-action' );
|
456 |
+
$aria_name = esc_attr( $addon['slug'] . '-name' );
|
457 |
+
|
458 |
+
?>
|
459 |
+
<div class="theme<?php if ( $this->is_addon_active( $addon['folder'] ) ) echo ' active'; else echo ' inactive'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
|
460 |
+
|
461 |
+
<?php if ( $screenshot != '' ) : ?>
|
462 |
+
|
463 |
+
<div class="theme-screenshot">
|
464 |
+
<img src="<?php echo $screenshot; ?>" alt="" />
|
465 |
+
</div>
|
466 |
+
|
467 |
+
<?php else : ?>
|
468 |
+
|
469 |
+
<div class="theme-screenshot blank"></div>
|
470 |
+
|
471 |
+
<?php endif; ?>
|
472 |
+
|
473 |
+
<a class="more-details" id="<?php echo $aria_action; ?>" href="<?php echo $addon_url; ?>" target="_blank"><?php _e( 'Documentation', 'mycred' ); ?></a>
|
474 |
+
|
475 |
+
<div class="theme-id-container">
|
476 |
+
|
477 |
+
<?php if ( $this->is_addon_active( $addon['folder'] ) ) : ?>
|
478 |
+
|
479 |
+
<h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $addon['name']; ?></h2>
|
480 |
+
|
481 |
+
<?php else : ?>
|
482 |
+
|
483 |
+
<h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $addon['name']; ?></h2>
|
484 |
+
|
485 |
+
<?php endif; ?>
|
486 |
+
|
487 |
+
<div class="theme-actions">
|
488 |
+
|
489 |
+
<?php echo $this->activate_deactivate_install( $addon['folder'] ); ?>
|
490 |
+
|
491 |
+
</div>
|
492 |
+
|
493 |
+
</div>
|
494 |
+
|
495 |
+
</div>
|
496 |
+
<?php
|
497 |
+
|
498 |
+
}
|
499 |
+
|
500 |
+
}
|
501 |
+
|
502 |
+
?>
|
503 |
+
<br class="clear">
|
504 |
+
</div>
|
505 |
+
</div>
|
506 |
+
<?php
|
507 |
+
}
|
508 |
+
|
509 |
+
public function get_membership_addons() {
|
510 |
+
|
511 |
+
$membership_details = mycred_get_membership_details();
|
512 |
+
$addons = array();
|
513 |
+
|
514 |
+
if(isset($membership_details['addons']) && !empty($membership_details['addons'])){
|
515 |
+
$addons = $membership_details['addons'];
|
516 |
+
}
|
517 |
+
|
518 |
+
return $addons;
|
519 |
+
|
520 |
+
}
|
521 |
+
|
522 |
+
public function is_addon_active($addon_folder_name) {
|
523 |
+
|
524 |
+
$active_plugins = get_option('active_plugins');
|
525 |
+
|
526 |
+
foreach($active_plugins as $active_plugin){
|
527 |
+
$arr = explode("/", $active_plugin, 2);
|
528 |
+
|
529 |
+
if($addon_folder_name == $arr[0]){
|
530 |
+
return true;
|
531 |
+
}
|
532 |
+
}
|
533 |
+
return false;
|
534 |
+
}
|
535 |
+
|
536 |
+
public function is_addon_installed($addon_folder_name) {
|
537 |
+
$installed_plugins = get_plugins();
|
538 |
+
|
539 |
+
foreach($installed_plugins as $folder_name => $installed_plugin){
|
540 |
+
$arr = explode("/", $folder_name, 2);
|
541 |
+
|
542 |
+
if($addon_folder_name == $arr[0]){
|
543 |
+
return true;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
return false;
|
547 |
+
}
|
548 |
+
|
549 |
+
public function is_addon_network_active($addon_folder_name){
|
550 |
+
|
551 |
+
$network_active_plugins = get_site_option('active_sitewide_plugins'); // Network activated plugins
|
552 |
+
|
553 |
+
foreach($network_active_plugins as $network_active_plugin => $timestamp){
|
554 |
+
$arr = explode("/", $network_active_plugin, 2);
|
555 |
+
|
556 |
+
if($addon_folder_name == $arr[0]){
|
557 |
+
return true;
|
558 |
+
}
|
559 |
+
}
|
560 |
+
return false;
|
561 |
+
}
|
562 |
+
|
563 |
+
public function activate_deactivate_install( $addon_folder = NULL ) {
|
564 |
+
|
565 |
+
/* need to do this for multisite as well */
|
566 |
+
|
567 |
+
$link_url = $this->get_membership_addon_action_url( $addon_folder, 'install' );
|
568 |
+
$link_text = __( 'Install', 'mycred' );
|
569 |
+
$network_active = false;
|
570 |
+
|
571 |
+
if(is_multisite() && $this->is_addon_network_active( $addon_folder )){
|
572 |
+
|
573 |
+
$link_url = "";
|
574 |
+
$link_text = __( 'Network Active', 'mycred' );
|
575 |
+
$network_active = true;
|
576 |
+
|
577 |
+
} else if ( $this->is_addon_active( $addon_folder ) ) {
|
578 |
+
|
579 |
+
$link_url = $this->get_membership_addon_action_url( $addon_folder, 'deactivate' );
|
580 |
+
$link_text = __( 'Deactivate', 'mycred' );
|
581 |
+
|
582 |
+
} else if($this->is_addon_installed( $addon_folder )){
|
583 |
+
|
584 |
+
$link_url = $this->get_membership_addon_action_url( $addon_folder, 'activate' );
|
585 |
+
$link_text = __( 'Activate', 'mycred' );
|
586 |
+
|
587 |
+
}
|
588 |
+
|
589 |
+
return '<a href="' . esc_url_raw( $link_url ) . '" title="' . esc_attr( $link_text ) . '" class="button button-primary mycred-action ' . esc_attr( $addon_folder ) . ' ' . ($network_active ? 'mycred-addon-network-active' : '') . '">' . esc_html( $link_text ) . '</a>';
|
590 |
+
|
591 |
+
}
|
592 |
+
|
593 |
+
|
594 |
+
function get_membership_addon_action_url( $addon_folder = NULL, $action = false ) {
|
595 |
+
|
596 |
+
if ( $addon_folder === NULL || $action === false ) return '#';
|
597 |
+
|
598 |
+
$args = array(
|
599 |
+
'page' => MYCRED_SLUG . '-membership',
|
600 |
+
'addon_folder' => $addon_folder,
|
601 |
+
'addon_action' => $action,
|
602 |
+
'_token' => wp_create_nonce( 'mycred-membership-addon-action' )
|
603 |
+
);
|
604 |
+
|
605 |
+
return esc_url( add_query_arg( $args, admin_url( 'admin.php' ) ) );
|
606 |
+
|
607 |
+
}
|
608 |
+
|
609 |
+
|
610 |
+
public function membership_addon_actions() {
|
611 |
+
|
612 |
+
//&& $this->core->user_is_point_admin()
|
613 |
+
// Important - Here we need to add a check, if the plugin on which action is being performed really belongs to mycred membership (because user can modify plugin folder name from URL)
|
614 |
+
// also need to test for multisite as well
|
615 |
+
|
616 |
+
if ( isset( $_GET['addon_action'] ) && isset( $_GET['addon_folder'] ) && isset( $_GET['_token'] ) && wp_verify_nonce( $_GET['_token'], 'mycred-membership-addon-action' ) ) {
|
617 |
+
|
618 |
+
$addon_folder = sanitize_text_field( $_GET['addon_folder'] );
|
619 |
+
$action = sanitize_text_field( $_GET['addon_action'] );
|
620 |
+
|
621 |
+
$result = 0; // 0 = fail, 1 = success
|
622 |
+
// Activation
|
623 |
+
if ( $action == 'activate' ) {
|
624 |
+
$installed_plugins = get_plugins();
|
625 |
+
|
626 |
+
foreach( $installed_plugins as $folder_name => $installed_plugin ){
|
627 |
+
$arr = explode("/", $folder_name, 2);
|
628 |
+
|
629 |
+
if($addon_folder == $arr[0]){
|
630 |
+
$success = activate_plugin( $folder_name );
|
631 |
+
if ( $success === NULL ) {
|
632 |
+
$result = 1;
|
633 |
+
}
|
634 |
+
}
|
635 |
+
}
|
636 |
+
|
637 |
+
} else if ( $action == 'deactivate' ) {
|
638 |
+
|
639 |
+
$active_plugins = get_option('active_plugins');
|
640 |
+
|
641 |
+
foreach($active_plugins as $active_plugin){
|
642 |
+
$arr = explode("/", $active_plugin, 2);
|
643 |
+
|
644 |
+
if($addon_folder == $arr[0]){
|
645 |
+
deactivate_plugins( $active_plugin );
|
646 |
+
$result = 1;
|
647 |
+
}
|
648 |
+
}
|
649 |
+
|
650 |
+
} else if ( $action == 'install' ) {
|
651 |
+
|
652 |
+
// first check if plugin is already installed
|
653 |
+
if (! $this->is_addon_installed( $addon_folder )){ // plugin is not installed
|
654 |
+
$result = 0;
|
655 |
+
if($this->membership_download_addon($addon_folder)){
|
656 |
+
if($this->membership_unzip_addon($addon_folder)){
|
657 |
+
$result = 1;
|
658 |
+
}
|
659 |
+
}
|
660 |
+
}
|
661 |
+
|
662 |
+
}
|
663 |
+
|
664 |
+
$url = add_query_arg( array( 'page' => MYCRED_SLUG . '-membership', 'success' => $result, 'addon_action' => $action ), admin_url( 'admin.php' ) );
|
665 |
+
|
666 |
+
wp_safe_redirect( $url );
|
667 |
+
exit;
|
668 |
+
|
669 |
+
}
|
670 |
+
|
671 |
+
}
|
672 |
+
|
673 |
+
public function membership_download_addon($addon_folder = ''){
|
674 |
+
|
675 |
+
if(!empty($addon_folder)){
|
676 |
+
|
677 |
+
$url = 'https://mycred.me/download-plugin/?memid='.mycred_get_my_id().'&addonfolder='.$addon_folder;
|
678 |
+
|
679 |
+
$plugin_directory = ABSPATH.'wp-content/plugins/'.$addon_folder.'.zip';
|
680 |
+
|
681 |
+
$data = wp_remote_get($url);
|
682 |
+
|
683 |
+
if ( is_array( $data ) && ! is_wp_error( $data ) ) {
|
684 |
+
|
685 |
+
if ( file_put_contents($plugin_directory, $data['body'] ) ) {
|
686 |
+
return true;
|
687 |
+
}
|
688 |
+
|
689 |
+
}
|
690 |
+
|
691 |
+
}
|
692 |
+
|
693 |
+
return false;
|
694 |
+
}
|
695 |
+
|
696 |
+
public function membership_unzip_addon($addon_folder = ''){
|
697 |
+
|
698 |
+
if(!empty($addon_folder)) {
|
699 |
+
$addon_zip_file = ABSPATH.'wp-content/plugins/'.$addon_folder.'.zip';
|
700 |
+
$plugins_directory = ABSPATH.'wp-content/plugins/';
|
701 |
+
|
702 |
+
WP_Filesystem();
|
703 |
+
$unzipfile = unzip_file( $addon_zip_file, $plugins_directory);
|
704 |
+
|
705 |
+
if ( $unzipfile ) {
|
706 |
+
unlink($addon_zip_file);
|
707 |
+
return true;
|
708 |
+
}
|
709 |
+
|
710 |
+
}
|
711 |
+
|
712 |
+
return false;
|
713 |
+
}
|
714 |
+
|
715 |
+
public function membership_get_plans(){
|
716 |
+
|
717 |
+
$url = 'https://mycred.me/wp-json/membership/v1/membership/pricing';
|
718 |
+
$data = wp_remote_get( $url );
|
719 |
+
$membership_plans = array();
|
720 |
+
|
721 |
+
if ( is_array( $data ) && ! is_wp_error( $data ) ) {
|
722 |
+
|
723 |
+
$membership_plans = json_decode( $data['body'], true );
|
724 |
+
|
725 |
+
}
|
726 |
+
|
727 |
+
return $membership_plans;
|
728 |
+
}
|
729 |
+
|
730 |
}
|
731 |
endif;
|
732 |
|
membership/subscription-functions.php
CHANGED
@@ -230,7 +230,7 @@ if( !function_exists('mycred_is_membership_active') ) {
|
|
230 |
* Get membership details
|
231 |
*
|
232 |
* @since 1.0
|
233 |
-
* @version 1.
|
234 |
*/
|
235 |
if( !function_exists('mycred_get_membership_details') ) {
|
236 |
function mycred_get_membership_details() {
|
@@ -239,14 +239,40 @@ if( !function_exists('mycred_get_membership_details') ) {
|
|
239 |
|
240 |
if( false === $membership_details ) {
|
241 |
|
242 |
-
$url = 'https://mycred.me/wp-json/membership/v1/member/'.mycred_get_my_id();
|
243 |
$data = wp_remote_get( $url );
|
244 |
|
245 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
wp_cache_set( 'mycred_membership_details', $membership_details );
|
247 |
}
|
248 |
|
249 |
return $membership_details;
|
250 |
|
251 |
}
|
252 |
-
}
|
230 |
* Get membership details
|
231 |
*
|
232 |
* @since 1.0
|
233 |
+
* @version 1.1
|
234 |
*/
|
235 |
if( !function_exists('mycred_get_membership_details') ) {
|
236 |
function mycred_get_membership_details() {
|
239 |
|
240 |
if( false === $membership_details ) {
|
241 |
|
242 |
+
$url = 'https://mycred.me/wp-json/membership/v1/member/'.mycred_get_my_id().'/?time='.time();
|
243 |
$data = wp_remote_get( $url );
|
244 |
|
245 |
+
if( is_array( $data ) && ! is_wp_error( $data ) && ! empty( $data['response']['code'] ) && $data['response']['code'] == 200 ) {
|
246 |
+
|
247 |
+
$membership_details = json_decode( $data['body'], true );
|
248 |
+
|
249 |
+
} else {
|
250 |
+
|
251 |
+
$membership_details = array (
|
252 |
+
"addons" => array(),
|
253 |
+
"sites" => array(),
|
254 |
+
"plan" => array(
|
255 |
+
array (
|
256 |
+
"ID" => "",
|
257 |
+
"title" => "",
|
258 |
+
"key" => "",
|
259 |
+
)
|
260 |
+
),
|
261 |
+
"order" => array (
|
262 |
+
array (
|
263 |
+
"order_id" => NULL,
|
264 |
+
"purchase" => 0,
|
265 |
+
"expire" => 0,
|
266 |
+
)
|
267 |
+
)
|
268 |
+
);
|
269 |
+
|
270 |
+
}
|
271 |
+
|
272 |
wp_cache_set( 'mycred_membership_details', $membership_details );
|
273 |
}
|
274 |
|
275 |
return $membership_details;
|
276 |
|
277 |
}
|
278 |
+
}
|
modules/mycred-module-caching.php
CHANGED
@@ -47,7 +47,7 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
|
|
47 |
}
|
48 |
|
49 |
add_action( 'mycred_update_user_balance', array( $this, 'balance_change' ), 10, 4 );
|
50 |
-
|
51 |
|
52 |
add_action( 'mycred_admin_init', array( $this, 'module_admin_init' ) );
|
53 |
|
@@ -155,7 +155,7 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
|
|
155 |
* @since 1.8
|
156 |
* @version 1.0
|
157 |
*/
|
158 |
-
public function cron_tasks() {
|
159 |
|
160 |
if ( $this->caching['history'] == 'day' ) {
|
161 |
|
@@ -183,6 +183,8 @@ if ( ! class_exists( 'myCRED_Caching_Module' ) ) :
|
|
183 |
$wpdb->query( $wpdb->prepare( "DELETE FROM {$mycred->log_table} WHERE time < %d AND ctype = %s;", $timestamp, $this->mycred_type ) );
|
184 |
|
185 |
}
|
|
|
|
|
186 |
|
187 |
}
|
188 |
|
47 |
}
|
48 |
|
49 |
add_action( 'mycred_update_user_balance', array( $this, 'balance_change' ), 10, 4 );
|
50 |
+
add_filter( 'mycred_cron_reset_key', array( $this, 'cron_tasks' ) );
|
51 |
|
52 |
add_action( 'mycred_admin_init', array( $this, 'module_admin_init' ) );
|
53 |
|
155 |
* @since 1.8
|
156 |
* @version 1.0
|
157 |
*/
|
158 |
+
public function cron_tasks( $period ) {
|
159 |
|
160 |
if ( $this->caching['history'] == 'day' ) {
|
161 |
|
183 |
$wpdb->query( $wpdb->prepare( "DELETE FROM {$mycred->log_table} WHERE time < %d AND ctype = %s;", $timestamp, $this->mycred_type ) );
|
184 |
|
185 |
}
|
186 |
+
|
187 |
+
return $period;
|
188 |
|
189 |
}
|
190 |
|
mycred.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: myCred
|
4 |
* Plugin URI: https://mycred.me
|
5 |
* Description: An adaptive points management system for WordPress powered websites.
|
6 |
-
* Version: 1.8.
|
7 |
* Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
|
8 |
* Author: myCred
|
9 |
* Author URI: https://mycred.me
|
@@ -19,7 +19,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
19 |
final class myCRED_Core {
|
20 |
|
21 |
// Plugin Version
|
22 |
-
public $version = '1.8.
|
23 |
|
24 |
// Instnace
|
25 |
protected static $_instance = NULL;
|
@@ -53,14 +53,14 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
53 |
* @since 1.7
|
54 |
* @version 1.0
|
55 |
*/
|
56 |
-
public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '1.8.
|
57 |
|
58 |
/**
|
59 |
* Not allowed
|
60 |
* @since 1.7
|
61 |
* @version 1.0
|
62 |
*/
|
63 |
-
public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '1.8.
|
64 |
|
65 |
/**
|
66 |
* Get
|
@@ -81,7 +81,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
81 |
if ( ! defined( $name ) )
|
82 |
define( $name, $value );
|
83 |
elseif ( ! $definable && defined( $name ) )
|
84 |
-
_doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '1.8.
|
85 |
}
|
86 |
|
87 |
/**
|
@@ -93,7 +93,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
93 |
if ( file_exists( $required_file ) )
|
94 |
require_once $required_file;
|
95 |
else
|
96 |
-
_doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '1.8.
|
97 |
}
|
98 |
|
99 |
/**
|
@@ -217,6 +217,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
217 |
$this->file( myCRED_INCLUDES_DIR . 'mycred-remote.php' );
|
218 |
$this->file( myCRED_INCLUDES_DIR . 'mycred-protect.php' );
|
219 |
$this->file( myCRED_INCLUDES_DIR . 'mycred-about.php' );
|
|
|
220 |
|
221 |
// If myCRED has been setup and is ready to begin
|
222 |
if ( mycred_is_installed() ) {
|
3 |
* Plugin Name: myCred
|
4 |
* Plugin URI: https://mycred.me
|
5 |
* Description: An adaptive points management system for WordPress powered websites.
|
6 |
+
* Version: 1.8.13
|
7 |
* Tags: point, credit, loyalty program, engagement, reward, woocommerce rewards
|
8 |
* Author: myCred
|
9 |
* Author URI: https://mycred.me
|
19 |
final class myCRED_Core {
|
20 |
|
21 |
// Plugin Version
|
22 |
+
public $version = '1.8.13';
|
23 |
|
24 |
// Instnace
|
25 |
protected static $_instance = NULL;
|
53 |
* @since 1.7
|
54 |
* @version 1.0
|
55 |
*/
|
56 |
+
public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '1.8.13' ); }
|
57 |
|
58 |
/**
|
59 |
* Not allowed
|
60 |
* @since 1.7
|
61 |
* @version 1.0
|
62 |
*/
|
63 |
+
public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '1.8.13' ); }
|
64 |
|
65 |
/**
|
66 |
* Get
|
81 |
if ( ! defined( $name ) )
|
82 |
define( $name, $value );
|
83 |
elseif ( ! $definable && defined( $name ) )
|
84 |
+
_doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '1.8.13' );
|
85 |
}
|
86 |
|
87 |
/**
|
93 |
if ( file_exists( $required_file ) )
|
94 |
require_once $required_file;
|
95 |
else
|
96 |
+
_doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '1.8.13' );
|
97 |
}
|
98 |
|
99 |
/**
|
217 |
$this->file( myCRED_INCLUDES_DIR . 'mycred-remote.php' );
|
218 |
$this->file( myCRED_INCLUDES_DIR . 'mycred-protect.php' );
|
219 |
$this->file( myCRED_INCLUDES_DIR . 'mycred-about.php' );
|
220 |
+
$this->file( myCRED_INCLUDES_DIR . 'mycred-nav-menu.php' );
|
221 |
|
222 |
// If myCRED has been setup and is ready to begin
|
223 |
if ( mycred_is_installed() ) {
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: mycred,wpexpertsio
|
3 |
Tags: badges, gamification, loyalty, points, rewards
|
4 |
Requires at least: 4.8
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.8.
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -14,9 +14,9 @@ An adaptive and powerful points management system for WordPress powered websites
|
|
14 |
|
15 |
myCred is an intelligent and adaptive **points management system** that allows you to build and manage a broad range of digital rewards including points, ranks and, badges on your WordPress/WooCommerce powered website.
|
16 |
|
17 |
-
Build **brand loyalty** by rewarding your customers through store reward systems, community leaderboards, monetizing your website content, etc.
|
18 |
|
19 |
-
**Increase customer engagement tenfold
|
20 |
|
21 |
= AMAZING AWARD SYSTEMS TO ENGAGE AND REWARD LOYAL CUSTOMERS =
|
22 |
|
@@ -24,9 +24,9 @@ myCred allows **THREE different ways** through which you can award your users:
|
|
24 |
|
25 |
* **Points -** Set events and triggers to allow real-time tracking and automatically award your users with points.
|
26 |
|
27 |
-
* **Ranks
|
28 |
|
29 |
-
* **Badges -** Boost your users
|
30 |
|
31 |
= BECOME A VIP MEMBER OF THE MYCRED MEMBERSHIP CLUB =
|
32 |
|
@@ -44,27 +44,27 @@ Join the myCred membership club today and take advantage of premium services tha
|
|
44 |
|
45 |
= Features =
|
46 |
|
47 |
-
**- Point Balances:** Each user on your website will have their own point balance, where they
|
48 |
**- Account History:** Each time a user gains or loses points on your website, the transaction is logged into a central log for accountability.
|
49 |
-
**- Points Management:** You have full control over your users
|
50 |
**- White-Labeling:** myCred has built-in support for white-labeling - This allows you to rename the plugin in your admin area to anything you like.
|
51 |
**- Import & Export:** myCred comes with three built-in import tools allowing you to import points, log entries, or migrate your CubePoints installation.
|
52 |
-
**- Automatic Points:** Automatically award or deduct points from your user
|
53 |
**- Multiple Point Types:** Create multiple point types through the admin area to manage things easily. There is no limit to the number of point types you can have at your disposal.
|
54 |
**- Multi-Site Support:** myCred has built-in support for multi-sites, allowing you to choose between using a unique myCred installation or centralize balances across your network.
|
55 |
-
**- Leaderboards:** Generate leaderboards based on your user
|
56 |
**- Badges:** Award badges to your users based on their points history. You can set certain requirements for this feature so that myCred automatically awards them to the deserving users.
|
57 |
**- Buy Points:** The buyCred add-on allows your users to purchase points using real money using some of the most popular payment gateways available in the market today.
|
58 |
**- Coupons:** Create and share coupon codes with your users, which can be redeemed when they have generated a certain amount of points.
|
59 |
**- Notifications:** The notifications add-on allows you to show popup notifications each time a user gains or loses points on your website.
|
60 |
-
**- Ranks:** Ranks are based on how well your user balance is performing. As a user
|
61 |
**- Store Payments:** myCred supports some of the most popular store plugins for WordPress, allowing your users to pay for orders/tickets using their point balance instead of real money.
|
62 |
**- Reward Purchases:** You can opt to reward your users with points that they can use to buy products in your store.
|
63 |
**- Sell Content:** The Sell Content add-on allows you to sell access to the content field of posts/pages or custom post types on your website.
|
64 |
**- Statistics:** The statistics add-on will convert your log data into charts to help visualize points usage and circulation on your website.
|
65 |
**- Transfers:** The transfer add-on allows your users to transfer points to other users on your website.
|
66 |
**- Theme Independent:** The myCred plugin is theme independent - Your theme needs to support widgets and shortcodes in order to run myCred.
|
67 |
-
**- BuddyPress Ready:** myCred has had built-in support for BuddyPress through which you can access BuddyPress related features like Insert point balances/badges/ranks into your user
|
68 |
**- Bootstrap Ready:** myCred comes with minimal CSS styling to give you the freedom to style everything according to your needs.
|
69 |
**- Translation Ready:** You can add your own language translation or adjust the built-in translation support.
|
70 |
|
@@ -77,25 +77,25 @@ Not only will you be able to manually adjust the point balance system at any tim
|
|
77 |
|
78 |
= AWARD OR DEDUCT POINTS AUTOMATICALLY =
|
79 |
|
80 |
-
**myCred** supports an extensive set of WordPress interactions through which you can automatically give/take points from a user. These actions can be as simple as logging in, publishing content, or leaving a comment. These automatic adjustments are managed by a feature called
|
81 |
|
82 |
|
83 |
= DEDICATED LOG =
|
84 |
|
85 |
-
Each time **myCred** adds or deducts points from a user, the adjustment is [logged](https://mycred.me/about/features/#account-history) in a dedicated log, allowing your users to browse their history. This log keeps a record of your users
|
86 |
|
87 |
This log data can be converted into charts to help you visualize the usage and circulation of points on your website.
|
88 |
|
89 |
You can achieve the following features by using a dedicated log for your points system:
|
90 |
|
91 |
* Set a limit to the maximum number of times each hook can give out points to your user.
|
92 |
-
* Badges will use the log
|
93 |
-
* Add-ons such as
|
94 |
* Add-ons use the log to make sure that a user does not gain repetitive points for the same interaction within a given time frame.
|
95 |
|
96 |
= BUILT-IN ADD-ONS =
|
97 |
|
98 |
-
myCred is much more than just a point management system
|
99 |
|
100 |
**- Badges:** Award your users badges based on their points history.
|
101 |
**- buyCred:** Let your users buy points in exchange for real money.
|
@@ -103,7 +103,7 @@ myCred is much more than just a point management system – The plugin comes wit
|
|
103 |
**- Email notifications:** Setup email notifications for status updates.
|
104 |
**- Gateway:** Let users pay with points in your store.
|
105 |
**- Notifications:** Enable popup notifications that display status updates.
|
106 |
-
**- Ranks:** Create ranks based on the user
|
107 |
**- Sell Content:** Sell your content in exchange for points.
|
108 |
**- Statistics:** Get a statistical overview of points in circulation, etc.
|
109 |
**- Transfers:** Allow your users to transfer points to other users.
|
@@ -114,7 +114,7 @@ Power your WordPress website with 50+ add-ons ranging from categories like **Gam
|
|
114 |
|
115 |
myCred supports some of the most popular WordPress plugins like **BuddyPress, WooCommerce, Jetpack, Contact Form 7, Disqus, Gravity Forms,** among countless others.
|
116 |
|
117 |
-
**Simple & organized
|
118 |
|
119 |
|
120 |
= INTEGRATED WITH THE MOST POPULAR LEARNING MANAGEMENT SYSTEMS =
|
@@ -142,10 +142,10 @@ myCred is integrated with a large number of popular learning management systems,
|
|
142 |
[Explore to find out more...](https://www.mycred.me/product-category/freebies/)
|
143 |
|
144 |
|
145 |
-
= MYCRED
|
146 |
|
147 |
-
- [Stripe
|
148 |
-
- [Easy Digital Downloads
|
149 |
- [myCred Zapier Addon](https://mycred.me/store/mycred-zapier-addon/)
|
150 |
- [myCred Dokan](https://www.mycred.me/store/mycred-dokan/)
|
151 |
- [myCred WCVendors](https://www.mycred.me/store/mycred-wc-vendors/)
|
@@ -153,13 +153,13 @@ myCred is integrated with a large number of popular learning management systems,
|
|
153 |
- [myCred for Users Ultra](https://www.mycred.me/store/mycred-for-users-ultra/)
|
154 |
- [myCred for User Pro](https://www.mycred.me/store/mycred-for-user-pro/)
|
155 |
|
156 |
-
= MYCRED
|
157 |
|
158 |
- [myCred PacMan](https://www.mycred.me/store/mycred-pacman/)
|
159 |
- [Wheel of Fortune Add-On](https://www.mycred.me/store/wheel-of-fortune-add-on/)
|
160 |
|
161 |
|
162 |
-
= MYCRED
|
163 |
|
164 |
- [myCred WooCommerce Plus](https://www.mycred.me/store/mycred-woocommerce-plus/)
|
165 |
- [myCred Email Digest](https://mycred.me/store/mycred-email-digest/)
|
@@ -167,7 +167,7 @@ myCred is integrated with a large number of popular learning management systems,
|
|
167 |
- [myCred Points Cap](https://mycred.me/store/mycred-points-cap/)
|
168 |
- [myCred Level Cred](https://www.mycred.me/store/mycred-level-cred/)
|
169 |
- [myCred Social Proof](https://www.mycred.me/store/mycred-social-proof/)
|
170 |
-
- [myCred SMS Payments
|
171 |
- [myCred Expiration Add on](https://www.mycred.me/store/mycred-expiration-add-on/)
|
172 |
- [myCred Social Share Add on](https://www.mycred.me/store/mycred-social-share-add-on/)
|
173 |
- [myCred Progress Bar Add on](https://www.mycred.me/store/mycred-progress-bar-add-on/)
|
@@ -186,16 +186,16 @@ You can find extensive [documentation](http://codex.mycred.me/) on myCred relate
|
|
186 |
|
187 |
= Customizations =
|
188 |
|
189 |
-
myCred has the ability to
|
190 |
|
191 |
|
192 |
= Support =
|
193 |
|
194 |
-
We offer support on our [myCred website](https://mycred.me/support/) from 9 AM
|
195 |
|
196 |
-
You can either submit a [customization request](https://mycred.me/customize/request-quote/) or open a [support ticket](https://mycred.me/support/) any time you
|
197 |
|
198 |
-
If you
|
199 |
|
200 |
== Installation ==
|
201 |
|
@@ -274,6 +274,9 @@ Bug fixes release.
|
|
274 |
= 1.8.12 =
|
275 |
Bug fixes release.
|
276 |
|
|
|
|
|
|
|
277 |
|
278 |
== Other Notes ==
|
279 |
|
@@ -296,167 +299,191 @@ Bug fixes release.
|
|
296 |
|
297 |
== Changelog ==
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
= 1.8.12 =
|
300 |
-
NEW - Introduce a new filter mycred_video_interval for myCred Addons.
|
301 |
-
NEW - Added rate attribute in mycred_buy_form shortcode.
|
302 |
-
FIX - buyCred pending payment payout.
|
303 |
-
FIX - Badge image broken on sub-sites when master template is enabled on buddypress profile.
|
304 |
-
FIX - All ranks not removing completely, it stored some of their data in database.
|
305 |
-
FIX - Multisite buyCred transaction id empty on subsites in Bank transfer gateway.
|
306 |
-
FIX - mycred sell content not working with bbpress.
|
307 |
-
FIX - Bitpay 404 page issue in buyCred popup vesion.
|
308 |
-
FIX - myCred Email notifications triggers "transfer send and receives" not working properly.
|
309 |
-
FIX - mycred_sales_history shortcode not working.
|
310 |
-
TWEAK - Compatible rank module with PHP 7.4
|
311 |
-
TWEAK - Some variables are undefined in different cases in Leaderboard.
|
312 |
|
313 |
= 1.8.11 =
|
314 |
-
NEW - Added button for remove default badge image.
|
315 |
-
FIX - Log menu not visible except the master site when the master template is enabled.
|
316 |
-
FIX - Bitpay buyCred payment gateway not working.
|
317 |
-
FIX - Pending payment menu not visible in multisite if the master template is enabled.
|
318 |
-
FIX - Undefined variable in myCRED_Query_Log class.
|
319 |
-
FIX - Single Quote in form title breaks the specific badge functionality for the gravity form.
|
320 |
-
FIX - Undefined index warnings in myCred leaderboard widget.
|
321 |
-
TWEAK - Update myCred translations.
|
322 |
-
TWEAK - mycred_hook_table code improvements.
|
323 |
|
324 |
= 1.8.9 =
|
325 |
-
NEW - Introduce a new filter mycred_update_total_balance.
|
326 |
-
FIX - Rank display setting issues.
|
327 |
-
FIX - View content hook limit not working properly.
|
328 |
-
FIX - Buycred maximum limit not working.
|
329 |
-
FIX - myCred ranks show in BBPress profile and topic post even the user is excluded from the point type.
|
330 |
-
FIX - Badges not displaying in BBPress profile even check show all badges.
|
331 |
-
FIX - BuyCred Payment transactions visible in recent comments section.
|
332 |
-
TWEAK - Improvement in mycred_my_ranks shortcode.
|
333 |
-
TWEAK - Buycred shows proper error messages.
|
334 |
|
335 |
= 1.8.8 =
|
336 |
-
NEW - Introduced myCred membership.
|
337 |
-
NEW - Added support in badge for specific link click and gravity form.
|
338 |
-
TWEAK - Added notice for meta key to avoid any conflicts.
|
339 |
-
FIX - leaderboard "current" attribute was not working.
|
340 |
-
FIX - myCred ranks show in BuddyPress profile even the user is excluded from the point type.
|
341 |
-
FIX - "number" attribute was not working in stats related shortcodes.
|
342 |
-
FIX - Errors in mycred_get_ranks function.
|
343 |
-
FIX - Unselected point types also appear in myCred Wallet Widget.
|
344 |
-
FIX - Four-digit points value not working in remote API.
|
345 |
-
FIX - MYSQL and MariaDB syntax error in their newer versions.
|
346 |
|
347 |
= 1.8.7 =
|
348 |
-
NEW - Introduce a new action hook mycred_after_badge_assign.
|
349 |
-
FIX - Placeholder attribute not working in mycred_transfer shortcode.
|
350 |
|
351 |
= 1.8.6 =
|
352 |
-
NEW - Introduce a new shortcode [mycred_my_balance_converted].
|
353 |
-
NEW - Introduce a new template tag %coupon_code%.
|
354 |
-
TWEAK - Avoid duplicate database calls in get_log_table().
|
355 |
-
TWEAK - Language support in [mycred_hook_table] shortcode.
|
356 |
-
FIX - [mycred_buy] shortcode always get default point type settings.
|
357 |
-
FIX - HTML format issue in [mycred_buy_form] shortcode.
|
358 |
-
FIX - Remove badge related PHP warnings.
|
359 |
-
FIX - %order_id% template tag does not render in myCRED email.
|
360 |
-
FIX - %transfer_message% template tag does not render in myCRED email.
|
361 |
|
362 |
= 1.8.5.1 =
|
363 |
-
FIX - myCRED Statistics add-on related shortcodes.
|
364 |
-
FIX - myCRED Leaderbard cache issue.
|
365 |
-
TWEAK - Database optimization.
|
366 |
|
367 |
= 1.8.5 =
|
368 |
-
NEW - Added "to" attribute in Leaderboard shortcode.
|
369 |
-
NEW - Added filter "mycred_show_custom_coupon_value" for coupon value.
|
370 |
-
FIX - myCRED Leaderboard widget notices.
|
371 |
-
FIX - Typo fix in BuddyPress hook.
|
372 |
-
FIX - Coupon success message not showing in custom point types.
|
373 |
-
FIX - Incorrect point type in coupon notification.
|
374 |
-
FIX - Ranks not being assigned based on Total Balance.
|
375 |
-
FIX - Set default point type in ctype attribute in [mycred_users_of_all_ranks] shortcode.
|
376 |
-
FIX - [mycred_hook_table] this shortcode showing only 1 content hook at a time.
|
377 |
-
FIX - Emails that are stored in draft are also being sent.
|
378 |
-
FIX - Template tags are not being rendered in email Notices.
|
379 |
-
FIX - Admin not able to select ranks "manual mode" from settings.
|
380 |
-
FIX - Admin not able to assign ranks when "manual mode" is enabled.
|
381 |
-
FIX - Errors in [mycred_email_subscriptions] shortcode.
|
382 |
-
FIX - Transfer Message showing as "-" in log.
|
383 |
-
FIX - myCRED Cache not deleting.
|
384 |
-
FIX - When deleting a BuddyPress Activity adds a "Profile Comment Delete" log.
|
385 |
-
FIX - Assign users badge from badge edit page.
|
386 |
-
FIX - "Not in" operator not passing in query_log.
|
387 |
-
FIX - Show main image in [mycred_my_badges] shortcode if level image is not set.
|
388 |
|
389 |
= 1.8.4.2 =
|
390 |
-
FIX - myCRED hooks not adding on other point types.
|
391 |
-
FIX - option_id name not calling for other point types.
|
392 |
|
393 |
= 1.8.4.1 =
|
394 |
-
FIX - myCRED hooks not saving.
|
395 |
-
FIX - setCookie function error when adding new hook.
|
396 |
|
397 |
= 1.8.4 =
|
398 |
-
NEW - Introduce a new filter
|
399 |
-
NEW - Add new action "mycred_pref_hooks" on mycred hooks page
|
400 |
-
TWEAK - Limits are showing for Approved comments hook in [mycred_hook_table] shortcode.
|
401 |
-
FIX - Sell content undefined offset in Backend Pages & Posts.
|
402 |
-
FIX - mycred_buy shortcode Undefined variable: post.
|
403 |
-
FIX - Bitpay 404 page redirect.
|
404 |
-
FIX - BuyCred Gateway error message no gateway available.
|
405 |
-
FIX - myCred Email accept only ARRAY value in "get_subject" function.
|
406 |
-
FIX - Incorrect log table name in multisite when central logging is enabled.
|
407 |
-
FIX - strpos depreciated behavior.
|
408 |
-
FIX - Coupon expiration before date.
|
409 |
-
FIX - "Total in Points" value show in both Cart & Checkout page when you select "Show in Cart and on Checkout Page" in WooCommerce myCRED Gateway.
|
410 |
|
411 |
= 1.8.3 =
|
412 |
-
FIX - Fixed Woocommerce checkout errors.
|
413 |
-
FIX - Fixed get_users_balance function.
|
414 |
-
FIX - Fixed typo error in bbPress hook.
|
415 |
-
NEW - Added new feature to copy to clipboard referral link in BuddyPress profile page
|
416 |
|
417 |
= 1.8.2 =
|
418 |
-
FIX - [mycred_best_user] shortcode fixed.
|
419 |
-
FIX - Post related template tags fixed.
|
420 |
-
FIX - Sell content related issue fixed.
|
421 |
IMPROVEMENT - Added check for existing logs getting disappeared.
|
422 |
|
423 |
= 1.8.1 =
|
424 |
-
FIX - [mycred_my_balance] shortcode fixed.
|
425 |
-
FIX - [mycred_total_balance] shortcode fixed.
|
426 |
-
FIX - rank related issues fixed.
|
427 |
|
428 |
= 1.8 =
|
429 |
-
NEW - Added new mycred_over_hook_limit filter for adjusting hook limit checks.
|
430 |
-
NEW - Added new MYCRED_RANK_KEY constant which can be used to whitelabel ranks.
|
431 |
-
NEW - Added new MYCRED_COUPON_KEY constant which can be used to whitelabel coupons.
|
432 |
-
NEW - Added new MYCRED_BADGE_KEY constant which can be used to whitelabel badges.
|
433 |
-
NEW - Added new MYCRED_EMAIL_KEY constant with can be used to whitelabel email notifications.
|
434 |
-
NEW - Added new MYCRED_BUY_KEY constant with can be used to whitelabel pending buyCRED payments.
|
435 |
-
NEW - Added new MYCRED_ENABLE_SHORTCODES constant in cases where myCRED shortcodes needs to be disabled.
|
436 |
-
NEW - Updated the Email Notifications add-on to version 1.4 with support for custom instances, multiple point types / notice and introduced the new myCRED_Email object.
|
437 |
-
NEW - Updated the buyCRED add-on which now has improved checkout process.
|
438 |
-
NEW - Added the option to set a custom gateway logo for all built-in payment gateways.
|
439 |
-
NEW - Updated the mycred_load_coupon shortcode to show an error message when an invalid coupon is used.
|
440 |
-
NEW - Added new Anniversary hook allowing you to reward users for each year they are a member on your website.
|
441 |
-
NEW - Added new MYCRED_ENABLE_HOOKS constant to disable hooks completely.
|
442 |
-
NEW - Added support for Multi Network setups.
|
443 |
-
NEW - Added new mycred_add_post_meta(), mycred_get_post_meta(), mycred_update_post_meta() and mycred_delete_post_meta() functions in order to add support for the Master Template feature on multisites.
|
444 |
-
NEW - Added support for multiple point types in leaderboards.
|
445 |
-
NEW - The leaderboard shortcode can now be setup to render results based on multiple point types.
|
446 |
-
NEW - Added caching of log and leaderboard queries.
|
447 |
-
NEW - Added new filter to allow adjustments to the reference used for publishing and deleting content hooks.
|
448 |
-
NEW - Added new mycred_give_run filter to control if the mycred_give shortcode should run or not.
|
449 |
-
TWEAK - Moved hooks to /includes/hooks/ and third-party hooks to /includes/hooks/external/.
|
450 |
-
TWEAK - Implemented the use of $mycred_log_table global throughout the plugin.
|
451 |
-
TWEAK - Improved Multisite support.
|
452 |
-
TWEAK - When a user jumps more than one badge level in a single instance, we want to make sure he gets rewarded for each level (if rewards is set).
|
453 |
-
TWEAK - Corrected codex urls for functions and shortcodes throughout the plugin.
|
454 |
-
TWEAK - Added support to whitelabel shortcodes.
|
455 |
-
TWEAK - Added new MYCRED_SHOW_PREMIUM_ADDONS constant to hide all mentions of premium add-ons in myCRED.
|
456 |
-
TWEAK - BuddyPress fixed issue related to points ignoring limit on adding to favorites
|
457 |
-
TWEAK - Optimized search the search for log entries
|
458 |
-
TWEAK - issue related to email not getting send on transfer in and out triggers in transfer addon
|
459 |
-
TWEAK - Rank excerpt fix
|
460 |
|
461 |
|
462 |
= Previous Versions =
|
2 |
Contributors: mycred,wpexpertsio
|
3 |
Tags: badges, gamification, loyalty, points, rewards
|
4 |
Requires at least: 4.8
|
5 |
+
Tested up to: 5.5
|
6 |
+
Stable tag: 1.8.13
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
14 |
|
15 |
myCred is an intelligent and adaptive **points management system** that allows you to build and manage a broad range of digital rewards including points, ranks and, badges on your WordPress/WooCommerce powered website.
|
16 |
|
17 |
+
Build **brand loyalty** by rewarding your customers through store reward systems, community leaderboards, monetizing your website content, etc. – The possibilities are endless.
|
18 |
|
19 |
+
**Increase customer engagement tenfold – Rewarding your users for community engagement will help your business grow.**
|
20 |
|
21 |
= AMAZING AWARD SYSTEMS TO ENGAGE AND REWARD LOYAL CUSTOMERS =
|
22 |
|
24 |
|
25 |
* **Points -** Set events and triggers to allow real-time tracking and automatically award your users with points.
|
26 |
|
27 |
+
* **Ranks –** Set ranks within your leaderboards and reward your users with significant perks after they reach a certain milestone.
|
28 |
|
29 |
+
* **Badges -** Boost your users’ participation by rewarding them for their exceptional performance.
|
30 |
|
31 |
= BECOME A VIP MEMBER OF THE MYCRED MEMBERSHIP CLUB =
|
32 |
|
44 |
|
45 |
= Features =
|
46 |
|
47 |
+
**- Point Balances:** Each user on your website will have their own point balance, where they’ll be able to view points that were gained/lost.
|
48 |
**- Account History:** Each time a user gains or loses points on your website, the transaction is logged into a central log for accountability.
|
49 |
+
**- Points Management:** You have full control over your users’ point balances; You can adjust your user/s balance by adding or removing points with or without a log entry.
|
50 |
**- White-Labeling:** myCred has built-in support for white-labeling - This allows you to rename the plugin in your admin area to anything you like.
|
51 |
**- Import & Export:** myCred comes with three built-in import tools allowing you to import points, log entries, or migrate your CubePoints installation.
|
52 |
+
**- Automatic Points:** Automatically award or deduct points from your user’s balance for their interaction on your Wordpress/WooCommerce website.
|
53 |
**- Multiple Point Types:** Create multiple point types through the admin area to manage things easily. There is no limit to the number of point types you can have at your disposal.
|
54 |
**- Multi-Site Support:** myCred has built-in support for multi-sites, allowing you to choose between using a unique myCred installation or centralize balances across your network.
|
55 |
+
**- Leaderboards:** Generate leaderboards based on your user’s balance or points history - display users with the most points for a particular instance.
|
56 |
**- Badges:** Award badges to your users based on their points history. You can set certain requirements for this feature so that myCred automatically awards them to the deserving users.
|
57 |
**- Buy Points:** The buyCred add-on allows your users to purchase points using real money using some of the most popular payment gateways available in the market today.
|
58 |
**- Coupons:** Create and share coupon codes with your users, which can be redeemed when they have generated a certain amount of points.
|
59 |
**- Notifications:** The notifications add-on allows you to show popup notifications each time a user gains or loses points on your website.
|
60 |
+
**- Ranks:** Ranks are based on how well your user balance is performing. As a user’s balance changes, so do their rank.
|
61 |
**- Store Payments:** myCred supports some of the most popular store plugins for WordPress, allowing your users to pay for orders/tickets using their point balance instead of real money.
|
62 |
**- Reward Purchases:** You can opt to reward your users with points that they can use to buy products in your store.
|
63 |
**- Sell Content:** The Sell Content add-on allows you to sell access to the content field of posts/pages or custom post types on your website.
|
64 |
**- Statistics:** The statistics add-on will convert your log data into charts to help visualize points usage and circulation on your website.
|
65 |
**- Transfers:** The transfer add-on allows your users to transfer points to other users on your website.
|
66 |
**- Theme Independent:** The myCred plugin is theme independent - Your theme needs to support widgets and shortcodes in order to run myCred.
|
67 |
+
**- BuddyPress Ready:** myCred has had built-in support for BuddyPress through which you can access BuddyPress related features like Insert point balances/badges/ranks into your user’s profiles.
|
68 |
**- Bootstrap Ready:** myCred comes with minimal CSS styling to give you the freedom to style everything according to your needs.
|
69 |
**- Translation Ready:** You can add your own language translation or adjust the built-in translation support.
|
70 |
|
77 |
|
78 |
= AWARD OR DEDUCT POINTS AUTOMATICALLY =
|
79 |
|
80 |
+
**myCred** supports an extensive set of WordPress interactions through which you can automatically give/take points from a user. These actions can be as simple as logging in, publishing content, or leaving a comment. These automatic adjustments are managed by a feature called “[Hooks](https://mycred.me/about/features/#automatic-points)†that can be set up in your admin area.
|
81 |
|
82 |
|
83 |
= DEDICATED LOG =
|
84 |
|
85 |
+
Each time **myCred** adds or deducts points from a user, the adjustment is [logged](https://mycred.me/about/features/#account-history) in a dedicated log, allowing your users to browse their history. This log keeps a record of your users’ accountability, badges, and ranks, among other useful statistics.
|
86 |
|
87 |
This log data can be converted into charts to help you visualize the usage and circulation of points on your website.
|
88 |
|
89 |
You can achieve the following features by using a dedicated log for your points system:
|
90 |
|
91 |
* Set a limit to the maximum number of times each hook can give out points to your user.
|
92 |
+
* Badges will use the log’s data to determine which user has earned a badge.
|
93 |
+
* Add-ons such as “Sell Content†use the log to keep track of users who have purchased posts from your website.
|
94 |
* Add-ons use the log to make sure that a user does not gain repetitive points for the same interaction within a given time frame.
|
95 |
|
96 |
= BUILT-IN ADD-ONS =
|
97 |
|
98 |
+
myCred is much more than just a point management system – The plugin comes with several [built-in add-ons](https://www.mycred.me/add-ons/) that enable you to perform complex tasks such as transfer or buy points for real money, allow payments in stores, etc.
|
99 |
|
100 |
**- Badges:** Award your users badges based on their points history.
|
101 |
**- buyCred:** Let your users buy points in exchange for real money.
|
103 |
**- Email notifications:** Setup email notifications for status updates.
|
104 |
**- Gateway:** Let users pay with points in your store.
|
105 |
**- Notifications:** Enable popup notifications that display status updates.
|
106 |
+
**- Ranks:** Create ranks based on the user’s point balance.
|
107 |
**- Sell Content:** Sell your content in exchange for points.
|
108 |
**- Statistics:** Get a statistical overview of points in circulation, etc.
|
109 |
**- Transfers:** Allow your users to transfer points to other users.
|
114 |
|
115 |
myCred supports some of the most popular WordPress plugins like **BuddyPress, WooCommerce, Jetpack, Contact Form 7, Disqus, Gravity Forms,** among countless others.
|
116 |
|
117 |
+
**Simple & organized –** To keep your admin area organized, myCred will only show features and setting for those third-party plugins that are installed and enabled.
|
118 |
|
119 |
|
120 |
= INTEGRATED WITH THE MOST POPULAR LEARNING MANAGEMENT SYSTEMS =
|
142 |
[Explore to find out more...](https://www.mycred.me/product-category/freebies/)
|
143 |
|
144 |
|
145 |
+
= MYCRED’S THIRD-PARTY BRIDGES PLUGINS: =
|
146 |
|
147 |
+
- [Stripe – buyCred Gateway](https://www.mycred.me/store/buycred-stripe/)
|
148 |
+
- [Easy Digital Downloads – myCred Gateway](https://www.mycred.me/store/mycred-for-easy-digital-downloads/)
|
149 |
- [myCred Zapier Addon](https://mycred.me/store/mycred-zapier-addon/)
|
150 |
- [myCred Dokan](https://www.mycred.me/store/mycred-dokan/)
|
151 |
- [myCred WCVendors](https://www.mycred.me/store/mycred-wc-vendors/)
|
153 |
- [myCred for Users Ultra](https://www.mycred.me/store/mycred-for-users-ultra/)
|
154 |
- [myCred for User Pro](https://www.mycred.me/store/mycred-for-user-pro/)
|
155 |
|
156 |
+
= MYCRED’S GAMIFICATION PLUGINS: =
|
157 |
|
158 |
- [myCred PacMan](https://www.mycred.me/store/mycred-pacman/)
|
159 |
- [Wheel of Fortune Add-On](https://www.mycred.me/store/wheel-of-fortune-add-on/)
|
160 |
|
161 |
|
162 |
+
= MYCRED’S ENHANCEMENT PLUGINS: =
|
163 |
|
164 |
- [myCred WooCommerce Plus](https://www.mycred.me/store/mycred-woocommerce-plus/)
|
165 |
- [myCred Email Digest](https://mycred.me/store/mycred-email-digest/)
|
167 |
- [myCred Points Cap](https://mycred.me/store/mycred-points-cap/)
|
168 |
- [myCred Level Cred](https://www.mycred.me/store/mycred-level-cred/)
|
169 |
- [myCred Social Proof](https://www.mycred.me/store/mycred-social-proof/)
|
170 |
+
- [myCred SMS Payments – Twilio Transfers](https://www.mycred.me/store/sms-payments/)
|
171 |
- [myCred Expiration Add on](https://www.mycred.me/store/mycred-expiration-add-on/)
|
172 |
- [myCred Social Share Add on](https://www.mycred.me/store/mycred-social-share-add-on/)
|
173 |
- [myCred Progress Bar Add on](https://www.mycred.me/store/mycred-progress-bar-add-on/)
|
186 |
|
187 |
= Customizations =
|
188 |
|
189 |
+
myCred has the ability to “do-it-all†because we have put in a lot of effort to make sure that the supported plugins are as developer-friendly as possible. If you need to build a custom feature, simply submit a [request for a quote](https://mycred.me/customize/request-quote/) via the myCred website.
|
190 |
|
191 |
|
192 |
= Support =
|
193 |
|
194 |
+
We offer support on our [myCred website](https://mycred.me/support/) from 9 AM – 5 PM, Monday to Friday (GMT+5).
|
195 |
|
196 |
+
You can either submit a [customization request](https://mycred.me/customize/request-quote/) or open a [support ticket](https://mycred.me/support/) any time you’re facing trouble with myCred.
|
197 |
|
198 |
+
If you’re facing a problem that is not described in our technical documentation, we suggest that you consult myCred’s [online community](https://mycred.me/support/forums/) with your question. We pay users through myCred Store Tokens as a reward for reporting bugs and even their fixes.
|
199 |
|
200 |
== Installation ==
|
201 |
|
274 |
= 1.8.12 =
|
275 |
Bug fixes release.
|
276 |
|
277 |
+
= 1.8.13 =
|
278 |
+
Bug fixes release.
|
279 |
+
|
280 |
|
281 |
== Other Notes ==
|
282 |
|
299 |
|
300 |
== Changelog ==
|
301 |
|
302 |
+
= 1.8.13 =
|
303 |
+
- **NEW** - Introduce a decimal attribute in mycred_my_balance_converted shortcode
|
304 |
+
- **NEW** - Introduce a filter mycred_woocommerce_gateway_supports
|
305 |
+
- **NEW** - Introduce myCred balance and rank menu items in wordpress menu
|
306 |
+
- **NEW** - Introduce a new hook reward for buying points in buyCred addon
|
307 |
+
- **NEW** - Added mycred membership table in membership page
|
308 |
+
- **NEW** - Added addon install, activate and deactivate functionality in mycred membership page
|
309 |
+
- **NEW** - Added new filter mycred_badge_assign to control if the badge assign or not.
|
310 |
+
- **FIX** - BBPress Hook delete reply/topic not working
|
311 |
+
- **FIX** - myCred Badge AND/OR condition now working correctly
|
312 |
+
- **FIX** - Badge reward not being added in total balance
|
313 |
+
- **FIX** - Undefined variables in mycred_leaderboard_position shortcode
|
314 |
+
- **FIX** - Rank manual mode not working
|
315 |
+
- **FIX** - mycred_buy shortcode message not visible to non logged in users
|
316 |
+
- **FIX** - mycred_chart_balance_history shortcode incorrect chart data
|
317 |
+
- **FIX** - Warnings in mycred referral hook
|
318 |
+
- **FIX** - "Click here to get your Membership License" link not working
|
319 |
+
- **FIX** - Badge reward not being added in total balance
|
320 |
+
- **FIX** - Badge reward not being reflected on ranks
|
321 |
+
- **FIX** - mycred_my_balance_converted shortcode prefix attribute not working
|
322 |
+
- **FIX** - mycred_reset_key cron action not working
|
323 |
+
- **TWEAK** - Improve mycred_get_membership_details function
|
324 |
+
- **TWEAK** - mycred_transfer shortcode prevent multiple form submission until the server responds
|
325 |
+
|
326 |
= 1.8.12 =
|
327 |
+
- **NEW** - Introduce a new filter mycred_video_interval for myCred Addons.
|
328 |
+
- **NEW** - Added rate attribute in mycred_buy_form shortcode.
|
329 |
+
- **FIX** - buyCred pending payment payout.
|
330 |
+
- **FIX** - Badge image broken on sub-sites when master template is enabled on buddypress profile.
|
331 |
+
- **FIX** - All ranks not removing completely, it stored some of their data in database.
|
332 |
+
- **FIX** - Multisite buyCred transaction id empty on subsites in Bank transfer gateway.
|
333 |
+
- **FIX** - mycred sell content not working with bbpress.
|
334 |
+
- **FIX** - Bitpay 404 page issue in buyCred popup vesion.
|
335 |
+
- **FIX** - myCred Email notifications triggers "transfer send and receives" not working properly.
|
336 |
+
- **FIX** - mycred_sales_history shortcode not working.
|
337 |
+
- **TWEAK** - Compatible rank module with PHP 7.4
|
338 |
+
- **TWEAK** - Some variables are undefined in different cases in Leaderboard.
|
339 |
|
340 |
= 1.8.11 =
|
341 |
+
- **NEW** - Added button for remove default badge image.
|
342 |
+
- **FIX** - Log menu not visible except the master site when the master template is enabled.
|
343 |
+
- **FIX** - Bitpay buyCred payment gateway not working.
|
344 |
+
- **FIX** - Pending payment menu not visible in multisite if the master template is enabled.
|
345 |
+
- **FIX** - Undefined variable in myCRED_Query_Log class.
|
346 |
+
- **FIX** - Single Quote in form title breaks the specific badge functionality for the gravity form.
|
347 |
+
- **FIX** - Undefined index warnings in myCred leaderboard widget.
|
348 |
+
- **TWEAK** - Update myCred translations.
|
349 |
+
- **TWEAK** - mycred_hook_table code improvements.
|
350 |
|
351 |
= 1.8.9 =
|
352 |
+
- **NEW** - Introduce a new filter mycred_update_total_balance.
|
353 |
+
- **FIX** - Rank display setting issues.
|
354 |
+
- **FIX** - View content hook limit not working properly.
|
355 |
+
- **FIX** - Buycred maximum limit not working.
|
356 |
+
- **FIX** - myCred ranks show in BBPress profile and topic post even the user is excluded from the point type.
|
357 |
+
- **FIX** - Badges not displaying in BBPress profile even check show all badges.
|
358 |
+
- **FIX** - BuyCred Payment transactions visible in recent comments section.
|
359 |
+
- **TWEAK** - Improvement in mycred_my_ranks shortcode.
|
360 |
+
- **TWEAK** - Buycred shows proper error messages.
|
361 |
|
362 |
= 1.8.8 =
|
363 |
+
- **NEW** - Introduced myCred membership.
|
364 |
+
- **NEW** - Added support in badge for specific link click and gravity form.
|
365 |
+
- **TWEAK** - Added notice for meta key to avoid any conflicts.
|
366 |
+
- **FIX** - leaderboard "current" attribute was not working.
|
367 |
+
- **FIX** - myCred ranks show in BuddyPress profile even the user is excluded from the point type.
|
368 |
+
- **FIX** - "number" attribute was not working in stats related shortcodes.
|
369 |
+
- **FIX** - Errors in mycred_get_ranks function.
|
370 |
+
- **FIX** - Unselected point types also appear in myCred Wallet Widget.
|
371 |
+
- **FIX** - Four-digit points value not working in remote API.
|
372 |
+
- **FIX** - MYSQL and MariaDB syntax error in their newer versions.
|
373 |
|
374 |
= 1.8.7 =
|
375 |
+
- **NEW** - Introduce a new action hook mycred_after_badge_assign.
|
376 |
+
- **FIX** - Placeholder attribute not working in mycred_transfer shortcode.
|
377 |
|
378 |
= 1.8.6 =
|
379 |
+
- **NEW** - Introduce a new shortcode [mycred_my_balance_converted].
|
380 |
+
- **NEW** - Introduce a new template tag %coupon_code%.
|
381 |
+
- **TWEAK** - Avoid duplicate database calls in get_log_table().
|
382 |
+
- **TWEAK** - Language support in [mycred_hook_table] shortcode.
|
383 |
+
- **FIX** - [mycred_buy] shortcode always get default point type settings.
|
384 |
+
- **FIX** - HTML format issue in [mycred_buy_form] shortcode.
|
385 |
+
- **FIX** - Remove badge related PHP warnings.
|
386 |
+
- **FIX** - %order_id% template tag does not render in myCRED email.
|
387 |
+
- **FIX** - %transfer_message% template tag does not render in myCRED email.
|
388 |
|
389 |
= 1.8.5.1 =
|
390 |
+
- **FIX** - myCRED Statistics add-on related shortcodes.
|
391 |
+
- **FIX** - myCRED Leaderbard cache issue.
|
392 |
+
- **TWEAK** - Database optimization.
|
393 |
|
394 |
= 1.8.5 =
|
395 |
+
- **NEW** - Added "to" attribute in Leaderboard shortcode.
|
396 |
+
- **NEW** - Added filter "mycred_show_custom_coupon_value" for coupon value.
|
397 |
+
- **FIX** - myCRED Leaderboard widget notices.
|
398 |
+
- **FIX** - Typo fix in BuddyPress hook.
|
399 |
+
- **FIX** - Coupon success message not showing in custom point types.
|
400 |
+
- **FIX** - Incorrect point type in coupon notification.
|
401 |
+
- **FIX** - Ranks not being assigned based on Total Balance.
|
402 |
+
- **FIX** - Set default point type in ctype attribute in [mycred_users_of_all_ranks] shortcode.
|
403 |
+
- **FIX** - [mycred_hook_table] this shortcode showing only 1 content hook at a time.
|
404 |
+
- **FIX** - Emails that are stored in draft are also being sent.
|
405 |
+
- **FIX** - Template tags are not being rendered in email Notices.
|
406 |
+
- **FIX** - Admin not able to select ranks "manual mode" from settings.
|
407 |
+
- **FIX** - Admin not able to assign ranks when "manual mode" is enabled.
|
408 |
+
- **FIX** - Errors in [mycred_email_subscriptions] shortcode.
|
409 |
+
- **FIX** - Transfer Message showing as "-" in log.
|
410 |
+
- **FIX** - myCRED Cache not deleting.
|
411 |
+
- **FIX** - When deleting a BuddyPress Activity adds a "Profile Comment Delete" log.
|
412 |
+
- **FIX** - Assign users badge from badge edit page.
|
413 |
+
- **FIX** - "Not in" operator not passing in query_log.
|
414 |
+
- **FIX** - Show main image in [mycred_my_badges] shortcode if level image is not set.
|
415 |
|
416 |
= 1.8.4.2 =
|
417 |
+
- **FIX** - myCRED hooks not adding on other point types.
|
418 |
+
- **FIX** - option_id name not calling for other point types.
|
419 |
|
420 |
= 1.8.4.1 =
|
421 |
+
- **FIX** - myCRED hooks not saving.
|
422 |
+
- **FIX** - setCookie function error when adding new hook.
|
423 |
|
424 |
= 1.8.4 =
|
425 |
+
- **NEW** - Introduce a new filter “mycred_option_id†for manipulating hooks.
|
426 |
+
- **NEW** - Add new action "mycred_pref_hooks" on mycred hooks page
|
427 |
+
- **TWEAK** - Limits are showing for Approved comments hook in [mycred_hook_table] shortcode.
|
428 |
+
- **FIX** - Sell content undefined offset in Backend Pages & Posts.
|
429 |
+
- **FIX** - mycred_buy shortcode Undefined variable: post.
|
430 |
+
- **FIX** - Bitpay 404 page redirect.
|
431 |
+
- **FIX** - BuyCred Gateway error message no gateway available.
|
432 |
+
- **FIX** - myCred Email accept only ARRAY value in "get_subject" function.
|
433 |
+
- **FIX** - Incorrect log table name in multisite when central logging is enabled.
|
434 |
+
- **FIX** - strpos depreciated behavior.
|
435 |
+
- **FIX** - Coupon expiration before date.
|
436 |
+
- **FIX** - "Total in Points" value show in both Cart & Checkout page when you select "Show in Cart and on Checkout Page" in WooCommerce myCRED Gateway.
|
437 |
|
438 |
= 1.8.3 =
|
439 |
+
- **FIX** - Fixed Woocommerce checkout errors.
|
440 |
+
- **FIX** - Fixed get_users_balance function.
|
441 |
+
- **FIX** - Fixed typo error in bbPress hook.
|
442 |
+
- **NEW** - Added new feature to copy to clipboard referral link in BuddyPress profile page
|
443 |
|
444 |
= 1.8.2 =
|
445 |
+
- **FIX** - [mycred_best_user] shortcode fixed.
|
446 |
+
- **FIX** - Post related template tags fixed.
|
447 |
+
- **FIX** - Sell content related issue fixed.
|
448 |
IMPROVEMENT - Added check for existing logs getting disappeared.
|
449 |
|
450 |
= 1.8.1 =
|
451 |
+
- **FIX** - [mycred_my_balance] shortcode fixed.
|
452 |
+
- **FIX** - [mycred_total_balance] shortcode fixed.
|
453 |
+
- **FIX** - rank related issues fixed.
|
454 |
|
455 |
= 1.8 =
|
456 |
+
- **NEW** - Added new mycred_over_hook_limit filter for adjusting hook limit checks.
|
457 |
+
- **NEW** - Added new MYCRED_RANK_KEY constant which can be used to whitelabel ranks.
|
458 |
+
- **NEW** - Added new MYCRED_COUPON_KEY constant which can be used to whitelabel coupons.
|
459 |
+
- **NEW** - Added new MYCRED_BADGE_KEY constant which can be used to whitelabel badges.
|
460 |
+
- **NEW** - Added new MYCRED_EMAIL_KEY constant with can be used to whitelabel email notifications.
|
461 |
+
- **NEW** - Added new MYCRED_BUY_KEY constant with can be used to whitelabel pending buyCRED payments.
|
462 |
+
- **NEW** - Added new MYCRED_ENABLE_SHORTCODES constant in cases where myCRED shortcodes needs to be disabled.
|
463 |
+
- **NEW** - Updated the Email Notifications add-on to version 1.4 with support for custom instances, multiple point types / notice and introduced the new myCRED_Email object.
|
464 |
+
- **NEW** - Updated the buyCRED add-on which now has improved checkout process.
|
465 |
+
- **NEW** - Added the option to set a custom gateway logo for all built-in payment gateways.
|
466 |
+
- **NEW** - Updated the mycred_load_coupon shortcode to show an error message when an invalid coupon is used.
|
467 |
+
- **NEW** - Added new Anniversary hook allowing you to reward users for each year they are a member on your website.
|
468 |
+
- **NEW** - Added new MYCRED_ENABLE_HOOKS constant to disable hooks completely.
|
469 |
+
- **NEW** - Added support for Multi Network setups.
|
470 |
+
- **NEW** - Added new mycred_add_post_meta(), mycred_get_post_meta(), mycred_update_post_meta() and mycred_delete_post_meta() functions in order to add support for the Master Template feature on multisites.
|
471 |
+
- **NEW** - Added support for multiple point types in leaderboards.
|
472 |
+
- **NEW** - The leaderboard shortcode can now be setup to render results based on multiple point types.
|
473 |
+
- **NEW** - Added caching of log and leaderboard queries.
|
474 |
+
- **NEW** - Added new filter to allow adjustments to the reference used for publishing and deleting content hooks.
|
475 |
+
- **NEW** - Added new mycred_give_run filter to control if the mycred_give shortcode should run or not.
|
476 |
+
- **TWEAK** - Moved hooks to /includes/hooks/ and third-party hooks to /includes/hooks/external/.
|
477 |
+
- **TWEAK** - Implemented the use of $mycred_log_table global throughout the plugin.
|
478 |
+
- **TWEAK** - Improved Multisite support.
|
479 |
+
- **TWEAK** - When a user jumps more than one badge level in a single instance, we want to make sure he gets rewarded for each level (if rewards is set).
|
480 |
+
- **TWEAK** - Corrected codex urls for functions and shortcodes throughout the plugin.
|
481 |
+
- **TWEAK** - Added support to whitelabel shortcodes.
|
482 |
+
- **TWEAK** - Added new MYCRED_SHOW_PREMIUM_ADDONS constant to hide all mentions of premium add-ons in myCRED.
|
483 |
+
- **TWEAK** - BuddyPress fixed issue related to points ignoring limit on adding to favorites
|
484 |
+
- **TWEAK** - Optimized search the search for log entries
|
485 |
+
- **TWEAK** - issue related to email not getting send on transfer in and out triggers in transfer addon
|
486 |
+
- **TWEAK** - Rank excerpt fix
|
487 |
|
488 |
|
489 |
= Previous Versions =
|