Version Description
The banking module have been replaced by Central deposite module, and interest related functionality has been removed. If you are using simple interest or compound interest related functionality, you will fine the respective functionalities missing after the update.
Download this release
Release Info
Developer | wpexpertsio |
Plugin | myCRED |
Version | 2.0 |
Comparing to | |
See all releases |
Code changes from version beta2.0 to 2.0
- addons/cash-creds/includes/cashcred-functions.php +15 -0
- addons/cash-creds/modules/cashcred-module-core.php +60 -7
- addons/cash-creds/modules/cashcred-module-withdrawal.php +9 -13
- addons/sell-content/myCRED-addon-sell-content.php +1344 -1339
- includes/classes/class.query-log.php +6 -8
- mycred.php +5 -5
- readme.txt +65 -30
addons/cash-creds/includes/cashcred-functions.php
CHANGED
@@ -450,5 +450,20 @@ if ( ! class_exists( 'CashCred_Gateway_Fields' ) ) :
|
|
450 |
endforeach;
|
451 |
}
|
452 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
}
|
454 |
endif;
|
450 |
endforeach;
|
451 |
}
|
452 |
|
453 |
+
}
|
454 |
+
endif;
|
455 |
+
|
456 |
+
if ( ! function_exists( 'mycred_get_cashcred_settings' ) ) :
|
457 |
+
function mycred_get_cashcred_settings() {
|
458 |
+
|
459 |
+
$defaults = array(
|
460 |
+
'debugging' => 'disable'
|
461 |
+
);
|
462 |
+
|
463 |
+
$settings = mycred_get_addon_settings( 'cashcreds' );
|
464 |
+
$settings = wp_parse_args( $settings, $defaults );
|
465 |
+
|
466 |
+
return apply_filters( 'mycred_get_cashcred_settings', $settings );
|
467 |
+
|
468 |
}
|
469 |
endif;
|
addons/cash-creds/modules/cashcred-module-core.php
CHANGED
@@ -25,9 +25,9 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
|
|
25 |
'gateway_prefs' => array()
|
26 |
),
|
27 |
'labels' => array(
|
28 |
-
'menu' => __( '
|
29 |
-
'page_title' => __( '
|
30 |
-
'page_header' => __( '
|
31 |
),
|
32 |
'screen_id' => MYCRED_SLUG . '-cashcreds',
|
33 |
'accordion' => true,
|
@@ -60,6 +60,9 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
|
|
60 |
add_action( 'wp_ajax_cashcred_pay_now', array( $this, 'cashcred_pay_now'), 10, 2 );
|
61 |
add_action( 'wp_ajax_nopriv_cashcred_pay_now', array( $this, 'cashcred_pay_now'), 10, 2 );
|
62 |
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
|
@@ -687,14 +690,14 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
|
|
687 |
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
|
688 |
<div class="form-group">
|
689 |
<div> </div>
|
690 |
-
<label for="buycred-gateway-<?php echo $key; ?>"><input type="checkbox" name="mycred_pref_cashcreds[active][]" id="
|
691 |
</div>
|
692 |
</div>
|
693 |
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
|
694 |
<?php if ( $has_test_mode ) : ?>
|
695 |
<div class="form-group">
|
696 |
<div> </div>
|
697 |
-
<label for="buycred-gateway-<?php echo $key; ?>-sandbox"><input type="checkbox" name="mycred_pref_cashcreds[gateway_prefs][<?php echo $key; ?>][sandbox]" id="
|
698 |
</div>
|
699 |
<?php endif; ?>
|
700 |
</div>
|
@@ -721,13 +724,13 @@ if ( ! class_exists( 'myCRED_cashCRED_Module' ) ) :
|
|
721 |
?>
|
722 |
</div>
|
723 |
|
724 |
-
<?php do_action( '
|
725 |
|
726 |
<p><?php submit_button( __( 'Update Settings', 'mycred' ), 'primary large', 'submit', false ); ?> <?php if ( MYCRED_SHOW_PREMIUM_ADDONS ) : ?><a href="https://mycred.me/product-category/buycred-gateways/" class="button button-secondary button-large" target="_blank">More Gateways</a><?php endif; ?></p>
|
727 |
|
728 |
</form>
|
729 |
|
730 |
-
<?php do_action( '
|
731 |
|
732 |
<script type="text/javascript">
|
733 |
jQuery(function($) {
|
@@ -770,6 +773,56 @@ jQuery(function($) {
|
|
770 |
|
771 |
}
|
772 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
773 |
}
|
774 |
endif;
|
775 |
|
25 |
'gateway_prefs' => array()
|
26 |
),
|
27 |
'labels' => array(
|
28 |
+
'menu' => __( 'cashcred Gateways', 'mycred' ),
|
29 |
+
'page_title' => __( 'cashCred Gateways', 'mycred' ),
|
30 |
+
'page_header' => __( 'cashcred Gateways', 'mycred' )
|
31 |
),
|
32 |
'screen_id' => MYCRED_SLUG . '-cashcreds',
|
33 |
'accordion' => true,
|
60 |
add_action( 'wp_ajax_cashcred_pay_now', array( $this, 'cashcred_pay_now'), 10, 2 );
|
61 |
add_action( 'wp_ajax_nopriv_cashcred_pay_now', array( $this, 'cashcred_pay_now'), 10, 2 );
|
62 |
|
63 |
+
add_action( 'mycred_after_core_prefs', array( $this, 'after_general_settings' ) );
|
64 |
+
add_filter( 'mycred_save_core_prefs', array( $this, 'sanitize_extra_settings' ), 90, 3 );
|
65 |
+
|
66 |
}
|
67 |
|
68 |
|
690 |
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
|
691 |
<div class="form-group">
|
692 |
<div> </div>
|
693 |
+
<label for="buycred-gateway-<?php echo $key; ?>"><input type="checkbox" name="mycred_pref_cashcreds[active][]" id="cashcred-gateway-<?php echo $key; ?>" value="<?php echo $key; ?>"<?php if ( $this->is_active( $key ) ) echo ' checked="checked"'; ?> /> <?php _e( 'Enable', 'mycred' ); ?></label>
|
694 |
</div>
|
695 |
</div>
|
696 |
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
|
697 |
<?php if ( $has_test_mode ) : ?>
|
698 |
<div class="form-group">
|
699 |
<div> </div>
|
700 |
+
<label for="buycred-gateway-<?php echo $key; ?>-sandbox"><input type="checkbox" name="mycred_pref_cashcreds[gateway_prefs][<?php echo $key; ?>][sandbox]" id="cashcred-gateway-<?php echo $key; ?>-sandbox" value="<?php echo $key; ?>"<?php if ( $sandbox_mode ) echo ' checked="checked"'; ?> /> <?php _e( 'Sandbox Mode', 'mycred' ); ?></label>
|
701 |
</div>
|
702 |
<?php endif; ?>
|
703 |
</div>
|
724 |
?>
|
725 |
</div>
|
726 |
|
727 |
+
<?php do_action( 'mycred_after_cashcred_page', $this ); ?>
|
728 |
|
729 |
<p><?php submit_button( __( 'Update Settings', 'mycred' ), 'primary large', 'submit', false ); ?> <?php if ( MYCRED_SHOW_PREMIUM_ADDONS ) : ?><a href="https://mycred.me/product-category/buycred-gateways/" class="button button-secondary button-large" target="_blank">More Gateways</a><?php endif; ?></p>
|
730 |
|
731 |
</form>
|
732 |
|
733 |
+
<?php do_action( 'mycred_bottom_cashcred_page', $this ); ?>
|
734 |
|
735 |
<script type="text/javascript">
|
736 |
jQuery(function($) {
|
773 |
|
774 |
}
|
775 |
|
776 |
+
/**
|
777 |
+
* Settings Page
|
778 |
+
* @since 1.2.3
|
779 |
+
* @version 1.2
|
780 |
+
*/
|
781 |
+
public function after_general_settings( $mycred = NULL ) {
|
782 |
+
|
783 |
+
$cashcred_prefs = mycred_get_cashcred_settings();
|
784 |
+
|
785 |
+
?>
|
786 |
+
<h4><span class="dashicons dashicons-admin-plugins static"></span><strong>cash</strong>CRED</h4>
|
787 |
+
<div class="body" style="display:none;">
|
788 |
+
|
789 |
+
<div class="row">
|
790 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
791 |
+
|
792 |
+
<div class="form-group">
|
793 |
+
<label for="mycred_pref_core_cashcreds_debugging"><?php _e( 'Payment Debugging Log', 'mycred' ); ?></label>
|
794 |
+
<select class="form-control" name="mycred_pref_core[cashcreds][debugging]" id="mycred_pref_core_cashcreds_debugging">
|
795 |
+
<option value="disable" <?php echo $cashcred_prefs['debugging'] != 'enable' ? 'selected="selected"' : ''; ?>>Disabled</option>
|
796 |
+
<option value="enable" <?php echo $cashcred_prefs['debugging'] == 'enable' ? 'selected="selected"' : ''; ?>>Enable</option>
|
797 |
+
</select>
|
798 |
+
<p><span class="description"><?php _e( 'Payment Debugging log for developers.', 'mycred' ); ?></span></p>
|
799 |
+
</div>
|
800 |
+
|
801 |
+
</div>
|
802 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"></div>
|
803 |
+
</div>
|
804 |
+
|
805 |
+
</div>
|
806 |
+
<?php
|
807 |
+
|
808 |
+
}
|
809 |
+
|
810 |
+
/**
|
811 |
+
* Sanitize & Save Settings
|
812 |
+
* @since 2.0
|
813 |
+
* @version 1.0
|
814 |
+
*/
|
815 |
+
public function sanitize_extra_settings( $new_data, $data, $general ) {
|
816 |
+
|
817 |
+
$new_data['cashcreds']['debugging'] = sanitize_text_field( $data['cashcreds']['debugging'] );
|
818 |
+
|
819 |
+
//var_dump( $new_data, $data );die;
|
820 |
+
|
821 |
+
return $new_data;
|
822 |
+
|
823 |
+
}
|
824 |
+
|
825 |
+
|
826 |
}
|
827 |
endif;
|
828 |
|
addons/cash-creds/modules/cashcred-module-withdrawal.php
CHANGED
@@ -205,11 +205,11 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
|
|
205 |
protected function register_cashcred_payments() {
|
206 |
|
207 |
$labels = array(
|
208 |
-
'name' => _x( '
|
209 |
-
'singular_name' => _x( '
|
210 |
-
'menu_name' => __( '
|
211 |
'parent_item_colon' => '',
|
212 |
-
'all_items' => __( '
|
213 |
'view_item' => '',
|
214 |
'add_new_item' => '',
|
215 |
'add_new' => '',
|
@@ -306,8 +306,8 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
|
|
306 |
|
307 |
add_submenu_page(
|
308 |
MYCRED_SLUG,
|
309 |
-
__( '
|
310 |
-
__( '
|
311 |
$this->core->get_point_editor_capability(),
|
312 |
'edit.php?post_type=' . MYCRED_CASHCRED_KEY
|
313 |
);
|
@@ -538,11 +538,10 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
|
|
538 |
'default'
|
539 |
);
|
540 |
|
541 |
-
$mycred_pref_cashcreds =
|
542 |
|
543 |
-
if( isset($mycred_pref_cashcreds["
|
544 |
-
|
545 |
-
|
546 |
add_meta_box(
|
547 |
'cashcred-developer-log',
|
548 |
__( 'Debugging Log', 'mycred' ),
|
@@ -1071,9 +1070,6 @@ if ( ! class_exists( 'cashCRED_Pending_Payments' ) ) :
|
|
1071 |
if ( $event === false )
|
1072 |
$c->comment_content .= ' Unsaved';
|
1073 |
|
1074 |
-
else
|
1075 |
-
$c->comment_content .= ' ' . $event;
|
1076 |
-
|
1077 |
$comments[] = $c;
|
1078 |
|
1079 |
}
|
205 |
protected function register_cashcred_payments() {
|
206 |
|
207 |
$labels = array(
|
208 |
+
'name' => _x( 'cashCred Withdrawal', 'Post Type General Name', 'mycred' ),
|
209 |
+
'singular_name' => _x( 'cashCred Withdrawal', 'Post Type Singular Name', 'mycred' ),
|
210 |
+
'menu_name' => __( 'cashCred Withdrawal', 'mycred' ),
|
211 |
'parent_item_colon' => '',
|
212 |
+
'all_items' => __( 'cashCred Withdrawal', 'mycred' ),
|
213 |
'view_item' => '',
|
214 |
'add_new_item' => '',
|
215 |
'add_new' => '',
|
306 |
|
307 |
add_submenu_page(
|
308 |
MYCRED_SLUG,
|
309 |
+
__( 'cashCred Withdrawal', 'mycred' ),
|
310 |
+
__( 'cashCred Withdrawal', 'mycred' ),
|
311 |
$this->core->get_point_editor_capability(),
|
312 |
'edit.php?post_type=' . MYCRED_CASHCRED_KEY
|
313 |
);
|
538 |
'default'
|
539 |
);
|
540 |
|
541 |
+
$mycred_pref_cashcreds = mycred_get_cashcred_settings();
|
542 |
|
543 |
+
if( isset( $mycred_pref_cashcreds["debugging"] ) && $mycred_pref_cashcreds["debugging"] == 'enable' ) {
|
544 |
+
|
|
|
545 |
add_meta_box(
|
546 |
'cashcred-developer-log',
|
547 |
__( 'Debugging Log', 'mycred' ),
|
1070 |
if ( $event === false )
|
1071 |
$c->comment_content .= ' Unsaved';
|
1072 |
|
|
|
|
|
|
|
1073 |
$comments[] = $c;
|
1074 |
|
1075 |
}
|
addons/sell-content/myCRED-addon-sell-content.php
CHANGED
@@ -1,1339 +1,1344 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Addon: Sell Content
|
4 |
-
* Addon URI: http://codex.mycred.me/chapter-iii/sell-content/
|
5 |
-
* Version: 2.0.1
|
6 |
-
*/
|
7 |
-
if ( ! defined( 'myCRED_VERSION' ) ) exit;
|
8 |
-
|
9 |
-
define( 'myCRED_SELL', __FILE__ );
|
10 |
-
define( 'myCRED_SELL_VERSION', '1.5' );
|
11 |
-
define( 'MYCRED_SELL_DIR', myCRED_ADDONS_DIR . 'sell-content/' );
|
12 |
-
define( 'MYCRED_SELL_ASSETS_DIR', MYCRED_SELL_DIR . 'assets/' );
|
13 |
-
define( 'MYCRED_SELL_INCLUDES_DIR', MYCRED_SELL_DIR . 'includes/' );
|
14 |
-
|
15 |
-
require_once MYCRED_SELL_INCLUDES_DIR . 'mycred-sell-functions.php';
|
16 |
-
require_once MYCRED_SELL_INCLUDES_DIR . 'mycred-sell-shortcodes.php';
|
17 |
-
|
18 |
-
/**
|
19 |
-
* myCRED_Sell_Content_Module class
|
20 |
-
* @since 0.1
|
21 |
-
* @version 2.0.1
|
22 |
-
*/
|
23 |
-
if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
|
24 |
-
class myCRED_Sell_Content_Module extends myCRED_Module {
|
25 |
-
|
26 |
-
public $current_user_id = 0;
|
27 |
-
public $priority = 10;
|
28 |
-
public $bbp_content = '';
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Construct
|
32 |
-
*/
|
33 |
-
function __construct() {
|
34 |
-
|
35 |
-
parent::__construct( 'myCRED_Sell_Content_Module', array(
|
36 |
-
'module_name' => 'sell_content',
|
37 |
-
'register' => false,
|
38 |
-
'defaults' => array(
|
39 |
-
'post_types' => 'post,page',
|
40 |
-
'filters' => array(),
|
41 |
-
'type' => array( MYCRED_DEFAULT_TYPE_KEY ),
|
42 |
-
'reload' => 0,
|
43 |
-
'working' => 'Processing ...',
|
44 |
-
'templates' => array(
|
45 |
-
'members' => '<div class="text-center"><h3>Premium Content</h3><p>Buy access to this content.</p><p>%buy_button%</p></div>',
|
46 |
-
'visitors' => '<div class="text-center"><h3>Premium Content</h3><p>Login to buy access to this content.</p></div>',
|
47 |
-
'cantafford' => '<div class="text-center"><h3>Premium Content</h3><p>Buy access to this content.</p><p><strong>Insufficient Funds</strong></p></div>'
|
48 |
-
)
|
49 |
-
),
|
50 |
-
'add_to_core' => true
|
51 |
-
) );
|
52 |
-
|
53 |
-
if ( ! is_array( $this->sell_content['type'] ) )
|
54 |
-
$this->sell_content['type'] = array( $this->sell_content['type'] );
|
55 |
-
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Module Init
|
60 |
-
* @since 0.1
|
61 |
-
* @version 1.2.1
|
62 |
-
*/
|
63 |
-
public function module_init() {
|
64 |
-
|
65 |
-
$this->current_user_id = get_current_user_id();
|
66 |
-
$this->priority = apply_filters( 'mycred_sell_content_priority', 25, $this );
|
67 |
-
|
68 |
-
// Email add-on support
|
69 |
-
add_filter( 'mycred_get_email_events', array( $this, 'email_notice_instance' ), 10, 2 );
|
70 |
-
add_filter( 'mycred_email_before_send', array( $this, 'email_notices' ), 40, 2 );
|
71 |
-
|
72 |
-
// Setup Content Override
|
73 |
-
add_action( 'template_redirect', array( $this, 'template_redirect' ), 99990 );
|
74 |
-
|
75 |
-
// Register shortcodes
|
76 |
-
add_shortcode( MYCRED_SLUG . '_sell_this', 'mycred_render_sell_this' );
|
77 |
-
add_shortcode( MYCRED_SLUG . '_sell_this_ajax', 'mycred_render_sell_this_ajax' );
|
78 |
-
add_shortcode( MYCRED_SLUG . '_sales_history', 'mycred_render_sell_history' );
|
79 |
-
add_shortcode( MYCRED_SLUG . '_content_sale_count', 'mycred_render_sell_count' );
|
80 |
-
add_shortcode( MYCRED_SLUG . '_content_buyer_count', 'mycred_render_sell_buyer_count' );
|
81 |
-
add_shortcode( MYCRED_SLUG . '_content_buyer_avatars', 'mycred_render_sell_buyer_avatars' );
|
82 |
-
|
83 |
-
// Setup Script
|
84 |
-
add_action( 'mycred_register_assets', array( $this, 'register_assets' ) );
|
85 |
-
add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
|
86 |
-
add_action( 'bbp_template_redirect', array( $this, 'bbp_content' ), 10 );
|
87 |
-
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Module Admin Init
|
92 |
-
* @since 1.7
|
93 |
-
* @version 1.0
|
94 |
-
*/
|
95 |
-
public function module_admin_init() {
|
96 |
-
|
97 |
-
// Setup the "Sell This" Metaboxes
|
98 |
-
$post_types = explode( ',', $this->sell_content['post_types'] );
|
99 |
-
if ( ! empty( $post_types ) ) {
|
100 |
-
|
101 |
-
foreach ( $post_types as $type ) {
|
102 |
-
add_action( "add_meta_boxes_{$type}", array( $this, 'add_metabox' ) );
|
103 |
-
add_action( "save_post_{$type}", array( $this, 'save_metabox' ) );
|
104 |
-
}
|
105 |
-
|
106 |
-
}
|
107 |
-
|
108 |
-
// User Override
|
109 |
-
add_action( 'mycred_user_edit_after_balances', array( $this, 'sell_content_user_screen' ), 50 );
|
110 |
-
|
111 |
-
add_action( 'personal_options_update', array( $this, 'save_manual_profit_share' ), 50 );
|
112 |
-
add_action( 'edit_user_profile_update', array( $this, 'save_manual_profit_share' ), 50 );
|
113 |
-
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Register Assets
|
118 |
-
* @since 1.7
|
119 |
-
* @version 1.0
|
120 |
-
*/
|
121 |
-
public function register_assets() {
|
122 |
-
|
123 |
-
wp_register_script(
|
124 |
-
'mycred-sell-this',
|
125 |
-
plugins_url( 'assets/js/buy-content.js', myCRED_SELL ),
|
126 |
-
array( 'jquery' ),
|
127 |
-
'2.0.1',
|
128 |
-
true
|
129 |
-
);
|
130 |
-
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Load Script
|
135 |
-
* @since 1.7
|
136 |
-
* @version 1.0.2
|
137 |
-
*/
|
138 |
-
public function enqueue_footer() {
|
139 |
-
|
140 |
-
global $mycred_sell_this;
|
141 |
-
|
142 |
-
// Only enqueue our script if it's needed
|
143 |
-
if ( $mycred_sell_this === true ) {
|
144 |
-
|
145 |
-
global $post;
|
146 |
-
|
147 |
-
wp_localize_script(
|
148 |
-
'mycred-sell-this',
|
149 |
-
'myCREDBuyContent',
|
150 |
-
array(
|
151 |
-
'ajaxurl' => esc_url( ( isset( $post->ID ) ) ? mycred_get_permalink( $post->ID ) : home_url( '/' ) ),
|
152 |
-
'token' => wp_create_nonce( 'mycred-buy-this-content' ),
|
153 |
-
'working' => esc_js( $this->sell_content['working'] ),
|
154 |
-
'reload' => $this->sell_content['reload'],
|
155 |
-
'sweeterror' => __( 'Error', 'mycred' )
|
156 |
-
)
|
157 |
-
);
|
158 |
-
|
159 |
-
wp_enqueue_script( 'mycred-sell-this' );
|
160 |
-
|
161 |
-
}
|
162 |
-
|
163 |
-
}
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Setup Content Filter
|
167 |
-
* We are using the template_redirect action to prevent this add-on having to run anywhere else but
|
168 |
-
* in the front-end of our website, since the the_content filter is used in soooo many places.
|
169 |
-
* As of 1.7.6, purchases are made via front-end submissions and not via admin-ajax.php
|
170 |
-
* @since 1.7
|
171 |
-
* @version 1.0.1
|
172 |
-
*/
|
173 |
-
public function template_redirect() {
|
174 |
-
|
175 |
-
global $mycred_partial_content_sale;
|
176 |
-
|
177 |
-
$mycred_partial_content_sale = false;
|
178 |
-
|
179 |
-
// Handle purhchase requests
|
180 |
-
$this->maybe_buy_content();
|
181 |
-
|
182 |
-
// Unless we successfully bought the content, filter it
|
183 |
-
add_filter( 'the_content', array( $this, 'the_content' ), $this->priority );
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Maybe Buy Content
|
189 |
-
* Check if a purchase request has been made either via an AJAX submission.
|
190 |
-
* @since 1.7.6
|
191 |
-
* @version 1.0
|
192 |
-
*/
|
193 |
-
public function maybe_buy_content() {
|
194 |
-
|
195 |
-
if ( is_user_logged_in() && ! mycred_is_admin() ) {
|
196 |
-
|
197 |
-
if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-buy-content' && isset( $_POST['postid'] ) && isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-buy-this-content' ) ) {
|
198 |
-
|
199 |
-
$post_id = absint( $_POST['postid'] );
|
200 |
-
$point_type = sanitize_key( $_POST['ctype'] );
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
add_filter( '
|
414 |
-
add_filter( '
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
$
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
<div class="col-lg-
|
649 |
-
<div
|
650 |
-
<
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
<?php
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
'
|
745 |
-
'
|
746 |
-
'
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
<
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
<
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
<
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
<
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
832 |
-
<div class="
|
833 |
-
<label for="<?php echo $this->field_id( '
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
$( '#post-type-filter-' + post_type ).
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
if ( $
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
$filters[ $post_type ]['
|
1026 |
-
|
1027 |
-
}
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
'
|
1061 |
-
'
|
1062 |
-
'
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
$new_data['sell_content']['
|
1076 |
-
$new_data['sell_content']['
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
'
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
#mycred-sell-content-
|
1144 |
-
#mycred-sell-content-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
if ( $
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
<
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Addon: Sell Content
|
4 |
+
* Addon URI: http://codex.mycred.me/chapter-iii/sell-content/
|
5 |
+
* Version: 2.0.1
|
6 |
+
*/
|
7 |
+
if ( ! defined( 'myCRED_VERSION' ) ) exit;
|
8 |
+
|
9 |
+
define( 'myCRED_SELL', __FILE__ );
|
10 |
+
define( 'myCRED_SELL_VERSION', '1.5' );
|
11 |
+
define( 'MYCRED_SELL_DIR', myCRED_ADDONS_DIR . 'sell-content/' );
|
12 |
+
define( 'MYCRED_SELL_ASSETS_DIR', MYCRED_SELL_DIR . 'assets/' );
|
13 |
+
define( 'MYCRED_SELL_INCLUDES_DIR', MYCRED_SELL_DIR . 'includes/' );
|
14 |
+
|
15 |
+
require_once MYCRED_SELL_INCLUDES_DIR . 'mycred-sell-functions.php';
|
16 |
+
require_once MYCRED_SELL_INCLUDES_DIR . 'mycred-sell-shortcodes.php';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* myCRED_Sell_Content_Module class
|
20 |
+
* @since 0.1
|
21 |
+
* @version 2.0.1
|
22 |
+
*/
|
23 |
+
if ( ! class_exists( 'myCRED_Sell_Content_Module' ) ) :
|
24 |
+
class myCRED_Sell_Content_Module extends myCRED_Module {
|
25 |
+
|
26 |
+
public $current_user_id = 0;
|
27 |
+
public $priority = 10;
|
28 |
+
public $bbp_content = '';
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Construct
|
32 |
+
*/
|
33 |
+
function __construct() {
|
34 |
+
|
35 |
+
parent::__construct( 'myCRED_Sell_Content_Module', array(
|
36 |
+
'module_name' => 'sell_content',
|
37 |
+
'register' => false,
|
38 |
+
'defaults' => array(
|
39 |
+
'post_types' => 'post,page',
|
40 |
+
'filters' => array(),
|
41 |
+
'type' => array( MYCRED_DEFAULT_TYPE_KEY ),
|
42 |
+
'reload' => 0,
|
43 |
+
'working' => 'Processing ...',
|
44 |
+
'templates' => array(
|
45 |
+
'members' => '<div class="text-center"><h3>Premium Content</h3><p>Buy access to this content.</p><p>%buy_button%</p></div>',
|
46 |
+
'visitors' => '<div class="text-center"><h3>Premium Content</h3><p>Login to buy access to this content.</p></div>',
|
47 |
+
'cantafford' => '<div class="text-center"><h3>Premium Content</h3><p>Buy access to this content.</p><p><strong>Insufficient Funds</strong></p></div>'
|
48 |
+
)
|
49 |
+
),
|
50 |
+
'add_to_core' => true
|
51 |
+
) );
|
52 |
+
|
53 |
+
if ( ! is_array( $this->sell_content['type'] ) )
|
54 |
+
$this->sell_content['type'] = array( $this->sell_content['type'] );
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Module Init
|
60 |
+
* @since 0.1
|
61 |
+
* @version 1.2.1
|
62 |
+
*/
|
63 |
+
public function module_init() {
|
64 |
+
|
65 |
+
$this->current_user_id = get_current_user_id();
|
66 |
+
$this->priority = apply_filters( 'mycred_sell_content_priority', 25, $this );
|
67 |
+
|
68 |
+
// Email add-on support
|
69 |
+
add_filter( 'mycred_get_email_events', array( $this, 'email_notice_instance' ), 10, 2 );
|
70 |
+
add_filter( 'mycred_email_before_send', array( $this, 'email_notices' ), 40, 2 );
|
71 |
+
|
72 |
+
// Setup Content Override
|
73 |
+
add_action( 'template_redirect', array( $this, 'template_redirect' ), 99990 );
|
74 |
+
|
75 |
+
// Register shortcodes
|
76 |
+
add_shortcode( MYCRED_SLUG . '_sell_this', 'mycred_render_sell_this' );
|
77 |
+
add_shortcode( MYCRED_SLUG . '_sell_this_ajax', 'mycred_render_sell_this_ajax' );
|
78 |
+
add_shortcode( MYCRED_SLUG . '_sales_history', 'mycred_render_sell_history' );
|
79 |
+
add_shortcode( MYCRED_SLUG . '_content_sale_count', 'mycred_render_sell_count' );
|
80 |
+
add_shortcode( MYCRED_SLUG . '_content_buyer_count', 'mycred_render_sell_buyer_count' );
|
81 |
+
add_shortcode( MYCRED_SLUG . '_content_buyer_avatars', 'mycred_render_sell_buyer_avatars' );
|
82 |
+
|
83 |
+
// Setup Script
|
84 |
+
add_action( 'mycred_register_assets', array( $this, 'register_assets' ) );
|
85 |
+
add_action( 'mycred_front_enqueue_footer', array( $this, 'enqueue_footer' ) );
|
86 |
+
add_action( 'bbp_template_redirect', array( $this, 'bbp_content' ), 10 );
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Module Admin Init
|
92 |
+
* @since 1.7
|
93 |
+
* @version 1.0
|
94 |
+
*/
|
95 |
+
public function module_admin_init() {
|
96 |
+
|
97 |
+
// Setup the "Sell This" Metaboxes
|
98 |
+
$post_types = explode( ',', $this->sell_content['post_types'] );
|
99 |
+
if ( ! empty( $post_types ) ) {
|
100 |
+
|
101 |
+
foreach ( $post_types as $type ) {
|
102 |
+
add_action( "add_meta_boxes_{$type}", array( $this, 'add_metabox' ) );
|
103 |
+
add_action( "save_post_{$type}", array( $this, 'save_metabox' ) );
|
104 |
+
}
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
// User Override
|
109 |
+
add_action( 'mycred_user_edit_after_balances', array( $this, 'sell_content_user_screen' ), 50 );
|
110 |
+
|
111 |
+
add_action( 'personal_options_update', array( $this, 'save_manual_profit_share' ), 50 );
|
112 |
+
add_action( 'edit_user_profile_update', array( $this, 'save_manual_profit_share' ), 50 );
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Register Assets
|
118 |
+
* @since 1.7
|
119 |
+
* @version 1.0
|
120 |
+
*/
|
121 |
+
public function register_assets() {
|
122 |
+
|
123 |
+
wp_register_script(
|
124 |
+
'mycred-sell-this',
|
125 |
+
plugins_url( 'assets/js/buy-content.js', myCRED_SELL ),
|
126 |
+
array( 'jquery' ),
|
127 |
+
'2.0.1',
|
128 |
+
true
|
129 |
+
);
|
130 |
+
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Load Script
|
135 |
+
* @since 1.7
|
136 |
+
* @version 1.0.2
|
137 |
+
*/
|
138 |
+
public function enqueue_footer() {
|
139 |
+
|
140 |
+
global $mycred_sell_this;
|
141 |
+
|
142 |
+
// Only enqueue our script if it's needed
|
143 |
+
if ( $mycred_sell_this === true ) {
|
144 |
+
|
145 |
+
global $post;
|
146 |
+
|
147 |
+
wp_localize_script(
|
148 |
+
'mycred-sell-this',
|
149 |
+
'myCREDBuyContent',
|
150 |
+
array(
|
151 |
+
'ajaxurl' => esc_url( ( isset( $post->ID ) ) ? mycred_get_permalink( $post->ID ) : home_url( '/' ) ),
|
152 |
+
'token' => wp_create_nonce( 'mycred-buy-this-content' ),
|
153 |
+
'working' => esc_js( $this->sell_content['working'] ),
|
154 |
+
'reload' => $this->sell_content['reload'],
|
155 |
+
'sweeterror' => __( 'Error', 'mycred' )
|
156 |
+
)
|
157 |
+
);
|
158 |
+
|
159 |
+
wp_enqueue_script( 'mycred-sell-this' );
|
160 |
+
|
161 |
+
}
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Setup Content Filter
|
167 |
+
* We are using the template_redirect action to prevent this add-on having to run anywhere else but
|
168 |
+
* in the front-end of our website, since the the_content filter is used in soooo many places.
|
169 |
+
* As of 1.7.6, purchases are made via front-end submissions and not via admin-ajax.php
|
170 |
+
* @since 1.7
|
171 |
+
* @version 1.0.1
|
172 |
+
*/
|
173 |
+
public function template_redirect() {
|
174 |
+
|
175 |
+
global $mycred_partial_content_sale;
|
176 |
+
|
177 |
+
$mycred_partial_content_sale = false;
|
178 |
+
|
179 |
+
// Handle purhchase requests
|
180 |
+
$this->maybe_buy_content();
|
181 |
+
|
182 |
+
// Unless we successfully bought the content, filter it
|
183 |
+
add_filter( 'the_content', array( $this, 'the_content' ), $this->priority );
|
184 |
+
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Maybe Buy Content
|
189 |
+
* Check if a purchase request has been made either via an AJAX submission.
|
190 |
+
* @since 1.7.6
|
191 |
+
* @version 1.0
|
192 |
+
*/
|
193 |
+
public function maybe_buy_content() {
|
194 |
+
|
195 |
+
if ( is_user_logged_in() && ! mycred_is_admin() ) {
|
196 |
+
|
197 |
+
if ( isset( $_POST['action'] ) && $_POST['action'] == 'mycred-buy-content' && isset( $_POST['postid'] ) && isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-buy-this-content' ) ) {
|
198 |
+
|
199 |
+
$post_id = absint( $_POST['postid'] );
|
200 |
+
$point_type = sanitize_key( $_POST['ctype'] );
|
201 |
+
$buying_cred = $this->sell_content['type'];
|
202 |
+
$point_types = mycred_get_types( true );
|
203 |
+
global $mycred_types;
|
204 |
+
|
205 |
+
if ( ! array_key_exists( $point_type, $mycred_types ) || mycred_force_singular_session( $this->current_user_id, 'mycred-last-content-purchase' ) || !in_array($point_type, $buying_cred) )
|
206 |
+
wp_send_json( 'ERROR' );
|
207 |
+
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
// If the content is for sale and we have not paid for it
|
213 |
+
if ( mycred_post_is_for_sale( $post_id ) && ! mycred_user_paid_for_content( $this->current_user_id, $post_id ) ) {
|
214 |
+
|
215 |
+
$content = '';
|
216 |
+
$post = mycred_get_post( $post_id );
|
217 |
+
$purchase = mycred_sell_content_new_purchase( $post, $this->current_user_id, $point_type );
|
218 |
+
|
219 |
+
// Successfull purchase
|
220 |
+
if ( $purchase === true ) {
|
221 |
+
|
222 |
+
preg_match('/\[mycred_sell_this[^\]]*](.*)\[\/mycred_sell_this[^\]]*]/uis', $post->post_content , $match );
|
223 |
+
|
224 |
+
$content = $post->post_content;
|
225 |
+
if ( is_array( $match ) && array_key_exists( 1, $match ) )
|
226 |
+
$content = $match[1];
|
227 |
+
|
228 |
+
do_action( 'mycred_sell_before_content_render' );
|
229 |
+
|
230 |
+
remove_filter( 'the_content', array( $this, 'the_content' ), $this->priority );
|
231 |
+
$content = apply_filters( 'the_content', $content );
|
232 |
+
$content = str_replace( ']]>', ']]>', $content );
|
233 |
+
$content = do_shortcode( $content );
|
234 |
+
add_filter( 'the_content', array( $this, 'the_content' ), $this->priority );
|
235 |
+
|
236 |
+
}
|
237 |
+
|
238 |
+
// Something went wrong
|
239 |
+
else {
|
240 |
+
|
241 |
+
$content = $purchase;
|
242 |
+
|
243 |
+
}
|
244 |
+
|
245 |
+
// Let others play
|
246 |
+
$content = apply_filters( 'mycred_content_purchase_ajax', $content, $purchase );
|
247 |
+
|
248 |
+
if ( $purchase !== true )
|
249 |
+
wp_send_json_error( $content );
|
250 |
+
|
251 |
+
wp_send_json_success( $content );
|
252 |
+
|
253 |
+
}
|
254 |
+
|
255 |
+
wp_send_json( 'ERROR' );
|
256 |
+
|
257 |
+
}
|
258 |
+
|
259 |
+
}
|
260 |
+
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* The Content Overwrite
|
265 |
+
* Handles content sales by replacing the posts content with the appropriate template
|
266 |
+
* for those who have not paid. Admins and authors are excluded.
|
267 |
+
* @since 0.1
|
268 |
+
* @version 1.2.2
|
269 |
+
*/
|
270 |
+
public function the_content( $content ) {
|
271 |
+
|
272 |
+
global $mycred_partial_content_sale, $mycred_sell_this;
|
273 |
+
|
274 |
+
$post_id = mycred_sell_content_post_id();
|
275 |
+
$post = mycred_get_post( $post_id );
|
276 |
+
|
277 |
+
// If content is for sale
|
278 |
+
if ( mycred_post_is_for_sale( $post_id ) ) {
|
279 |
+
|
280 |
+
$mycred_sell_this = true;
|
281 |
+
|
282 |
+
// Parse shortcodes now just in case it has not been done already
|
283 |
+
$_content = do_shortcode( $content );
|
284 |
+
|
285 |
+
// Partial Content Sale - We have already done the work in the shortcode
|
286 |
+
if ( $mycred_partial_content_sale === true )
|
287 |
+
return $_content;
|
288 |
+
|
289 |
+
// Logged in users
|
290 |
+
if ( is_user_logged_in() ) {
|
291 |
+
|
292 |
+
// Authors and admins do not pay
|
293 |
+
if ( ! mycred_is_admin() && $post->post_author != $this->current_user_id ) {
|
294 |
+
|
295 |
+
// In case we have not paid
|
296 |
+
if ( ! mycred_user_paid_for_content( $this->current_user_id, $post_id ) ) {
|
297 |
+
|
298 |
+
// Get Payment Options
|
299 |
+
$payment_options = mycred_sell_content_payment_buttons( $this->current_user_id, $post_id );
|
300 |
+
|
301 |
+
// User can buy
|
302 |
+
if ( $payment_options !== false ) {
|
303 |
+
|
304 |
+
$content = $this->sell_content['templates']['members'];
|
305 |
+
$content = str_replace( '%buy_button%', $payment_options, $content );
|
306 |
+
$content = mycred_sell_content_template( $content, $post, 'mycred-sell-entire-content', 'mycred-sell-unpaid' );
|
307 |
+
|
308 |
+
}
|
309 |
+
|
310 |
+
// Can not afford to buy
|
311 |
+
else {
|
312 |
+
|
313 |
+
$content = $this->sell_content['templates']['cantafford'];
|
314 |
+
$content = mycred_sell_content_template( $content, $post, 'mycred-sell-entire-content', 'mycred-sell-insufficient' );
|
315 |
+
|
316 |
+
}
|
317 |
+
|
318 |
+
}
|
319 |
+
|
320 |
+
}
|
321 |
+
|
322 |
+
}
|
323 |
+
|
324 |
+
// Visitors
|
325 |
+
else {
|
326 |
+
|
327 |
+
$content = $this->sell_content['templates']['visitors'];
|
328 |
+
$content = mycred_sell_content_template( $content, $post, 'mycred-sell-entire-content', 'mycred-sell-visitor' );
|
329 |
+
|
330 |
+
}
|
331 |
+
|
332 |
+
}
|
333 |
+
|
334 |
+
return $content;
|
335 |
+
|
336 |
+
}
|
337 |
+
|
338 |
+
|
339 |
+
|
340 |
+
public function bbp_content() {
|
341 |
+
|
342 |
+
global $mycred_partial_content_sale, $mycred_sell_this;
|
343 |
+
|
344 |
+
$post_id = mycred_sell_content_post_id();
|
345 |
+
$post = mycred_get_post( $post_id );
|
346 |
+
$content = '';
|
347 |
+
|
348 |
+
// If content is for sale
|
349 |
+
if ( mycred_post_is_for_sale( $post_id ) && ( bbp_is_single_forum() || bbp_is_single_topic() || bbp_is_single_reply() ) ) {
|
350 |
+
|
351 |
+
$mycred_sell_this = true;
|
352 |
+
|
353 |
+
// Partial Content Sale - We have already done the work in the shortcode
|
354 |
+
if ( $mycred_partial_content_sale === true ) return;
|
355 |
+
|
356 |
+
// Logged in users
|
357 |
+
if ( is_user_logged_in() ) {
|
358 |
+
|
359 |
+
// Authors and admins do not pay
|
360 |
+
if ( ! mycred_is_admin() && $post->post_author != $this->current_user_id ) {
|
361 |
+
|
362 |
+
// In case we have not paid
|
363 |
+
if ( ! mycred_user_paid_for_content( $this->current_user_id, $post_id ) ) {
|
364 |
+
|
365 |
+
// Get Payment Options
|
366 |
+
$payment_options = mycred_sell_content_payment_buttons( $this->current_user_id, $post_id );
|
367 |
+
|
368 |
+
// User can buy
|
369 |
+
if ( $payment_options !== false ) {
|
370 |
+
|
371 |
+
$content = $this->sell_content['templates']['members'];
|
372 |
+
$content = str_replace( '%buy_button%', $payment_options, $content );
|
373 |
+
$content = mycred_sell_content_template( $content, $post, 'mycred-sell-entire-content', 'mycred-sell-unpaid' );
|
374 |
+
$this->mycred_bbp_sell_forum_actions();
|
375 |
+
|
376 |
+
}
|
377 |
+
|
378 |
+
// Can not afford to buy
|
379 |
+
else {
|
380 |
+
|
381 |
+
$content = $this->sell_content['templates']['cantafford'];
|
382 |
+
$content = mycred_sell_content_template( $content, $post, 'mycred-sell-entire-content', 'mycred-sell-insufficient' );
|
383 |
+
$this->mycred_bbp_sell_forum_actions();
|
384 |
+
|
385 |
+
}
|
386 |
+
|
387 |
+
}
|
388 |
+
|
389 |
+
}
|
390 |
+
|
391 |
+
}
|
392 |
+
|
393 |
+
// Visitors
|
394 |
+
else {
|
395 |
+
|
396 |
+
$content = $this->sell_content['templates']['visitors'];
|
397 |
+
$content = mycred_sell_content_template( $content, $post, 'mycred-sell-entire-content', 'mycred-sell-visitor' );
|
398 |
+
$this->mycred_bbp_sell_forum_actions();
|
399 |
+
|
400 |
+
}
|
401 |
+
|
402 |
+
}
|
403 |
+
|
404 |
+
$this->bbp_content = $content;
|
405 |
+
|
406 |
+
}
|
407 |
+
|
408 |
+
|
409 |
+
public function mycred_bbp_sell_forum_actions() {
|
410 |
+
|
411 |
+
add_action( 'bbp_template_before_single_forum', array( $this, 'bbp_template_before_single' ) );
|
412 |
+
add_action( 'bbp_template_before_single_topic', array( $this, 'bbp_template_before_single' ) );
|
413 |
+
add_filter( 'bbp_no_breadcrumb', array( $this, 'bbp_remove_breadcrumb' ), 10 );
|
414 |
+
add_filter( 'bbp_get_forum_subscribe_link', array( $this, 'bbp_remove_subscribe_link' ), 10 , 3 );
|
415 |
+
add_filter( 'bbp_get_topic_subscribe_link', array( $this, 'bbp_remove_subscribe_link' ), 10 , 3 );
|
416 |
+
add_filter( 'bbp_get_topic_favorite_link', array( $this, 'bbp_remove_subscribe_link' ), 10 , 3 );
|
417 |
+
add_filter( 'bbp_get_template_part', array( $this, 'bbp_remove_templates' ), 10 , 3 );
|
418 |
+
add_filter( 'bbp_get_single_forum_description', array( $this, 'bbp_get_single_description' ), 10 , 3 );
|
419 |
+
add_filter( 'bbp_get_single_topic_description', array( $this, 'bbp_get_single_description' ), 10 , 3 );
|
420 |
+
|
421 |
+
}
|
422 |
+
|
423 |
+
public function bbp_template_before_single() {
|
424 |
+
|
425 |
+
echo $this->bbp_content;
|
426 |
+
|
427 |
+
}
|
428 |
+
|
429 |
+
public function bbp_remove_breadcrumb( $is_front ) {
|
430 |
+
return true;
|
431 |
+
}
|
432 |
+
|
433 |
+
public function bbp_remove_subscribe_link( $retval, $r, $args ) {
|
434 |
+
return '';
|
435 |
+
}
|
436 |
+
|
437 |
+
public function bbp_remove_templates( $templates, $slug, $name ) {
|
438 |
+
|
439 |
+
if ( $slug == 'content' ) return $templates;
|
440 |
+
|
441 |
+
return array('');
|
442 |
+
}
|
443 |
+
|
444 |
+
public function bbp_get_single_description( $retstr, $r, $args ) {
|
445 |
+
return '';
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* User Level Override
|
450 |
+
* @since 1.5
|
451 |
+
* @version 1.3.1
|
452 |
+
*/
|
453 |
+
public function sell_content_user_screen( $user ) {
|
454 |
+
|
455 |
+
// Only visible to admins
|
456 |
+
if ( ! mycred_is_admin() ) return;
|
457 |
+
|
458 |
+
$mycred_types = mycred_get_types( true );
|
459 |
+
$available_options = array();
|
460 |
+
|
461 |
+
foreach ( $mycred_types as $point_type_key => $label ) {
|
462 |
+
|
463 |
+
$setup = array( 'name' => $label, 'enabled' => false, 'default' => 0, 'excluded' => true, 'override' => false, 'custom' => 0 );
|
464 |
+
|
465 |
+
if ( ! empty( $this->sell_content['type'] ) && in_array( $point_type_key, $this->sell_content['type'] ) ) {
|
466 |
+
|
467 |
+
$setup['enabled'] = true;
|
468 |
+
$mycred = mycred( $point_type_key );
|
469 |
+
|
470 |
+
if ( ! $mycred->exclude_user( $user->ID ) ) {
|
471 |
+
|
472 |
+
$setup['excluded'] = false;
|
473 |
+
|
474 |
+
$settings = mycred_get_option( 'mycred_sell_this_' . $point_type_key );
|
475 |
+
|
476 |
+
$setup['default'] = $settings['profit_share'];
|
477 |
+
|
478 |
+
$users_share = mycred_get_user_meta( $user->ID, 'mycred_sell_content_share_' . $point_type_key, '', true );
|
479 |
+
if ( strlen( $users_share ) > 0 ) {
|
480 |
+
|
481 |
+
$setup['override'] = true;
|
482 |
+
$setup['custom'] = $users_share;
|
483 |
+
|
484 |
+
}
|
485 |
+
|
486 |
+
}
|
487 |
+
|
488 |
+
}
|
489 |
+
|
490 |
+
$available_options[ $point_type_key ] = $setup;
|
491 |
+
|
492 |
+
}
|
493 |
+
|
494 |
+
if ( empty( $available_options ) ) return;
|
495 |
+
|
496 |
+
?>
|
497 |
+
<p class="mycred-p"><?php _e( 'Users profit share when their content is purchased.', 'mycred' ); ?></p>
|
498 |
+
<table class="form-table mycred-inline-table">
|
499 |
+
<tr>
|
500 |
+
<th scope="row"><?php _e( 'Profit Share', 'mycred' ); ?></th>
|
501 |
+
<td>
|
502 |
+
<fieldset id="mycred-badge-list" class="badge-list">
|
503 |
+
<legend class="screen-reader-text"><span><?php _e( 'Profit Share', 'mycred' ); ?></span></legend>
|
504 |
+
<?php
|
505 |
+
|
506 |
+
foreach ( $available_options as $point_type => $data ) {
|
507 |
+
|
508 |
+
// This point type is not for sale
|
509 |
+
if ( ! $data['enabled'] ) {
|
510 |
+
|
511 |
+
?>
|
512 |
+
<div class="mycred-wrapper buycred-wrapper disabled-option color-option">
|
513 |
+
<div><?php printf( _x( '%s Profit Share', 'Points Name', 'mycred' ), $data['name'] ); ?></div>
|
514 |
+
<div class="balance-row">
|
515 |
+
<div class="balance-view"><?php _e( 'Disabled', 'mycred' ); ?></div>
|
516 |
+
<div class="balance-desc"><em><?php _e( 'Not accepted as payment.', 'mycred' ); ?></em></div>
|
517 |
+
</div>
|
518 |
+
</div>
|
519 |
+
<?php
|
520 |
+
|
521 |
+
}
|
522 |
+
|
523 |
+
// This user is excluded from this point type
|
524 |
+
elseif ( $data['excluded'] ) {
|
525 |
+
|
526 |
+
?>
|
527 |
+
<div class="mycred-wrapper buycred-wrapper disabled-option color-option">
|
528 |
+
<div><?php printf( _x( '%s Profit Share', 'Points Name', 'mycred' ), $data['name'] ); ?></div>
|
529 |
+
<div class="balance-row">
|
530 |
+
<div class="balance-view"><?php _e( 'Excluded', 'mycred' ); ?></div>
|
531 |
+
<div class="balance-desc"><em><?php printf( _x( 'User can not pay using %s', 'Points Name', 'mycred' ), $data['name'] ); ?></em></div>
|
532 |
+
</div>
|
533 |
+
</div>
|
534 |
+
<?php
|
535 |
+
|
536 |
+
}
|
537 |
+
|
538 |
+
// Eligeble user
|
539 |
+
else {
|
540 |
+
|
541 |
+
?>
|
542 |
+
<div class="mycred-wrapper buycred-wrapper color-option selected">
|
543 |
+
<div><?php printf( _x( '%s Profit Share', 'Buying Points', 'mycred' ), $data['name'] ); ?></div>
|
544 |
+
<div class="balance-row">
|
545 |
+
<div class="balance-view"><input type="text" size="8" name="mycred_sell_this[<?php echo $point_type; ?>]" class="half" placeholder="<?php echo esc_attr( $data['default'] ); ?>" value="<?php if ( $data['override'] ) echo esc_attr( $data['custom'] ); ?>" /> %</div>
|
546 |
+
<div class="balance-desc"><em><?php _e( 'Leave empty to use the default.', 'mycred' ); ?></em></div>
|
547 |
+
</div>
|
548 |
+
</div>
|
549 |
+
<?php
|
550 |
+
|
551 |
+
}
|
552 |
+
|
553 |
+
}
|
554 |
+
|
555 |
+
?>
|
556 |
+
</fieldset>
|
557 |
+
</td>
|
558 |
+
</tr>
|
559 |
+
</table>
|
560 |
+
<hr />
|
561 |
+
<?php
|
562 |
+
|
563 |
+
}
|
564 |
+
|
565 |
+
/**
|
566 |
+
* Save Override
|
567 |
+
* @since 1.5
|
568 |
+
* @version 1.2
|
569 |
+
*/
|
570 |
+
function save_manual_profit_share( $user_id ) {
|
571 |
+
|
572 |
+
// Only visible to admins
|
573 |
+
if ( ! mycred_is_admin() ) return;
|
574 |
+
|
575 |
+
if ( isset( $_POST['mycred_sell_this'] ) && ! empty( $_POST['mycred_sell_this'] ) ) {
|
576 |
+
|
577 |
+
foreach ( $_POST['mycred_sell_this'] as $point_type => $share ) {
|
578 |
+
|
579 |
+
$share = sanitize_text_field( $share );
|
580 |
+
|
581 |
+
mycred_delete_user_meta( $user_id, 'mycred_sell_content_share_' . $point_type );
|
582 |
+
if ( $share != '' && is_numeric( $share ) )
|
583 |
+
mycred_update_user_meta( $user_id, 'mycred_sell_content_share_' . $point_type, '', $share );
|
584 |
+
|
585 |
+
}
|
586 |
+
|
587 |
+
}
|
588 |
+
|
589 |
+
}
|
590 |
+
|
591 |
+
/**
|
592 |
+
* Enabled / Disabled Select Options
|
593 |
+
* @since 1.7
|
594 |
+
* @version 1.0
|
595 |
+
*/
|
596 |
+
protected function enabled_options( $selected = '' ) {
|
597 |
+
|
598 |
+
$options = array(
|
599 |
+
'disabled' => __( 'Disabled', 'mycred' ),
|
600 |
+
'enabled' => __( 'Enabled', 'mycred' )
|
601 |
+
);
|
602 |
+
|
603 |
+
$output = '';
|
604 |
+
foreach ( $options as $value => $label ) {
|
605 |
+
$output .= '<option value="' . $value . '"';
|
606 |
+
if ( $selected == $value ) $output .= ' selected="selected"';
|
607 |
+
$output .= '>' . $label . '</option>';
|
608 |
+
}
|
609 |
+
|
610 |
+
return $output;
|
611 |
+
|
612 |
+
}
|
613 |
+
|
614 |
+
/**
|
615 |
+
* Settings Page
|
616 |
+
* @since 0.1
|
617 |
+
* @version 1.4
|
618 |
+
*/
|
619 |
+
public function after_general_settings( $mycred = NULL ) {
|
620 |
+
|
621 |
+
$post_types = mycred_sell_content_post_types();
|
622 |
+
$selected_types = explode( ',', $this->sell_content['post_types'] );
|
623 |
+
|
624 |
+
$point_types = mycred_get_types( true );
|
625 |
+
|
626 |
+
?>
|
627 |
+
<h4><span class="dashicons dashicons-admin-plugins static"></span><?php _e( 'Sell Content', 'mycred' ); ?></h4>
|
628 |
+
<div class="body" style="display:none;">
|
629 |
+
|
630 |
+
<h3><?php _e( 'Post Types', 'mycred' ); ?></h3>
|
631 |
+
<p><?php _e( 'Which post type(s) content field do you want to sell access to?', 'mycred' ); ?></p>
|
632 |
+
<div id="mycred-sell-this-post-type-filter">
|
633 |
+
<?php
|
634 |
+
|
635 |
+
if ( ! empty( $post_types ) ) {
|
636 |
+
foreach ( $post_types as $post_type => $post_type_label ) {
|
637 |
+
|
638 |
+
$selected = '';
|
639 |
+
if ( in_array( $post_type, $selected_types ) )
|
640 |
+
$selected = ' checked="checked"';
|
641 |
+
|
642 |
+
$show_options = 'none';
|
643 |
+
if ( in_array( $post_type, $selected_types ) )
|
644 |
+
$show_options = 'block';
|
645 |
+
|
646 |
+
?>
|
647 |
+
<div class="row">
|
648 |
+
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
|
649 |
+
<div class="checkbox">
|
650 |
+
<label for="<?php echo $this->field_id( array( 'post_types' => $post_type ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'post_types' => $post_type ) ); ?>"<?php echo $selected; ?> id="<?php echo $this->field_id( array( 'post_types' => $post_type ) ); ?>" class="mycred-check-count" data-type="<?php echo $post_type; ?>" value="<?php echo $post_type; ?>" /> <?php echo esc_attr( $post_type_label ); ?></label>
|
651 |
+
</div>
|
652 |
+
</div>
|
653 |
+
<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
|
654 |
+
<div id="<?php echo $this->field_id( array( 'post_types' => $post_type ) ); ?>-wrap" style="display: <?php echo $show_options; ?>;">
|
655 |
+
<div class="row">
|
656 |
+
<div class="col-lg-5 col-md-5 col-sm-6 col-xs-12">
|
657 |
+
<div class="form-group">
|
658 |
+
<select name="<?php echo $this->field_name( array( 'filters' => $post_type ) ); ?>[by]" class="form-control toggle-filter-menu" data-type="<?php echo $post_type; ?>">
|
659 |
+
<?php
|
660 |
+
|
661 |
+
$settings = array( 'by' => 'all', 'list' => '' );
|
662 |
+
if ( array_key_exists( $post_type, $this->sell_content['filters'] ) )
|
663 |
+
$settings = $this->sell_content['filters'][ $post_type ];
|
664 |
+
|
665 |
+
$options = mycred_get_post_type_options( $post_type );
|
666 |
+
if ( ! empty( $options ) ) {
|
667 |
+
foreach ( $options as $value => $option ) {
|
668 |
+
|
669 |
+
echo '<option value="' . $value . '"';
|
670 |
+
if ( $value == $settings['by'] ) echo ' selected="selected"';
|
671 |
+
if ( $option['data'] != '' ) echo ' data-place="' . $option['data'] . '"';
|
672 |
+
echo '>' . $option['label'] . '</option>';
|
673 |
+
|
674 |
+
}
|
675 |
+
}
|
676 |
+
|
677 |
+
?>
|
678 |
+
</select>
|
679 |
+
</div>
|
680 |
+
</div>
|
681 |
+
<div class="col-lg-7 col-md-7 col-sm-6 col-xs-12">
|
682 |
+
<div id="post-type-filter-<?php echo $post_type; ?>" style="display: <?php if ( ! in_array( $settings['by'], array( 'all', 'manual' ) ) ) echo 'block'; else echo 'none'; ?>;">
|
683 |
+
<div class="form-group">
|
684 |
+
<input type="text" name="<?php echo $this->field_name( array( 'filters' => $post_type ) ); ?>[list]" value="<?php echo esc_attr( $settings['list'] ); ?>" placeholder="<?php if ( array_key_exists( $settings['by'], $options ) ) echo esc_attr( $options[ $settings['by'] ]['data'] ); ?>" class="form-control" />
|
685 |
+
</div>
|
686 |
+
</div>
|
687 |
+
</div>
|
688 |
+
</div>
|
689 |
+
</div>
|
690 |
+
</div>
|
691 |
+
</div>
|
692 |
+
<?php
|
693 |
+
|
694 |
+
}
|
695 |
+
}
|
696 |
+
|
697 |
+
?>
|
698 |
+
</div>
|
699 |
+
|
700 |
+
<h3><?php _e( 'Point Types', 'mycred' ); ?></h3>
|
701 |
+
<p><?php _e( 'Which point type(s) can be used as payment for accessing content?', 'mycred' ); ?></p>
|
702 |
+
<div class="row">
|
703 |
+
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
704 |
+
<?php
|
705 |
+
|
706 |
+
if ( ! empty( $point_types ) ) {
|
707 |
+
foreach ( $point_types as $point_type => $point_type_label ) {
|
708 |
+
|
709 |
+
$selected = '';
|
710 |
+
if ( in_array( $point_type, $this->sell_content['type'] ) )
|
711 |
+
$selected = ' checked="checked"';
|
712 |
+
|
713 |
+
if ( count( $point_types ) === 1 )
|
714 |
+
$selected = ' checked="checked" disabled="disabled"';
|
715 |
+
|
716 |
+
?>
|
717 |
+
<div class="form-group">
|
718 |
+
<label for="<?php echo $this->field_id( array( 'type' => $point_type ) ); ?>"><input type="checkbox" name="<?php echo $this->field_name( array( 'type' => $point_type ) ); ?>"<?php echo $selected; ?> id="<?php echo $this->field_id( array( 'type' => $point_type ) ); ?>" class="mycred-check-count" data-type="<?php echo $point_type; ?>" value="<?php echo $point_type; ?>" /> <?php echo esc_attr( $point_type_label ); ?></label>
|
719 |
+
</div>
|
720 |
+
<?php
|
721 |
+
|
722 |
+
}
|
723 |
+
}
|
724 |
+
|
725 |
+
?>
|
726 |
+
</div>
|
727 |
+
</div>
|
728 |
+
|
729 |
+
<?php
|
730 |
+
|
731 |
+
if ( ! empty( $point_types ) ) {
|
732 |
+
foreach ( $point_types as $point_type => $point_type_label ) {
|
733 |
+
|
734 |
+
$selected = 'none';
|
735 |
+
if ( in_array( $point_type, $this->sell_content['type'] ) )
|
736 |
+
$selected = 'block';
|
737 |
+
|
738 |
+
if ( count( $point_types ) === 1 )
|
739 |
+
$selected = 'block';
|
740 |
+
|
741 |
+
$mycred = mycred( $point_type );
|
742 |
+
$type_setup = mycred_get_option( 'mycred_sell_this_' . $point_type );
|
743 |
+
$type_setup = wp_parse_args( $type_setup, array(
|
744 |
+
'status' => 'disabled',
|
745 |
+
'price' => 0,
|
746 |
+
'expire' => 0,
|
747 |
+
'profit_share' => 0,
|
748 |
+
'button_label' => 'Pay %price%',
|
749 |
+
'button_classes' => 'btn btn-primary btn-lg',
|
750 |
+
'log_payment' => 'Purchase of %link_with_title%',
|
751 |
+
'log_sale' => 'Sale of %link_with_title%'
|
752 |
+
) );
|
753 |
+
|
754 |
+
$expiration_label = apply_filters( 'mycred_sell_exp_title', __( 'Hour(s)', 'mycred' ), $point_type );
|
755 |
+
|
756 |
+
?>
|
757 |
+
<div id="mycred-sell-<?php echo $point_type; ?>-wrap" style="display: <?php echo $selected; ?>;">
|
758 |
+
<h3><?php printf( __( '%s Setup', 'mycred' ), $point_type_label ); ?></h3>
|
759 |
+
<div class="row">
|
760 |
+
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
|
761 |
+
<div class="form-group">
|
762 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-status' ) ); ?>"><?php _e( 'Default Status', 'mycred' ); ?></label>
|
763 |
+
<select name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[status]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-status' ) ); ?>" class="form-control">
|
764 |
+
<?php echo $this->enabled_options( $type_setup['status'] ); ?>
|
765 |
+
</select>
|
766 |
+
</div>
|
767 |
+
</div>
|
768 |
+
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
|
769 |
+
<div class="form-group">
|
770 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-price' ) ); ?>"><?php _e( 'Default Price', 'mycred' ); ?></label>
|
771 |
+
<input type="text" name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[price]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-price' ) ); ?>" class="form-control" value="<?php echo esc_attr( $type_setup['price'] ); ?>" />
|
772 |
+
</div>
|
773 |
+
</div>
|
774 |
+
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
|
775 |
+
<div class="form-group">
|
776 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-expire' ) ); ?>"><?php _e( 'Expiration', 'mycred' ); ?></label>
|
777 |
+
<input type="text" name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[expire]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-expire' ) ); ?>" class="form-control" value="<?php echo esc_attr( $type_setup['expire'] ); ?>" />
|
778 |
+
<p><span class="description"><?php printf( __( 'Option to automatically expire purchases after certain number of %s. Use zero to disable.', 'mycred' ), $expiration_label ); ?></span></p>
|
779 |
+
</div>
|
780 |
+
</div>
|
781 |
+
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
|
782 |
+
<div class="form-group">
|
783 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-profit-share' ) ); ?>"><?php _e( 'Profit Share', 'mycred' ); ?></label>
|
784 |
+
<input type="text" name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[profit_share]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-profit-share' ) ); ?>" class="form-control" value="<?php echo esc_attr( $type_setup['profit_share'] ); ?>" />
|
785 |
+
<p><span class="description"><?php printf( __( 'Option to pay a percentage of each sale with the content author.', 'mycred' ), $expiration_label ); ?></span></p>
|
786 |
+
</div>
|
787 |
+
</div>
|
788 |
+
</div>
|
789 |
+
<div class="row">
|
790 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
791 |
+
<div class="form-group">
|
792 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-button' ) ); ?>"><?php _e( 'Button Label', 'mycred' ); ?></label>
|
793 |
+
<input type="text" name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[button_label]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-button' ) ); ?>" class="form-control" placeholder="<?php _e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $type_setup['button_label'] ); ?>" />
|
794 |
+
<p><span class="description"><?php echo $this->core->available_template_tags( array(), '%price%' ); ?></span></p>
|
795 |
+
</div>
|
796 |
+
</div>
|
797 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
798 |
+
<div class="form-group">
|
799 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-css' ) ); ?>"><?php _e( 'Button CSS Classes', 'mycred' ); ?></label>
|
800 |
+
<input type="text" name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[button_classes]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-css' ) ); ?>" class="form-control" value="<?php echo esc_attr( $type_setup['button_classes'] ); ?>" />
|
801 |
+
</div>
|
802 |
+
</div>
|
803 |
+
</div>
|
804 |
+
<h3><?php _e( 'Log Templates', 'mycred' ); ?></h3>
|
805 |
+
<div class="row">
|
806 |
+
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
807 |
+
<div class="form-group">
|
808 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-log-pay' ) ); ?>"><?php _e( 'Payment log entry template', 'mycred' ); ?></label>
|
809 |
+
<input type="text" name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[log_payment]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-log-pay' ) ); ?>" class="form-control" placeholder="<?php _e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $type_setup['log_payment'] ); ?>" />
|
810 |
+
<p><span class="description"><?php echo $this->core->available_template_tags( array( 'general', 'post' ) ); ?></span></p>
|
811 |
+
</div>
|
812 |
+
</div>
|
813 |
+
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
814 |
+
<div class="form-group">
|
815 |
+
<label for="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-log-share' ) ); ?>"><?php _e( 'Profit Share payout log entry template', 'mycred' ); ?></label>
|
816 |
+
<input type="text" name="<?php echo $this->field_name( array( 'post_type_setup' => $point_type ) ); ?>[log_sale]" id="<?php echo $this->field_id( array( 'post_type_setup' => $point_type . '-log-share' ) ); ?>" class="form-control" placeholder="<?php _e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $type_setup['log_sale'] ); ?>" />
|
817 |
+
<p><span class="description"><?php echo $this->core->available_template_tags( array( 'general', 'post' ) ); ?></span></p>
|
818 |
+
</div>
|
819 |
+
</div>
|
820 |
+
</div>
|
821 |
+
</div>
|
822 |
+
<?php
|
823 |
+
|
824 |
+
}
|
825 |
+
}
|
826 |
+
|
827 |
+
?>
|
828 |
+
|
829 |
+
<h3><?php _e( 'Transactions', 'mycred' ); ?></h3>
|
830 |
+
<div class="row">
|
831 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
832 |
+
<div class="checkbox">
|
833 |
+
<label for="<?php echo $this->field_id( 'reload' ); ?>"><input type="checkbox" name="<?php echo $this->field_name( 'reload' ); ?>" id="<?php echo $this->field_id( 'reload' ); ?>" <?php checked( $this->sell_content['reload'], 1 ); ?> value="1" /> <?php _e( 'Reload page after successful payments.', 'mycred' ); ?></label>
|
834 |
+
</div>
|
835 |
+
</div>
|
836 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
837 |
+
<div class="form-group">
|
838 |
+
<label for="<?php echo $this->field_id( 'working' ); ?>"><?php _e( 'Button Label', 'mycred' ); ?></label>
|
839 |
+
<input type="text" name="<?php echo $this->field_name( 'working' ); ?>" id="<?php echo $this->field_id( 'working' ); ?>" class="form-control" placeholder="<?php _e( 'Required', 'mycred' ); ?>" value="<?php echo esc_attr( $this->sell_content['working'] ); ?>" />
|
840 |
+
<p><span class="description"><?php _e( 'Option to show a custom button label while the payment is being processed. HTML is allowed.', 'mycred' ); ?></span></p>
|
841 |
+
</div>
|
842 |
+
</div>
|
843 |
+
</div>
|
844 |
+
|
845 |
+
<div class="row">
|
846 |
+
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
847 |
+
<h3><?php _e( 'Purchase Template', 'mycred' ); ?></h3>
|
848 |
+
<p><span class="description"><?php _e( 'The content will be replaced with this template when viewed by a user that has not paid for the content but can afford to pay.', 'mycred' ); ?></span></p>
|
849 |
+
<?php
|
850 |
+
|
851 |
+
wp_editor( $this->sell_content['templates']['members'], $this->field_id( array( 'templates' => 'members' ) ), array(
|
852 |
+
'textarea_name' => $this->field_name( array( 'templates' => 'members' ) ),
|
853 |
+
'textarea_rows' => 10
|
854 |
+
) );
|
855 |
+
|
856 |
+
echo '<p>' . $this->core->available_template_tags( array( 'post' ), '%buy_button%' ) . '</p>';
|
857 |
+
|
858 |
+
?>
|
859 |
+
</div>
|
860 |
+
</div>
|
861 |
+
|
862 |
+
<div class="row">
|
863 |
+
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
864 |
+
<h3><?php _e( 'Insufficient Funds Template', 'mycred' ); ?></h3>
|
865 |
+
<p><span class="description"><?php _e( 'The content will be replaced with this template when viewed by a user that has not paid for the content and can not afford to pay.', 'mycred' ); ?></span></p>
|
866 |
+
<?php
|
867 |
+
|
868 |
+
wp_editor( $this->sell_content['templates']['cantafford'], $this->field_id( array( 'templates' => 'cantafford' ) ), array(
|
869 |
+
'textarea_name' => $this->field_name( array( 'templates' => 'cantafford' ) ),
|
870 |
+
'textarea_rows' => 10
|
871 |
+
) );
|
872 |
+
|
873 |
+
echo '<p>' . $this->core->available_template_tags( array( 'post' ) ) . '</p>';
|
874 |
+
|
875 |
+
?>
|
876 |
+
</div>
|
877 |
+
</div>
|
878 |
+
|
879 |
+
<div class="row">
|
880 |
+
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
881 |
+
<h3><?php _e( 'Visitors Template', 'mycred' ); ?></h3>
|
882 |
+
<p><span class="description"><?php _e( 'The content will be replaced with this template when viewed by someone who is not logged in on your website.', 'mycred' ); ?></span></p>
|
883 |
+
<?php
|
884 |
+
|
885 |
+
wp_editor( $this->sell_content['templates']['visitors'], $this->field_id( array( 'templates' => 'visitors' ) ), array(
|
886 |
+
'textarea_name' => $this->field_name( array( 'templates' => 'visitors' ) ),
|
887 |
+
'textarea_rows' => 10
|
888 |
+
) );
|
889 |
+
|
890 |
+
echo '<p>' . $this->core->available_template_tags( array( 'post' ) ) . '</p>';
|
891 |
+
|
892 |
+
?>
|
893 |
+
</div>
|
894 |
+
</div>
|
895 |
+
|
896 |
+
</div>
|
897 |
+
<script type="text/javascript">
|
898 |
+
(function($) {
|
899 |
+
|
900 |
+
var selectedposttypes = <?php echo count( $selected_types ); ?>;
|
901 |
+
var selectedpointtypes = <?php echo count( $this->sell_content['type'] ); ?>;
|
902 |
+
|
903 |
+
$( '#myCRED-wrap .mycred-check-count' ).click(function(){
|
904 |
+
|
905 |
+
if ( $(this).is( ':checked' ) ) {
|
906 |
+
|
907 |
+
selectedposttypes++;
|
908 |
+
$( '#mycred-sell-content-post-type-warning' ).hide();
|
909 |
+
|
910 |
+
$( '#sellcontentprefsposttypes' + $(this).data( 'type' ) + '-wrap' ).show();
|
911 |
+
|
912 |
+
}
|
913 |
+
else {
|
914 |
+
selectedposttypes--;
|
915 |
+
if ( selectedposttypes <= 0 )
|
916 |
+
$( '#mycred-sell-content-post-type-warning' ).show();
|
917 |
+
else
|
918 |
+
$( '#mycred-sell-content-post-type-warning' ).hide();
|
919 |
+
|
920 |
+
$( '#sellcontentprefsposttypes' + $(this).data( 'type' ) + '-wrap' ).hide();
|
921 |
+
}
|
922 |
+
|
923 |
+
});
|
924 |
+
|
925 |
+
$( '#myCRED-wrap .mycred-check-count' ).click(function(){
|
926 |
+
|
927 |
+
if ( $(this).is( ':checked' ) ) {
|
928 |
+
|
929 |
+
selectedpointtypes++;
|
930 |
+
$( '#mycred-sell-content-point-type-warning' ).hide();
|
931 |
+
|
932 |
+
$( '#mycred-sell-' + $(this).data( 'type' ) + '-wrap' ).show();
|
933 |
+
|
934 |
+
}
|
935 |
+
else {
|
936 |
+
selectedpointtypes--;
|
937 |
+
if ( selectedpointtypes <= 0 )
|
938 |
+
$( '#mycred-sell-content-point-type-warning' ).show();
|
939 |
+
else
|
940 |
+
$( '#mycred-sell-content-point-type-warning' ).hide();
|
941 |
+
|
942 |
+
$( '#mycred-sell-' + $(this).data( 'type' ) + '-wrap' ).hide();
|
943 |
+
}
|
944 |
+
|
945 |
+
});
|
946 |
+
|
947 |
+
$( '#mycred-sell-this-post-type-filter' ).on( 'change', 'select.toggle-filter-menu', function(){
|
948 |
+
|
949 |
+
var post_type = $(this).data( 'type' );
|
950 |
+
var selectedfilter = $(this).find( ':selected' );
|
951 |
+
var placeholder = selectedfilter.data( 'place' );
|
952 |
+
|
953 |
+
if ( selectedfilter === undefined || selectedfilter.val() == 'all' || selectedfilter.val() == 'manual' ) {
|
954 |
+
$( '#post-type-filter-' + post_type ).hide();
|
955 |
+
$( '#post-type-filter-' + post_type + ' input' ).val( '' );
|
956 |
+
}
|
957 |
+
|
958 |
+
else {
|
959 |
+
$( '#post-type-filter-' + post_type ).show();
|
960 |
+
}
|
961 |
+
|
962 |
+
if ( placeholder === undefined )
|
963 |
+
$( '#post-type-filter-' + post_type + ' input' ).attr( 'placeholder', '' );
|
964 |
+
|
965 |
+
else
|
966 |
+
$( '#post-type-filter-' + post_type + ' input' ).attr( 'placeholder', placeholder );
|
967 |
+
|
968 |
+
});
|
969 |
+
|
970 |
+
})( jQuery );
|
971 |
+
</script>
|
972 |
+
<?php
|
973 |
+
|
974 |
+
}
|
975 |
+
|
976 |
+
/**
|
977 |
+
* Sanitize & Save Settings
|
978 |
+
* @since 0.1
|
979 |
+
* @version 1.4
|
980 |
+
*/
|
981 |
+
public function sanitize_extra_settings( $new_data, $data, $general ) {
|
982 |
+
|
983 |
+
$settings = $data['sell_content'];
|
984 |
+
|
985 |
+
// Post Types
|
986 |
+
$post_types = array();
|
987 |
+
if ( array_key_exists( 'post_types', $settings ) && is_array( $settings['post_types'] ) && ! empty( $settings['post_types'] ) ) {
|
988 |
+
|
989 |
+
foreach ( $settings['post_types'] as $post_type ) {
|
990 |
+
$post_types[] = sanitize_text_field( $post_type );
|
991 |
+
}
|
992 |
+
|
993 |
+
}
|
994 |
+
$new_data['sell_content']['post_types'] = implode( ',', $post_types );
|
995 |
+
|
996 |
+
// Post Type Filter
|
997 |
+
$filters = array();
|
998 |
+
if ( array_key_exists( 'filters', $settings ) && is_array( $settings['filters'] ) && ! empty( $settings['filters'] ) ) {
|
999 |
+
|
1000 |
+
foreach ( $settings['filters'] as $post_type => $setup ) {
|
1001 |
+
|
1002 |
+
if ( ! in_array( $post_type, $post_types ) ) continue;
|
1003 |
+
|
1004 |
+
$filters[ $post_type ] = array( 'by' => 'all', 'list' => '' );
|
1005 |
+
|
1006 |
+
$by = sanitize_text_field( $setup['by'] );
|
1007 |
+
if ( $by != '' ) {
|
1008 |
+
|
1009 |
+
// Unless we selected all, we need to check the list
|
1010 |
+
if ( $by !== 'all' && $by !== 'manual' ) {
|
1011 |
+
|
1012 |
+
// Clean up list by sanitizing and removing stray empty spaces
|
1013 |
+
$list = sanitize_text_field( $setup['list'] );
|
1014 |
+
if ( $list != '' ) {
|
1015 |
+
$_list = array();
|
1016 |
+
foreach ( explode( ',', $list ) as $object_slug ) {
|
1017 |
+
$object_slug = sanitize_text_field( $object_slug );
|
1018 |
+
$object_slug = trim( $object_slug );
|
1019 |
+
$_list[] = $object_slug;
|
1020 |
+
}
|
1021 |
+
$list = implode( ',', $_list );
|
1022 |
+
}
|
1023 |
+
|
1024 |
+
$filters[ $post_type ]['by'] = $by;
|
1025 |
+
$filters[ $post_type ]['list'] = $list;
|
1026 |
+
|
1027 |
+
}
|
1028 |
+
elseif ( $by === 'manual' ) {
|
1029 |
+
|
1030 |
+
$filters[ $post_type ]['by'] = 'manual';
|
1031 |
+
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
}
|
1039 |
+
$new_data['sell_content']['filters'] = $filters;
|
1040 |
+
|
1041 |
+
// Point Types
|
1042 |
+
$point_types = array();
|
1043 |
+
if ( array_key_exists( 'type', $settings ) && is_array( $settings['type'] ) && ! empty( $settings['type'] ) ) {
|
1044 |
+
|
1045 |
+
foreach ( $settings['type'] as $point_type ) {
|
1046 |
+
$point_types[] = sanitize_key( $point_type );
|
1047 |
+
}
|
1048 |
+
|
1049 |
+
}
|
1050 |
+
if ( empty( $point_types ) )
|
1051 |
+
$point_types[] = MYCRED_DEFAULT_TYPE_KEY;
|
1052 |
+
|
1053 |
+
$new_data['sell_content']['type'] = $point_types;
|
1054 |
+
|
1055 |
+
// Point type default setup
|
1056 |
+
if ( array_key_exists( 'post_type_setup', $settings ) ) {
|
1057 |
+
foreach ( $settings['post_type_setup'] as $point_type => $setup ) {
|
1058 |
+
|
1059 |
+
$new = wp_parse_args( $setup, array(
|
1060 |
+
'status' => 'disabled',
|
1061 |
+
'price' => 0,
|
1062 |
+
'expire' => 0,
|
1063 |
+
'profit_share' => 0,
|
1064 |
+
'button_label' => '',
|
1065 |
+
'button_classes' => '',
|
1066 |
+
'log_payment' => '',
|
1067 |
+
'log_sale' => ''
|
1068 |
+
) );
|
1069 |
+
|
1070 |
+
mycred_update_option( 'mycred_sell_this_' . $point_type, $new );
|
1071 |
+
|
1072 |
+
}
|
1073 |
+
}
|
1074 |
+
|
1075 |
+
$new_data['sell_content']['reload'] = ( ( isset( $settings['reload'] ) ) ? absint( $settings['reload'] ) : 0 );
|
1076 |
+
$new_data['sell_content']['working'] = wp_kses_post( $settings['working'] );
|
1077 |
+
|
1078 |
+
// Templates
|
1079 |
+
$new_data['sell_content']['templates']['members'] = wp_kses_post( $settings['templates']['members'] );
|
1080 |
+
$new_data['sell_content']['templates']['visitors'] = wp_kses_post( $settings['templates']['visitors'] );
|
1081 |
+
$new_data['sell_content']['templates']['cantafford'] = wp_kses_post( $settings['templates']['cantafford'] );
|
1082 |
+
|
1083 |
+
update_option( 'mycred_sell_content_one_seven_updated', time() );
|
1084 |
+
|
1085 |
+
return $new_data;
|
1086 |
+
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
/**
|
1090 |
+
* Scripts & Styles
|
1091 |
+
* @since 1.7
|
1092 |
+
* @version 1.0
|
1093 |
+
*/
|
1094 |
+
public function scripts_and_styles() {
|
1095 |
+
|
1096 |
+
$screen = get_current_screen();
|
1097 |
+
|
1098 |
+
if ( in_array( $screen->id, explode( ',', $this->sell_content['post_types'] ) ) ) {
|
1099 |
+
wp_enqueue_style( 'mycred-bootstrap-grid' );
|
1100 |
+
wp_enqueue_style( 'mycred-forms' );
|
1101 |
+
}
|
1102 |
+
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
/**
|
1106 |
+
* Add Meta Box to Content
|
1107 |
+
* @since 0.1
|
1108 |
+
* @version 1.1
|
1109 |
+
*/
|
1110 |
+
public function add_metabox( $post ) {
|
1111 |
+
|
1112 |
+
$settings = mycred_sell_content_settings();
|
1113 |
+
|
1114 |
+
// Do not add the metabox unless we set this post type to be "manual"
|
1115 |
+
if ( empty( $settings['filters'][ $post->post_type ] ) || $settings['filters'][ $post->post_type ]['by'] !== 'manual' ) return;
|
1116 |
+
|
1117 |
+
add_meta_box(
|
1118 |
+
'mycred-sell-content-setup',
|
1119 |
+
apply_filters( 'mycred_sell_this_label', __( 'Sell Content', 'mycred' ), $this ),
|
1120 |
+
array( $this, 'metabox' ),
|
1121 |
+
$post->post_type,
|
1122 |
+
'side',
|
1123 |
+
'high'
|
1124 |
+
);
|
1125 |
+
|
1126 |
+
add_filter( 'postbox_classes_' . $post->post_type . '_mycred-sell-content-setup', array( $this, 'metabox_classes' ) );
|
1127 |
+
|
1128 |
+
}
|
1129 |
+
|
1130 |
+
/**
|
1131 |
+
* Sell Meta Box
|
1132 |
+
* @since 0.1
|
1133 |
+
* @version 1.2
|
1134 |
+
*/
|
1135 |
+
public function metabox( $post ) {
|
1136 |
+
|
1137 |
+
$settings = mycred_sell_content_settings();
|
1138 |
+
$expiration = apply_filters( 'mycred_sell_exp_title', __( 'Hour(s)', 'mycred' ) );
|
1139 |
+
$is_author = ( ( $post->post_author == $this->current_user_id ) ? true : false );
|
1140 |
+
|
1141 |
+
?>
|
1142 |
+
<style type="text/css">
|
1143 |
+
#mycred-sell-content-setup .inside { padding: 0 !important; }
|
1144 |
+
#mycred-sell-content-setup .inside .row { margin-bottom: 0; }
|
1145 |
+
#mycred-sell-content-setup .inside .container-fluid { padding-left: 0; padding-right: 0; }
|
1146 |
+
#mycred-sell-content-setup .inside .row .col-lg-12 .form-group { padding: 12px 12px 10px 12px; background-color: white; border-bottom: 1px solid #ddd; }
|
1147 |
+
#mycred-sell-content-types .point-type-setup .cover { border-bottom: 1px solid #ddd; }
|
1148 |
+
#mycred-sell-content-types .point-type-setup .cover > .row { padding-top: 6px; padding-bottom: 12px; }
|
1149 |
+
#mycred-sell-content-types .point-type-setup:last-child .cover { border-bottom: none; }
|
1150 |
+
</style>
|
1151 |
+
<div id="mycred-sell-content-types" class="container-fluid">
|
1152 |
+
<input type="hidden" name="mycred-sell-this-setup-token" value="<?php echo wp_create_nonce( 'mycred-sell-this-content' ); ?>" />
|
1153 |
+
<?php
|
1154 |
+
|
1155 |
+
if ( ! empty( $settings['type'] ) ) {
|
1156 |
+
foreach ( $settings['type'] as $point_type ) {
|
1157 |
+
|
1158 |
+
$setup = mycred_get_option( 'mycred_sell_this_' . $point_type );
|
1159 |
+
|
1160 |
+
if ( $setup['status'] === 'disabled' ) continue;
|
1161 |
+
|
1162 |
+
$mycred = mycred( $point_type );
|
1163 |
+
|
1164 |
+
$suffix = '_' . $point_type;
|
1165 |
+
if ( $point_type == MYCRED_DEFAULT_TYPE_KEY )
|
1166 |
+
$suffix = '';
|
1167 |
+
|
1168 |
+
$sale_setup = (array) mycred_get_post_meta( $post->ID, 'myCRED_sell_content' . $suffix );
|
1169 |
+
|
1170 |
+
$sale_setup = empty($sale_setup) ? $sale_setup : $sale_setup[0];
|
1171 |
+
|
1172 |
+
$sale_setup = shortcode_atts( array(
|
1173 |
+
'status' => 'disabled',
|
1174 |
+
'price' => 0,
|
1175 |
+
'expire' => 0
|
1176 |
+
), $sale_setup );
|
1177 |
+
|
1178 |
+
$expiration_description = __( 'Never expires', 'mycred' );
|
1179 |
+
if ( absint( $sale_setup['expire'] ) > 0 )
|
1180 |
+
$expiration_description = $sale_setup['expire'] . ' ' . $expiration;
|
1181 |
+
|
1182 |
+
?>
|
1183 |
+
<div class="form point-type-setup">
|
1184 |
+
<div class="row row-narrow">
|
1185 |
+
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
1186 |
+
<div class="form-group slim">
|
1187 |
+
<label for="mycred-sell-this-<?php echo $point_type; ?>-status" class="slim"><input type="checkbox" name="mycred_sell_this[<?php echo $point_type; ?>][status]" id="mycred-sell-this-<?php echo $point_type; ?>-status"<?php if ( $sale_setup['status'] === 'enabled' ) echo ' checked="checked"'; ?> value="enabled" class="toggle-setup" data-type="<?php echo $point_type; ?>" /> <?php printf( __( 'Sell using %s', 'Point types name', 'mycred' ), $mycred->plural() ); ?></label>
|
1188 |
+
</div>
|
1189 |
+
</div>
|
1190 |
+
</div>
|
1191 |
+
<div class="cover">
|
1192 |
+
<div class="row row-narrow padded-row mycred-sell-setup-container" id="mycred-sell-content-<?php echo $point_type; ?>-wrap" style="display: <?php if ( $sale_setup['status'] === 'enabled' ) echo 'block'; else echo 'none'; ?>;">
|
1193 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
1194 |
+
<div class="form-group slim">
|
1195 |
+
<label for="mycred-sell-this-<?php echo $point_type; ?>-price"><?php _e( 'Price', 'mycred' ); ?></label>
|
1196 |
+
<input type="text" name="mycred_sell_this[<?php echo $point_type; ?>][price]" id="mycred-sell-this-<?php echo $point_type; ?>-price" class="form-control" value="<?php echo esc_attr( $sale_setup['price'] ); ?>" />
|
1197 |
+
</div>
|
1198 |
+
</div>
|
1199 |
+
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
1200 |
+
<div class="form-group slim">
|
1201 |
+
<label for="mycred-sell-this-<?php echo $point_type; ?>-expire"><?php _e( 'Expiration', 'mycred' ); ?></label>
|
1202 |
+
<input type="text" name="mycred_sell_this[<?php echo $point_type; ?>][expire]" id="mycred-sell-this-<?php echo $point_type; ?>-expire" class="form-control" value="<?php echo absint( $sale_setup['expire'] ); ?>" />
|
1203 |
+
</div>
|
1204 |
+
</div>
|
1205 |
+
</div>
|
1206 |
+
</div>
|
1207 |
+
</div>
|
1208 |
+
<?php
|
1209 |
+
|
1210 |
+
}
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
?>
|
1214 |
+
<script type="text/javascript">
|
1215 |
+
(function($) {
|
1216 |
+
|
1217 |
+
$( '#mycred-sell-content-types .toggle-setup' ).click(function(){
|
1218 |
+
|
1219 |
+
if ( $(this).is( ':checked' ) ) {
|
1220 |
+
$( '#mycred-sell-content-types #mycred-sell-content-' + $(this).data( 'type' ) + '-wrap' ).slideDown();
|
1221 |
+
}
|
1222 |
+
else {
|
1223 |
+
$( '#mycred-sell-content-types #mycred-sell-content-' + $(this).data( 'type' ) + '-wrap' ).slideUp();
|
1224 |
+
}
|
1225 |
+
|
1226 |
+
});
|
1227 |
+
|
1228 |
+
})( jQuery );
|
1229 |
+
</script>
|
1230 |
+
</div>
|
1231 |
+
<?php
|
1232 |
+
|
1233 |
+
}
|
1234 |
+
|
1235 |
+
/**
|
1236 |
+
* Save Sell Meta Box
|
1237 |
+
* @since 0.1
|
1238 |
+
* @version 1.1
|
1239 |
+
*/
|
1240 |
+
public function save_metabox( $post_id ) {
|
1241 |
+
|
1242 |
+
// Minimum requirement
|
1243 |
+
if ( ! isset( $_POST['mycred_sell_this'] ) || ! is_array( $_POST['mycred_sell_this'] ) || empty( $_POST['mycred_sell_this'] ) ) return;
|
1244 |
+
|
1245 |
+
// Verify nonce
|
1246 |
+
if ( isset( $_POST['mycred-sell-this-setup-token'] ) && wp_verify_nonce( $_POST['mycred-sell-this-setup-token'], 'mycred-sell-this-content' ) ) {
|
1247 |
+
|
1248 |
+
$settings = mycred_sell_content_settings();
|
1249 |
+
|
1250 |
+
if ( ! empty( $settings['type'] ) ) {
|
1251 |
+
foreach ( $settings['type'] as $point_type ) {
|
1252 |
+
|
1253 |
+
if ( ! array_key_exists( $point_type, $_POST['mycred_sell_this'] ) ) continue;
|
1254 |
+
|
1255 |
+
$mycred = mycred( $point_type );
|
1256 |
+
|
1257 |
+
$new_setup = array( 'status' => 'disabled', 'price' => 0, 'expire' => 0 );
|
1258 |
+
$submission = shortcode_atts( array(
|
1259 |
+
'status' => 'disabled',
|
1260 |
+
'price' => 0,
|
1261 |
+
'expire' => 0
|
1262 |
+
), $_POST['mycred_sell_this'][ $point_type ] );
|
1263 |
+
|
1264 |
+
if ( $submission['status'] == '' ) $submission['status'] = 'disabled';
|
1265 |
+
|
1266 |
+
// If not empty and different from the general setup, save<
|
1267 |
+
if ( in_array( $submission['status'], array( 'enabled', 'disabled' ) ) )
|
1268 |
+
$new_setup['status'] = sanitize_key( $submission['status'] );
|
1269 |
+
|
1270 |
+
// If not empty and different from the general setup, save<
|
1271 |
+
if ( strlen( $submission['price'] ) > 0 )
|
1272 |
+
$new_setup['price'] = $mycred->number( sanitize_text_field( $submission['price'] ) );
|
1273 |
+
|
1274 |
+
// If not empty and different from the general setup, save<
|
1275 |
+
if ( strlen( $submission['expire'] ) > 0 )
|
1276 |
+
$new_setup['expire'] = absint( sanitize_text_field( $submission['expire'] ) );
|
1277 |
+
|
1278 |
+
$suffix = '_' . $point_type;
|
1279 |
+
if ( $point_type == MYCRED_DEFAULT_TYPE_KEY )
|
1280 |
+
$suffix = '';
|
1281 |
+
|
1282 |
+
mycred_update_post_meta( $post_id, 'myCRED_sell_content' . $suffix, $new_setup );
|
1283 |
+
|
1284 |
+
}
|
1285 |
+
}
|
1286 |
+
|
1287 |
+
}
|
1288 |
+
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
/**
|
1292 |
+
* Add Email Notice Instance
|
1293 |
+
* @since 1.5.4
|
1294 |
+
* @version 1.0
|
1295 |
+
*/
|
1296 |
+
public function email_notice_instance( $events, $request ) {
|
1297 |
+
|
1298 |
+
if ( $request['ref'] == 'buy_content' ) {
|
1299 |
+
if ( $request['amount'] < 0 )
|
1300 |
+
$events[] = 'buy_content|negative';
|
1301 |
+
elseif ( $request['amount'] > 0 )
|
1302 |
+
$events[] = 'buy_content|positive';
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
return $events;
|
1306 |
+
|
1307 |
+
}
|
1308 |
+
|
1309 |
+
/**
|
1310 |
+
* Support for Email Notices
|
1311 |
+
* @since 1.1
|
1312 |
+
* @version 1.0
|
1313 |
+
*/
|
1314 |
+
public function email_notices( $data ) {
|
1315 |
+
|
1316 |
+
if ( $data['request']['ref'] == 'buy_content' ) {
|
1317 |
+
$message = $data['message'];
|
1318 |
+
$data['message'] = $this->core->template_tags_post( $message, $data['request']['ref_id'] );
|
1319 |
+
}
|
1320 |
+
|
1321 |
+
return $data;
|
1322 |
+
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
endif;
|
1328 |
+
|
1329 |
+
/**
|
1330 |
+
* Load Sell Content Module
|
1331 |
+
* @since 1.7
|
1332 |
+
* @version 1.0
|
1333 |
+
*/
|
1334 |
+
if ( ! function_exists( 'mycred_load_sell_content_addon' ) ) :
|
1335 |
+
function mycred_load_sell_content_addon( $modules, $point_types ) {
|
1336 |
+
|
1337 |
+
$modules['solo']['content'] = new myCRED_Sell_Content_Module();
|
1338 |
+
$modules['solo']['content']->load();
|
1339 |
+
|
1340 |
+
return $modules;
|
1341 |
+
|
1342 |
+
}
|
1343 |
+
endif;
|
1344 |
+
add_filter( 'mycred_load_modules', 'mycred_load_sell_content_addon', 90, 2 );
|
includes/classes/class.query-log.php
CHANGED
@@ -886,14 +886,12 @@ if ( ! class_exists( 'myCRED_Query_Log' ) ) :
|
|
886 |
|
887 |
/**
|
888 |
* Ordering of results
|
889 |
-
*
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
'orderby' => array( 'time' => 'ASC', 'id' => 'ASC' )
|
896 |
-
|
897 |
*/
|
898 |
$this->sortby = "ORDER BY time DESC";
|
899 |
if ( ! empty( $this->args['orderby'] ) ) {
|
886 |
|
887 |
/**
|
888 |
* Ordering of results
|
889 |
+
*
|
890 |
+
* Single order
|
891 |
+
* orderby=time&order=ASC
|
892 |
+
*
|
893 |
+
* Multiple orders
|
894 |
+
* 'orderby' => array( 'time' => 'ASC', 'id' => 'ASC' )
|
|
|
|
|
895 |
*/
|
896 |
$this->sortby = "ORDER BY time DESC";
|
897 |
if ( ! empty( $this->args['orderby'] ) ) {
|
mycred.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* Author URI: https://mycred.me
|
10 |
* Author Email: support@mycred.me
|
11 |
* Requires at least: WP 4.8
|
12 |
-
* Tested up to: WP 5.
|
13 |
* Text Domain: mycred
|
14 |
* Domain Path: /lang
|
15 |
* License: GPLv2 or later
|
@@ -54,14 +54,14 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
54 |
* @since 1.7
|
55 |
* @version 1.0
|
56 |
*/
|
57 |
-
public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '
|
58 |
|
59 |
/**
|
60 |
* Not allowed
|
61 |
* @since 1.7
|
62 |
* @version 1.0
|
63 |
*/
|
64 |
-
public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '
|
65 |
|
66 |
/**
|
67 |
* Get
|
@@ -82,7 +82,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
82 |
if ( ! defined( $name ) )
|
83 |
define( $name, $value );
|
84 |
elseif ( ! $definable && defined( $name ) )
|
85 |
-
_doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '
|
86 |
}
|
87 |
|
88 |
/**
|
@@ -94,7 +94,7 @@ if ( ! class_exists( 'myCRED_Core' ) ) :
|
|
94 |
if ( file_exists( $required_file ) )
|
95 |
require_once $required_file;
|
96 |
else
|
97 |
-
_doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '
|
98 |
}
|
99 |
|
100 |
/**
|
9 |
* Author URI: https://mycred.me
|
10 |
* Author Email: support@mycred.me
|
11 |
* Requires at least: WP 4.8
|
12 |
+
* Tested up to: WP 5.6
|
13 |
* Text Domain: mycred
|
14 |
* Domain Path: /lang
|
15 |
* License: GPLv2 or later
|
54 |
* @since 1.7
|
55 |
* @version 1.0
|
56 |
*/
|
57 |
+
public function __clone() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '2.0' ); }
|
58 |
|
59 |
/**
|
60 |
* Not allowed
|
61 |
* @since 1.7
|
62 |
* @version 1.0
|
63 |
*/
|
64 |
+
public function __wakeup() { _doing_it_wrong( __FUNCTION__, 'Cheatin’ huh?', '2.0' ); }
|
65 |
|
66 |
/**
|
67 |
* Get
|
82 |
if ( ! defined( $name ) )
|
83 |
define( $name, $value );
|
84 |
elseif ( ! $definable && defined( $name ) )
|
85 |
+
_doing_it_wrong( 'myCRED_Core->define()', 'Could not define: ' . $name . ' as it is already defined somewhere else!', '2.0' );
|
86 |
}
|
87 |
|
88 |
/**
|
94 |
if ( file_exists( $required_file ) )
|
95 |
require_once $required_file;
|
96 |
else
|
97 |
+
_doing_it_wrong( 'myCRED_Core->file()', 'Requested file ' . $required_file . ' not found.', '2.0' );
|
98 |
}
|
99 |
|
100 |
/**
|
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:
|
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 |
|
@@ -40,35 +40,54 @@ Join the myCred membership club today and take advantage of premium services tha
|
|
40 |
|
41 |
[Check the package pricing page for the add-on list](https://mycred.me/membership/)
|
42 |
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
71 |
-
|
72 |
= AN ATTRACTIVE AND EFFECTIVE POINTS AND REWARDS SYSTEM =
|
73 |
|
74 |
Empower your WordPress website users by rewarding them points - each user has their own **POINT BALANCE** that can be used in purchasing online products or online activities.
|
@@ -77,25 +96,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
|
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 “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
|
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 +122,7 @@ myCred is much more than just a point management system – The plugin come
|
|
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 +133,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 +161,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 +172,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 +186,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/)
|
@@ -191,11 +210,11 @@ myCred has the ability to “do-it-all†because we have put in a lot o
|
|
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 |
|
@@ -229,6 +248,9 @@ You can find a list of [frequently asked questions](https://mycred.me/about/faq/
|
|
229 |
|
230 |
== Upgrade Notice ==
|
231 |
|
|
|
|
|
|
|
232 |
= 1.8.0 =
|
233 |
Major release(Make sure to take backup before updating)
|
234 |
|
@@ -310,6 +332,19 @@ Bug fixes release.
|
|
310 |
|
311 |
== Changelog ==
|
312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
= 1.8.14.2 =
|
314 |
- **TWEAK** - Code optimization.
|
315 |
|
@@ -518,4 +553,4 @@ IMPROVEMENT - Added check for existing logs getting disappeared.
|
|
518 |
|
519 |
|
520 |
= Previous Versions =
|
521 |
-
https://mycred.me/support/changelog/
|
2 |
Contributors: mycred,wpexpertsio
|
3 |
Tags: badges, gamification, loyalty, points, rewards
|
4 |
Requires at least: 4.8
|
5 |
+
Tested up to: 5.6
|
6 |
+
Stable tag: 2.0
|
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 |
|
40 |
|
41 |
[Check the package pricing page for the add-on list](https://mycred.me/membership/)
|
42 |
|
43 |
+
= Introducing cashCred in myCred v2.0 =
|
44 |
+
|
45 |
+
**GIVE USERS THE POWER TO CONVERT THEIR MYCRED POINTS INTO REAL MONEY.**
|
46 |
+
|
47 |
+
**cashCred** is a built-in myCred add-on that allows users to redeem myCred points for real money anytime, anywhere. **Give users the power to earn points through myCred's intelligent rewards system.** Instead of giving them cash, you reward them with points that can be encashed at any time.
|
48 |
+
|
49 |
+
**cashCred** works perfectly with a reward system that engages users to perform activities that require user interaction (watching a video, filling out a survey and more).
|
50 |
+
|
51 |
+
* **Convert Points to Cash -** Users can redeem myCred points for money.
|
52 |
+
* **Multiple Point Types -** Allow multiple custom point types.
|
53 |
+
* **Exchange Rates -** Define exchange rates for each point type.
|
54 |
+
* **Cash Withdrawal -** Users can send a request to the admin for cash withdrawal
|
55 |
+
* **User Requests -** Approve or deny user requests for cash withdrawal.
|
56 |
+
* **Additional Notes -** Write additional notes for users which will be displayed on the payment form.
|
57 |
+
* **Currency Code -** Define the currency code (USD, GBP, AUD, etc.) for the payment form.
|
58 |
+
* **Shortcode Support -** Display the cashCred module on the website using a shortcode.
|
59 |
+
* **Set Limits & Restrictions -** Set minimum or maximum restriction limits on point conversion requests.
|
60 |
+
* **Pay Through PayPal -** cashCred supports payment through PayPal.
|
61 |
+
* **Pay Through Stripe -** cashCred supports payment through Stripe.
|
62 |
+
|
63 |
+
**Important Announcement** You have to update your myCred plugin to version 2.0 in order to use the myCred cashCred services.
|
64 |
|
65 |
= Features =
|
66 |
|
67 |
+
**- 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.
|
68 |
**- Account History:** Each time a user gains or loses points on your website, the transaction is logged into a central log for accountability.
|
69 |
+
**- 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.
|
70 |
**- 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.
|
71 |
**- Import & Export:** myCred comes with three built-in import tools allowing you to import points, log entries, or migrate your CubePoints installation.
|
72 |
+
**- Automatic Points:** Automatically award or deduct points from your user's balance for their interaction on your Wordpress/WooCommerce website.
|
73 |
**- 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.
|
74 |
**- 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.
|
75 |
+
**- Leaderboards:** Generate leaderboards based on your user's balance or points history - display users with the most points for a particular instance.
|
76 |
**- 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.
|
77 |
**- 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.
|
78 |
**- Coupons:** Create and share coupon codes with your users, which can be redeemed when they have generated a certain amount of points.
|
79 |
**- Notifications:** The notifications add-on allows you to show popup notifications each time a user gains or loses points on your website.
|
80 |
+
**- Ranks:** Ranks are based on how well your user balance is performing. As a user's balance changes, so do their rank.
|
81 |
**- 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.
|
82 |
**- Reward Purchases:** You can opt to reward your users with points that they can use to buy products in your store.
|
83 |
**- 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.
|
84 |
**- Statistics:** The statistics add-on will convert your log data into charts to help visualize points usage and circulation on your website.
|
85 |
**- Transfers:** The transfer add-on allows your users to transfer points to other users on your website.
|
86 |
**- Theme Independent:** The myCred plugin is theme independent - Your theme needs to support widgets and shortcodes in order to run myCred.
|
87 |
+
**- 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.
|
88 |
**- Bootstrap Ready:** myCred comes with minimal CSS styling to give you the freedom to style everything according to your needs.
|
89 |
**- Translation Ready:** You can add your own language translation or adjust the built-in translation support.
|
90 |
|
|
|
91 |
= AN ATTRACTIVE AND EFFECTIVE POINTS AND REWARDS SYSTEM =
|
92 |
|
93 |
Empower your WordPress website users by rewarding them points - each user has their own **POINT BALANCE** that can be used in purchasing online products or online activities.
|
96 |
|
97 |
= AWARD OR DEDUCT POINTS AUTOMATICALLY =
|
98 |
|
99 |
+
**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.
|
100 |
|
101 |
|
102 |
= DEDICATED LOG =
|
103 |
|
104 |
+
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 user’s accountability, badges, and ranks, among other useful statistics.
|
105 |
|
106 |
This log data can be converted into charts to help you visualize the usage and circulation of points on your website.
|
107 |
|
108 |
You can achieve the following features by using a dedicated log for your points system:
|
109 |
|
110 |
* Set a limit to the maximum number of times each hook can give out points to your user.
|
111 |
+
* Badges will use the log’s data to determine which user has earned a badge.
|
112 |
* Add-ons such as “Sell Content†use the log to keep track of users who have purchased posts from your website.
|
113 |
* 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.
|
114 |
|
115 |
= BUILT-IN ADD-ONS =
|
116 |
|
117 |
+
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.
|
118 |
|
119 |
**- Badges:** Award your users badges based on their points history.
|
120 |
**- buyCred:** Let your users buy points in exchange for real money.
|
122 |
**- Email notifications:** Setup email notifications for status updates.
|
123 |
**- Gateway:** Let users pay with points in your store.
|
124 |
**- Notifications:** Enable popup notifications that display status updates.
|
125 |
+
**- Ranks:** Create ranks based on the user’s point balance.
|
126 |
**- Sell Content:** Sell your content in exchange for points.
|
127 |
**- Statistics:** Get a statistical overview of points in circulation, etc.
|
128 |
**- Transfers:** Allow your users to transfer points to other users.
|
133 |
|
134 |
myCred supports some of the most popular WordPress plugins like **BuddyPress, WooCommerce, Jetpack, Contact Form 7, Disqus, Gravity Forms,** among countless others.
|
135 |
|
136 |
+
**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.
|
137 |
|
138 |
|
139 |
= INTEGRATED WITH THE MOST POPULAR LEARNING MANAGEMENT SYSTEMS =
|
161 |
[Explore to find out more...](https://www.mycred.me/product-category/freebies/)
|
162 |
|
163 |
|
164 |
+
= MYCRED'S THIRD-PARTY BRIDGES PLUGINS: =
|
165 |
|
166 |
+
- [Stripe - buyCred Gateway](https://www.mycred.me/store/buycred-stripe/)
|
167 |
+
- [Easy Digital Downloads - myCred Gateway](https://www.mycred.me/store/mycred-for-easy-digital-downloads/)
|
168 |
- [myCred Zapier Addon](https://mycred.me/store/mycred-zapier-addon/)
|
169 |
- [myCred Dokan](https://www.mycred.me/store/mycred-dokan/)
|
170 |
- [myCred WCVendors](https://www.mycred.me/store/mycred-wc-vendors/)
|
172 |
- [myCred for Users Ultra](https://www.mycred.me/store/mycred-for-users-ultra/)
|
173 |
- [myCred for User Pro](https://www.mycred.me/store/mycred-for-user-pro/)
|
174 |
|
175 |
+
= MYCRED'S GAMIFICATION PLUGINS: =
|
176 |
|
177 |
- [myCred PacMan](https://www.mycred.me/store/mycred-pacman/)
|
178 |
- [Wheel of Fortune Add-On](https://www.mycred.me/store/wheel-of-fortune-add-on/)
|
179 |
|
180 |
|
181 |
+
= MYCRED'S ENHANCEMENT PLUGINS: =
|
182 |
|
183 |
- [myCred WooCommerce Plus](https://www.mycred.me/store/mycred-woocommerce-plus/)
|
184 |
- [myCred Email Digest](https://mycred.me/store/mycred-email-digest/)
|
186 |
- [myCred Points Cap](https://mycred.me/store/mycred-points-cap/)
|
187 |
- [myCred Level Cred](https://www.mycred.me/store/mycred-level-cred/)
|
188 |
- [myCred Social Proof](https://www.mycred.me/store/mycred-social-proof/)
|
189 |
+
- [myCred SMS Payments - Twilio Transfers](https://www.mycred.me/store/sms-payments/)
|
190 |
- [myCred Expiration Add on](https://www.mycred.me/store/mycred-expiration-add-on/)
|
191 |
- [myCred Social Share Add on](https://www.mycred.me/store/mycred-social-share-add-on/)
|
192 |
- [myCred Progress Bar Add on](https://www.mycred.me/store/mycred-progress-bar-add-on/)
|
210 |
|
211 |
= Support =
|
212 |
|
213 |
+
We offer support on our [myCred website](https://mycred.me/support/) from 9 AM - 5 PM, Monday to Friday (GMT+5).
|
214 |
|
215 |
+
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.
|
216 |
|
217 |
+
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.
|
218 |
|
219 |
== Installation ==
|
220 |
|
248 |
|
249 |
== Upgrade Notice ==
|
250 |
|
251 |
+
= 2.0 =
|
252 |
+
The banking module have been replaced by Central deposite module, and interest related functionality has been removed. If you are using simple interest or compound interest related functionality, you will fine the respective functionalities missing after the update.
|
253 |
+
|
254 |
= 1.8.0 =
|
255 |
Major release(Make sure to take backup before updating)
|
256 |
|
332 |
|
333 |
== Changelog ==
|
334 |
|
335 |
+
= 2.0 =
|
336 |
+
NEW - myCred CashCred
|
337 |
+
NEW - Added filter 'mycred_link_click_amount'
|
338 |
+
NEW - Added exclude attribute in myCred leaderboard
|
339 |
+
NEW - Added 'NOT LIKE' and '!=' operator for expiration addon
|
340 |
+
FIX - Php notices in rank addon
|
341 |
+
FIX - Rewards points option not visible for other product type in woocommerce
|
342 |
+
FIX - Erros in mycred_total_balance shortcode
|
343 |
+
FIX - myCred logs export issue
|
344 |
+
FIX - Fixed mycred admin dashboard overview widget showing incorrect or same amount of points
|
345 |
+
FIX - buyCred gift_to attribute not working
|
346 |
+
TWEAK - myCred Central Deposit
|
347 |
+
|
348 |
= 1.8.14.2 =
|
349 |
- **TWEAK** - Code optimization.
|
350 |
|
553 |
|
554 |
|
555 |
= Previous Versions =
|
556 |
+
https://mycred.me/support/changelog/
|