Version Description
Bug fixes.
=
Download this release
Release Info
Developer | designbymerovingi |
Plugin | myCRED |
Version | 1.7.9.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.9.1 to 1.7.9.2
- abstracts/mycred-abstract-module.php +8 -7
- addons/badges/assets/js/edit-badge.js +1 -0
- addons/badges/includes/mycred-badge-object.php +6 -1
- addons/badges/myCRED-addon-badges.php +68 -68
- addons/gateway/carts/mycred-woocommerce.php +22 -18
- addons/sell-content/includes/mycred-sell-functions.php +16 -5
- includes/classes/class.query-leaderboard.php +1 -1
- includes/mycred-functions.php +15 -18
- includes/mycred-setup.php +3 -3
- modules/mycred-module-hooks.php +4 -5
- modules/mycred-module-settings.php +8 -2
- mycred.php +3 -3
- readme.txt +14 -25
abstracts/mycred-abstract-module.php
CHANGED
@@ -351,30 +351,31 @@ if ( ! class_exists( 'myCRED_Module' ) ) :
|
|
351 |
* @param $key (string) required key to check for
|
352 |
* @returns (bool) true or false
|
353 |
* @since 0.1
|
354 |
-
* @version 1.
|
355 |
*/
|
356 |
function is_active( $key = '' ) {
|
357 |
|
358 |
-
$module
|
|
|
359 |
|
360 |
if ( ! isset( $this->active ) && ! empty( $key ) ) {
|
361 |
|
362 |
if ( isset( $this->$module['active'] ) )
|
363 |
$active = $this->$module['active'];
|
364 |
-
else
|
365 |
-
return false;
|
366 |
|
367 |
-
if ( in_array( $key, $active ) )
|
|
|
368 |
|
369 |
}
|
370 |
|
371 |
elseif ( isset( $this->active ) && ! empty( $key ) ) {
|
372 |
|
373 |
-
if ( in_array( $key, $this->active ) )
|
|
|
374 |
|
375 |
}
|
376 |
|
377 |
-
return
|
378 |
|
379 |
}
|
380 |
|
351 |
* @param $key (string) required key to check for
|
352 |
* @returns (bool) true or false
|
353 |
* @since 0.1
|
354 |
+
* @version 1.1
|
355 |
*/
|
356 |
function is_active( $key = '' ) {
|
357 |
|
358 |
+
$module = $this->module_name;
|
359 |
+
$is_active = false;
|
360 |
|
361 |
if ( ! isset( $this->active ) && ! empty( $key ) ) {
|
362 |
|
363 |
if ( isset( $this->$module['active'] ) )
|
364 |
$active = $this->$module['active'];
|
|
|
|
|
365 |
|
366 |
+
if ( in_array( $key, $active ) )
|
367 |
+
$is_active = true;
|
368 |
|
369 |
}
|
370 |
|
371 |
elseif ( isset( $this->active ) && ! empty( $key ) ) {
|
372 |
|
373 |
+
if ( in_array( $key, $this->active ) )
|
374 |
+
$is_active = true;
|
375 |
|
376 |
}
|
377 |
|
378 |
+
return apply_filters( 'mycred_module_is_active', $is_active, $module, $key, $this );
|
379 |
|
380 |
}
|
381 |
|
addons/badges/assets/js/edit-badge.js
CHANGED
@@ -351,6 +351,7 @@ jQuery(function($){
|
|
351 |
// Render a fresh level
|
352 |
var template = Mustache.render( BadgeLevel, {
|
353 |
level : TotalBadgeLevels,
|
|
|
354 |
requirements : reqtemplate
|
355 |
});
|
356 |
|
351 |
// Render a fresh level
|
352 |
var template = Mustache.render( BadgeLevel, {
|
353 |
level : TotalBadgeLevels,
|
354 |
+
levelone : ( parseInt( TotalBadgeLevels ) + 1 ),
|
355 |
requirements : reqtemplate
|
356 |
});
|
357 |
|
addons/badges/includes/mycred-badge-object.php
CHANGED
@@ -82,7 +82,12 @@ if ( ! class_exists( 'myCRED_Badge' ) ) :
|
|
82 |
if ( is_numeric( $image_identification ) && strpos( '://', $image_identification ) === false )
|
83 |
$image_url = wp_get_attachment_url( $image_identification );
|
84 |
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
}
|
88 |
|
82 |
if ( is_numeric( $image_identification ) && strpos( '://', $image_identification ) === false )
|
83 |
$image_url = wp_get_attachment_url( $image_identification );
|
84 |
|
85 |
+
$image_width = ( $this->image_width !== false ) ? ' width="' . esc_attr( $this->image_width ) . '"' : '';
|
86 |
+
$image_height = ( $this->image_height !== false ) ? ' height="' . esc_attr( $this->image_height ) . '"' : '';
|
87 |
+
|
88 |
+
$html = '<img src="' . esc_url( $image_url ) . '" class="' . MYCRED_SLUG . '-badge-image badge-level' . esc_attr( $level ) . '" title="' . esc_attr( $this->title ) . '" alt="' . esc_attr( $this->title ) . '"' . $image_width . $image_height . ' />';
|
89 |
+
|
90 |
+
return apply_filters( 'mycred_badge_image', $html, $image, $this );
|
91 |
|
92 |
}
|
93 |
|
addons/badges/myCRED-addon-badges.php
CHANGED
@@ -511,7 +511,7 @@ if ( ! class_exists( 'myCRED_Badge_Module' ) ) :
|
|
511 |
/**
|
512 |
* Enqueue Scripts
|
513 |
* @since 1.0
|
514 |
-
* @version 1.0
|
515 |
*/
|
516 |
public function enqueue_scripts() {
|
517 |
|
@@ -532,16 +532,16 @@ if ( ! class_exists( 'myCRED_Badge_Module' ) ) :
|
|
532 |
'myCREDBadge',
|
533 |
array(
|
534 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
535 |
-
'addlevel' => __( 'Add Level', 'mycred' ),
|
536 |
-
'removelevel' => __( 'Remove Level', 'mycred' ),
|
537 |
-
'setimage' => __( 'Set Image', 'mycred' ),
|
538 |
-
'changeimage' => __( 'Change Image', 'mycred' ),
|
539 |
'remove' => esc_js( esc_attr__( 'Are you sure you want to remove this level?', 'mycred' ) ),
|
540 |
'levellabel' => esc_js( sprintf( '%s {{level}}', __( 'Level', 'mycred' ) ) ),
|
541 |
'uploadtitle' => esc_js( esc_attr__( 'Badge Image', 'mycred' ) ),
|
542 |
'uploadbutton' => esc_js( esc_attr__( 'Use as Badge', 'mycred' ) ),
|
543 |
-
'compareAND' => _x( 'AND', 'Comparison of badge requirements. A AND B', 'mycred' ),
|
544 |
-
'compareOR' => _x( 'OR', 'Comparison of badge requirements. A OR B', 'mycred' )
|
545 |
)
|
546 |
);
|
547 |
|
@@ -790,7 +790,7 @@ jQuery(function($) {
|
|
790 |
/**
|
791 |
* Badge Setup Metabox
|
792 |
* @since 1.7
|
793 |
-
* @version 1.
|
794 |
*/
|
795 |
public function metabox_badge_setup( $post ) {
|
796 |
|
@@ -799,8 +799,8 @@ jQuery(function($) {
|
|
799 |
$point_types = mycred_get_types( true );
|
800 |
|
801 |
$sums = apply_filters( 'mycred_badge_requirement_sums', array(
|
802 |
-
'count' => __( 'Time(s)', 'mycred' ),
|
803 |
-
'sum' => __( 'In total', 'mycred' )
|
804 |
), $badge );
|
805 |
|
806 |
// Badge rewards can no be used as a requirement
|
@@ -821,10 +821,10 @@ jQuery(function($) {
|
|
821 |
$level_counter = 0;
|
822 |
foreach ( $badge->levels as $level => $setup ) {
|
823 |
|
824 |
-
$level
|
825 |
|
826 |
-
$add_level = '<button type="button" class="button button-seconary button-small top-right-corner" id="badges-add-new-level">' . __( 'Add Level', 'mycred' ) . '</button>';
|
827 |
-
$remove_level = '<button type="button" class="button button-seconary button-small top-right-corner remove-badge-level" data-level="' . $level . '">' . __( 'Remove Level', 'mycred' ) . '</button>';
|
828 |
|
829 |
$level_image = $this->get_level_image( $setup, $level );
|
830 |
$empty_level = 'empty dashicons';
|
@@ -840,18 +840,18 @@ jQuery(function($) {
|
|
840 |
$js_level = str_replace( '{{removelevelbutton}}', $remove_level, $js_level );
|
841 |
$js_level = str_replace( '{{emptylevelimage}}', $empty_level, $js_level );
|
842 |
$js_level = str_replace( '{{levelimage}}', '', $js_level );
|
843 |
-
$js_level = str_replace( '{{levelimagebutton}}', __( 'Set Image', 'mycred' ), $js_level );
|
844 |
-
$js_level = str_replace( '{{levelplaceholder}}', __( 'Level', 'mycred' ) . ' {{
|
845 |
|
846 |
$template = str_replace( '{{levelimage}}', $level_image, $template );
|
847 |
$template = str_replace( '{{emptylevelimage}}', $empty_level, $template );
|
848 |
-
$template = str_replace( '{{levelimagebutton}}', ( ( $level_image === false ) ? __( 'Set Image', 'mycred' ) : __( 'Change Image', 'mycred' ) ), $template );
|
849 |
|
850 |
-
$template = str_replace( '{{levelplaceholder}}', sprintf( __( 'Level %d', 'mycred' ), $level+1 ), $template );
|
851 |
-
$template = str_replace( '{{levellabel}}', $setup['label'], $template );
|
852 |
|
853 |
-
$template = str_replace( '{{requirementslabel}}', __( 'Requirement', 'mycred' ), $template );
|
854 |
-
$js_level = str_replace( '{{requirementslabel}}', __( 'Requirement', 'mycred' ), $js_level );
|
855 |
|
856 |
$template = str_replace( '{{adnselected}}', ( ( $setup['compare'] === 'AND' ) ? 'selected' : '' ), $template );
|
857 |
$template = str_replace( '{{orselected}}', ( ( $setup['compare'] === 'OR' ) ? 'selected' : '' ), $template );
|
@@ -863,105 +863,105 @@ jQuery(function($) {
|
|
863 |
|
864 |
foreach ( $setup['requires'] as $req_level => $reqsetup ) {
|
865 |
|
866 |
-
$requirement
|
867 |
|
868 |
-
$requirement
|
869 |
-
$requirement
|
870 |
|
871 |
-
$point_type_options
|
872 |
$point_type_options .= '<option value=""';
|
873 |
if ( $reqsetup['type'] == '' ) $point_type_options .= ' selected="selected"';
|
874 |
-
$point_type_options .= '>' . __( 'Select Point Type', 'mycred' ) . '</option>';
|
875 |
foreach ( $point_types as $type_id => $type_label ) {
|
876 |
-
$point_type_options .= '<option value="' . $type_id . '"';
|
877 |
if ( $reqsetup['type'] == $type_id ) $point_type_options .= ' selected="selected"';
|
878 |
-
$point_type_options .= '>' . $type_label . '</option>';
|
879 |
}
|
880 |
|
881 |
-
$requirement
|
882 |
-
$point_type_options
|
883 |
-
$js_requirement
|
884 |
|
885 |
-
$reference_options
|
886 |
-
$reference_options
|
887 |
if ( $reqsetup['reference'] == '' ) $reference_options .= ' selected="selected"';
|
888 |
-
$reference_options
|
889 |
foreach ( $references as $ref_id => $ref_label ) {
|
890 |
-
$reference_options .= '<option value="' . $ref_id . '"';
|
891 |
if ( $reqsetup['reference'] == $ref_id ) $reference_options .= ' selected="selected"';
|
892 |
-
$reference_options .= '>' . $ref_label . '</option>';
|
893 |
}
|
894 |
|
895 |
-
$requirement
|
896 |
-
$requirement
|
897 |
|
898 |
-
$reference_options
|
899 |
-
$js_requirement
|
900 |
-
$js_requirement
|
901 |
|
902 |
-
$by_options
|
903 |
-
$by_options
|
904 |
if ( $reqsetup['by'] == '' ) $by_options .= ' selected="selected"';
|
905 |
-
$by_options
|
906 |
foreach ( $sums as $sum_id => $sum_label ) {
|
907 |
$by_options .= '<option value="' . $sum_id . '"';
|
908 |
if ( $reqsetup['by'] == $sum_id ) $by_options .= ' selected="selected"';
|
909 |
$by_options .= '>' . $sum_label . '</option>';
|
910 |
}
|
911 |
|
912 |
-
$requirement
|
913 |
|
914 |
-
$by_options
|
915 |
-
$js_requirement
|
916 |
|
917 |
-
$selectedtype
|
918 |
if ( array_key_exists( $reqsetup['type'], $point_types ) )
|
919 |
$selectedtype = $point_types[ $reqsetup['type'] ];
|
920 |
|
921 |
$requirement = str_replace( '{{selectedtype}}', $selectedtype, $requirement );
|
922 |
|
923 |
-
$selectedreference
|
924 |
if ( array_key_exists( $reqsetup['reference'], $references ) )
|
925 |
$selectedreference = $references[ $reqsetup['reference'] ];
|
926 |
|
927 |
-
$requirement
|
928 |
|
929 |
-
$selectedby
|
930 |
if ( array_key_exists( $reqsetup['by'], $sums ) )
|
931 |
$selectedby = $sums[ $reqsetup['by'] ];
|
932 |
|
933 |
-
$requirement
|
934 |
|
935 |
-
$requirement_button
|
936 |
-
$js_requirement
|
937 |
|
938 |
-
$requirement_button
|
939 |
if ( $req_level == 0 )
|
940 |
$requirement_button = '<button type="button" class="button button-secondary form-control" id="badges-add-new-requirement">+</button>';
|
941 |
|
942 |
-
$requirement
|
943 |
|
944 |
-
$compare_label
|
945 |
if ( $level > 0 && $req_level < $total_requirements )
|
946 |
$compare_label = ( ( $setup['compare'] === 'AND' ) ? _x( 'AND', 'Comparison of badge requirements. A AND B', 'mycred' ) : _x( 'OR', 'Comparison of badge requirements. A OR B', 'mycred' ) );
|
947 |
|
948 |
if ( $req_level+1 == $total_requirements )
|
949 |
$compare_label = '';
|
950 |
|
951 |
-
$requirement
|
952 |
|
953 |
$level_requirements .= $requirement;
|
954 |
|
955 |
}
|
956 |
|
957 |
-
$template
|
958 |
|
959 |
-
$rewards
|
960 |
|
961 |
-
$js_level
|
962 |
|
963 |
-
$rewards
|
964 |
-
$rewards
|
965 |
|
966 |
$point_type_options = '';
|
967 |
foreach ( $point_types as $type_id => $type_label ) {
|
@@ -970,13 +970,13 @@ jQuery(function($) {
|
|
970 |
$point_type_options .= '>' . $type_label . '</option>';
|
971 |
}
|
972 |
|
973 |
-
$rewards
|
974 |
-
$rewards
|
975 |
-
$rewards
|
976 |
-
$rewards
|
977 |
|
978 |
-
$template
|
979 |
-
$js_level
|
980 |
|
981 |
echo $template;
|
982 |
|
511 |
/**
|
512 |
* Enqueue Scripts
|
513 |
* @since 1.0
|
514 |
+
* @version 1.0.1
|
515 |
*/
|
516 |
public function enqueue_scripts() {
|
517 |
|
532 |
'myCREDBadge',
|
533 |
array(
|
534 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
535 |
+
'addlevel' => esc_js( __( 'Add Level', 'mycred' ) ),
|
536 |
+
'removelevel' => esc_js( __( 'Remove Level', 'mycred' ) ),
|
537 |
+
'setimage' => esc_js( __( 'Set Image', 'mycred' ) ),
|
538 |
+
'changeimage' => esc_js( __( 'Change Image', 'mycred' ) ),
|
539 |
'remove' => esc_js( esc_attr__( 'Are you sure you want to remove this level?', 'mycred' ) ),
|
540 |
'levellabel' => esc_js( sprintf( '%s {{level}}', __( 'Level', 'mycred' ) ) ),
|
541 |
'uploadtitle' => esc_js( esc_attr__( 'Badge Image', 'mycred' ) ),
|
542 |
'uploadbutton' => esc_js( esc_attr__( 'Use as Badge', 'mycred' ) ),
|
543 |
+
'compareAND' => esc_js( _x( 'AND', 'Comparison of badge requirements. A AND B', 'mycred' ) ),
|
544 |
+
'compareOR' => esc_js( _x( 'OR', 'Comparison of badge requirements. A OR B', 'mycred' ) )
|
545 |
)
|
546 |
);
|
547 |
|
790 |
/**
|
791 |
* Badge Setup Metabox
|
792 |
* @since 1.7
|
793 |
+
* @version 1.2
|
794 |
*/
|
795 |
public function metabox_badge_setup( $post ) {
|
796 |
|
799 |
$point_types = mycred_get_types( true );
|
800 |
|
801 |
$sums = apply_filters( 'mycred_badge_requirement_sums', array(
|
802 |
+
'count' => esc_js( __( 'Time(s)', 'mycred' ) ),
|
803 |
+
'sum' => esc_js( __( 'In total', 'mycred' ) )
|
804 |
), $badge );
|
805 |
|
806 |
// Badge rewards can no be used as a requirement
|
821 |
$level_counter = 0;
|
822 |
foreach ( $badge->levels as $level => $setup ) {
|
823 |
|
824 |
+
$level = $level_counter;
|
825 |
|
826 |
+
$add_level = '<button type="button" class="button button-seconary button-small top-right-corner" id="badges-add-new-level">' . esc_js( __( 'Add Level', 'mycred' ) ) . '</button>';
|
827 |
+
$remove_level = '<button type="button" class="button button-seconary button-small top-right-corner remove-badge-level" data-level="' . $level . '">' . esc_js( __( 'Remove Level', 'mycred' ) ) . '</button>';
|
828 |
|
829 |
$level_image = $this->get_level_image( $setup, $level );
|
830 |
$empty_level = 'empty dashicons';
|
840 |
$js_level = str_replace( '{{removelevelbutton}}', $remove_level, $js_level );
|
841 |
$js_level = str_replace( '{{emptylevelimage}}', $empty_level, $js_level );
|
842 |
$js_level = str_replace( '{{levelimage}}', '', $js_level );
|
843 |
+
$js_level = str_replace( '{{levelimagebutton}}', esc_js( __( 'Set Image', 'mycred' ) ), $js_level );
|
844 |
+
$js_level = str_replace( '{{levelplaceholder}}', esc_js( __( 'Level', 'mycred' ) ) . ' {{levelone}}', $js_level );
|
845 |
|
846 |
$template = str_replace( '{{levelimage}}', $level_image, $template );
|
847 |
$template = str_replace( '{{emptylevelimage}}', $empty_level, $template );
|
848 |
+
$template = str_replace( '{{levelimagebutton}}', ( ( $level_image === false ) ? esc_js( __( 'Set Image', 'mycred' ) ) : esc_js( __( 'Change Image', 'mycred' ) ) ), $template );
|
849 |
|
850 |
+
$template = str_replace( '{{levelplaceholder}}', esc_js( sprintf( __( 'Level %d', 'mycred' ), $level+1 ) ), $template );
|
851 |
+
$template = str_replace( '{{levellabel}}', esc_js( $setup['label'] ), $template );
|
852 |
|
853 |
+
$template = str_replace( '{{requirementslabel}}', esc_js( __( 'Requirement', 'mycred' ) ), $template );
|
854 |
+
$js_level = str_replace( '{{requirementslabel}}', esc_js( __( 'Requirement', 'mycred' ) ), $js_level );
|
855 |
|
856 |
$template = str_replace( '{{adnselected}}', ( ( $setup['compare'] === 'AND' ) ? 'selected' : '' ), $template );
|
857 |
$template = str_replace( '{{orselected}}', ( ( $setup['compare'] === 'OR' ) ? 'selected' : '' ), $template );
|
863 |
|
864 |
foreach ( $setup['requires'] as $req_level => $reqsetup ) {
|
865 |
|
866 |
+
$requirement = $this->requirements_template( $level );
|
867 |
|
868 |
+
$requirement = str_replace( '{{level}}', $level, $requirement );
|
869 |
+
$requirement = str_replace( '{{reqlevel}}', $req_level, $requirement );
|
870 |
|
871 |
+
$point_type_options = '';
|
872 |
$point_type_options .= '<option value=""';
|
873 |
if ( $reqsetup['type'] == '' ) $point_type_options .= ' selected="selected"';
|
874 |
+
$point_type_options .= '>' . esc_js( __( 'Select Point Type', 'mycred' ) ) . '</option>';
|
875 |
foreach ( $point_types as $type_id => $type_label ) {
|
876 |
+
$point_type_options .= '<option value="' . esc_attr( $type_id ) . '"';
|
877 |
if ( $reqsetup['type'] == $type_id ) $point_type_options .= ' selected="selected"';
|
878 |
+
$point_type_options .= '>' . esc_html( $type_label ) . '</option>';
|
879 |
}
|
880 |
|
881 |
+
$requirement = str_replace( '{{pointtypes}}', $point_type_options, $requirement );
|
882 |
+
$point_type_options = str_replace( 'selected="selected"', '', $point_type_options );
|
883 |
+
$js_requirement = str_replace( '{{pointtypes}}', $point_type_options, $js_requirement );
|
884 |
|
885 |
+
$reference_options = '';
|
886 |
+
$reference_options .= '<option value=""';
|
887 |
if ( $reqsetup['reference'] == '' ) $reference_options .= ' selected="selected"';
|
888 |
+
$reference_options .= '>' . esc_js( __( 'Select Reference', 'mycred' ) ) . '</option>';
|
889 |
foreach ( $references as $ref_id => $ref_label ) {
|
890 |
+
$reference_options .= '<option value="' . esc_attr( $ref_id ) . '"';
|
891 |
if ( $reqsetup['reference'] == $ref_id ) $reference_options .= ' selected="selected"';
|
892 |
+
$reference_options .= '>' . esc_html( $ref_label ) . '</option>';
|
893 |
}
|
894 |
|
895 |
+
$requirement = str_replace( '{{references}}', $reference_options, $requirement );
|
896 |
+
$requirement = str_replace( '{{reqamount}}', $reqsetup['amount'], $requirement );
|
897 |
|
898 |
+
$reference_options = str_replace( 'selected="selected"', '', $reference_options );
|
899 |
+
$js_requirement = str_replace( '{{references}}', $reference_options, $js_requirement );
|
900 |
+
$js_requirement = str_replace( '{{reqamount}}', $reqsetup['amount'], $js_requirement );
|
901 |
|
902 |
+
$by_options = '';
|
903 |
+
$by_options .= '<option value=""';
|
904 |
if ( $reqsetup['by'] == '' ) $by_options .= ' selected="selected"';
|
905 |
+
$by_options .= '>' . __( 'Select', 'mycred' ) . '</option>';
|
906 |
foreach ( $sums as $sum_id => $sum_label ) {
|
907 |
$by_options .= '<option value="' . $sum_id . '"';
|
908 |
if ( $reqsetup['by'] == $sum_id ) $by_options .= ' selected="selected"';
|
909 |
$by_options .= '>' . $sum_label . '</option>';
|
910 |
}
|
911 |
|
912 |
+
$requirement = str_replace( '{{requirementtype}}', $by_options, $requirement );
|
913 |
|
914 |
+
$by_options = str_replace( 'selected="selected"', '', $by_options );
|
915 |
+
$js_requirement = str_replace( '{{requirementtype}}', $by_options, $js_requirement );
|
916 |
|
917 |
+
$selectedtype = '-';
|
918 |
if ( array_key_exists( $reqsetup['type'], $point_types ) )
|
919 |
$selectedtype = $point_types[ $reqsetup['type'] ];
|
920 |
|
921 |
$requirement = str_replace( '{{selectedtype}}', $selectedtype, $requirement );
|
922 |
|
923 |
+
$selectedreference = '-';
|
924 |
if ( array_key_exists( $reqsetup['reference'], $references ) )
|
925 |
$selectedreference = $references[ $reqsetup['reference'] ];
|
926 |
|
927 |
+
$requirement = str_replace( '{{selectedref}}', $selectedreference, $requirement );
|
928 |
|
929 |
+
$selectedby = '-';
|
930 |
if ( array_key_exists( $reqsetup['by'], $sums ) )
|
931 |
$selectedby = $sums[ $reqsetup['by'] ];
|
932 |
|
933 |
+
$requirement = str_replace( '{{selectedby}}', $selectedby, $requirement );
|
934 |
|
935 |
+
$requirement_button = '<button type="button" class="button button-primary form-control remove-requirement" data-req="{{reqlevel}}">-</button>';
|
936 |
+
$js_requirement = str_replace( '{{reqbutton}}', $requirement_button, $js_requirement );
|
937 |
|
938 |
+
$requirement_button = '<button type="button" class="button button-primary form-control remove-requirement" data-req="' . $req_level . '">-</button>';
|
939 |
if ( $req_level == 0 )
|
940 |
$requirement_button = '<button type="button" class="button button-secondary form-control" id="badges-add-new-requirement">+</button>';
|
941 |
|
942 |
+
$requirement = str_replace( '{{reqbutton}}', $requirement_button, $requirement );
|
943 |
|
944 |
+
$compare_label = '';
|
945 |
if ( $level > 0 && $req_level < $total_requirements )
|
946 |
$compare_label = ( ( $setup['compare'] === 'AND' ) ? _x( 'AND', 'Comparison of badge requirements. A AND B', 'mycred' ) : _x( 'OR', 'Comparison of badge requirements. A OR B', 'mycred' ) );
|
947 |
|
948 |
if ( $req_level+1 == $total_requirements )
|
949 |
$compare_label = '';
|
950 |
|
951 |
+
$requirement = str_replace( '{{comparelabel}}', esc_js( $compare_label ), $requirement );
|
952 |
|
953 |
$level_requirements .= $requirement;
|
954 |
|
955 |
}
|
956 |
|
957 |
+
$template = str_replace( '{{{requirements}}}', $level_requirements, $template );
|
958 |
|
959 |
+
$rewards = $this->rewards_template();
|
960 |
|
961 |
+
$js_level = str_replace( '{{reqamount}}', '', $js_level );
|
962 |
|
963 |
+
$rewards = str_replace( '{{level}}', $level, $rewards );
|
964 |
+
$rewards = str_replace( '{{rewardlabel}}', esc_js( __( 'Reward', 'mycred' ) ), $rewards );
|
965 |
|
966 |
$point_type_options = '';
|
967 |
foreach ( $point_types as $type_id => $type_label ) {
|
970 |
$point_type_options .= '>' . $type_label . '</option>';
|
971 |
}
|
972 |
|
973 |
+
$rewards = str_replace( '{{pointtypes}}', $point_type_options, $rewards );
|
974 |
+
$rewards = str_replace( '{{logplaceholder}}', esc_js( __( 'Log template', 'mycred' ) ), $rewards );
|
975 |
+
$rewards = str_replace( '{{logtemplate}}', esc_js( $setup['reward']['log'] ), $rewards );
|
976 |
+
$rewards = str_replace( '{{rewardamount}}', $setup['reward']['amount'], $rewards );
|
977 |
|
978 |
+
$template = str_replace( '{{rewards}}', $rewards, $template );
|
979 |
+
$js_level = str_replace( '{{rewards}}', $rewards, $js_level );
|
980 |
|
981 |
echo $template;
|
982 |
|
addons/gateway/carts/mycred-woocommerce.php
CHANGED
@@ -283,7 +283,7 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
|
|
283 |
/**
|
284 |
* Process Payment
|
285 |
* @since 0.1
|
286 |
-
* @version 1.4.
|
287 |
*/
|
288 |
function process_payment( $order_id ) {
|
289 |
|
@@ -295,7 +295,7 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
|
|
295 |
return;
|
296 |
}
|
297 |
|
298 |
-
$user_id
|
299 |
|
300 |
// Make sure we have not been excluded
|
301 |
if ( $this->mycred->exclude_user( $user_id ) ) {
|
@@ -304,15 +304,16 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
|
|
304 |
}
|
305 |
|
306 |
// Grab Order
|
307 |
-
$order
|
|
|
|
|
308 |
|
309 |
// Cost
|
|
|
310 |
if ( $this->use_exchange() )
|
311 |
-
$cost = $this->mycred->number( ( $
|
312 |
-
else
|
313 |
-
$cost = $order->order_total;
|
314 |
|
315 |
-
$cost
|
316 |
|
317 |
// Check funds
|
318 |
if ( $this->mycred->get_users_balance( $user_id, $this->mycred_type ) < $cost ) {
|
@@ -322,7 +323,7 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
|
|
322 |
}
|
323 |
|
324 |
// Let others decline a store order
|
325 |
-
$decline
|
326 |
if ( $decline !== false ) {
|
327 |
wc_add_notice( $decline, 'error' );
|
328 |
return;
|
@@ -391,28 +392,29 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
|
|
391 |
/**
|
392 |
* Process Refunds
|
393 |
* @since 1.5.4
|
394 |
-
* @version 1.0.
|
395 |
*/
|
396 |
public function process_refund( $order_id, $amount = null, $reason = '' ) {
|
397 |
|
398 |
-
$order
|
399 |
|
400 |
if ( ! isset( $order->order_total ) ) {
|
401 |
return false;
|
402 |
}
|
403 |
|
|
|
|
|
404 |
if ( $amount === NULL )
|
405 |
-
$amount = $
|
406 |
|
|
|
407 |
if ( $this->use_exchange() )
|
408 |
-
$refund = $
|
409 |
-
else
|
410 |
-
$refund = $amount;
|
411 |
|
412 |
$this->mycred->add_creds(
|
413 |
'woocommerce_refund',
|
414 |
$order->user_id,
|
415 |
-
$refund,
|
416 |
$this->log_template_refund,
|
417 |
$order_id,
|
418 |
array( 'ref_type' => 'post', 'reason' => $reason ),
|
@@ -437,14 +439,16 @@ if ( ! function_exists( 'mycred_init_woo_gateway' ) ) :
|
|
437 |
if ( $product === NULL ) continue;
|
438 |
|
439 |
// Calculate Share
|
440 |
-
|
441 |
-
|
|
|
|
|
442 |
|
443 |
// Payout
|
444 |
$this->mycred->add_creds(
|
445 |
'store_sale_refund',
|
446 |
$product->post_author,
|
447 |
-
0
|
448 |
$this->profit_sharing_refund_log,
|
449 |
$product->ID,
|
450 |
array( 'ref_type' => 'post', 'order_id' => $order_id ),
|
283 |
/**
|
284 |
* Process Payment
|
285 |
* @since 0.1
|
286 |
+
* @version 1.4.3
|
287 |
*/
|
288 |
function process_payment( $order_id ) {
|
289 |
|
295 |
return;
|
296 |
}
|
297 |
|
298 |
+
$user_id = get_current_user_id();
|
299 |
|
300 |
// Make sure we have not been excluded
|
301 |
if ( $this->mycred->exclude_user( $user_id ) ) {
|
304 |
}
|
305 |
|
306 |
// Grab Order
|
307 |
+
$order = wc_get_order( $order_id );
|
308 |
+
|
309 |
+
$order_total = ( version_compare( $woocommerce->version, '3.0', '>=' ) ) ? $order->get_total() : $order->order_total;
|
310 |
|
311 |
// Cost
|
312 |
+
$cost = $order_total;
|
313 |
if ( $this->use_exchange() )
|
314 |
+
$cost = $this->mycred->number( ( $order_total / $this->exchange_rate ) );
|
|
|
|
|
315 |
|
316 |
+
$cost = apply_filters( 'mycred_woo_order_cost', $cost, $order, false, $this );
|
317 |
|
318 |
// Check funds
|
319 |
if ( $this->mycred->get_users_balance( $user_id, $this->mycred_type ) < $cost ) {
|
323 |
}
|
324 |
|
325 |
// Let others decline a store order
|
326 |
+
$decline = apply_filters( 'mycred_decline_store_purchase', false, $order, $this );
|
327 |
if ( $decline !== false ) {
|
328 |
wc_add_notice( $decline, 'error' );
|
329 |
return;
|
392 |
/**
|
393 |
* Process Refunds
|
394 |
* @since 1.5.4
|
395 |
+
* @version 1.0.2
|
396 |
*/
|
397 |
public function process_refund( $order_id, $amount = null, $reason = '' ) {
|
398 |
|
399 |
+
$order = wc_get_order( $order_id );
|
400 |
|
401 |
if ( ! isset( $order->order_total ) ) {
|
402 |
return false;
|
403 |
}
|
404 |
|
405 |
+
$order_total = ( version_compare( $woocommerce->version, '3.0', '>=' ) ) ? $order->get_total() : $order->order_total;
|
406 |
+
|
407 |
if ( $amount === NULL )
|
408 |
+
$amount = $order_total;
|
409 |
|
410 |
+
$refund = $amount;
|
411 |
if ( $this->use_exchange() )
|
412 |
+
$refund = $this->mycred->number( ( $refund / $this->exchange_rate ) );
|
|
|
|
|
413 |
|
414 |
$this->mycred->add_creds(
|
415 |
'woocommerce_refund',
|
416 |
$order->user_id,
|
417 |
+
0 - $refund,
|
418 |
$this->log_template_refund,
|
419 |
$order_id,
|
420 |
array( 'ref_type' => 'post', 'reason' => $reason ),
|
439 |
if ( $product === NULL ) continue;
|
440 |
|
441 |
// Calculate Share
|
442 |
+
$percentage = apply_filters( 'mycred_woo_profit_share_refund', $this->profit_sharing_percent, $order, $product, $this );
|
443 |
+
if ( $percentage == 0 ) continue;
|
444 |
+
|
445 |
+
$share = ( $percentage / 100 ) * $item['line_total'];
|
446 |
|
447 |
// Payout
|
448 |
$this->mycred->add_creds(
|
449 |
'store_sale_refund',
|
450 |
$product->post_author,
|
451 |
+
0 - $share,
|
452 |
$this->profit_sharing_refund_log,
|
453 |
$product->ID,
|
454 |
array( 'ref_type' => 'post', 'order_id' => $order_id ),
|
addons/sell-content/includes/mycred-sell-functions.php
CHANGED
@@ -411,7 +411,7 @@ endif;
|
|
411 |
* Get Payment Buttons
|
412 |
* Returns all payment buttons a user can use to pay for a given post.
|
413 |
* @since 1.7
|
414 |
-
* @version 1.
|
415 |
*/
|
416 |
if ( ! function_exists( 'mycred_sell_content_payment_buttons' ) ) :
|
417 |
function mycred_sell_content_payment_buttons( $user_id = NULL, $post_id = NULL ) {
|
@@ -429,12 +429,23 @@ if ( ! function_exists( 'mycred_sell_content_payment_buttons' ) ) :
|
|
429 |
foreach ( $settings['type'] as $point_type ) {
|
430 |
|
431 |
// Load point type
|
432 |
-
$mycred
|
433 |
-
$setup
|
434 |
-
$price
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
|
436 |
// Point type not enabled
|
437 |
-
if ( $
|
438 |
|
439 |
// Make sure we are not excluded from this type
|
440 |
if ( $mycred->exclude_user( $user_id ) ) continue;
|
411 |
* Get Payment Buttons
|
412 |
* Returns all payment buttons a user can use to pay for a given post.
|
413 |
* @since 1.7
|
414 |
+
* @version 1.1
|
415 |
*/
|
416 |
if ( ! function_exists( 'mycred_sell_content_payment_buttons' ) ) :
|
417 |
function mycred_sell_content_payment_buttons( $user_id = NULL, $post_id = NULL ) {
|
429 |
foreach ( $settings['type'] as $point_type ) {
|
430 |
|
431 |
// Load point type
|
432 |
+
$mycred = mycred( $point_type );
|
433 |
+
$setup = mycred_get_option( 'mycred_sell_this_' . $point_type );
|
434 |
+
$price = mycred_get_content_price( $post_id, $point_type, $user_id );
|
435 |
+
$status = $setup['status'];
|
436 |
+
|
437 |
+
// Manual mode
|
438 |
+
if ( $settings['filters'][ $post->post_type ]['by'] == 'manual' ) {
|
439 |
+
|
440 |
+
$suffix = ( $point_type != MYCRED_DEFAULT_TYPE_KEY ) ? '_' . $point_type : '';
|
441 |
+
$manual_setup = (array) get_post_meta( $post_id, 'myCRED_sell_content' . $suffix, true );
|
442 |
+
if ( ! empty( $manual_setup ) && array_key_exists( 'status', $manual_setup ) )
|
443 |
+
$status = $manual_setup['status'];
|
444 |
+
|
445 |
+
}
|
446 |
|
447 |
// Point type not enabled
|
448 |
+
if ( $status == 'disabled' ) continue;
|
449 |
|
450 |
// Make sure we are not excluded from this type
|
451 |
if ( $mycred->exclude_user( $user_id ) ) continue;
|
includes/classes/class.query-leaderboard.php
CHANGED
@@ -207,7 +207,7 @@ if ( ! class_exists( 'myCRED_Query_Leaderboard' ) ) :
|
|
207 |
// User is not in the leaderboard so we need to append him/her to the end of the leaderboard array.
|
208 |
$new_row = array( 'ID' => $this->user_id );
|
209 |
$new_row['position'] = $this->get_users_current_position();
|
210 |
-
$new_row['
|
211 |
|
212 |
if ( $return )
|
213 |
return $new_row;
|
207 |
// User is not in the leaderboard so we need to append him/her to the end of the leaderboard array.
|
208 |
$new_row = array( 'ID' => $this->user_id );
|
209 |
$new_row['position'] = $this->get_users_current_position();
|
210 |
+
$new_row['cred'] = $this->get_users_current_value();
|
211 |
|
212 |
if ( $return )
|
213 |
return $new_row;
|
includes/mycred-functions.php
CHANGED
@@ -2874,34 +2874,31 @@ endif;
|
|
2874 |
* Used to prevent multiple simultaneous AJAX calls from any one user.
|
2875 |
* The $timelimit sets the minimum amount of seconds that must have passed between
|
2876 |
* two AJAX requests.
|
2877 |
-
* Not sure if this is the best solution, might change it later as it creates an overhead
|
2878 |
-
* on database queries if spammed.
|
2879 |
* @since 1.7
|
2880 |
-
* @version 1.
|
2881 |
*/
|
2882 |
if ( ! function_exists( 'mycred_force_singular_session' ) ) :
|
2883 |
function mycred_force_singular_session( $user_id = NULL, $key = NULL, $timelimit = MYCRED_MIN_TIME_LIMIT ) {
|
2884 |
|
2885 |
-
$force
|
2886 |
-
$time
|
2887 |
-
$user_id
|
2888 |
-
$key
|
2889 |
-
$timelimit
|
2890 |
-
|
2891 |
-
if ( $user_id === 0 || $key == '' ) return true;
|
2892 |
|
2893 |
-
|
2894 |
-
|
2895 |
-
$session = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = %s;", $user_id, $key ) );
|
2896 |
|
2897 |
-
//
|
2898 |
-
|
2899 |
-
|
|
|
|
|
2900 |
|
2901 |
-
|
2902 |
-
if ( isset( $session->meta_value ) && ( $time - $session->meta_value ) < $timelimit )
|
2903 |
$force = true;
|
2904 |
|
|
|
|
|
2905 |
return apply_filters( 'mycred_force_singular_session', $force, $user_id, $key, $timelimit );
|
2906 |
|
2907 |
}
|
2874 |
* Used to prevent multiple simultaneous AJAX calls from any one user.
|
2875 |
* The $timelimit sets the minimum amount of seconds that must have passed between
|
2876 |
* two AJAX requests.
|
|
|
|
|
2877 |
* @since 1.7
|
2878 |
+
* @version 1.1
|
2879 |
*/
|
2880 |
if ( ! function_exists( 'mycred_force_singular_session' ) ) :
|
2881 |
function mycred_force_singular_session( $user_id = NULL, $key = NULL, $timelimit = MYCRED_MIN_TIME_LIMIT ) {
|
2882 |
|
2883 |
+
$force = false;
|
2884 |
+
$time = time();
|
2885 |
+
$user_id = absint( $user_id );
|
2886 |
+
$key = sanitize_text_field( $key );
|
2887 |
+
$timelimit = absint( $timelimit );
|
|
|
|
|
2888 |
|
2889 |
+
if ( $key == '' ) return true;
|
|
|
|
|
2890 |
|
2891 |
+
// 1 - Cookies
|
2892 |
+
$last_call = $time - $timelimit;
|
2893 |
+
$cookie_key = md5( $user_id . $key );
|
2894 |
+
if ( isset( $_COOKIE[ $cookie_key ] ) )
|
2895 |
+
$last_call = absint( $_COOKIE[ $cookie_key ] );
|
2896 |
|
2897 |
+
if ( ( $time - $last_call ) < $timelimit )
|
|
|
2898 |
$force = true;
|
2899 |
|
2900 |
+
setcookie( $cookie_key, $time, ( time() + DAY_IN_SECONDS ), COOKIEPATH, COOKIE_DOMAIN );
|
2901 |
+
|
2902 |
return apply_filters( 'mycred_force_singular_session', $force, $user_id, $key, $timelimit );
|
2903 |
|
2904 |
}
|
includes/mycred-setup.php
CHANGED
@@ -88,7 +88,7 @@ if ( ! class_exists( 'myCRED_Setup' ) ) :
|
|
88 |
* Setup Screen
|
89 |
* Outputs the setup page.
|
90 |
* @since 0.1
|
91 |
-
* @version 1.2
|
92 |
*/
|
93 |
public function setup_page() {
|
94 |
|
@@ -112,7 +112,7 @@ pre { margin: 0 0 12px 0; padding: 10px; background-color: #dedede; }
|
|
112 |
</div>
|
113 |
</div>
|
114 |
|
115 |
-
<div id="form-content">
|
116 |
|
117 |
<?php $this->new_point_type(); ?>
|
118 |
|
@@ -242,7 +242,7 @@ jQuery(function($) {
|
|
242 |
setupform.remove();
|
243 |
}
|
244 |
else {
|
245 |
-
$( '#form-content' ).empty().append( response.data );
|
246 |
setupform.slideDown();
|
247 |
}
|
248 |
|
88 |
* Setup Screen
|
89 |
* Outputs the setup page.
|
90 |
* @since 0.1
|
91 |
+
* @version 1.2.1
|
92 |
*/
|
93 |
public function setup_page() {
|
94 |
|
112 |
</div>
|
113 |
</div>
|
114 |
|
115 |
+
<div id="mycred-form-content">
|
116 |
|
117 |
<?php $this->new_point_type(); ?>
|
118 |
|
242 |
setupform.remove();
|
243 |
}
|
244 |
else {
|
245 |
+
$( '#mycred-form-content' ).empty().append( response.data );
|
246 |
setupform.slideDown();
|
247 |
}
|
248 |
|
modules/mycred-module-hooks.php
CHANGED
@@ -2729,7 +2729,7 @@ if ( ! class_exists( 'myCRED_Hook_Video_Views' ) ) :
|
|
2729 |
/**
|
2730 |
* Run
|
2731 |
* @since 1.2
|
2732 |
-
* @version 1.0.
|
2733 |
*/
|
2734 |
public function run() {
|
2735 |
|
@@ -2737,10 +2737,9 @@ if ( ! class_exists( 'myCRED_Hook_Video_Views' ) ) :
|
|
2737 |
|
2738 |
$mycred_video_points = array();
|
2739 |
|
2740 |
-
add_action( 'mycred_front_enqueue',
|
2741 |
-
add_action( 'template_redirect',
|
2742 |
-
add_action( '
|
2743 |
-
add_action( 'wp_footer', array( $this, 'footer' ) );
|
2744 |
|
2745 |
}
|
2746 |
|
2729 |
/**
|
2730 |
* Run
|
2731 |
* @since 1.2
|
2732 |
+
* @version 1.0.2
|
2733 |
*/
|
2734 |
public function run() {
|
2735 |
|
2737 |
|
2738 |
$mycred_video_points = array();
|
2739 |
|
2740 |
+
add_action( 'mycred_front_enqueue', array( $this, 'register_script' ), 90 );
|
2741 |
+
add_action( 'template_redirect', array( $this, 'maybe_reward_points' ), 5 );
|
2742 |
+
add_action( 'wp_footer', array( $this, 'footer' ) );
|
|
|
2743 |
|
2744 |
}
|
2745 |
|
modules/mycred-module-settings.php
CHANGED
@@ -106,7 +106,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
|
|
106 |
/**
|
107 |
* Reset All Balances Action
|
108 |
* @since 1.3
|
109 |
-
* @version 1.4
|
110 |
*/
|
111 |
public function action_reset_balance() {
|
112 |
|
@@ -121,7 +121,7 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
|
|
121 |
check_ajax_referer( 'mycred-management-actions', 'token' );
|
122 |
|
123 |
// Access
|
124 |
-
if ( ! is_user_logged_in() || ! $this->core->
|
125 |
wp_send_json_error( 'Access denied' );
|
126 |
|
127 |
global $wpdb;
|
@@ -132,6 +132,12 @@ if ( ! class_exists( 'myCRED_Settings_Module' ) ) :
|
|
132 |
array( '%s' )
|
133 |
);
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
do_action( 'mycred_zero_balances', $type );
|
136 |
|
137 |
// Response
|
106 |
/**
|
107 |
* Reset All Balances Action
|
108 |
* @since 1.3
|
109 |
+
* @version 1.4.1
|
110 |
*/
|
111 |
public function action_reset_balance() {
|
112 |
|
121 |
check_ajax_referer( 'mycred-management-actions', 'token' );
|
122 |
|
123 |
// Access
|
124 |
+
if ( ! is_user_logged_in() || ! $this->core->user_is_point_admin() )
|
125 |
wp_send_json_error( 'Access denied' );
|
126 |
|
127 |
global $wpdb;
|
132 |
array( '%s' )
|
133 |
);
|
134 |
|
135 |
+
$wpdb->delete(
|
136 |
+
$wpdb->usermeta,
|
137 |
+
array( 'meta_key' => mycred_get_meta_key( $type, '_total' ) ),
|
138 |
+
array( '%s' )
|
139 |
+
);
|
140 |
+
|
141 |
do_action( 'mycred_zero_balances', $type );
|
142 |
|
143 |
// Response
|
mycred.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
* Plugin Name: myCRED
|
4 |
* Plugin URI: https://mycred.me
|
5 |
* Description: An adaptive points management system for WordPress powered websites.
|
6 |
-
* Version: 1.7.9.
|
7 |
* Tags: points, credit, balance, finance, rewards, engagement, woocommerce, bbpress, buddypress
|
8 |
* Author: Gabriel S Merovingi
|
9 |
* Author URI: http://www.merovingi.com
|
10 |
* Author Email: support@mycred.me
|
11 |
* Requires at least: WP 4.0
|
12 |
-
* Tested up to: WP 4.8.
|
13 |
* Text Domain: mycred
|
14 |
* Domain Path: /lang
|
15 |
* License: GPLv2 or later
|
@@ -19,7 +19,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
19 |
final class myCRED_Core {
|
20 |
|
21 |
// Plugin Version
|
22 |
-
public $version = '1.7.9.
|
23 |
|
24 |
// Instnace
|
25 |
protected static $_instance = NULL;
|
3 |
* Plugin Name: myCRED
|
4 |
* Plugin URI: https://mycred.me
|
5 |
* Description: An adaptive points management system for WordPress powered websites.
|
6 |
+
* Version: 1.7.9.2
|
7 |
* Tags: points, credit, balance, finance, rewards, engagement, woocommerce, bbpress, buddypress
|
8 |
* Author: Gabriel S Merovingi
|
9 |
* Author URI: http://www.merovingi.com
|
10 |
* Author Email: support@mycred.me
|
11 |
* Requires at least: WP 4.0
|
12 |
+
* Tested up to: WP 4.8.2
|
13 |
* Text Domain: mycred
|
14 |
* Domain Path: /lang
|
15 |
* License: GPLv2 or later
|
19 |
final class myCRED_Core {
|
20 |
|
21 |
// Plugin Version
|
22 |
+
public $version = '1.7.9.2';
|
23 |
|
24 |
// Instnace
|
25 |
protected static $_instance = NULL;
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: designbymerovingi
|
3 |
Tags: point, points, tokens, credit, management, reward, charge, community, contest, buddypress, jetpack, bbpress, simple press, woocommerce, wp e-commerce, contact-form-7
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 4.8.
|
6 |
-
Stable tag: 1.7.9.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -96,8 +96,8 @@ You can find a list of [frequently asked questions](https://mycred.me/about/faq/
|
|
96 |
|
97 |
== Upgrade Notice ==
|
98 |
|
99 |
-
= 1.7.9.
|
100 |
-
|
101 |
|
102 |
|
103 |
== Other Notes ==
|
@@ -121,27 +121,16 @@ Last set of bug fixes for the 1.7.x version.
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
-
= 1.7.9.
|
125 |
-
FIX -
|
126 |
-
FIX -
|
127 |
-
FIX -
|
128 |
-
FIX -
|
129 |
-
FIX -
|
130 |
-
FIX -
|
131 |
-
FIX -
|
132 |
-
|
133 |
-
|
134 |
-
NEW - Added timeframe support when basing leaderboards on total balances.
|
135 |
-
NEW - Added new myCRED_Query_Leaderboard class for leaderboard queries.
|
136 |
-
NEW - Added option to cache leaderboard results.
|
137 |
-
NEW - Added new mycred_admin_show_balance filter to hide balances being inserted in the WP Toolbar.
|
138 |
-
NEW - Added new mycred_transfer_to_field filter for transfer forms recipient field.
|
139 |
-
TWEAK - Improved how the lowest point amount value is calculated by get_lowest_value().
|
140 |
-
TWEAK - Referral redirects are now done using status code 301.
|
141 |
-
TWEAK - A users earned badges are now cached to cut down on database queries.
|
142 |
-
TWEAK - Updated how order details are retrieved in WooCommerce 3.0
|
143 |
-
REMOVED - Events Manager Pro support. Support for EM Pro has been moved to a separate free plugin.
|
144 |
-
|
145 |
|
146 |
= Previous Versions =
|
147 |
https://mycred.me/support/changelog/
|
2 |
Contributors: designbymerovingi
|
3 |
Tags: point, points, tokens, credit, management, reward, charge, community, contest, buddypress, jetpack, bbpress, simple press, woocommerce, wp e-commerce, contact-form-7
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 4.8.2
|
6 |
+
Stable tag: 1.7.9.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
96 |
|
97 |
== Upgrade Notice ==
|
98 |
|
99 |
+
= 1.7.9.2 =
|
100 |
+
Bug fixes.
|
101 |
|
102 |
|
103 |
== Other Notes ==
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
+
= 1.7.9.2 =
|
125 |
+
FIX - When deleting balances, the total balance should also be deleted.
|
126 |
+
FIX - Appended users in leaderboard always shows a zero value.
|
127 |
+
FIX - JavaScript error when using non english locals in the badge editor.
|
128 |
+
FIX - Content set for sale using "Manual Mode" will not render the enabled type buttons correctly (when using multiple types).
|
129 |
+
FIX - The placeholder names for new badges show an incorrect count where 1 is repeated twice.
|
130 |
+
FIX - Added comp. with latest version of WooCommerce 3.1.2
|
131 |
+
FIX - Built-in View Video hook was calling for a non existing function.
|
132 |
+
TWEAK - Adjusted the setup form containers id as it seems to collide with styling of third-party plugins in the wp-admin area.
|
133 |
+
TWEAK - Added mycred_module_is_active filter to allow overrides of module loads e.g. add-ons, banking or hooks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
= Previous Versions =
|
136 |
https://mycred.me/support/changelog/
|