Abandoned Cart Lite for WooCommerce - Version 4.5

Version Description

Download this release

Release Info

Developer ashokrane
Plugin Icon 128x128 Abandoned Cart Lite for WooCommerce
Version 4.5
Comparing to
See all releases

Code changes from version 4.4 to 4.5

Files changed (56) hide show
  1. includes/wcal-common.php +0 -46
  2. {assets → woocommerce-abandoned-cart/assets}/css/view.abandoned.orders.style.css +0 -0
  3. {assets → woocommerce-abandoned-cart/assets}/css/wcal_template_activate.css +0 -0
  4. woocommerce-abandoned-cart/assets/images/abandon-cart-cut-off-time.png +0 -0
  5. woocommerce-abandoned-cart/assets/images/abandoned-cart-lite-email-templates.png +0 -0
  6. {assets → woocommerce-abandoned-cart/assets}/images/abandoned_cart_small.png +0 -0
  7. {assets → woocommerce-abandoned-cart/assets}/images/ac_editor_icon.png +0 -0
  8. {assets → woocommerce-abandoned-cart/assets}/images/ac_tab_icon.png +0 -0
  9. {assets → woocommerce-abandoned-cart/assets}/images/check.jpg +0 -0
  10. {assets → woocommerce-abandoned-cart/assets}/images/copy.png +0 -0
  11. {assets → woocommerce-abandoned-cart/assets}/images/delete.png +0 -0
  12. {assets → woocommerce-abandoned-cart/assets}/images/edit.png +0 -0
  13. woocommerce-abandoned-cart/assets/images/email-templates-send-time.png +0 -0
  14. {assets → woocommerce-abandoned-cart/assets}/images/handbag.jpg +0 -0
  15. woocommerce-abandoned-cart/assets/images/icon-256x256.png +0 -0
  16. {assets → woocommerce-abandoned-cart/assets}/images/shoes.jpg +0 -0
  17. {assets → woocommerce-abandoned-cart/assets}/images/site-logo-new.jpg +0 -0
  18. {assets → woocommerce-abandoned-cart/assets}/images/spectre.jpg +0 -0
  19. {assets → woocommerce-abandoned-cart/assets}/js/abandoncart_plugin_button.js +0 -0
  20. {assets → woocommerce-abandoned-cart/assets}/js/jquery.tipTip.minified.js +0 -0
  21. {assets → woocommerce-abandoned-cart/assets}/js/wcal_template_activate.js +0 -0
  22. {assets → woocommerce-abandoned-cart/assets}/js/wcal_ts_dismiss_notice.js +0 -0
  23. {cron → woocommerce-abandoned-cart/cron}/wcal_send_email.php +0 -0
  24. {i18n → woocommerce-abandoned-cart/i18n}/languages/messages.pot +0 -0
  25. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-de_DE.mo +0 -0
  26. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-de_DE.po +0 -0
  27. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-he_IL.mo +0 -0
  28. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-he_IL.po +0 -0
  29. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-sk_SK.mo +0 -0
  30. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-sk_SK.po +0 -0
  31. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac.mo +0 -0
  32. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac.po +0 -0
  33. {i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac.pot +0 -0
  34. {includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-abandoned-orders-table.php +0 -0
  35. {includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-aes-counter.php +0 -0
  36. {includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-aes.php +0 -0
  37. {includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-product-report-table.php +0 -0
  38. {includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-recover-orders-table.php +0 -0
  39. {includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-templates-table.php +0 -0
  40. {includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-ts-tracker.php +0 -0
  41. woocommerce-abandoned-cart/includes/wcal-common.php +65 -0
  42. {includes → woocommerce-abandoned-cart/includes}/wcal_actions.php +0 -0
  43. {includes → woocommerce-abandoned-cart/includes}/wcal_admin_notice.php +0 -0
  44. {includes → woocommerce-abandoned-cart/includes}/wcal_class-guest.php +0 -0
  45. {includes → woocommerce-abandoned-cart/includes}/wcal_default-settings.php +0 -0
  46. {includes → woocommerce-abandoned-cart/includes}/wcal_ts_tracking.php +1 -1
  47. woocommerce-abandoned-cart/includes/welcome.php +330 -0
  48. readme.txt → woocommerce-abandoned-cart/readme.txt +13 -1
  49. screenshot-1.png → woocommerce-abandoned-cart/screenshot-1.png +0 -0
  50. screenshot-2.png → woocommerce-abandoned-cart/screenshot-2.png +0 -0
  51. screenshot-3.png → woocommerce-abandoned-cart/screenshot-3.png +0 -0
  52. screenshot-4.png → woocommerce-abandoned-cart/screenshot-4.png +0 -0
  53. screenshot-5.png → woocommerce-abandoned-cart/screenshot-5.png +0 -0
  54. {views → woocommerce-abandoned-cart/views}/wcal-email-template-preview.php +0 -0
  55. {views → woocommerce-abandoned-cart/views}/wcal-wc-email-template-preview.php +0 -0
  56. woocommerce-ac.php → woocommerce-abandoned-cart/woocommerce-ac.php +175 -204
includes/wcal-common.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- class wcal_common {
4
- public static function wcal_get_abandoned_order_count( $get_section_result ){
5
- global $wpdb;
6
- $return_abandoned_count = 0;
7
- $blank_cart_info = '{"cart":[]}';
8
- $blank_cart_info_guest = '[]';
9
- $ac_cutoff_time = get_option( 'ac_lite_cart_abandoned_time' );
10
- $cut_off_time = intval( $ac_cutoff_time ) * 60;
11
- $current_time = current_time( 'timestamp' );
12
- $compare_time = $current_time - $cut_off_time;
13
-
14
- switch ( $get_section_result ) {
15
- case 'wcal_all_abandoned':
16
- $query_ac = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'REGISTERED' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 ) OR ( user_type = 'GUEST' AND abandoned_cart_info NOT LIKE '$blank_cart_info_guest' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 ) ORDER BY recovered_cart desc ";
17
- $ac_results = $wpdb->get_results( $query_ac );
18
- $return_abandoned_count = count( $ac_results );
19
- break;
20
-
21
- case 'wcal_all_registered':
22
- $query_ac = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'REGISTERED' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 ) ORDER BY recovered_cart desc ";
23
- $ac_results = $wpdb->get_results( $query_ac );
24
- $return_abandoned_count = count( $ac_results );
25
- break;
26
-
27
- case 'wcal_all_guest':
28
- $query_ac = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'GUEST' AND abandoned_cart_info NOT LIKE '$blank_cart_info_guest' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 AND user_id >= 63000000 ) ORDER BY recovered_cart desc ";
29
- $ac_results = $wpdb->get_results( $query_ac );
30
- $return_abandoned_count = count( $ac_results );
31
- break;
32
-
33
- case 'wcal_all_visitor':
34
- $query_ac = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'GUEST' AND abandoned_cart_info NOT LIKE '$blank_cart_info_guest' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 AND user_id = 0 ) ORDER BY recovered_cart desc ";
35
- $ac_results = $wpdb->get_results( $query_ac );
36
- $return_abandoned_count = count( $ac_results );
37
- break;
38
-
39
- default:
40
- # code...
41
- break;
42
- }
43
- return $return_abandoned_count;
44
- }
45
- }
46
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{assets → woocommerce-abandoned-cart/assets}/css/view.abandoned.orders.style.css RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/css/wcal_template_activate.css RENAMED
File without changes
woocommerce-abandoned-cart/assets/images/abandon-cart-cut-off-time.png ADDED
Binary file
woocommerce-abandoned-cart/assets/images/abandoned-cart-lite-email-templates.png ADDED
Binary file
{assets → woocommerce-abandoned-cart/assets}/images/abandoned_cart_small.png RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/ac_editor_icon.png RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/ac_tab_icon.png RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/check.jpg RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/copy.png RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/delete.png RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/edit.png RENAMED
File without changes
woocommerce-abandoned-cart/assets/images/email-templates-send-time.png ADDED
Binary file
{assets → woocommerce-abandoned-cart/assets}/images/handbag.jpg RENAMED
File without changes
woocommerce-abandoned-cart/assets/images/icon-256x256.png ADDED
Binary file
{assets → woocommerce-abandoned-cart/assets}/images/shoes.jpg RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/site-logo-new.jpg RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/images/spectre.jpg RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/js/abandoncart_plugin_button.js RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/js/jquery.tipTip.minified.js RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/js/wcal_template_activate.js RENAMED
File without changes
{assets → woocommerce-abandoned-cart/assets}/js/wcal_ts_dismiss_notice.js RENAMED
File without changes
{cron → woocommerce-abandoned-cart/cron}/wcal_send_email.php RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/messages.pot RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-de_DE.mo RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-de_DE.po RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-he_IL.mo RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-he_IL.po RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-sk_SK.mo RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac-sk_SK.po RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac.mo RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac.po RENAMED
File without changes
{i18n → woocommerce-abandoned-cart/i18n}/languages/woocommerce-ac.pot RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-abandoned-orders-table.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-aes-counter.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-aes.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-product-report-table.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-recover-orders-table.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-templates-table.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/classes/class-wcal-ts-tracker.php RENAMED
File without changes
woocommerce-abandoned-cart/includes/wcal-common.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class wcal_common {
4
+ public static function wcal_get_abandoned_order_count( $get_section_result ){
5
+ global $wpdb;
6
+ $return_abandoned_count = 0;
7
+ $blank_cart_info = '{"cart":[]}';
8
+ $blank_cart_info_guest = '[]';
9
+ $ac_cutoff_time = get_option( 'ac_lite_cart_abandoned_time' );
10
+ $cut_off_time = intval( $ac_cutoff_time ) * 60;
11
+ $current_time = current_time( 'timestamp' );
12
+ $compare_time = $current_time - $cut_off_time;
13
+
14
+ switch ( $get_section_result ) {
15
+ case 'wcal_all_abandoned':
16
+ $query_ac = "SELECT COUNT(`id`) as cnt FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'REGISTERED' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 ) OR ( user_type = 'GUEST' AND abandoned_cart_info NOT LIKE '$blank_cart_info_guest' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 ) ORDER BY recovered_cart desc ";
17
+ $return_abandoned_count = $wpdb->get_var( $query_ac );
18
+ break;
19
+
20
+ case 'wcal_all_registered':
21
+ $query_ac = "SELECT COUNT(`id`) FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'REGISTERED' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 ) ORDER BY recovered_cart desc ";
22
+ $return_abandoned_count = $wpdb->get_var( $query_ac );
23
+ break;
24
+
25
+ case 'wcal_all_guest':
26
+ $query_ac = "SELECT COUNT(`id`) FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'GUEST' AND abandoned_cart_info NOT LIKE '$blank_cart_info_guest' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 AND user_id >= 63000000 ) ORDER BY recovered_cart desc ";
27
+ $return_abandoned_count = $wpdb->get_var( $query_ac );
28
+ break;
29
+
30
+ case 'wcal_all_visitor':
31
+ $query_ac = "SELECT COUNT(`id`) FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE ( user_type = 'GUEST' AND abandoned_cart_info NOT LIKE '$blank_cart_info_guest' AND abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND abandoned_cart_time <= '$compare_time' AND recovered_cart = 0 AND user_id = 0 ) ORDER BY recovered_cart desc ";
32
+ $return_abandoned_count = $wpdb->get_var( $query_ac );
33
+ break;
34
+
35
+ default:
36
+ # code...
37
+ break;
38
+ }
39
+ return $return_abandoned_count;
40
+ }
41
+
42
+
43
+ /**
44
+ * This function returns the Abandoned Cart Lite plugin version number.
45
+ */
46
+ public static function wcal_get_version() {
47
+ $plugin_version = '';
48
+ $wcap_plugin_dir = dirname ( dirname (__FILE__) );
49
+ $wcap_plugin_dir .= '/woocommerce-ac.php';
50
+
51
+ $plugin_data = get_file_data( $wcap_plugin_dir, array( 'Version' => 'Version' ) );
52
+ if ( ! empty( $plugin_data['Version'] ) ) {
53
+ $plugin_version = $plugin_data[ 'Version' ];
54
+ }
55
+ return $plugin_version;
56
+ }
57
+
58
+ /**
59
+ * This function returns the plugin url
60
+ */
61
+ public static function wcal_get_plugin_url() {
62
+ return plugins_url() . '/woocommerce-abandoned-cart/';
63
+ }
64
+ }
65
+ ?>
{includes → woocommerce-abandoned-cart/includes}/wcal_actions.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/wcal_admin_notice.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/wcal_class-guest.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/wcal_default-settings.php RENAMED
File without changes
{includes → woocommerce-abandoned-cart/includes}/wcal_ts_tracking.php RENAMED
@@ -47,7 +47,7 @@ class Wcal_TS_Tracking {
47
  <div class="wcal-message wcal-tracker notice notice-info is-dismissible" style="position: relative;">
48
  <div style="position: absolute;"><img class="site-logo" src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/site-logo-new.jpg"></div>
49
  <p style="margin: 10px 0 10px 130px; font-size: medium;">
50
- <?php print( __( 'Want to help make Abandoned Cart even more awesome? Allow Abandoned Cart to collect non-sensitive diagnostic data and usage information and get 20% off on your next purchase. <a href="https://www.tychesoftwares.com/abandoned-cart-lite-usage-tracking/">Find out more</a>. <br><br>', 'woocommerce-ac' ) ); ?></p>
51
  <p class="submit">
52
  <a class="button-primary button button-large" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcal_tracker_optin', 'true' ), 'wcal_tracker_optin', 'wcal_tracker_nonce' ) ); ?>"><?php esc_html_e( 'Allow', 'woocommerce-ac' ); ?></a>
53
  <a class="button-secondary button button-large skip" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcal_tracker_optout', 'true' ), 'wcal_tracker_optout', 'wcal_tracker_nonce' ) ); ?>"><?php esc_html_e( 'No thanks', 'woocommerce-ac' ); ?></a>
47
  <div class="wcal-message wcal-tracker notice notice-info is-dismissible" style="position: relative;">
48
  <div style="position: absolute;"><img class="site-logo" src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/site-logo-new.jpg"></div>
49
  <p style="margin: 10px 0 10px 130px; font-size: medium;">
50
+ <?php print( __( 'Want to help make Abandoned Cart even more awesome? Allow Abandoned Cart to collect non-sensitive diagnostic data and usage information and get 20% off on your next purchase. <a href="https://www.tychesoftwares.com/abandoned-cart-lite-usage-tracking/" target="_blank">Find out more</a>. <br><br>', 'woocommerce-ac' ) ); ?></p>
51
  <p class="submit">
52
  <a class="button-primary button button-large" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcal_tracker_optin', 'true' ), 'wcal_tracker_optin', 'wcal_tracker_nonce' ) ); ?>"><?php esc_html_e( 'Allow', 'woocommerce-ac' ); ?></a>
53
  <a class="button-secondary button button-large skip" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcal_tracker_optout', 'true' ), 'wcal_tracker_optout', 'wcal_tracker_nonce' ) ); ?>"><?php esc_html_e( 'No thanks', 'woocommerce-ac' ); ?></a>
woocommerce-abandoned-cart/includes/welcome.php ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Abandoned Cart Lite Welcome Page Class
5
+ *
6
+ * Displays on plugin activation
7
+ */
8
+
9
+ // Exit if accessed directly.
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ }
13
+
14
+ /**
15
+ * Wcal_Welcome Class
16
+ *
17
+ * A general class for About page.
18
+ *
19
+ * @since 4.5
20
+ */
21
+ class Wcal_Welcome {
22
+
23
+ /**
24
+ * @var string The capability users should have to view the page
25
+ */
26
+ public $minimum_capability = 'manage_options';
27
+
28
+ /**
29
+ * Get things started
30
+ *
31
+ * @since 4.5
32
+ */
33
+ public function __construct() {
34
+
35
+ add_action( 'admin_menu', array( $this, 'admin_menus' ) );
36
+ add_action( 'admin_head', array( $this, 'admin_head' ) );
37
+
38
+ if ( !isset( $_GET[ 'page' ] ) ||
39
+ ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] != 'wcal-about' ) ) {
40
+ add_action( 'admin_init', array( $this, 'welcome' ) );
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Register the Dashboard Page which is later hidden but this pages
46
+ * is used to render the Welcome page.
47
+ *
48
+ * @access public
49
+ * @since 4.5
50
+ * @return void
51
+ */
52
+ public function admin_menus() {
53
+ $display_version = WCAL_VERSION;
54
+
55
+ // About Page
56
+ add_dashboard_page(
57
+ sprintf( esc_html__( 'Welcome to Abandoned Cart Lite %s', 'woocommerce-ac' ), $display_version ),
58
+ esc_html__( 'Welcome to Abandoned Cart Lite', 'woocommerce-ac' ),
59
+ $this->minimum_capability,
60
+ 'wcal-about',
61
+ array( $this, 'about_screen' )
62
+ );
63
+
64
+ }
65
+
66
+ /**
67
+ * Hide Individual Dashboard Pages
68
+ *
69
+ * @access public
70
+ * @since 4.5
71
+ * @return void
72
+ */
73
+ public function admin_head() {
74
+ remove_submenu_page( 'index.php', 'wcal-about' );
75
+ }
76
+
77
+ /**
78
+ * Render About Screen
79
+ *
80
+ * @access public
81
+ * @since 4.5
82
+ * @return void
83
+ */
84
+ public function about_screen() {
85
+ $display_version = WCAL_VERSION;
86
+ // Badge for welcome page
87
+ $badge_url = WCAL_PLUGIN_URL . 'assets/images/icon-256x256.png';
88
+ ?>
89
+ <style>
90
+ .feature-section .feature-section-item {
91
+ float:left;
92
+ width:48%;
93
+ }
94
+ </style>
95
+ <div class="wrap about-wrap">
96
+
97
+ <?php $this->get_welcome_header() ?>
98
+
99
+ <div style="float:left;width: 80%;">
100
+ <p class="about-text" style="margin-right:20px;"><?php
101
+ printf(
102
+ __( "Thank you for activating or updating to the latest version of Abandoned Cart Lite! If you're a first time user, welcome! You're well on your way to start recovering your lost revenues." )
103
+ );
104
+ ?></p>
105
+ </div>
106
+ <div class="wcal-badge"><img src="<?php echo $badge_url; ?>" style="width:150px;"/></div>
107
+
108
+ <p>&nbsp;</p>
109
+
110
+ <div class="feature-section clearfix introduction">
111
+
112
+ <h3><?php esc_html_e( "Get Started with Abandoned Cart Lite", 'woocommerce-ac' ); ?></h3>
113
+
114
+ <div class="video feature-section-item" style="float:left;padding-right:10px;">
115
+ <img src="<?php echo WCAL_PLUGIN_URL . '/assets/images/abandoned-cart-lite-email-templates.png' ?>"
116
+ alt="<?php esc_attr_e( 'WooCommerce Abandoned Cart Lite', 'woocommerce-ac' ); ?>" style="width:600px;">
117
+ </div>
118
+
119
+ <div class="content feature-section-item last-feature">
120
+ <h3><?php esc_html_e( 'Activate Email Template', 'woocommerce-ac' ); ?></h3>
121
+
122
+ <p><?php esc_html_e( 'To start sending out abandoned cart notification emails, simply activate the email template from under WooCommerce -> Abandoned Carts -> Email Templates page.', 'woocommerce-ac' ); ?></p>
123
+ <a href="admin.php?page=woocommerce_ac_page&action=emailtemplates" target="_blank" class="button-secondary">
124
+ <?php esc_html_e( 'Click Here to go to Email Templates page', 'woocommerce-ac' ); ?>
125
+ <span class="dashicons dashicons-external"></span>
126
+ </a>
127
+ </div>
128
+ </div>
129
+
130
+ <!-- /.intro-section -->
131
+
132
+ <div class="content">
133
+
134
+ <h3><?php esc_html_e( "Know more about Abandoned Cart Pro", 'woocommerce-ac' ); ?></h3>
135
+
136
+ <p><?php _e( 'The Abandoned Cart Pro plugin gives you features where you are able to recover more sales compared to the Lite plugin. Here are some notable features the Pro version provides.' ); ?></p>
137
+
138
+ <div class="feature-section clearfix introduction">
139
+ <div class="video feature-section-item" style="float:left;padding-right:10px;">
140
+ <img src="https://www.tychesoftwares.com/wp-content/uploads/2017/08/atc_frontend.png"
141
+ alt="<?php esc_attr_e( 'WooCommerce Abandoned Cart Lite', 'woocommerce-ac' ); ?>" style="width:500px;">
142
+ </div>
143
+
144
+ <div class="content feature-section-item last-feature">
145
+ <h3><?php esc_html_e( 'Capture Visitor Emails on click of Add to Cart button', 'woocommerce-ac' ); ?></h3>
146
+
147
+ <p><?php esc_html_e( 'The ability to capture the email address early in the order process is very important to reduce cart abandonment by unknown users as well as to be able to recover their carts if they abandon it. This ultimately leads to increase in your store sales.', 'woocommerce-ac' ); ?></p>
148
+ <a href="https://www.tychesoftwares.com/capture-guest-user-email-address-before-checkout-page-with-woocommerce-abandoned-cart-pro/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank" class="button-secondary">
149
+ <?php esc_html_e( 'Learn More', 'woocommerce-ac' ); ?>
150
+ <span class="dashicons dashicons-external"></span>
151
+ </a>
152
+ </div>
153
+ </div>
154
+
155
+ <div class="feature-section clearfix">
156
+ <div class="content feature-section-item">
157
+
158
+ <h3><?php esc_html_e( 'Set different cut-off times for visitors & logged-in users', 'woocommerce-ac' ); ?></h3>
159
+
160
+ <p><?php esc_html_e( 'The provision for setting two separate cut-off times for different roles is mainly because sometimes if the store admin wants the visitor carts to be captured earlier than the registered user carts, then these different settings can play an important role.', 'woocommerce-ac' ); ?></p>
161
+ <a href="https://www.tychesoftwares.com/capturing-abandoned-carts-woocommerce-abandoned-cart-pro-plugin/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank" class="button-secondary">
162
+ <?php esc_html_e( 'Learn More', 'woocommerce-ac' ); ?>
163
+ <span class="dashicons dashicons-external"></span>
164
+ </a>
165
+ </div>
166
+
167
+ <div class="content feature-section-item last-feature">
168
+ <img src="<?php echo WCAL_PLUGIN_URL . 'assets/images/abandon-cart-cut-off-time.png'; ?>" alt="<?php esc_attr_e( 'WooCommerce Abandoned Cart Lite', 'woocommerce-ac' ); ?>" style="width:450px;">
169
+ </div>
170
+ </div>
171
+
172
+
173
+ <div class="feature-section clearfix introduction">
174
+ <div class="video feature-section-item" style="float:left;padding-right:10px;">
175
+ <img src="<?php echo WCAL_PLUGIN_URL . 'assets/images/email-templates-send-time.png'; ?>" alt="<?php esc_attr_e( 'WooCommerce Abandoned Cart Lite', 'woocommerce-ac' ); ?>" style="width:450px;">
176
+ </div>
177
+
178
+ <div class="content feature-section-item last-feature">
179
+ <h3><?php esc_html_e( 'Send abandoned cart recovery email in minutes of cart being abandoned', 'woocommerce-ac' ); ?></h3>
180
+
181
+ <p><?php esc_html_e( 'The ability to send the abandoned cart recovery email within first few minutes of cart being abandoned is a big advantage. In the Lite plugin, the earliest an email can be sent is after 1 hour. Whereas in the Pro version, the first recovery email gets sent 15 minutes after the cart is abandoned. This increases the recovery chances manifold.', 'woocommerce-ac' ); ?></p>
182
+ <a href="https://www.tychesoftwares.com/understanding-the-default-email-templates-of-abandoned-cart-pro-for-woocommerce-plugin/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank" class="button-secondary">
183
+ <?php esc_html_e( 'Learn More', 'woocommerce-ac' ); ?>
184
+ <span class="dashicons dashicons-external"></span>
185
+ </a>
186
+ </div>
187
+ </div>
188
+
189
+ <div class="feature-section clearfix">
190
+ <div class="content feature-section-item">
191
+
192
+ <h3><?php esc_html_e( 'Full range of merge tags that allow you to personalize the abandoned cart email', 'woocommerce-ac' ); ?></h3>
193
+
194
+ <p><?php esc_html_e( 'The Lite version has only 3 merge tags available to personalize the abandoned cart recovery emails. The Pro version instead, has 20 different merge tags that can be used effectively to personalize each email that gets sent out to the customers for recovering their abandoned carts.', 'woocommerce-ac' ); ?></p>
195
+ <a href="https://www.tychesoftwares.com/understanding-the-default-email-templates-of-abandoned-cart-pro-for-woocommerce-plugin/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank" class="button-secondary">
196
+ <?php esc_html_e( 'Learn More', 'woocommerce-ac' ); ?>
197
+ <span class="dashicons dashicons-external"></span>
198
+ </a>
199
+ </div>
200
+
201
+ <div class="content feature-section-item last-feature">
202
+ <img src="https://www.tychesoftwares.com/wp-content/uploads/2016/10/drop-down-of-AC.png" alt="<?php esc_attr_e( 'WooCommerce Abandoned Cart Lite', 'woocommerce-ac' ); ?>" style="width:450px;">
203
+ </div>
204
+ </div>
205
+
206
+ <a href="https://www.tychesoftwares.com/differences-between-pro-and-lite-versions-of-abandoned-cart-for-woocommerce-plugin/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank" class="button-secondary">
207
+ <?php esc_html_e( 'View full list of differences between Lite & Pro plugin', 'woocommerce-ac' ); ?>
208
+ <span class="dashicons dashicons-external"></span>
209
+ </a>
210
+ </div>
211
+
212
+ <div class="feature-section clearfix">
213
+
214
+ <div class="content feature-section-item">
215
+
216
+ <h3><?php esc_html_e( 'Getting to Know Tyche Softwares', 'woocommerce-ac' ); ?></h3>
217
+
218
+ <ul class="ul-disc">
219
+ <li><a href="https://tychesoftwares.com/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank"><?php esc_html_e( 'Visit the Tyche Softwares Website', 'woocommerce-ac' ); ?></a></li>
220
+ <li><a href="https://tychesoftwares.com/premium-plugins/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank"><?php esc_html_e( 'View all Premium Plugins', 'woocommerce-ac' ); ?></a>
221
+ <ul class="ul-disc">
222
+ <li><a href="https://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank">Abandoned Cart Pro Plugin for WooCommerce</a></li>
223
+ <li><a href="https://www.tychesoftwares.com/store/premium-plugins/woocommerce-booking-plugin/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank">Booking & Appointment Plugin for WooCommerce</a></li>
224
+ <li><a href="https://www.tychesoftwares.com/store/premium-plugins/order-delivery-date-for-woocommerce-pro-21/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank">Order Delivery Date for WooCommerce</a></li>
225
+ <li><a href="https://www.tychesoftwares.com/store/premium-plugins/product-delivery-date-pro-for-woocommerce/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank">Product Delivery Date for WooCommerce</a></li>
226
+ <li><a href="https://www.tychesoftwares.com/store/premium-plugins/deposits-for-woocommerce/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank">Deposits for WooCommerce</a></li>
227
+ </ul>
228
+ </li>
229
+ <li><a href="https://tychesoftwares.com/about/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank"><?php esc_html_e( 'Meet the team', 'woocommerce-ac' ); ?></a></li>
230
+ </ul>
231
+
232
+ </div>
233
+
234
+
235
+ <div class="content feature-section-item">
236
+
237
+ <h3><?php esc_html_e( 'Current Offers', 'woocommerce-ac' ); ?></h3>
238
+
239
+ <p>Buy all our <a href="https://tychesoftwares.com/premium-plugins/?utm_source=wpaboutpage&utm_medium=link&utm_campaign=AbandonedCartLitePlugin" target="_blank">premium plugins</a> at 30% off till 31st December 2017</p>
240
+
241
+ </div>
242
+
243
+ </div>
244
+ <!-- /.feature-section -->
245
+
246
+ </div>
247
+ <?php
248
+
249
+ update_option( 'wcal_welcome_page_shown', 'yes' );
250
+ update_option( 'wcal_welcome_page_shown_time', current_time( 'timestamp' ) );
251
+ }
252
+
253
+
254
+ /**
255
+ * The header section for the welcome screen.
256
+ *
257
+ * @since 4.5
258
+ */
259
+ public function get_welcome_header() {
260
+ // Badge for welcome page
261
+ $badge_url = WCAL_PLUGIN_URL . 'assets/images/icon-256x256.png';
262
+ ?>
263
+ <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
264
+ <?php $this->social_media_elements(); ?>
265
+
266
+ <?php }
267
+
268
+
269
+ /**
270
+ * Social Media Like Buttons
271
+ *
272
+ * Various social media elements to Tyche Softwares
273
+ */
274
+ public function social_media_elements() { ?>
275
+
276
+ <div class="social-items-wrap">
277
+
278
+ <iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Ftychesoftwares&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21&amp;appId=220596284639969"
279
+ scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;"
280
+ allowTransparency="true"></iframe>
281
+
282
+ <a href="https://twitter.com/tychesoftwares" class="twitter-follow-button" data-show-count="false"><?php
283
+ printf(
284
+ esc_html_e( 'Follow %s', 'tychesoftwares' ),
285
+ '@tychesoftwares'
286
+ );
287
+ ?></a>
288
+ <script>!function (d, s, id) {
289
+ var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
290
+ if (!d.getElementById(id)) {
291
+ js = d.createElement(s);
292
+ js.id = id;
293
+ js.src = p + '://platform.twitter.com/widgets.js';
294
+ fjs.parentNode.insertBefore(js, fjs);
295
+ }
296
+ }(document, 'script', 'twitter-wjs');
297
+ </script>
298
+
299
+ </div>
300
+ <!--/.social-items-wrap -->
301
+
302
+ <?php
303
+ }
304
+
305
+
306
+ /**
307
+ * Sends user to the Welcome page on first activation of Abandoned Cart Lite as well as each
308
+ * time Abandoned Cart Lite is upgraded to a new version
309
+ *
310
+ * @access public
311
+ * @since 4.5
312
+ *
313
+ * @return void
314
+ */
315
+ public function welcome() {
316
+
317
+ // Bail if activating from network, or bulk
318
+ if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
319
+ return;
320
+ }
321
+
322
+ if( !get_option( 'wcal_welcome_page_shown' ) ) {
323
+ wp_safe_redirect( admin_url( 'index.php?page=wcal-about' ) );
324
+ exit;
325
+ }
326
+ }
327
+
328
+ }
329
+
330
+ new Wcal_Welcome();
readme.txt → woocommerce-abandoned-cart/readme.txt RENAMED
@@ -4,7 +4,7 @@ Contributors: ashokrane, pinal.shah, bhavik.kiri, chetnapatel, tychesoftwares
4
  Tags: abandon cart, cart recovery, increase woocommerce conversion rate , recover woocommerce cart, increase sales with woocommerce
5
  Author URI: https://www.tychesoftwares.com/
6
  Requires at least: 1.3
7
- Tested up to: 4.8.2
8
  Stable tag: trunk
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -188,6 +188,12 @@ You can refer **[here](https://www.tychesoftwares.com/differences-between-pro-an
188
 
189
  == Changelog ==
190
 
 
 
 
 
 
 
191
  = 4.4 (13.10-2017) =
192
 
193
  * This version has 3 bugs fixes along with 1 Enhancement.
@@ -491,6 +497,12 @@ For existing users, this setting will remain unchecked. For new users of the plu
491
 
492
  == Upgrade Notice ==
493
 
 
 
 
 
 
 
494
  = 4.4 (13.10-2017) =
495
 
496
  * This version has 3 bugs fixes along with 1 Enhancement.
4
  Tags: abandon cart, cart recovery, increase woocommerce conversion rate , recover woocommerce cart, increase sales with woocommerce
5
  Author URI: https://www.tychesoftwares.com/
6
  Requires at least: 1.3
7
+ Tested up to: 4.9.1
8
  Stable tag: trunk
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
188
 
189
  == Changelog ==
190
 
191
+ = 4.5 (28.12-2017) =
192
+
193
+ * This version has 1 bug fix.
194
+
195
+ * Bug Fixed - Made some performance optimizations so the plugin occupies less CPU resources. We will continue working on this so the resource usage stays low.
196
+
197
  = 4.4 (13.10-2017) =
198
 
199
  * This version has 3 bugs fixes along with 1 Enhancement.
497
 
498
  == Upgrade Notice ==
499
 
500
+ = 4.5 (28.12-2017) =
501
+
502
+ * This version has 1 bug fix.
503
+
504
+ * Bug Fixed - Made some performance optimizations so the plugin occupies less CPU resources. We will continue working on this so the resource usage stays low.
505
+
506
  = 4.4 (13.10-2017) =
507
 
508
  * This version has 3 bugs fixes along with 1 Enhancement.
screenshot-1.png → woocommerce-abandoned-cart/screenshot-1.png RENAMED
File without changes
screenshot-2.png → woocommerce-abandoned-cart/screenshot-2.png RENAMED
File without changes
screenshot-3.png → woocommerce-abandoned-cart/screenshot-3.png RENAMED
File without changes
screenshot-4.png → woocommerce-abandoned-cart/screenshot-4.png RENAMED
File without changes
screenshot-5.png → woocommerce-abandoned-cart/screenshot-5.png RENAMED
File without changes
{views → woocommerce-abandoned-cart/views}/wcal-email-template-preview.php RENAMED
File without changes
{views → woocommerce-abandoned-cart/views}/wcal-wc-email-template-preview.php RENAMED
File without changes
woocommerce-ac.php → woocommerce-abandoned-cart/woocommerce-ac.php RENAMED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Abandoned Cart Lite for WooCommerce
4
  * Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
5
  * Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
6
- * Version: 4.4
7
  * Author: Tyche Softwares
8
  * Author URI: http://www.tychesoftwares.com/
9
  * Text Domain: woocommerce-ac
@@ -25,6 +25,14 @@ require_once( "includes/wcal-common.php" );
25
  require_once( "includes/wcal_ts_tracking.php");
26
  require_once( "includes/wcal_admin_notice.php");
27
 
 
 
 
 
 
 
 
 
28
  // Add a new interval of 15 minutes
29
  add_filter( 'cron_schedules', 'wcal_add_cron_schedule' );
30
 
@@ -139,6 +147,16 @@ function woocommerce_ac_delete_lite() {
139
  delete_option( 'wcal_from_name' );
140
  delete_option( 'wcal_from_email' );
141
  delete_option( 'wcal_reply_email' );
 
 
 
 
 
 
 
 
 
 
142
  }
143
  /**
144
  * woocommerce_abandon_cart_lite class
@@ -628,6 +646,7 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
628
  exit;
629
  }
630
  }
 
631
  // Language Translation
632
  function wcal_update_po_file() {
633
  $domain = 'woocommerce-ac';
@@ -636,7 +655,7 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
636
  return $loaded;
637
  } else {
638
  load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/i18n/languages/' );
639
- }
640
  }
641
 
642
  /*-----------------------------------------------------------------------------------*/
@@ -714,6 +733,43 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
714
  update_option( 'woocommerce_ac_default_templates_installed', "yes" );
715
  }
716
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
717
  /**
718
  * This is add for thos user who Install the plguin first time.
719
  * So for them this option will be cheked.
@@ -742,6 +798,7 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
742
  * WP Settings API
743
  **************************************************************/
744
  function wcal_initialize_plugin_options() {
 
745
  // First, we register a section. This is necessary since all future options must belong to a
746
  add_settings_section(
747
  'ac_lite_general_settings_section', // ID used to identify this section and with which to register options
@@ -983,111 +1040,119 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
983
  *************************************************/
984
  function wcal_update_db_check() {
985
  global $wpdb;
986
- $wcap_collate = '';
987
- if ( $wpdb->has_cap( 'collation' ) ) {
988
- $wcap_collate = $wpdb->get_charset_collate();
989
- }
990
- if( get_option( 'ac_lite_delete_alter_table_queries' ) != 'yes' ) {
991
- update_option( 'ac_lite_alter_table_queries', '' );
992
- update_option( 'ac_lite_delete_alter_table_queries', 'yes' );
993
- }
994
- if( get_option( 'ac_lite_alter_table_queries' ) != 'yes' ) {
995
- if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_email_templates'" ) === $wpdb->prefix . 'ac_email_templates' ) {
996
- $old_table_name = $wpdb->prefix . "ac_email_templates";
997
- $table_name = $wpdb->prefix . "ac_email_templates_lite";
998
 
999
- $alter_ac_email_table_query = "ALTER TABLE $old_table_name
1000
- RENAME TO $table_name";
1001
- $wpdb->get_results ( $alter_ac_email_table_query );
1002
  }
 
 
 
 
 
 
 
 
 
 
 
 
1003
 
1004
- if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_sent_history'" ) === $wpdb->prefix . 'ac_sent_history' ) {
1005
- $old_sent_table_name = $wpdb->prefix . "ac_sent_history";
1006
- $sent_table_name = $wpdb->prefix . "ac_sent_history_lite";
1007
- $alter_ac_sent_history_table_query = "ALTER TABLE $old_sent_table_name
1008
- RENAME TO $sent_table_name";
1009
- $wpdb->get_results ( $alter_ac_sent_history_table_query );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1010
  }
1011
 
1012
- if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_abandoned_cart_history'" ) === $wpdb->prefix . 'ac_abandoned_cart_history' ) {
1013
- $old_ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history";
1014
- $ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history_lite";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1015
 
1016
- $alter_ac_abandoned_cart_history_table_query = "ALTER TABLE $old_ac_history_table_name
1017
- RENAME TO $ac_history_table_name";
1018
- $wpdb->get_results ( $alter_ac_abandoned_cart_history_table_query );
1019
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1020
  update_option( 'ac_lite_alter_table_queries', 'yes' );
1021
  }
1022
 
1023
- $ac_history_table_name = $wpdb->prefix."ac_abandoned_cart_history_lite";
1024
- $check_table_query = "SHOW COLUMNS FROM $ac_history_table_name LIKE 'user_type'";
1025
- $results = $wpdb->get_results( $check_table_query );
1026
-
1027
- if ( count( $results ) == 0 ) {
1028
- $alter_table_query = "ALTER TABLE $ac_history_table_name ADD `user_type` text AFTER `recovered_cart`";
1029
- $wpdb->get_results( $alter_table_query );
1030
- }
1031
-
1032
- $table_name = $wpdb->prefix . "ac_email_templates_lite";
1033
- $check_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'is_wc_template' ";
1034
- $results = $wpdb->get_results( $check_template_table_query );
1035
-
1036
- if ( count( $results ) == 0 ) {
1037
- $alter_template_table_query = "ALTER TABLE $table_name
1038
- ADD COLUMN `is_wc_template` enum('0','1') COLLATE utf8_unicode_ci NOT NULL AFTER `template_name`,
1039
- ADD COLUMN `default_template` int(11) NOT NULL AFTER `is_wc_template`";
1040
- $wpdb->get_results( $alter_template_table_query );
1041
- }
1042
-
1043
-
1044
- $table_name = $wpdb->prefix . "ac_email_templates_lite";
1045
- $check_email_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'wc_email_header' ";
1046
- $results_email = $wpdb->get_results( $check_email_template_table_query );
1047
-
1048
- if ( count( $results_email ) == 0 ) {
1049
- $alter_email_template_table_query = "ALTER TABLE $table_name
1050
- ADD COLUMN `wc_email_header` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `default_template`";
1051
- $wpdb->get_results( $alter_email_template_table_query );
1052
- }
1053
-
1054
- $guest_table = $wpdb->prefix."ac_guest_abandoned_cart_history_lite" ;
1055
- $query_guest_table = "SHOW TABLES LIKE '$guest_table' ";
1056
- $result_guest_table = $wpdb->get_results( $query_guest_table );
1057
-
1058
- if ( count( $result_guest_table ) == 0 ) {
1059
-
1060
- $ac_guest_history_table_name = $wpdb->prefix . "ac_guest_abandoned_cart_history_lite";
1061
- $ac_guest_history_query = "CREATE TABLE IF NOT EXISTS $ac_guest_history_table_name (
1062
- `id` int(15) NOT NULL AUTO_INCREMENT,
1063
- `billing_first_name` text,
1064
- `billing_last_name` text,
1065
- `billing_company_name` text,
1066
- `billing_address_1` text,
1067
- `billing_address_2` text,
1068
- `billing_city` text,
1069
- `billing_county` text,
1070
- `billing_zipcode` text,
1071
- `email_id` text,
1072
- `phone` text,
1073
- `ship_to_billing` text,
1074
- `order_notes` text,
1075
- `shipping_first_name` text,
1076
- `shipping_last_name` text,
1077
- `shipping_company_name` text,
1078
- `shipping_address_1` text,
1079
- `shipping_address_2` text,
1080
- `shipping_city` text,
1081
- `shipping_county` text,
1082
- `shipping_zipcode` double,
1083
- `shipping_charges` double,
1084
- PRIMARY KEY (`id`)
1085
- ) $wcap_collate AUTO_INCREMENT=63000000";
1086
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
1087
- $wpdb->query( $ac_guest_history_query );
1088
- }
1089
  //get the option, if it is not set to individual then convert to individual records and delete the base record
1090
- $ac_settings = get_option( 'ac_lite_settings_status' );
1091
  if ( $ac_settings != 'INDIVIDUAL' ) {
1092
  //fetch the existing settings and save them as inidividual to be used for the settings API
1093
  $woocommerce_ac_settings = json_decode( get_option( 'woocommerce_ac_settings' ) );
@@ -1113,78 +1178,6 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
1113
  //Delete the main settings record
1114
  delete_option( 'woocommerce_ac_settings' );
1115
  }
1116
- if ( !get_option( 'wcal_security_key' ) ){
1117
- update_option( 'wcal_security_key', 'qJB0rGtIn5UB1xG03efyCp' );
1118
- }
1119
- if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_abandoned_cart_history_lite';" ) ) {
1120
- if ( ! $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_abandoned_cart_history_lite` LIKE 'unsubscribe_link';" ) ) {
1121
- $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_abandoned_cart_history_lite ADD `unsubscribe_link` enum('0','1') COLLATE utf8_unicode_ci NOT NULL AFTER `user_type`;" );
1122
- }
1123
- }
1124
-
1125
- if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_abandoned_cart_history_lite';" ) ) {
1126
- if ( ! $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_abandoned_cart_history_lite` LIKE 'session_id';" ) ) {
1127
- $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_abandoned_cart_history_lite ADD `session_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `unsubscribe_link`;" );
1128
- }
1129
- }
1130
- /**
1131
- *
1132
- * This is used to prevent guest users wrong Id. If guest users id is less then 63000000 then this code will ensure that we
1133
- * will change the id of guest tables so it wont affect on the next guest users.
1134
- */
1135
- if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_guest_abandoned_cart_history_lite';" ) && 'yes' != get_option( 'wcal_guest_user_id_altered' ) ) {
1136
- $last_id = $wpdb->get_var( "SELECT max(id) FROM `{$wpdb->prefix}ac_guest_abandoned_cart_history_lite`;" );
1137
- if ( NULL != $last_id && $last_id <= 63000000 ) {
1138
- $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_guest_abandoned_cart_history_lite AUTO_INCREMENT = 63000000;" );
1139
- update_option ( 'wcal_guest_user_id_altered', 'yes' );
1140
- }
1141
- }
1142
-
1143
- /**
1144
- * We have moved email templates fields in the setings section. SO to remove that fields column fro the db we need it.
1145
- * For existing user we need to fill this setting with the first template.
1146
- * @since 4.7
1147
- */
1148
- if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_email_templates_lite';" ) ) {
1149
- if ( $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_email_templates_lite` LIKE 'from_email';" ) ) {
1150
- $get_email_template_query = "SELECT `from_email` FROM {$wpdb->prefix}ac_email_templates_lite WHERE `is_active` = '1' ORDER BY `id` ASC LIMIT 1";
1151
- $get_email_template_result = $wpdb->get_results ($get_email_template_query);
1152
- $wcal_from_email = '';
1153
- if ( isset( $get_email_template_result ) && count ( $get_email_template_result ) > 0 ){
1154
- $wcal_from_email = $get_email_template_result[0]->from_email;
1155
- /* Store data in setings api*/
1156
- update_option ( 'wcal_from_email', $wcal_from_email );
1157
- /* Delete table from the Db*/
1158
- $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_email_templates_lite DROP COLUMN `from_email`;" );
1159
- }
1160
- }
1161
-
1162
- if ( $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_email_templates_lite` LIKE 'from_name';" ) ) {
1163
- $get_email_template_from_name_query = "SELECT `from_name` FROM {$wpdb->prefix}ac_email_templates_lite WHERE `is_active` = '1' ORDER BY `id` ASC LIMIT 1";
1164
- $get_email_template_from_name_result = $wpdb->get_results ($get_email_template_from_name_query);
1165
- $wcal_from_name = '';
1166
- if ( isset( $get_email_template_from_name_result ) && count ( $get_email_template_from_name_result ) > 0 ){
1167
- $wcal_from_name = $get_email_template_from_name_result[0]->from_name;
1168
- /* Store data in setings api*/
1169
- add_option ( 'wcal_from_name', $wcal_from_name );
1170
- /* Delete table from the Db*/
1171
- $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_email_templates_lite DROP COLUMN `from_name`;" );
1172
- }
1173
- }
1174
-
1175
- if ( $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_email_templates_lite` LIKE 'reply_email';" ) ) {
1176
- $get_email_template_reply_email_query = "SELECT `reply_email` FROM {$wpdb->prefix}ac_email_templates_lite WHERE `is_active` = '1' ORDER BY `id` ASC LIMIT 1";
1177
- $get_email_template_reply_email_result = $wpdb->get_results ($get_email_template_reply_email_query);
1178
- $wcal_reply_email = '';
1179
- if ( isset( $get_email_template_reply_email_result ) && count ( $get_email_template_reply_email_result ) > 0 ){
1180
- $wcal_reply_email = $get_email_template_reply_email_result[0]->reply_email;
1181
- /* Store data in setings api*/
1182
- update_option ( 'wcal_reply_email', $wcal_reply_email );
1183
- /* Delete table from the Db*/
1184
- $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_email_templates_lite DROP COLUMN `reply_email`;" );
1185
- }
1186
- }
1187
- }
1188
  }
1189
 
1190
  /**
@@ -1899,21 +1892,21 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
1899
  }
1900
 
1901
  function wcal_action_admin_init() {
1902
- global $typenow;
1903
  // only hook up these filters if we're in the admin panel and the current user has permission
1904
  // to edit posts and pages
 
 
 
1905
  if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
1906
  return;
1907
  }
1908
- if ( !isset( $_GET['page'] ) || $_GET['page'] != "woocommerce_ac_page" ) {
1909
- return;
1910
- }
1911
  if ( get_user_option( 'rich_editing' ) == 'true' ) {
1912
  remove_filter( 'the_excerpt', 'wpautop' );
1913
  add_filter( 'tiny_mce_before_init', array( &$this, 'wcal_format_tiny_MCE' ) );
1914
  add_filter( 'mce_buttons', array( &$this, 'wcal_filter_mce_button' ) );
1915
  add_filter( 'mce_external_plugins', array( &$this, 'wcal_filter_mce_plugin' ) );
1916
- }
1917
  if ( isset( $_GET['page'] ) && 'woocommerce_ac_page' == $_GET['page'] ) {
1918
  if( session_id() === '' ){
1919
  //session has not started
@@ -3137,38 +3130,16 @@ if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
3137
  }
3138
 
3139
  function wcal_admin_footer_text( $footer_text ) {
3140
- if ( ! current_user_can( 'manage_woocommerce' ) ) {
3141
- return;
3142
- }
3143
- if ( self::wcal_wc_check_ac_installed() ) {
3144
- $current_screen = get_current_screen();
3145
- $wc_pages = wc_get_screen_ids();
3146
- // Set only wc pages
3147
- $wc_pages = array_flip( $wc_pages );
3148
- if ( isset( $wc_pages['profile'] ) ) {
3149
- unset( $wc_pages['profile'] );
3150
- }
3151
- if ( isset( $wc_pages['user-edit'] ) ) {
3152
- unset( $wc_pages['user-edit'] );
3153
- }
3154
- $wc_pages = array_flip( $wc_pages );
3155
- $wc_pages[] = 'woocommerce_page_woocommerce_ac_page';
3156
- // Check to make sure we're on a WooCommerce admin page
3157
- if ( isset( $current_screen->id ) && apply_filters( 'woocommerce_display_admin_footer_text', in_array( $current_screen->id, $wc_pages ) ) ) {
3158
- // Change the footer text
3159
- if ( ! get_option( 'woocommerce_admin_footer_text_rated' ) ) {
3160
- $footer_text = sprintf( __( 'If you like <strong>Abandoned Cart Lite for WooCommerce</strong> then please <a href="https://wordpress.org/support/plugin/woocommerce-abandoned-cart/reviews/">leave a review </a> for us and let us know how we are doing. A review will help us immensely.', 'woocommerce-ac' ) );
3161
- wc_enqueue_js( "
3162
- jQuery( 'a.wc-rating-link' ).click( function() {
3163
- jQuery.post( '" . WC()->ajax_url() . "', { action: 'woocommerce_rated' } );
3164
  jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
3165
  });
3166
- " );
3167
- } else {
3168
- $footer_text = __( 'Thank you for selling with Abandoned Cart Lite for WooCommerce.', 'woocommerce-ac' );
3169
- }
3170
- }
3171
- }
3172
  return $footer_text;
3173
  }
3174
 
3
  * Plugin Name: Abandoned Cart Lite for WooCommerce
4
  * Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
5
  * Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
6
+ * Version: 4.5
7
  * Author: Tyche Softwares
8
  * Author URI: http://www.tychesoftwares.com/
9
  * Text Domain: woocommerce-ac
25
  require_once( "includes/wcal_ts_tracking.php");
26
  require_once( "includes/wcal_admin_notice.php");
27
 
28
+ if ( is_admin() ) {
29
+ require_once( 'includes/welcome.php' );
30
+
31
+ define( 'WCAL_VERSION', wcal_common::wcal_get_version() );
32
+
33
+ define( 'WCAL_PLUGIN_URL', wcal_common::wcal_get_plugin_url() );
34
+ }
35
+
36
  // Add a new interval of 15 minutes
37
  add_filter( 'cron_schedules', 'wcal_add_cron_schedule' );
38
 
147
  delete_option( 'wcal_from_name' );
148
  delete_option( 'wcal_from_email' );
149
  delete_option( 'wcal_reply_email' );
150
+
151
+ delete_option( 'ac_security_key' );
152
+ delete_option( 'wcal_activate_time' );
153
+ delete_option( 'ac_lite_alter_table_queries' );
154
+ delete_option( 'ac_lite_delete_alter_table_queries' );
155
+ delete_option( 'wcal_allow_tracking' );
156
+ delete_option( 'wcal_ts_tracker_last_send' );
157
+
158
+ delete_option( 'wcal_welcome_page_shown_time' );
159
+ delete_option( 'wcal_welcome_page_shown' );
160
  }
161
  /**
162
  * woocommerce_abandon_cart_lite class
646
  exit;
647
  }
648
  }
649
+
650
  // Language Translation
651
  function wcal_update_po_file() {
652
  $domain = 'woocommerce-ac';
655
  return $loaded;
656
  } else {
657
  load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/i18n/languages/' );
658
+ }
659
  }
660
 
661
  /*-----------------------------------------------------------------------------------*/
733
  update_option( 'woocommerce_ac_default_templates_installed', "yes" );
734
  }
