WooCommerce Direct Checkout - Version 2.6.6

Version Description

  • Fix: WooCommerce compatibility
Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WooCommerce Direct Checkout
Version 2.6.6
Comparing to
See all releases

Code changes from version 6.2.5 to 2.6.6

includes/install.php CHANGED
@@ -2,101 +2,100 @@
2
 
3
  class QLWCDC_Install {
4
 
5
- protected static $_instance;
6
-
7
- public function __construct() {
8
- register_activation_hook(QLWCDC_PLUGIN_FILE, array(__CLASS__, 'activation'));
9
- register_deactivation_hook(QLWCDC_PLUGIN_FILE, array(__CLASS__, 'deactivation'));
10
- self::import_old_settings();
11
- }
12
-
13
- public static function instance() {
14
- if (is_null(self::$_instance)) {
15
- self::$_instance = new self();
16
- }
17
- return self::$_instance;
18
- }
19
-
20
- public static function activation() {
21
- self::add_transient();
22
- self::add_settings();
23
- }
24
-
25
- public static function deactivation() {
26
-
27
- }
28
-
29
- private static function add_transient() {
30
- set_transient('qlwcdc-first-rating', true, MONTH_IN_SECONDS);
31
- }
32
-
33
- private static function add_settings() {
34
- if ('yes' === get_option('woocommerce_cart_redirect_after_add')) {
35
- add_option('qlwcdc_add_to_cart', 'redirect');
36
- add_option('qlwcdc_add_to_cart_redirect_page', 'cart');
37
- }
38
- }
39
-
40
- public static function import_old_settings() {
41
-
42
- global $wpdb;
43
-
44
- if (!get_option('qlwcdc_wcd_imported2')) {
45
-
46
- if (get_option('direct_checkout_pro_enabled', get_option('direct_checkout_enabled'))) {
47
-
48
- $url = get_option('direct_checkout_pro_cart_redirect_url', get_option('direct_checkout_cart_redirect_url'));
49
-
50
- if ($url === wc_get_cart_url()) {
51
- $val = 'cart';
52
- } elseif (filter_var($url, FILTER_VALIDATE_URL) !== false && $url != wc_get_checkout_url()) {
53
- $val = 'url';
54
- } else {
55
- $val = 'checkout';
56
- }
57
-
58
- /* add_option('qlwcdc_add_product_cart', 'redirect');
59
- add_option('qlwcdc_add_product_cart_redirect_page', $val);
60
- add_option('qlwcdc_add_product_cart_redirect_url', $url);
61
-
62
- add_option('qlwcdc_add_archive_cart', 'redirect');
63
- add_option('qlwcdc_add_archive_cart_redirect_page', $val);
64
- add_option('qlwcdc_add_archive_cart_redirect_url', $url); */
65
-
66
- add_option('qlwcdc_add_to_cart', 'redirect');
67
- add_option('qlwcdc_add_to_cart_redirect_page', $val);
68
- add_option('qlwcdc_add_to_cart_redirect_url', $url);
69
- }
70
-
71
- if ($text = get_option('direct_checkout_cart_button_text', get_option('direct_checkout_cart_button_text'))) {
72
- add_option('qlwcdc_add_product_text', 'yes');
73
- add_option('qlwcdc_add_product_text_content', $text);
74
- add_option('qlwcdc_add_archive_text', 'yes');
75
- add_option('qlwcdc_add_archive_text_content', $text);
76
- add_option('qlwcdc_add_archive_text_in', array(
77
- 'simple',
78
- 'grouped',
79
- 'virtual',
80
- 'variable',
81
- 'downloadable'
82
- ));
83
- }
84
-
85
- if (count($keys = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s", '_direct_checkout_pro_enabled')))) {
86
- foreach ($keys as $key) {
87
- if ($key->meta_value == 'yes') {
88
- if ($text = get_post_meta($key->post_id, '_direct_checkout_pro_cart_button_text', true)) {
89
- add_post_meta($key->post_id, 'qlwcdc_add_product_text', 'yes', true);
90
- add_post_meta($key->post_id, 'qlwcdc_add_product_text_content', $text, true);
91
- }
92
- }
93
- }
94
- }
95
-
96
- delete_option('qlwcdc_wcd_imported');
97
- update_option('qlwcdc_wcd_imported2', true);
98
- }
99
- }
100
 
101
  }
102
 
2
 
3
  class QLWCDC_Install {
4
 
5
+ protected static $_instance;
6
+
7
+ public function __construct() {
8
+ register_activation_hook( QLWCDC_PLUGIN_FILE, array( __CLASS__, 'activation' ) );
9
+ register_deactivation_hook( QLWCDC_PLUGIN_FILE, array( __CLASS__, 'deactivation' ) );
10
+ self::import_old_settings();
11
+ }
12
+
13
+ public static function instance() {
14
+ if ( is_null( self::$_instance ) ) {
15
+ self::$_instance = new self();
16
+ }
17
+ return self::$_instance;
18
+ }
19
+
20
+ public static function activation() {
21
+ self::add_settings();
22
+ }
23
+
24
+ public static function deactivation() {
25
+
26
+ }
27
+
28
+ private static function add_settings() {
29
+ if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) {
30
+ add_option( 'qlwcdc_add_to_cart', 'redirect' );
31
+ add_option( 'qlwcdc_add_to_cart_redirect_page', 'cart' );
32
+ }
33
+ }
34
+
35
+ public static function import_old_settings() {
36
+
37
+ global $wpdb;
38
+
39
+ if ( ! get_option( 'qlwcdc_wcd_imported2' ) ) {
40
+
41
+ if ( get_option( 'direct_checkout_pro_enabled', get_option( 'direct_checkout_enabled' ) ) ) {
42
+
43
+ $url = get_option( 'direct_checkout_pro_cart_redirect_url', get_option( 'direct_checkout_cart_redirect_url' ) );
44
+
45
+ if ( $url === wc_get_cart_url() ) {
46
+ $val = 'cart';
47
+ } elseif ( filter_var( $url, FILTER_VALIDATE_URL ) !== false && $url != wc_get_checkout_url() ) {
48
+ $val = 'url';
49
+ } else {
50
+ $val = 'checkout';
51
+ }
52
+
53
+ /*
54
+ add_option('qlwcdc_add_product_cart', 'redirect');
55
+ add_option('qlwcdc_add_product_cart_redirect_page', $val);
56
+ add_option('qlwcdc_add_product_cart_redirect_url', $url);
57
+
58
+ add_option('qlwcdc_add_archive_cart', 'redirect');
59
+ add_option('qlwcdc_add_archive_cart_redirect_page', $val);
60
+ add_option('qlwcdc_add_archive_cart_redirect_url', $url); */
61
+
62
+ add_option( 'qlwcdc_add_to_cart', 'redirect' );
63
+ add_option( 'qlwcdc_add_to_cart_redirect_page', $val );
64
+ add_option( 'qlwcdc_add_to_cart_redirect_url', $url );
65
+ }
66
+
67
+ if ( $text = get_option( 'direct_checkout_cart_button_text', get_option( 'direct_checkout_cart_button_text' ) ) ) {
68
+ add_option( 'qlwcdc_add_product_text', 'yes' );
69
+ add_option( 'qlwcdc_add_product_text_content', $text );
70
+ add_option( 'qlwcdc_add_archive_text', 'yes' );
71
+ add_option( 'qlwcdc_add_archive_text_content', $text );
72
+ add_option(
73
+ 'qlwcdc_add_archive_text_in',
74
+ array(
75
+ 'simple',
76
+ 'grouped',
77
+ 'virtual',
78
+ 'variable',
79
+ 'downloadable',
80
+ )
81
+ );
82
+ }
83
+
84
+ if ( count( $keys = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s", '_direct_checkout_pro_enabled' ) ) ) ) {
85
+ foreach ( $keys as $key ) {
86
+ if ( $key->meta_value == 'yes' ) {
87
+ if ( $text = get_post_meta( $key->post_id, '_direct_checkout_pro_cart_button_text', true ) ) {
88
+ add_post_meta( $key->post_id, 'qlwcdc_add_product_text', 'yes', true );
89
+ add_post_meta( $key->post_id, 'qlwcdc_add_product_text_content', $text, true );
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ delete_option( 'qlwcdc_wcd_imported' );
96
+ update_option( 'qlwcdc_wcd_imported2', true );
97
+ }
98
+ }
 
99
 
100
  }
101
 
includes/qlwcdc.php CHANGED
@@ -1,68 +1,59 @@
1
  <?php
2
 
3
- class QLWCDC
4
- {
5
 
6
- protected static $instance;
7
 
8
- public function __construct()
9
- {
10
 
11
- include_once(QLWCDC_PLUGIN_DIR . '/includes/install.php');
12
- include_once(QLWCDC_PLUGIN_DIR . '/includes/notices.php');
13
 
14
- add_action('plugins_loaded', array($this, 'includes'));
15
 
16
- load_plugin_textdomain('woocommerce-direct-checkout', false, QLWCDC_PLUGIN_DIR . '/languages/');
17
- }
18
 
19
- public static function instance()
20
- {
21
- if (!isset(self::$instance)) {
22
- self::$instance = new self();
23
- }
24
- return self::$instance;
25
- }
26
 
27
- public function includes()
28
- {
29
- include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/backend.php');
30
- include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/general.php');
31
- include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/archives.php');
32
- include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/products.php');
33
- include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/checkout.php');
34
- include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/premium.php');
35
- include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/suggestions.php');
36
- }
37
 
38
- public function register_scripts()
39
- {
40
- wp_register_script('qlwcdc-admin', plugins_url('/assets/backend/qlwcdc-admin' . QLWCDC::instance()->is_min() . '.js', QLWCDC_PLUGIN_FILE), array('jquery'), QLWCDC_PLUGIN_VERSION, true);
41
- }
42
 
43
- public function is_min()
44
- {
45
- if (!defined('SCRIPT_DEBUG') || !SCRIPT_DEBUG) {
46
- return '.min';
47
- }
48
- }
49
 
50
- public function get_product_option($product_id = null, $meta_key = null, $default = null)
51
- {
 
 
52
 
53
- if (!$meta_key) {
54
- return null;
55
- }
56
 
57
- if ($product_id && metadata_exists('post', $product_id, $meta_key)) {
 
 
 
58
 
59
- if ($value = get_post_meta($product_id, $meta_key, true)) {
60
- return $value;
61
- }
62
- }
63
-
64
- return get_option($meta_key, $default);
65
- }
66
  }
67
 
68
  QLWCDC::instance();
1
  <?php
2
 
3
+ class QLWCDC {
 
4
 
 
5
 
6
+ protected static $instance;
 
7
 
8
+ public function __construct() {
9
+ include_once QLWCDC_PLUGIN_DIR . '/includes/install.php';
10
 
11
+ add_action( 'plugins_loaded', array( $this, 'includes' ) );
12
 
13
+ load_plugin_textdomain( 'woocommerce-direct-checkout', false, QLWCDC_PLUGIN_DIR . '/languages/' );
14
+ }
15
 
16
+ public static function instance() {
17
+ if ( ! isset( self::$instance ) ) {
18
+ self::$instance = new self();
19
+ }
20
+ return self::$instance;
21
+ }
 
22
 
23
+ public function includes() {
24
+ include_once QLWCDC_PLUGIN_DIR . 'includes/controller/backend.php';
25
+ include_once QLWCDC_PLUGIN_DIR . 'includes/controller/general.php';
26
+ include_once QLWCDC_PLUGIN_DIR . 'includes/controller/archives.php';
27
+ include_once QLWCDC_PLUGIN_DIR . 'includes/controller/products.php';
28
+ include_once QLWCDC_PLUGIN_DIR . 'includes/controller/checkout.php';
29
+ include_once QLWCDC_PLUGIN_DIR . 'includes/controller/premium.php';
30
+ include_once QLWCDC_PLUGIN_DIR . 'includes/controller/suggestions.php';
31
+ }
 
32
 
33
+ public function register_scripts() {
34
+ wp_register_script( 'qlwcdc-admin', plugins_url( '/assets/backend/qlwcdc-admin' . self::instance()->is_min() . '.js', QLWCDC_PLUGIN_FILE ), array( 'jquery' ), QLWCDC_PLUGIN_VERSION, true );
35
+ }
 
36
 
37
+ public function is_min() {
38
+ if ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) {
39
+ return '.min';
40
+ }
41
+ }
 
42
 
43
+ public function get_product_option( $product_id = null, $meta_key = null, $default = null ) {
44
+ if ( ! $meta_key ) {
45
+ return null;
46
+ }
47
 
48
+ if ( $product_id && metadata_exists( 'post', $product_id, $meta_key ) ) {
 
 
49
 
50
+ if ( $value = get_post_meta( $product_id, $meta_key, true ) ) {
51
+ return $value;
52
+ }
53
+ }
54
 
55
+ return get_option( $meta_key, $default );
56
+ }
 
 
 
 
 
57
  }
58
 
59
  QLWCDC::instance();
includes/quadlayers/links.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLWCDC_Admin_Links {
4
+
5
+ protected static $_instance;
6
+
7
+ function __construct() {
8
+ add_filter( 'plugin_action_links_' . QLWCDC_PLUGIN_BASENAME, array( $this, 'add_action_links' ) );
9
+ }
10
+
11
+ public function add_action_links( $links ) {
12
+ $links[] = '<a target="_blank" href="' . QLWCDC_DEMO_URL . '">' . esc_html__( 'Documentation', 'woocommerce-direct-checkout' ) . '</a>';
13
+ $links[] = '<a target="_blank" href="' . QLWCDC_SUPPORT_URL . '">' . esc_html__( 'Support', 'woocommerce-direct-checkout' ) . '</a>';
14
+ return $links;
15
+ }
16
+
17
+ public static function instance() {
18
+ if ( is_null( self::$_instance ) ) {
19
+ self::$_instance = new self();
20
+ }
21
+ return self::$_instance;
22
+ }
23
+
24
+ }
25
+
26
+ QLWCDC_Admin_Links::instance();
includes/quadlayers/notices.php ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLWCDC_Notices {
4
+
5
+ protected static $_instance;
6
+
7
+ public function __construct() {
8
+ add_action( 'wp_ajax_wooccm_dismiss_notice', array( $this, 'ajax_dismiss_notice' ) );
9
+ add_action( 'admin_notices', array( $this, 'add_notices' ) );
10
+ register_activation_hook( QLWCDC_PLUGIN_FILE, array( $this, 'add_transient' ) );
11
+ }
12
+
13
+ function ajax_dismiss_notice() {
14
+ if ( check_admin_referer( 'wooccm_dismiss_notice', 'nonce' ) && isset( $_REQUEST['notice_id'] ) ) {
15
+
16
+ $notice_id = sanitize_key( $_REQUEST['notice_id'] );
17
+
18
+ update_user_meta( get_current_user_id(), $notice_id, true );
19
+ set_transient( 'wooccm-notice-delay', true, MONTH_IN_SECONDS );
20
+
21
+ wp_send_json( $notice_id );
22
+ }
23
+
24
+ wp_die();
25
+ }
26
+
27
+ function add_transient() {
28
+ set_transient( 'wooccm-notice-delay', true, MONTH_IN_SECONDS );
29
+ }
30
+
31
+ function add_notices() {
32
+
33
+ $transient = get_transient( 'wooccm-notice-delay' );
34
+
35
+ if ( $transient ) {
36
+ return;
37
+ }
38
+
39
+ ?>
40
+ <script>
41
+ (function($) {
42
+ $(document).ready(()=> {
43
+ $('.wooccm-notice').on('click', '.notice-dismiss', function(e) {
44
+ e.preventDefault();
45
+ var notice_id = $(e.delegateTarget).data('notice_id');
46
+ $.ajax({
47
+ type: 'POST',
48
+ url: ajaxurl,
49
+ data: {
50
+ notice_id: notice_id,
51
+ action: 'wooccm_dismiss_notice',
52
+ nonce: '<?php echo esc_attr( wp_create_nonce( 'wooccm_dismiss_notice' ) ); ?>'
53
+ },
54
+ success: function(response) {
55
+ console.log(response);
56
+ },
57
+ });
58
+ });
59
+ })
60
+ })(jQuery);
61
+ </script>
62
+ <?php
63
+
64
+ $plugin_slug = QLWCDC_PREMIUM_SELL_SLUG;
65
+
66
+ $user_rating = ! get_user_meta( get_current_user_id(), 'wooccm-user-rating', true );
67
+ $user_premium = ! get_user_meta( get_current_user_id(), 'wooccm-user-premium', true ) && ! $this->is_installed( "{$plugin_slug}/{$plugin_slug}.php" );
68
+ $user_cross_sell = ! get_user_meta( get_current_user_id(), 'wooccm-user-cross-sell', true );
69
+
70
+ if ( $user_rating ) {
71
+ ?>
72
+ <div id="wooccm-admin-rating" class="wooccm-notice notice notice-info is-dismissible" data-notice_id="wooccm-user-rating">
73
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
74
+ <div class="notice-image">
75
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url( '/assets/backend/img/logo.jpg', QLWCDC_PLUGIN_FILE ); ?>" alt="<?php echo esc_html( QLWCDC_PLUGIN_NAME ); ?>>">
76
+ </div>
77
+ <div class="notice-content" style="margin-left: 15px;">
78
+ <p>
79
+ <?php printf( esc_html__( 'Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout' ), QLWCDC_PLUGIN_NAME ); ?>
80
+ <br/>
81
+ <?php esc_html_e( 'Could you please give it a 5-star rating on WordPress?. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'woocommerce-direct-checkout' ); ?>
82
+ </p>
83
+ <a href="<?php echo esc_url( QLWCDC_REVIEW_URL ); ?>" class="button-primary" target="_blank">
84
+ <?php esc_html_e( 'Yes, of course!', 'woocommerce-direct-checkout' ); ?>
85
+ </a>
86
+ <a href="<?php echo esc_url( QLWCDC_SUPPORT_URL ); ?>" class="button-secondary" target="_blank">
87
+ <?php esc_html_e( 'Report a bug', 'woocommerce-direct-checkout' ); ?>
88
+ </a>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ <?php
93
+ return;
94
+ }
95
+
96
+ if ( ! $user_rating && $user_premium ) {
97
+ ?>
98
+ <div class="wooccm-notice notice notice-info is-dismissible" data-notice_id="wooccm-user-premium">
99
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
100
+ <div class="notice-image">
101
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo esc_url( plugins_url( '/assets/backend/img/logo.jpg', QLWCDC_PLUGIN_FILE ) ); ?>" alt="<?php echo esc_html( QLWCDC_PLUGIN_NAME ); ?>>">
102
+ </div>
103
+ <div class="notice-content" style="margin-left: 15px;">
104
+ <p>
105
+ <?php esc_html_e( 'Hello! We have a special gift!', 'woocommerce-direct-checkout' ); ?>
106
+ <br />
107
+ <?php
108
+ printf(
109
+ esc_html__( 'Today we want to make you a special gift. Using this coupon before the next 48 hours you can get a 20 percent discount on the premium version of the %s plugin.', 'woocommerce-direct-checkout' ),
110
+ esc_html( QLWCDC_PREMIUM_SELL_NAME )
111
+ )
112
+ ?>
113
+ </p>
114
+ <a href="<?php echo esc_url( QLWCDC_PREMIUM_SELL_URL ); ?>" class="button-primary" target="_blank">
115
+ <?php esc_html_e( 'More info', 'woocommerce-direct-checkout' ); ?>
116
+ </a>
117
+ <input style="width:130px" type="text" value="ADMINPANEL20%"/>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ <?php
122
+ return;
123
+ }
124
+
125
+ if ( ! $user_rating && ! $user_premium && $user_cross_sell ) {
126
+
127
+ $cross_sell = $this->get_cross_sell();
128
+
129
+ if ( empty( $cross_sell ) ) {
130
+ return;
131
+ }
132
+
133
+ list($action, $action_link) = $cross_sell;
134
+
135
+ ?>
136
+ <div class="wooccm-notice notice notice-info is-dismissible" data-notice_id="wooccm-user-cross-sell">
137
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
138
+ <div class="notice-image">
139
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url( '/assets/backend/img/logo.jpg', QLWCDC_PLUGIN_FILE ); ?>" alt="<?php echo esc_html( QLWCDC_PLUGIN_NAME ); ?>>">
140
+ </div>
141
+ <div class="notice-content" style="margin-left: 15px;">
142
+ <p>
143
+ <?php printf( esc_html__( 'Hello! We want to invite you to try our %s plugin!', 'woocommerce-direct-checkout' ), esc_html( QLWCDC_CROSS_INSTALL_NAME ) ); ?>
144
+ <br/>
145
+ <?php echo esc_html( QLWCDC_CROSS_INSTALL_DESCRIPTION ); ?>
146
+ </p>
147
+ <a href="<?php echo esc_url( $action_link ); ?>" class="button-primary">
148
+ <?php echo esc_html( $action ); ?>
149
+ </a>
150
+ <a href="<?php echo esc_url( QLWCDC_CROSS_INSTALL_URL ); ?>" class="button-secondary" target="_blank">
151
+ <?php esc_html_e( 'More info', 'woocommerce-direct-checkout' ); ?>
152
+ </a>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ <?php
157
+ return;
158
+ }
159
+
160
+ }
161
+
162
+ function get_cross_sell() {
163
+
164
+ $screen = get_current_screen();
165
+
166
+ if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
167
+ return array();
168
+ }
169
+
170
+ $plugin_slug = QLWCDC_CROSS_INSTALL_SLUG;
171
+
172
+ $plugin_file = "{$plugin_slug}/{$plugin_slug}.php";
173
+
174
+ if ( is_plugin_active( $plugin_file ) ) {
175
+ return array();
176
+ }
177
+
178
+ if ( $this->is_installed( $plugin_file ) ) {
179
+
180
+ if ( ! current_user_can( 'activate_plugins' ) ) {
181
+ return array();
182
+ }
183
+
184
+ return array(
185
+ esc_html__( 'Activate', 'woocommerce-direct-checkout' ),
186
+ wp_nonce_url( "plugins.php?action=activate&amp;plugin={$plugin_file}&amp;plugin_status=all&amp;paged=1", "activate-plugin_{$plugin_file}" ),
187
+ );
188
+
189
+ }
190
+
191
+ if ( ! current_user_can( 'install_plugins' ) ) {
192
+ return array();
193
+ }
194
+
195
+ return array(
196
+ esc_html__( 'Install', 'woocommerce-direct-checkout' ),
197
+ wp_nonce_url( self_admin_url( "update.php?action=install-plugin&plugin={$plugin_slug}" ), "install-plugin_{$plugin_slug}" ),
198
+ );
199
+
200
+ }
201
+
202
+ function is_installed( $path ) {
203
+
204
+ $installed_plugins = get_plugins();
205
+
206
+ return isset( $installed_plugins[ $path ] );
207
+ }
208
+
209
+ public static function instance() {
210
+ if ( is_null( self::$_instance ) ) {
211
+ self::$_instance = new self();
212
+ }
213
+ return self::$_instance;
214
+ }
215
+ }
216
+
217
+ QLWCDC_Notices::instance();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/portfolio/woocommerce-direct-checkout/
4
  Tags: woocommerce, woocommerce ajax, woocommerce ajax cart, add to cart, woocommerce direct checkout, woocommerce quick buy, woocommerce remove checkout fields, woocommerce ajax single products, woocommerce one page checkout
5
  Requires at least: 4.6
6
  Tested up to: 6.0.1
7
- Stable tag: 2.6.4
8
  WC requires at least: 3.1.0
9
  WC tested up to: 6.8
10
  License: GPLv3
@@ -64,6 +64,9 @@ The premium version of WooCommerce Direct Checkot allows to include a quick purc
64
 
65
  == Changelog ==
66
 
 
 
 
67
  = 2.6.5 =
68
  * Fix: WooCommerce compatibility
69
 
4
  Tags: woocommerce, woocommerce ajax, woocommerce ajax cart, add to cart, woocommerce direct checkout, woocommerce quick buy, woocommerce remove checkout fields, woocommerce ajax single products, woocommerce one page checkout
5
  Requires at least: 4.6
6
  Tested up to: 6.0.1
7
+ Stable tag: 2.6.6
8
  WC requires at least: 3.1.0
9
  WC tested up to: 6.8
10
  License: GPLv3
64
 
65
  == Changelog ==
66
 
67
+ = 2.6.6 =
68
+ * Fix: WooCommerce compatibility
69
+
70
  = 2.6.5 =
71
  * Fix: WooCommerce compatibility
72
 
woocommerce-direct-checkout.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Direct Checkout for WooCommerce
5
  * Plugin URI: https://quadlayers.com/documentation/woocommerce-direct-checkout/
6
  * Description: Simplifies the checkout process to improve your sales rate.
7
- * Version: 2.6.5
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -15,48 +15,35 @@
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  die( '-1' );
17
  }
18
- if ( ! defined( 'QLWCDC_PLUGIN_NAME' ) ) {
19
- define( 'QLWCDC_PLUGIN_NAME', 'Direct Checkout for WooCommerce' );
20
- }
21
- if ( ! defined( 'QLWCDC_PLUGIN_VERSION' ) ) {
22
- define( 'QLWCDC_PLUGIN_VERSION', '2.6.5' );
23
- }
24
- if ( ! defined( 'QLWCDC_PLUGIN_FILE' ) ) {
25
- define( 'QLWCDC_PLUGIN_FILE', __FILE__ );
26
- }
27
- if ( ! defined( 'QLWCDC_PLUGIN_DIR' ) ) {
28
- define( 'QLWCDC_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
29
- }
30
- if ( ! defined( 'QLWCDC_PREFIX' ) ) {
31
- define( 'QLWCDC_PREFIX', 'qlwcdc' );
32
- }
33
- if ( ! defined( 'QLWCDC_DOMAIN' ) ) {
34
- define( 'QLWCDC_DOMAIN', QLWCDC_PREFIX );
35
- }
36
- if ( ! defined( 'QLWCDC_WORDPRESS_URL' ) ) {
37
- define( 'QLWCDC_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-direct-checkout/' );
38
- }
39
- if ( ! defined( 'QLWCDC_REVIEW_URL' ) ) {
40
- define( 'QLWCDC_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-direct-checkout/reviews/?filter=5#new-post' );
41
- }
42
- if ( ! defined( 'QLWCDC_DEMO_URL' ) ) {
43
- define( 'QLWCDC_DEMO_URL', 'https://quadlayers.com/woocommerce-direct?utm_source=qlwcdc_admin' );
44
- }
45
- if ( ! defined( 'QLWCDC_DOCUMENTATION_URL' ) ) {
46
- define( 'QLWCDC_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/woocommerce-direct-checkout/?utm_source=qlwcdc_admin' );
47
- }
48
- if ( ! defined( 'QLWCDC_PURCHASE_URL' ) ) {
49
- define( 'QLWCDC_PURCHASE_URL', 'https://quadlayers.com/portfolio/woocommerce-direct-checkout/?utm_source=qlwcdc_admin' );
50
- }
51
- if ( ! defined( 'QLWCDC_SUPPORT_URL' ) ) {
52
- define( 'QLWCDC_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qlwcdc_admin' );
53
- }
54
- if ( ! defined( 'QLWCDC_GROUP_URL' ) ) {
55
- define( 'QLWCDC_GROUP_URL', 'https://www.facebook.com/groups/quadlayers' );
56
- }
57
 
58
  if ( ! class_exists( 'QLWCDC' ) ) {
59
  include_once QLWCDC_PLUGIN_DIR . 'includes/qlwcdc.php';
60
  }
61
 
62
  require_once QLWCDC_PLUGIN_DIR . 'includes/quadlayers/widget.php';
 
 
4
  * Plugin Name: Direct Checkout for WooCommerce
5
  * Plugin URI: https://quadlayers.com/documentation/woocommerce-direct-checkout/
6
  * Description: Simplifies the checkout process to improve your sales rate.
7
+ * Version: 2.6.6
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  die( '-1' );
17
  }
18
+
19
+ define( 'QLWCDC_PLUGIN_NAME', 'Direct Checkout for WooCommerce' );
20
+ define( 'QLWCDC_PLUGIN_VERSION', '2.6.6' );
21
+ define( 'QLWCDC_PLUGIN_FILE', __FILE__ );
22
+ define( 'QLWCDC_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
23
+ define( 'QLWCDC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
24
+ define( 'QLWCDC_PREFIX', 'qlwcdc' );
25
+ define( 'QLWCDC_DOMAIN', QLWCDC_PREFIX );
26
+ define( 'QLWCDC_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-direct-checkout/' );
27
+ define( 'QLWCDC_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-direct-checkout/reviews/?filter=5#new-post' );
28
+ define( 'QLWCDC_DEMO_URL', 'https://quadlayers.com/woocommerce-direct?utm_source=qlwcdc_admin' );
29
+ define( 'QLWCDC_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/woocommerce-direct-checkout/?utm_source=qlwcdc_admin' );
30
+ define( 'QLWCDC_PURCHASE_URL', 'https://quadlayers.com/portfolio/woocommerce-direct-checkout/?utm_source=qlwcdc_admin' );
31
+ define( 'QLWCDC_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qlwcdc_admin' );
32
+ define( 'QLWCDC_GROUP_URL', 'https://www.facebook.com/groups/quadlayers' );
33
+
34
+ define( 'QLWCDC_PREMIUM_SELL_SLUG', 'woocommerce-direct-checkout-pro' );
35
+ define( 'QLWCDC_PREMIUM_SELL_NAME', 'WooCommerce Direct Checkout' );
36
+ define( 'QLWCDC_PREMIUM_SELL_URL', 'https://quadlayers.com/portfolio/woocommerce-direct-checkout/?utm_source=qlwcdc_admin' );
37
+
38
+ define( 'QLWCDC_CROSS_INSTALL_SLUG', 'woocommerce-checkout-manager' );
39
+ define( 'QLWCDC_CROSS_INSTALL_NAME', 'Checkout Manager' );
40
+ define( 'QLWCDC_CROSS_INSTALL_DESCRIPTION', esc_html__( 'Checkout Field Manager( Checkout Manager ) for WooCommerce allows you to add custom fields to the checkout page, related to billing, Shipping or Additional fields sections.', 'woocommerce-direct-checkout' ) );
41
+ define( 'QLWCDC_CROSS_INSTALL_URL', 'https:// quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=qlwcdc_admin' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  if ( ! class_exists( 'QLWCDC' ) ) {
44
  include_once QLWCDC_PLUGIN_DIR . 'includes/qlwcdc.php';
45
  }
46
 
47
  require_once QLWCDC_PLUGIN_DIR . 'includes/quadlayers/widget.php';
48
+ require_once QLWCDC_PLUGIN_DIR . 'includes/quadlayers/notices.php';
49
+ require_once QLWCDC_PLUGIN_DIR . 'includes/quadlayers/links.php';