WooCommerce Direct Checkout - Version 6.2.5

Version Description

Download this release

Release Info

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

Code changes from version 2.6.4 to 6.2.5

includes/notices.php CHANGED
@@ -2,90 +2,173 @@
2
 
3
  class QLWCDC_Notices {
4
 
5
- protected static $_instance;
6
-
7
- public function __construct() {
8
- add_action('wp_ajax_qlwcdc_dismiss_notice', array($this, 'ajax_dismiss_notice'));
9
- add_action('admin_notices', array($this, 'add_notices'));
10
- add_filter('plugin_action_links_' . plugin_basename(QLWCDC_PLUGIN_FILE), array($this, 'add_action_links'));
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 function ajax_dismiss_notice() {
21
-
22
- if (check_admin_referer('qlwcdc_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
23
-
24
- $notice_id = sanitize_key($_REQUEST['notice_id']);
25
-
26
- update_user_meta(get_current_user_id(), $notice_id, true);
27
-
28
- wp_send_json($notice_id);
29
- }
30
-
31
- wp_die();
32
- }
33
-
34
- public function add_notices() {
35
-
36
- if (!get_transient('qlwcdc-first-rating') && !get_user_meta(get_current_user_id(), 'qlwcdc-user-rating', true)) {
37
- ?>
38
- <div id="qlwcdc-admin-rating" class="qlwcdc-notice notice is-dismissible" data-notice_id="qlwcdc-user-rating">
39
- <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
40
- <div class="notice-image">
41
- <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); ?>>">
42
- </div>
43
- <div class="notice-content" style="margin-left: 15px;">
44
- <p>
45
- <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout'), QLWCDC_PLUGIN_NAME); ?>
46
- <br/>
47
- <?php esc_html_e('Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'woocommerce-direct-checkout'); ?>
48
- </p>
49
- <a href="<?php echo esc_url(QLWCDC_REVIEW_URL); ?>" class="button-primary" target="_blank">
50
- <?php esc_html_e('Yes, of course!', 'woocommerce-direct-checkout'); ?>
51
- </a>
52
- <a href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
53
- <?php esc_html_e('Report a bug', 'woocommerce-direct-checkout'); ?>
54
- </a>
55
- </div>
56
- </div>
57
- </div>
58
- <script>
59
- (function ($) {
60
- $('.qlwcdc-notice').on('click', '.notice-dismiss', function (e) {
61
- e.preventDefault();
62
- var notice_id = $(e.delegateTarget).data('notice_id');
63
- $.ajax({
64
- type: 'POST',
65
- url: ajaxurl,
66
- data: {
67
- notice_id: notice_id,
68
- action: 'qlwcdc_dismiss_notice',
69
- nonce: '<?php echo wp_create_nonce('qlwcdc_dismiss_notice'); ?>'
70
- },
71
- success: function (response) {
72
- console.log(response);
73
- },
74
- });
75
- });
76
- })(jQuery);
77
- </script>
78
- <?php
79
- }
80
- }
81
-
82
- public function add_action_links($links) {
83
-
84
- $links[] = '<a target="_blank" href="' . QLWCDC_PURCHASE_URL . '">' . esc_html__('Premium', 'woocommerce-direct-checkout') . '</a>';
85
- $links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(QLWCDC_PREFIX)) . '">' . esc_html__('Settings', 'woocommerce-direct-checkout') . '</a>';
86
-
87
- return $links;
88
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  }
91
 
2
 
3
  class QLWCDC_Notices {
4
 
5
+ protected static $_instance;
6
+
7
+ public function __construct() {
8
+ add_action( 'wp_ajax_qlwcdc_dismiss_notice', array( $this, 'ajax_dismiss_notice' ) );
9
+ add_action( 'admin_notices', array( $this, 'add_notices' ) );
10
+ add_filter( 'plugin_action_links_' . plugin_basename( QLWCDC_PLUGIN_FILE ), array( $this, 'add_action_links' ) );
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 function ajax_dismiss_notice() {
21
+
22
+ if ( check_admin_referer( 'qlwcdc_dismiss_notice', 'nonce' ) && isset( $_REQUEST['notice_id'] ) ) {
23
+
24
+ $notice_id = sanitize_key( $_REQUEST['notice_id'] );
25
+
26
+ update_user_meta( get_current_user_id(), $notice_id, true );
27
+
28
+ wp_send_json( $notice_id );
29
+ }
30
+
31
+ wp_die();
32
+ }
33
+
34
+ public function add_notices() {
35
+
36
+ if ( ! get_transient( 'qlwcdc-first-rating' ) && ! get_user_meta( get_current_user_id(), 'qlwcdc-user-rating', true ) ) {
37
+ ?>
38
+ <div id="qlwcdc-admin-rating" class="qlwcdc-notice notice is-dismissible" data-notice_id="qlwcdc-user-rating">
39
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
40
+ <div class="notice-image">
41
+ <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 ); ?>>">
42
+ </div>
43
+ <div class="notice-content" style="margin-left: 15px;">
44
+ <p>
45
+ <?php printf( esc_html__( 'Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout' ), QLWCDC_PLUGIN_NAME ); ?>
46
+ <br/>
47
+ <?php esc_html_e( 'Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'woocommerce-direct-checkout' ); ?>
48
+ </p>
49
+ <a href="<?php echo esc_url( QLWCDC_REVIEW_URL ); ?>" class="button-primary" target="_blank">
50
+ <?php esc_html_e( 'Yes, of course!', 'woocommerce-direct-checkout' ); ?>
51
+ </a>
52
+ <a href="<?php echo esc_url( QLWCDC_SUPPORT_URL ); ?>" class="button-secondary" target="_blank">
53
+ <?php esc_html_e( 'Report a bug', 'woocommerce-direct-checkout' ); ?>
54
+ </a>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <?php
59
+ }
60
+
61
+ if ( get_user_meta( get_current_user_id(), 'qlwcdc-user-rating', true ) && ! get_user_meta( get_current_user_id(), 'qlwcdc-user-cross-sell', true ) ) {
62
+
63
+ $cross_sell = $this->get_cross_sell();
64
+
65
+ if ( empty( $cross_sell ) ) {
66
+ return;
67
+ }
68
+
69
+ list($title, $link) = $cross_sell;
70
+
71
+ ?>
72
+ <div id="qlwcdc-admin-rating" class="qlwcdc-notice notice notice-info is-dismissible" data-notice_id="qlwcdc-user-cross-sell">
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! We want to invite you to try our Checkout Manager plugin!', 'woocommerce-direct-checkout' ), QLWCDC_PLUGIN_NAME ); ?>
80
+ <br/>
81
+ <?php esc_html_e( 'Checkout Field Manager (Checkout Manager) for WooCommerce allows you to include custom fields to the checkout page, related to billing, Shipping or Additional fields sections.', 'woocommerce-direct-checkout' ); ?>
82
+ </p>
83
+ <a href="<?php echo esc_url( $link ); ?>" class="button-primary">
84
+ <?php echo esc_html( $title ); ?>
85
+ </a>
86
+ <a href="https://quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=qlwcdc_admin" class="button-secondary" target="_blank">
87
+ <?php esc_html_e( 'More info', 'woocommerce-direct-checkout' ); ?>
88
+ </a>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ <?php
93
+ }
94
+ ?>
95
+ <script>
96
+ (function ($) {
97
+ $('.qlwcdc-notice').on('click', '.notice-dismiss', function (e) {
98
+ e.preventDefault();
99
+ var notice_id = $(e.delegateTarget).data('notice_id');
100
+ $.ajax({
101
+ type: 'POST',
102
+ url: ajaxurl,
103
+ data: {
104
+ notice_id: notice_id,
105
+ action: 'qlwcdc_dismiss_notice',
106
+ nonce: '<?php echo wp_create_nonce( 'qlwcdc_dismiss_notice' ); ?>'
107
+ },
108
+ success: function (response) {
109
+ console.log(response);
110
+ },
111
+ });
112
+ });
113
+ })(jQuery);
114
+ </script>
115
+ <?php
116
+ }
117
+
118
+ function get_cross_sell() {
119
+
120
+ $screen = get_current_screen();
121
+
122
+ if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
123
+ return array();
124
+ }
125
+
126
+ $plugin_slug = 'woocommerce-checkout-manager';
127
+
128
+ $plugin_file = "{$plugin_slug}/{$plugin_slug}.php";
129
+
130
+ if ( is_plugin_active( $plugin_file ) ) {
131
+ return array();
132
+ }
133
+
134
+ if ( $this->is_installed( $plugin_file ) ) {
135
+
136
+ if ( ! current_user_can( 'activate_plugins' ) ) {
137
+ return array();
138
+ }
139
+
140
+ return array(
141
+ esc_html__( 'Activate', 'woocommerce-direct-checkout' ),
142
+ wp_nonce_url( "plugins.php?action=activate&amp;plugin={$plugin_file}&amp;plugin_status=all&amp;paged=1", "activate-plugin_{$plugin_file}" ),
143
+ );
144
+
145
+ }
146
+
147
+ if ( ! current_user_can( 'install_plugins' ) ) {
148
+ return array();
149
+ }
150
+
151
+ return array(
152
+ esc_html__( 'Install', 'woocommerce-direct-checkout' ),
153
+ wp_nonce_url( self_admin_url( "update.php?action=install-plugin&plugin={$plugin_slug}" ), "install-plugin_{$plugin_slug}" ),
154
+ );
155
+
156
+ }
157
+
158
+ function is_installed( $path ) {
159
+
160
+ $installed_plugins = get_plugins();
161
+
162
+ return isset( $installed_plugins[ $path ] );
163
+ }
164
+
165
+ public function add_action_links( $links ) {
166
+
167
+ $links[] = '<a target="_blank" href="' . QLWCDC_PURCHASE_URL . '">' . esc_html__( 'Premium', 'woocommerce-direct-checkout' ) . '</a>';
168
+ $links[] = '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=' . sanitize_title( QLWCDC_PREFIX ) ) . '">' . esc_html__( 'Settings', 'woocommerce-direct-checkout' ) . '</a>';
169
+
170
+ return $links;
171
+ }
172
 
173
  }
174
 
readme.txt CHANGED
@@ -64,6 +64,9 @@ The premium version of WooCommerce Direct Checkot allows to include a quick purc
64
 
65
  == Changelog ==
66
 
 
 
 
67
  = 2.6.4 =
68
  * Fix: WooCommerce compatibility
69
 
64
 
65
  == Changelog ==
66
 
67
+ = 2.6.5 =
68
+ * Fix: WooCommerce compatibility
69
+
70
  = 2.6.4 =
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.4
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -19,7 +19,7 @@ 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.3' );
23
  }
24
  if ( ! defined( 'QLWCDC_PLUGIN_FILE' ) ) {
25
  define( 'QLWCDC_PLUGIN_FILE', __FILE__ );
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
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__ );