735
  }
736
+
737
+ $guest_table = $wpdb->prefix."ac_guest_abandoned_cart_history_lite" ;
738
+ $query_guest_table = "SHOW TABLES LIKE '$guest_table' ";
739
+ $result_guest_table = $wpdb->get_results( $query_guest_table );
740
+
741
+ if ( count( $result_guest_table ) == 0 ) {
742
+
743
+ $ac_guest_history_table_name = $wpdb->prefix . "ac_guest_abandoned_cart_history_lite";
744
+ $ac_guest_history_query = "CREATE TABLE IF NOT EXISTS $ac_guest_history_table_name (
745
+ `id` int(15) NOT NULL AUTO_INCREMENT,
746
+ `billing_first_name` text,
747
+ `billing_last_name` text,
748
+ `billing_company_name` text,
749
+ `billing_address_1` text,
750
+ `billing_address_2` text,
751
+ `billing_city` text,
752
+ `billing_county` text,
753
+ `billing_zipcode` text,
754
+ `email_id` text,
755
+ `phone` text,
756
+ `ship_to_billing` text,
757
+ `order_notes` text,
758
+ `shipping_first_name` text,
759
+ `shipping_last_name` text,
760
+ `shipping_company_name` text,
761
+ `shipping_address_1` text,
762
+ `shipping_address_2` text,
763
+ `shipping_city` text,
764
+ `shipping_county` text,
765
+ `shipping_zipcode` double,
766
+ `shipping_charges` double,
767
+ PRIMARY KEY (`id`)
768
+ ) $wcap_collate AUTO_INCREMENT=63000000";
769
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
770
+ $wpdb->query( $ac_guest_history_query );
771
+ }
772
+
773
  /**
774
  * This is add for thos user who Install the plguin first time.
775
  * So for them this option will be cheked.
798
  * WP Settings API
799
  **************************************************************/
800
  function wcal_initialize_plugin_options() {
801
+
802
  // First, we register a section. This is necessary since all future options must belong to a
803
  add_settings_section(
804
  'ac_lite_general_settings_section', // ID used to identify this section and with which to register options
1040
  *************************************************/
1041
  function wcal_update_db_check() {
1042
  global $wpdb;
1043
+
1044
+ if( get_option( 'ac_lite_alter_table_queries' ) != 'yes' ) {
1045
+
1046
+ $ac_history_table_name = $wpdb->prefix."ac_abandoned_cart_history_lite";
1047
+ $check_table_query = "SHOW COLUMNS FROM $ac_history_table_name LIKE 'user_type'";
1048
+ $results = $wpdb->get_results( $check_table_query );
 
 
 
 
 
 
1049
 
1050
+ if ( count( $results ) == 0 ) {
1051
+ $alter_table_query = "ALTER TABLE $ac_history_table_name ADD `user_type` text AFTER `recovered_cart`";
1052
+ $wpdb->get_results( $alter_table_query );
1053
  }
1054
+
1055
+ $table_name = $wpdb->prefix . "ac_email_templates_lite";
1056
+ $check_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'is_wc_template' ";
1057
+ $results = $wpdb->get_results( $check_template_table_query );
1058
+
1059
+ if ( count( $results ) == 0 ) {
1060
+ $alter_template_table_query = "ALTER TABLE $table_name
1061
+ ADD COLUMN `is_wc_template` enum('0','1') COLLATE utf8_unicode_ci NOT NULL AFTER `template_name`,
1062
+ ADD COLUMN `default_template` int(11) NOT NULL AFTER `is_wc_template`";
1063
+ $wpdb->get_results( $alter_template_table_query );
1064
+ }
1065
+
1066
 
1067
+ $table_name = $wpdb->prefix . "ac_email_templates_lite";
1068
+ $check_email_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'wc_email_header' ";
1069
+ $results_email = $wpdb->get_results( $check_email_template_table_query );
1070
+
1071
+ if ( count( $results_email ) == 0 ) {
1072
+ $alter_email_template_table_query = "ALTER TABLE $table_name
1073
+ ADD COLUMN `wc_email_header` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `default_template`";
1074
+ $wpdb->get_results( $alter_email_template_table_query );
1075
+ }
1076
+
1077
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_abandoned_cart_history_lite';" ) ) {
1078
+ if ( ! $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_abandoned_cart_history_lite` LIKE 'unsubscribe_link';" ) ) {
1079
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_abandoned_cart_history_lite ADD `unsubscribe_link` enum('0','1') COLLATE utf8_unicode_ci NOT NULL AFTER `user_type`;" );
1080
+ }
1081
+ }
1082
+
1083
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_abandoned_cart_history_lite';" ) ) {
1084
+ if ( ! $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_abandoned_cart_history_lite` LIKE 'session_id';" ) ) {
1085
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_abandoned_cart_history_lite ADD `session_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `unsubscribe_link`;" );
1086
+ }
1087
+ }
1088
+ /**
1089
+ *
1090
+ * This is used to prevent guest users wrong Id. If guest users id is less then 63000000 then this code will ensure that we
1091
+ * will change the id of guest tables so it wont affect on the next guest users.
1092
+ */
1093
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_guest_abandoned_cart_history_lite';" ) && 'yes' != get_option( 'wcal_guest_user_id_altered' ) ) {
1094
+ $last_id = $wpdb->get_var( "SELECT max(id) FROM `{$wpdb->prefix}ac_guest_abandoned_cart_history_lite`;" );
1095
+ if ( NULL != $last_id && $last_id <= 63000000 ) {
1096
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_guest_abandoned_cart_history_lite AUTO_INCREMENT = 63000000;" );
1097
+ update_option ( 'wcal_guest_user_id_altered', 'yes' );
1098
+ }
1099
  }
1100
 
1101
+ /**
1102
+ * We have moved email templates fields in the setings section. SO to remove that fields column fro the db we need it.
1103
+ * For existing user we need to fill this setting with the first template.
1104
+ * @since 4.7
1105
+ */
1106
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_email_templates_lite';" ) ) {
1107
+ if ( $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_email_templates_lite` LIKE 'from_email';" ) ) {
1108
+ $get_email_template_query = "SELECT `from_email` FROM {$wpdb->prefix}ac_email_templates_lite WHERE `is_active` = '1' ORDER BY `id` ASC LIMIT 1";
1109
+ $get_email_template_result = $wpdb->get_results ($get_email_template_query);
1110
+ $wcal_from_email = '';
1111
+ if ( isset( $get_email_template_result ) && count ( $get_email_template_result ) > 0 ){
1112
+ $wcal_from_email = $get_email_template_result[0]->from_email;
1113
+ /* Store data in setings api*/
1114
+ update_option ( 'wcal_from_email', $wcal_from_email );
1115
+ /* Delete table from the Db*/
1116
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_email_templates_lite DROP COLUMN `from_email`;" );
1117
+ }
1118
+ }
1119
 
1120
+ if ( $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_email_templates_lite` LIKE 'from_name';" ) ) {
1121
+ $get_email_template_from_name_query = "SELECT `from_name` FROM {$wpdb->prefix}ac_email_templates_lite WHERE `is_active` = '1' ORDER BY `id` ASC LIMIT 1";
1122
+ $get_email_template_from_name_result = $wpdb->get_results ($get_email_template_from_name_query);
1123
+ $wcal_from_name = '';
1124
+ if ( isset( $get_email_template_from_name_result ) && count ( $get_email_template_from_name_result ) > 0 ){
1125
+ $wcal_from_name = $get_email_template_from_name_result[0]->from_name;
1126
+ /* Store data in setings api*/
1127
+ add_option ( 'wcal_from_name', $wcal_from_name );
1128
+ /* Delete table from the Db*/
1129
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_email_templates_lite DROP COLUMN `from_name`;" );
1130
+ }
1131
+ }
1132
+
1133
+ if ( $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_email_templates_lite` LIKE 'reply_email';" ) ) {
1134
+ $get_email_template_reply_email_query = "SELECT `reply_email` FROM {$wpdb->prefix}ac_email_templates_lite WHERE `is_active` = '1' ORDER BY `id` ASC LIMIT 1";
1135
+ $get_email_template_reply_email_result = $wpdb->get_results ($get_email_template_reply_email_query);
1136
+ $wcal_reply_email = '';
1137
+ if ( isset( $get_email_template_reply_email_result ) && count ( $get_email_template_reply_email_result ) > 0 ){
1138
+ $wcal_reply_email = $get_email_template_reply_email_result[0]->reply_email;
1139
+ /* Store data in setings api*/
1140
+ update_option ( 'wcal_reply_email', $wcal_reply_email );
1141
+ /* Delete table from the Db*/
1142
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_email_templates_lite DROP COLUMN `reply_email`;" );
1143
+ }
1144
+ }
1145
+ }
1146
+
1147
+ if ( !get_option( 'wcal_security_key' ) ){
1148
+ update_option( 'wcal_security_key', 'qJB0rGtIn5UB1xG03efyCp' );
1149
+ }
1150
+
1151
  update_option( 'ac_lite_alter_table_queries', 'yes' );
1152
  }
1153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1154
  //get the option, if it is not set to individual then convert to individual records and delete the base record
1155
+ $ac_settings = get_option( 'ac_lite_settings_status' );
1156
  if ( $ac_settings != 'INDIVIDUAL' ) {
1157
  //fetch the existing settings and save them as inidividual to be used for the settings API
1158
  $woocommerce_ac_settings = json_decode( get_option( 'woocommerce_ac_settings' ) );
1178
  //Delete the main settings record
1179
  delete_option( 'woocommerce_ac_settings' );
1180
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1181
  }
1182
 
1183
  /**
1892
  }
1893
 
1894
  function wcal_action_admin_init() {
1895
+
1896
  // only hook up these filters if we're in the admin panel and the current user has permission
1897
  // to edit posts and pages
1898
+ if ( !isset( $_GET['page'] ) || $_GET['page'] != "woocommerce_ac_page" ) {
1899
+ return;
1900
+ }
1901
  if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
1902
  return;
1903
  }
 
 
 
1904
  if ( get_user_option( 'rich_editing' ) == 'true' ) {
1905
  remove_filter( 'the_excerpt', 'wpautop' );
1906
  add_filter( 'tiny_mce_before_init', array( &$this, 'wcal_format_tiny_MCE' ) );
1907
  add_filter( 'mce_buttons', array( &$this, 'wcal_filter_mce_button' ) );
1908
  add_filter( 'mce_external_plugins', array( &$this, 'wcal_filter_mce_plugin' ) );
1909
+ }
1910
  if ( isset( $_GET['page'] ) && 'woocommerce_ac_page' == $_GET['page'] ) {
1911
  if( session_id() === '' ){
1912
  //session has not started
3130
  }
3131
 
3132
  function wcal_admin_footer_text( $footer_text ) {
3133
+
3134
+ if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'woocommerce_ac_page' ) {
3135
+ $footer_text = sprintf( __( 'If you love <strong>Abandoned Cart Lite for WooCommerce</strong>, then please leave us a <a href="https://wordpress.org/support/plugin/woocommerce-abandoned-cart/reviews/?rate=5#new-post" target="_blank" class="ac-rating-link" data-rated="Thanks :)">★★★★★</a>
3136
+ rating. Thank you in advance. :)', 'woocommerce-ac' ) );
3137
+ wc_enqueue_js( "
3138
+ jQuery( 'a.ac-rating-link' ).click( function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3139
  jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
3140
  });
3141
+ " );
3142
+ }
 
 
 
 
3143
  return $footer_text;
3144
  }
3145