Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 3.0.1

Version Description

  • 12/03/2021 =
    • Bug fixes
    • Performance improvement
    • Site speed issue got resolved.
Download this release

Release Info

Developer Tatvic
Plugin Icon 128x128 Enhanced Ecommerce Google Analytics Plugin for WooCommerce
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0.0 to 3.0.1

Files changed (117) hide show
  1. LICENSE.txt +0 -0
  2. admin/class-enhanced-ecommerce-google-analytics-admin.php +256 -75
  3. admin/class-enhanced-ecommerce-google-analytics-settings.php +30 -2
  4. admin/class-tvc-admin-helper.php +435 -0
  5. admin/css/enhanced-ecommerce-google-analytics-admin.css +363 -0
  6. admin/images.zip +0 -0
  7. admin/images/adwords.png +0 -0
  8. admin/images/banner.png +0 -0
  9. admin/images/cotlw.gif +0 -0
  10. admin/images/cotlw.png +0 -0
  11. admin/images/discount.gif +0 -0
  12. admin/images/facebook.jpg +0 -0
  13. admin/images/google_optimize.png +0 -0
  14. admin/images/m1.png +0 -0
  15. admin/images/m2.png +0 -0
  16. admin/images/new-2.gif +0 -0
  17. admin/images/new-img.gif +0 -0
  18. admin/images/no-config-success.svg +0 -1
  19. admin/images/plugin_bk.png +0 -0
  20. admin/images/rating.png +0 -0
  21. admin/images/ratings.png +0 -0
  22. admin/images/refresh.png +0 -0
  23. admin/images/shopify_new.png +0 -0
  24. admin/images/tatvic_logo.png +0 -0
  25. admin/images/woo.png +0 -0
  26. admin/images/woo_banner_adv.gif +0 -0
  27. admin/index.php +0 -0
  28. admin/js/enhanced-ecommerce-google-analytics-admin.js +0 -0
  29. {includes/setup → admin}/js/jquery-3.5.1.min.js +0 -0
  30. admin/partials/about-plugin.php +2 -2
  31. admin/partials/enhanced-ecommerce-google-analytics-admin-display.php +89 -44
  32. admin/partials/general-fields.php +331 -133
  33. admin/partials/sidebar.php +6 -3
  34. enhanced-ecommerce-google-analytics.php +76 -9
  35. includes/application/class-feed-master.php +0 -676
  36. includes/application/class-tvc-email.php +0 -68
  37. includes/application/class-tvc-feed-processor.php +0 -341
  38. includes/application/class-tvc-feed-queries.php +0 -243
  39. includes/application/class-tvc-feed-value-editors.php +0 -240
  40. includes/application/class-tvc-schedules.php +0 -147
  41. includes/application/google/class-feed.php +0 -213
  42. includes/application/tvc-cron-functions.php +0 -54
  43. includes/application/tvc-feed-processing-support.php +0 -1583
  44. includes/application/tvc-feed-processor-functions.php +0 -107
  45. includes/class-enhanced-ecommerce-google-analytics-activator.php +0 -0
  46. includes/class-enhanced-ecommerce-google-analytics-deactivator.php +0 -0
  47. includes/class-enhanced-ecommerce-google-analytics-i18n.php +0 -0
  48. includes/class-enhanced-ecommerce-google-analytics-loader.php +0 -0
  49. includes/class-enhanced-ecommerce-google-analytics.php +58 -8
  50. includes/class-tvc-register-scripts.php +9 -9
  51. includes/data/class-tvc-ajax-file.php +82 -64
  52. includes/data/class-tvc-backup.php +0 -181
  53. includes/data/class-tvc-channel-ftp.php +0 -37
  54. includes/data/class-tvc-channel.php +0 -342
  55. includes/data/class-tvc-data.php +0 -713
  56. includes/data/class-tvc-db-management.php +0 -325
  57. includes/data/class-tvc-tab.php +0 -126
  58. includes/data/class-tvc-variations.php +0 -85
  59. includes/data/tvc-admin-functions.php +0 -372
  60. includes/index.php +0 -0
  61. includes/json/client-secrets.json +0 -26
  62. includes/json/currency.json +0 -252
  63. includes/libraries/tvc-background-process.php +0 -754
  64. includes/setup/CustomApi.php +41 -31
  65. includes/setup/ShoppingApi.php +2 -2
  66. includes/setup/add-campaign.php +3 -1
  67. includes/setup/class-tatvic-category-selector-element.php +1 -1
  68. includes/setup/class-tvc-database-management.php +0 -537
  69. includes/setup/class-tvc-folders.php +0 -147
  70. includes/setup/class-tvc-prepare-taxonomy.php +0 -375
  71. includes/setup/google-ads.php +167 -236
  72. includes/setup/google-shopping-feed-gaa-config.php +407 -464
  73. includes/setup/google-shopping-feed-shopping-campaigns.php +1 -1
  74. includes/setup/google-shopping-feed-sync-product.php +459 -490
  75. includes/setup/google-shopping-feed.php +197 -233
  76. includes/setup/help-html.php +35 -29
  77. includes/setup/img/lock.png +0 -0
  78. includes/setup/img/tick-mark.png +0 -0
  79. includes/setup/img/tvc-lock-large.png +0 -0
  80. includes/setup/img/tvc-lock.png +0 -0
  81. includes/setup/img/tvc-tick-large.png +0 -0
  82. includes/setup/img/tvc-tick.png +0 -0
  83. includes/setup/json/client-secrets.json +1 -1
  84. includes/user-interface/abstract-tvc-category-wrapper.php +0 -87
  85. includes/user-interface/class-tvc-add-options-page.php +0 -64
  86. includes/user-interface/class-tvc-admin-page.php +0 -131
  87. includes/user-interface/class-tvc-i18n-scripts.php +0 -240
  88. includes/user-interface/class-tvc-list-table.php +0 -863
  89. includes/user-interface/class-tvc-main-admin-page.php +0 -117
  90. includes/user-interface/class-tvc-product-feed-category-wrapper.php +0 -51
  91. includes/user-interface/class-tvc-product-feed-page.php +0 -182
  92. includes/user-interface/elements/class-tvc-attribute-selector-element.php +0 -113
  93. includes/user-interface/elements/class-tvc-category-selector-element.php +0 -121
  94. includes/user-interface/js/fontawesome.js +0 -2
  95. includes/user-interface/js/sweetalert.min.js +0 -1
  96. includes/user-interface/js/tvc_backup-list.js +0 -89
  97. includes/user-interface/js/tvc_backup-list.min.js +0 -60
  98. includes/user-interface/js/tvc_feed-form-events.js +0 -331
  99. includes/user-interface/js/tvc_feed-form-events.min.js +0 -1
  100. includes/user-interface/js/tvc_feed-form.js +0 -2604
  101. includes/user-interface/js/tvc_feed-form.min.js +0 -1770
  102. includes/user-interface/js/tvc_feed-html.js +0 -513
  103. includes/user-interface/js/tvc_feed-html.min.js +0 -1
  104. includes/user-interface/js/tvc_feed-list.js +0 -284
  105. includes/user-interface/js/tvc_feed-list.min.js +0 -227
  106. includes/user-interface/js/tvc_msg_events.js +0 -27
  107. includes/user-interface/js/tvc_msg_events.min.js +0 -1
  108. includes/user-interface/js/tvc_setting-form.js +0 -150
  109. includes/user-interface/js/tvc_setting-form.min.js +0 -1
  110. includes/user-interface/js/tvc_support.js +0 -261
  111. includes/user-interface/js/tvc_support.min.js +0 -192
  112. includes/user-interface/js/tvc_verify-inputs.js +0 -79
  113. includes/user-interface/js/tvc_verify-inputs.min.js +0 -1
  114. includes/user-interface/tvc-admin-menu-functions.php +0 -92
  115. index.php +0 -0
  116. languages/enhanced-ecommerce-google-analytics.pot +0 -0
  117. public/class-enhanced-ecommerce-google-analytics-public.php +679 -182
LICENSE.txt CHANGED
File without changes
admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -20,9 +20,8 @@
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
  */
23
- //require __DIR__ . '../includes/setup/CustomerClient.php';
24
 
25
- class Enhanced_Ecommerce_Google_Analytics_Admin {
26
 
27
  /**
28
  * The ID of this plugin.
@@ -52,88 +51,46 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
52
  protected $ga_id;
53
  protected $ga_LC;
54
  protected $ga_eeT;
55
- protected $customerClient;
56
-
57
- public function __construct($plugin_name, $version) {
58
-
59
  $this->plugin_name = $plugin_name;
60
  $this->version = $version;
61
- if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
62
- $protocol = 'https://';
63
- } else {
64
- $protocol = 'http://';
65
- }
66
- $server_name = $_SERVER['SERVER_NAME'];
67
- $domain = $protocol.$server_name;
68
- $woo_country = $this->woo_country();
69
- $country = (!empty($woo_country)) ? $woo_country[0] : 'US';
70
- $currency_code = $this->get_currency_code();
71
- $timezone = get_option('timezone_string');
72
- //sigin with google
73
- $this->returnUrl = "estorenew.tatvic.com/tat_ee/ads-analytics-form.php?domain=".$domain."&country=".$country."&user_currency=".$currency_code."&timezone".$timezone;
74
  $this->accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : '';
75
  $this->refreshToken = isset($_GET['refresh_token']) ? $_GET['refresh_token'] : '';
76
  $this->email = isset($_GET['email']) ? $_GET['email'] : '';
77
-
78
- if(isset($_GET['property_id']) && isset($_GET['ads_id'])) {
79
- $data = unserialize(get_option('ee_options'));
80
- if(isset($data['ga_id']) && ($data['ga_id'] != $_GET['property_id'])) {
81
- $_POST['ga_id'] = $_GET['property_id'];
82
- $_POST['ads_id'] = $_GET['ads_id'];
83
- } else if(isset($data['ga_id']) && ($data['ga_id'] == $_GET['property_id'])) {
84
- if($_GET['ads_id'] != '') {
85
- $_POST['ga_id'] = $_GET['property_id'];
86
- $_POST['ads_id'] = $_GET['ads_id'];
87
- } else {
88
- $_POST['ga_id'] = $_GET['property_id'];
89
- }
90
- } else {
91
- $_POST['ga_id'] = $_GET['property_id'];
92
- $_POST['ads_id'] = $_GET['ads_id'];
93
- }
94
-
95
- Enhanced_Ecommerce_Google_Settings::update_analytics_options('ee_options');
96
- }
97
-
98
- $this->url = "https://estorenew.tatvic.com/tat_ee/ga_rdr_ee.php?return_url=" . $this->returnUrl;
99
- }
100
-
101
- /**
102
- * @return array
103
- * Get woocommerce default set country
104
- */
105
- private function woo_country(){
106
- // The country/state
107
- $store_raw_country = get_option( 'woocommerce_default_country' );
108
- // Split the country/state
109
- $split_country = explode( ":", $store_raw_country );
110
- return $split_country;
111
- }
112
- /**
113
- * @return mixed
114
- */
115
- private function get_currency_code(){
116
- $woo_country = $this->woo_country();
117
- $country = (!empty($woo_country)) ? $woo_country[0] : 'US';
118
- $getCurrency = file_get_contents(ENHANCAD_PLUGIN_DIR . 'includes/json/currency.json');
119
- $contData = json_decode($getCurrency);
120
- return $contData->{$country};
121
  }
 
122
  /**
123
  * Register the stylesheets for the admin area.
124
  *
125
  * @since 1.0.0
126
  */
127
  public function enqueue_styles() {
128
-
129
  $screen = get_current_screen();
130
  if ($screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' || (isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')) {
131
  wp_register_style('font_awesome', '//use.fontawesome.com/releases/v5.0.13/css/all.css');
132
  wp_enqueue_style('font_awesome');
133
- wp_register_style('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
134
- wp_enqueue_style('aga_bootstrap');
135
  wp_register_style('aga_confirm', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css');
136
  wp_enqueue_style('aga_confirm');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all');
138
  }
139
  }
@@ -144,16 +101,34 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
144
  * @since 1.0.0
145
  */
146
  public function enqueue_scripts() {
147
-
148
  $screen = get_current_screen();
149
  if ($screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' || (isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')) {
 
 
 
150
  wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
151
  wp_enqueue_script('popper_bootstrap');
152
- wp_register_script('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js');
153
  wp_enqueue_script('aga_bootstrap');
 
 
154
  wp_register_script('aga_confirm_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js');
155
  wp_enqueue_script('aga_confirm_js');
156
  wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/enhanced-ecommerce-google-analytics-admin.js', array('jquery'), $this->version, false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  }
158
  }
159
 
@@ -164,7 +139,23 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
164
  */
165
  public function display_admin_page() {
166
  add_menu_page(
167
- 'Tatvic EE Plugin', 'Tatvic EE Plugin', 'manage_options', "enhanced-ecommerce-google-analytics-admin-display", array($this, 'showPage'), plugin_dir_url(__FILE__) . 'images/tatvic_logo.png', 26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  );
169
  }
170
  /**
@@ -173,7 +164,9 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
173
  * @since 1.0.0
174
  */
175
  public function showPage() {
 
176
  require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
 
177
  if (!empty($_GET['tab'])) {
178
  $get_action = $_GET['tab'];
179
  } else {
@@ -182,28 +175,216 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
182
  if (method_exists($this, $get_action)) {
183
  $this->$get_action();
184
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
 
187
- public function general_settings() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  require_once( 'partials/general-fields.php');
189
  }
190
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  public function conversion_tracking() {
192
  require_once( 'partials/conversion-tracking.php');
193
  }
194
-
195
  public function google_optimize() {
196
  require_once( 'partials/google-optimize.php');
197
  }
198
-
199
  public function about_plugin() {
200
  require_once( 'partials/about-plugin.php');
201
  }
202
  public function country_location() {
203
  // date function to hide 30% off sale after certain date
204
  return date_default_timezone_set('Australia/Sydney'); // Change this depending on what timezone your in
205
- }
206
-
207
  public function today() {
208
  $this->country_location();
209
  return strtotime(date('Y-m-d'));
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
  */
 
23
 
24
+ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
25
 
26
  /**
27
  * The ID of this plugin.
51
  protected $ga_id;
52
  protected $ga_LC;
53
  protected $ga_eeT;
54
+ protected $setting_status;
55
+ protected $site_url;
56
+ public function __construct($plugin_name, $version) {
 
57
  $this->plugin_name = $plugin_name;
58
  $this->version = $version;
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  $this->accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : '';
60
  $this->refreshToken = isset($_GET['refresh_token']) ? $_GET['refresh_token'] : '';
61
  $this->email = isset($_GET['email']) ? $_GET['email'] : '';
62
+ $this->url = $this->get_connect_url();
63
+ $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
+
66
  /**
67
  * Register the stylesheets for the admin area.
68
  *
69
  * @since 1.0.0
70
  */
71
  public function enqueue_styles() {
 
72
  $screen = get_current_screen();
73
  if ($screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' || (isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')) {
74
  wp_register_style('font_awesome', '//use.fontawesome.com/releases/v5.0.13/css/all.css');
75
  wp_enqueue_style('font_awesome');
76
+ wp_register_style('plugin-bootstrap',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.min.css');
77
+ wp_enqueue_style('plugin-bootstrap');
78
  wp_register_style('aga_confirm', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css');
79
  wp_enqueue_style('aga_confirm');
80
+
81
+ wp_enqueue_style('custom-css', ENHANCAD_PLUGIN_URL . '/includes/setup/css/custom-style.css', array(), $this->version, 'all' );
82
+ if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
83
+ wp_register_style('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css');
84
+ wp_enqueue_style('plugin-select2');
85
+ wp_register_style('plugin-steps',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.css');
86
+ wp_enqueue_style('plugin-steps');
87
+ }
88
+ if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
89
+ wp_register_style('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css');
90
+ wp_enqueue_style('plugin-select2');
91
+ wp_register_style('bootstrap-datepicker',ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.css');
92
+ wp_enqueue_style('bootstrap-datepicker');
93
+ }
94
  wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all');
95
  }
96
  }
101
  * @since 1.0.0
102
  */
103
  public function enqueue_scripts() {
 
104
  $screen = get_current_screen();
105
  if ($screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' || (isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')) {
106
+
107
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/sweetalert.min.js', array( 'jquery' ), $this->version, false );
108
+ wp_enqueue_script( 'custom-jquery', ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js', array( 'jquery' ), $this->version, false );
109
  wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
110
  wp_enqueue_script('popper_bootstrap');
111
+ wp_register_script('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.5.1/js/bootstrap.min.js');
112
  wp_enqueue_script('aga_bootstrap');
113
+ wp_register_script('aga_bootstrap_mod', 'https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js');
114
+ wp_enqueue_script('aga_bootstrap_mod');
115
  wp_register_script('aga_confirm_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js');
116
  wp_enqueue_script('aga_confirm_js');
117
  wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/enhanced-ecommerce-google-analytics-admin.js', array('jquery'), $this->version, false);
118
+ if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
119
+ wp_register_script('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js');
120
+ wp_enqueue_script('plugin-select2');
121
+ wp_register_script('plugin-step-js',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.js');
122
+ wp_enqueue_script('plugin-step-js');
123
+ }
124
+ if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
125
+ wp_register_script('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js');
126
+ wp_enqueue_script('plugin-select2');
127
+ wp_register_script('plugin-chart',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/chart/chart.js');
128
+ wp_enqueue_script('plugin-chart');
129
+ wp_register_script('bootstrap_datepicker',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js');
130
+ wp_enqueue_script('bootstrap_datepicker');
131
+ }
132
  }
133
  }
134
 
139
  */
140
  public function display_admin_page() {
141
  add_menu_page(
142
+ 'Tatvic EE Plugin', 'Tatvic EE Plugin', 'manage_options', "enhanced-ecommerce-google-analytics-admin-display", array($this, 'showPage'), plugin_dir_url(__FILE__) . 'images/tatvic_logo.png', 26
143
+ );
144
+ add_submenu_page(
145
+ 'enhanced-ecommerce-google-analytics-admin-display',
146
+ esc_html__('Google Ads', 'actionable-google-analytics-admin-display'),
147
+ esc_html__('Google Ads', 'actionable-google-analytics-admin-display'),
148
+ 'manage_woocommerce',
149
+ 'enhanced-ecommerce-google-analytics-admin-display&tab=google_ads',
150
+ array($this, 'showPage')
151
+ );
152
+ add_submenu_page(
153
+ 'enhanced-ecommerce-google-analytics-admin-display',
154
+ esc_html__('Google Shopping', 'enhanced-ecommerce-google-analytics-admin-display'),
155
+ esc_html__('Google Shopping', 'enhanced-ecommerce-google-analytics-admin-display'),
156
+ 'manage_woocommerce',
157
+ 'enhanced-ecommerce-google-analytics-admin-display&tab=google_shopping_feed',
158
+ array($this, 'showPage')
159
  );
160
  }
161
  /**
164
  * @since 1.0.0
165
  */
166
  public function showPage() {
167
+ echo '<div class="tvc_plugin_container">';
168
  require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
169
+ new TVC_Tabs();
170
  if (!empty($_GET['tab'])) {
171
  $get_action = $_GET['tab'];
172
  } else {
175
  if (method_exists($this, $get_action)) {
176
  $this->$get_action();
177
  }
178
+ echo '</div>';
179
+ }
180
+ public function check_nall_and_message($val, $msg, $msg_false){
181
+ if((isset($val) && $val != "" && $val != 0) ){
182
+ return $msg;
183
+ }else{
184
+ return $msg_false;
185
+ }
186
+ }
187
+ public function check_setting_status(){
188
+ if(!empty($this->setting_status)){
189
+ return $this->setting_status;
190
+ }else{
191
+ $google_detail = $this->get_ee_options_data();
192
+ $setting_status = array();
193
+ if(isset($google_detail['setting'])){
194
+ $googleDetail = $google_detail['setting'];
195
+ //for google analytic
196
+ if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "BOTH" ){
197
+ if($googleDetail->property_id != "" && $googleDetail->measurement_id != ""){
198
+ $setting_status['google_analytic']= true;
199
+ $setting_status['google_analytic_msg']= "";
200
+ }else if($googleDetail->property_id == "" ){
201
+ $setting_status['google_analytic']= false;
202
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
203
+ }else if($googleDetail->measurement_id == "" ){
204
+ $setting_status['google_analytic']= false;
205
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
206
+ }
207
+ }else if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && $googleDetail->tracking_option == "GA4"){
208
+ if( $googleDetail->measurement_id != ""){
209
+ $setting_status['google_analytic']= true;
210
+ $setting_status['google_analytic_msg']= "";
211
+ }else{
212
+ $setting_status['google_analytic']= false;
213
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
214
+ }
215
+ }else if(isset($googleDetail->tracking_option) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "UA" ){
216
+ if($googleDetail->property_id != ""){
217
+ $setting_status['google_analytic']= true;
218
+ $setting_status['google_analytic_msg']= "";
219
+ }else{
220
+ $setting_status['google_analytic']= false;
221
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
222
+ }
223
+ }else{
224
+ $setting_status['google_analytic']= false;
225
+ $setting_status['google_analytic_msg']= "";
226
+ }
227
+ // for google shopping
228
+ if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"google_ads_id") ){
229
+ //main tab
230
+ if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
231
+ $setting_status['google_shopping']= true;
232
+ $setting_status['google_shopping_msg']= "";
233
+ }else if($googleDetail->google_merchant_center_id == ""){
234
+ $setting_status['google_shopping']= false;
235
+ $setting_status['google_shopping_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
236
+ }else if($googleDetail->google_ads_id == ""){
237
+ $setting_status['google_shopping']= false;
238
+ $setting_status['google_shopping_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
239
+ }
240
+ }else{
241
+ $setting_status['google_shopping']= false;
242
+ $setting_status['google_shopping_msg']= "";
243
+ }
244
+
245
+ //google_ads_id
246
+ if(property_exists($googleDetail,"google_ads_id") && property_exists($googleDetail,"google_merchant_center_id") ){
247
+ if( $googleDetail->google_ads_id != "" && $googleDetail->google_merchant_center_id != ""){
248
+ $setting_status['google_ads']= true;
249
+ $setting_status['google_ads_msg']= "";
250
+ }else if($googleDetail->google_merchant_center_id == ""){
251
+ $setting_status['google_ads']= false;
252
+ $setting_status['google_ads_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
253
+ }else if($googleDetail->google_ads_id == ""){
254
+ $setting_status['google_ads']= false;
255
+ $setting_status['google_ads_msg']= "Configure Google Ads account to reach to millions of interested shoppers <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
256
+ }
257
+ }else{
258
+ $setting_status['google_ads']= false;
259
+ $setting_status['google_ads_msg']= "";
260
+ }
261
+ }
262
+ $this->setting_status = $setting_status;
263
+ return $setting_status;
264
+ }
265
  }
266
+ public function check_setting_status_sub_tabs(){
267
+ $google_detail = $this->get_ee_options_data();
268
+ $setting_status = array();
269
+ if(isset($google_detail['setting'])){
270
+ $googleDetail = $google_detail['setting'];
271
+ //sub tab shopping config
272
+ if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"is_site_verified") && property_exists($googleDetail,"is_domain_claim") && property_exists($googleDetail,"google_ads_id")){
273
+ if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != "" && $googleDetail->is_site_verified == 1 && $googleDetail->is_domain_claim == 1 ){
274
+ $setting_status['google_shopping_conf']= true;
275
+ $setting_status['google_shopping_conf_msg']= "Google Shopping Configuration Success.";
276
+ }else if($googleDetail->google_merchant_center_id == "" || $googleDetail->google_ads_id == "" ){
277
+ $setting_status['google_shopping_conf']= false;
278
+ $setting_status['google_shopping_conf_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
279
+ }else if($googleDetail->is_site_verified ==0 && $googleDetail->is_domain_claim ==0 ){
280
+ $setting_status['google_shopping_conf']= false;
281
+ $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
282
+ }else if($googleDetail->is_site_verified ==0 ){
283
+ $setting_status['google_shopping_conf']= false;
284
+ $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
285
+ }else if($googleDetail->is_domain_claim ==0 ){
286
+ $setting_status['google_shopping_conf']= false;
287
+ $setting_status['google_shopping_conf_msg']= "Domain claim is pending. Your store url may be linked to other merchant center account.";
288
+ }
289
+ }else{
290
+ $setting_status['google_shopping_conf']= false;
291
+ $missing="";
292
+ }
293
+ //sub tab product sync
294
+ $syncProductList = [];
295
+ $syncProductStat = [];
296
+ if(property_exists($googleDetail,"google_merchant_center_id") && $googleDetail->google_merchant_center_id != ''){
297
+ if(isset($google_detail['prod_sync_status']) && $google_detail['prod_sync_status']){
298
+ $syncProductStat = $google_detail['prod_sync_status'];
299
+ $sync_product_total = (!empty($syncProductStat)) ? $syncProductStat->total : "0";
300
+ $sync_product_approved = (!empty($syncProductStat)) ? $syncProductStat->approved : "0";
301
+ $sync_product_disapproved = (!empty($syncProductStat)) ? $syncProductStat->disapproved : "0";
302
+ $sync_product_pending = (!empty($syncProductStat)) ? $syncProductStat->pending : "0";
303
 
304
+ if($sync_product_total > 1 && $sync_product_approved > 1 && $sync_product_disapproved < 1){
305
+ $setting_status['google_shopping_p_sync']= true;
306
+ $setting_status['google_shopping_p_sync_msg']= "Google Shopping product sync is a success.";
307
+ }else if($sync_product_total < 1){
308
+ $setting_status['google_shopping_p_sync']= false;
309
+ $setting_status['google_shopping_p_sync_msg']= "Sync your product data into Merchant center and get eligible for free listing across Google.";
310
+ }else if($sync_product_disapproved > 0){
311
+ $setting_status['google_shopping_p_sync']= false;
312
+ $setting_status['google_shopping_p_sync_msg']= "There seems to be some problem with your product data. Rectify the issues by selecting right attributes.";
313
+ }
314
+ }
315
+ }else{
316
+ $setting_status['google_shopping_p_sync']= false;
317
+ $setting_status['google_shopping_p_sync_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
318
+ }
319
+
320
+ //sub tab product Campaigns
321
+ if(property_exists($googleDetail,"google_merchant_center_id") && $googleDetail->google_merchant_center_id != ''){
322
+ if(isset($google_detail['campaigns_list']) && $google_detail['campaigns_list']){
323
+ $campaigns_list = $google_detail['campaigns_list'];
324
+ $totalCampaigns = count($campaigns_list);
325
+ if($totalCampaigns < 1){
326
+ $setting_status['google_shopping_p_campaigns']= false;
327
+ $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
328
+ }else{
329
+ $setting_status['google_shopping_p_campaigns']= true;
330
+ }
331
+ }else{
332
+ $setting_status['google_shopping_p_campaigns']= false;
333
+ $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
334
+ }
335
+ }else{
336
+ $setting_status['google_shopping_p_campaigns']= false;
337
+ $setting_status['google_shopping_p_campaigns_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
338
+ }
339
+ }
340
+ return $setting_status;
341
+ }
342
+ public function general_settings() {
343
  require_once( 'partials/general-fields.php');
344
  }
345
+ public function google_ads() {
346
+ require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
347
+ require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-ads.php');
348
+ new GoogleAds();
349
+ }
350
+ public function google_shopping_feed() {
351
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
352
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed.php');
353
+ new GoogleShoppingFeed();
354
+ }
355
+ public function gaa_config_page() {
356
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
357
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-gaa-config.php');
358
+ new GAAConfiguration();
359
+ }
360
+ public function sync_product_page() {
361
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
362
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-sync-product.php');
363
+ new SyncProductConfiguration();
364
+ }
365
+ public function shopping_campaigns_page() {
366
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
367
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-shopping-campaigns.php');
368
+ new CampaignsConfiguration();
369
+ }
370
+ public function add_campaign_page() {
371
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
372
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/add-campaign.php');
373
+ new AddCampaign();
374
+ }
375
  public function conversion_tracking() {
376
  require_once( 'partials/conversion-tracking.php');
377
  }
 
378
  public function google_optimize() {
379
  require_once( 'partials/google-optimize.php');
380
  }
 
381
  public function about_plugin() {
382
  require_once( 'partials/about-plugin.php');
383
  }
384
  public function country_location() {
385
  // date function to hide 30% off sale after certain date
386
  return date_default_timezone_set('Australia/Sydney'); // Change this depending on what timezone your in
387
+ }
 
388
  public function today() {
389
  $this->country_location();
390
  return strtotime(date('Y-m-d'));
admin/class-enhanced-ecommerce-google-analytics-settings.php CHANGED
@@ -26,10 +26,15 @@ if ( ! defined( 'ABSPATH' ) ) {
26
  class Enhanced_Ecommerce_Google_Settings {
27
 
28
  public static function add_update_settings($settings) {
 
29
  if ( !get_option($settings)) {
30
  $ee_options = array();
31
  if(is_array($_POST)) {
32
  foreach ($_POST as $key => $value) {
 
 
 
 
33
  if(!isset($_POST[$key])){
34
  $_POST[$key] = '';
35
  }
@@ -38,13 +43,19 @@ class Enhanced_Ecommerce_Google_Settings {
38
  }
39
  }
40
  }
41
- add_option( $settings, serialize( $ee_options ) );
 
 
42
  }
43
  else {
44
  $get_ee_settings = unserialize(get_option($settings));
45
  if(is_array($get_ee_settings)) {
46
  foreach ($get_ee_settings as $key => $value) {
47
- if(!isset($_POST[$key])){
 
 
 
 
48
  $_POST[$key] = '';
49
  }
50
  if( $_POST[$key] != $value ) {
@@ -54,11 +65,16 @@ class Enhanced_Ecommerce_Google_Settings {
54
  }
55
  if(is_array($_POST)) {
56
  foreach($_POST as $key=>$value){
 
 
 
 
57
  if(!array_key_exists($key,$get_ee_settings)){
58
  $get_ee_settings[$key] = $value;
59
  }
60
  }
61
  }
 
62
  update_option($settings, serialize( $get_ee_settings ));
63
  }
64
  self::admin_notice__success();
@@ -69,6 +85,10 @@ class Enhanced_Ecommerce_Google_Settings {
69
  $ee_options = array();
70
  if(is_array($_POST)) {
71
  foreach ($_POST as $key => $value) {
 
 
 
 
72
  if(!isset($_POST[$key])){
73
  $_POST[$key] = $value;
74
  }
@@ -82,6 +102,10 @@ class Enhanced_Ecommerce_Google_Settings {
82
  $get_ee_settings = unserialize(get_option($settings));
83
  if(is_array($get_ee_settings)) {
84
  foreach ($get_ee_settings as $key => $value) {
 
 
 
 
85
  if(!isset($_POST[$key])){
86
  $_POST[$key] = $value;
87
  }
@@ -93,6 +117,10 @@ class Enhanced_Ecommerce_Google_Settings {
93
 
94
  if(is_array($_POST)) {
95
  foreach($_POST as $key=>$value){
 
 
 
 
96
  if(!array_key_exists($key,$get_ee_settings)){
97
  $get_ee_settings[$key] = $value;
98
  }
26
  class Enhanced_Ecommerce_Google_Settings {
27
 
28
  public static function add_update_settings($settings) {
29
+
30
  if ( !get_option($settings)) {
31
  $ee_options = array();
32
  if(is_array($_POST)) {
33
  foreach ($_POST as $key => $value) {
34
+ if($key == "ee_submit_plugin"){
35
+ unset($_POST["ee_submit_plugin"]);
36
+ continue;
37
+ }
38
  if(!isset($_POST[$key])){
39
  $_POST[$key] = '';
40
  }
43
  }
44
  }
45
  }
46
+ if(!add_option( $settings, serialize( $ee_options ) )){
47
+ update_option($settings, serialize( $ee_options ));
48
+ }
49
  }
50
  else {
51
  $get_ee_settings = unserialize(get_option($settings));
52
  if(is_array($get_ee_settings)) {
53
  foreach ($get_ee_settings as $key => $value) {
54
+ if($key == "ee_submit_plugin"){
55
+ unset($_POST["ee_submit_plugin"]);
56
+ continue;
57
+ }
58
+ if(!isset($_POST[$key]) ){
59
  $_POST[$key] = '';
60
  }
61
  if( $_POST[$key] != $value ) {
65
  }
66
  if(is_array($_POST)) {
67
  foreach($_POST as $key=>$value){
68
+ if($key == "ee_submit_plugin"){
69
+ unset($_POST["ee_submit_plugin"]);
70
+ continue;
71
+ }
72
  if(!array_key_exists($key,$get_ee_settings)){
73
  $get_ee_settings[$key] = $value;
74
  }
75
  }
76
  }
77
+
78
  update_option($settings, serialize( $get_ee_settings ));
79
  }
80
  self::admin_notice__success();
85
  $ee_options = array();
86
  if(is_array($_POST)) {
87
  foreach ($_POST as $key => $value) {
88
+ if($key == "ee_submit_plugin"){
89
+ unset($_POST["ee_submit_plugin"]);
90
+ continue;
91
+ }
92
  if(!isset($_POST[$key])){
93
  $_POST[$key] = $value;
94
  }
102
  $get_ee_settings = unserialize(get_option($settings));
103
  if(is_array($get_ee_settings)) {
104
  foreach ($get_ee_settings as $key => $value) {
105
+ if($key == "ee_submit_plugin"){
106
+ unset($_POST["ee_submit_plugin"]);
107
+ continue;
108
+ }
109
  if(!isset($_POST[$key])){
110
  $_POST[$key] = $value;
111
  }
117
 
118
  if(is_array($_POST)) {
119
  foreach($_POST as $key=>$value){
120
+ if($key == "ee_submit_plugin"){
121
+ unset($_POST["ee_submit_plugin"]);
122
+ continue;
123
+ }
124
  if(!array_key_exists($key,$get_ee_settings)){
125
  $get_ee_settings[$key] = $value;
126
  }
admin/class-tvc-admin-helper.php ADDED
@@ -0,0 +1,435 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ Class TVC_Admin_Helper{
3
+ protected $customApiObj;
4
+ protected $ee_options_data = "";
5
+ protected $e_options_settings = "";
6
+ protected $merchantId = "";
7
+ protected $main_merchantId = "";
8
+ protected $subscriptionId = "";
9
+ protected $time_zone = "";
10
+ protected $connect_actual_link = "";
11
+ protected $connect_url = "";
12
+ protected $woo_country = "";
13
+ protected $woo_currency = "";
14
+ protected $currentCustomerId = "";
15
+ protected $user_currency_symbol = "";
16
+ protected $setting_status = "";
17
+ public function __construct($theURL = '') {
18
+ $this->includes();
19
+ $this->customApiObj = new CustomApi();
20
+ }
21
+ public function includes() {
22
+ if (!class_exists('CustomApi.php')) {
23
+ require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
24
+ }
25
+ if (!class_exists('ShoppingApi')) {
26
+ require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/ShoppingApi.php');
27
+ }
28
+
29
+ }
30
+
31
+ public function is_ee_options_data_empty(){
32
+ if($this->get_subscriptionId() != ""){
33
+ if(empty($this->get_ee_options_data())){
34
+ $this->set_update_api_to_db();
35
+ }
36
+ }
37
+ }
38
+ public function get_ee_options_data(){
39
+ if(!empty($this->ee_options_data)){
40
+ return $this->ee_options_data;
41
+ }else{
42
+ $this->ee_options_data = unserialize(get_option('ee_api_data'));
43
+ //echo "<pre>";
44
+ //print_r($this->ee_options_data);
45
+ //exit;
46
+ return $this->ee_options_data;
47
+ }
48
+ }
49
+ public function set_update_db_to_api(){
50
+ if($this->get_subscriptionId() != ""){
51
+ $ee_options_settings = $this->get_ee_options_settings();
52
+ $ads_ert = get_option('ads_ert');
53
+ $ads_edrt = get_option('ads_edrt');
54
+
55
+ $tvc_setting_db = [];
56
+ $tvc_setting_db['subscription_id'] = $this->get_subscriptionId();
57
+ $tvc_setting_db['enhanced_e_commerce_tracking'] = (($ee_options_settings['ga_eeT'] == "on" || $ee_options_settings['ga_eeT'])?1:0);
58
+ $tvc_setting_db['add_gtag_snippet'] = (($ee_options_settings['ga_ST'] == "on" || $ee_options_settings['ga_ST'])?1:0);
59
+
60
+
61
+ $tvc_setting_db['google-add'] ="";
62
+ $tvc_setting_db['remarketing_tags'] = (($ads_ert == "on" || $ads_ert)?1:0);
63
+ $tvc_setting_db['dynamic_remarketing_tags'] = (($ads_edrt == "on" || $ads_edrt)?1:0);
64
+ $customApiObj = new CustomApi();
65
+ $response = $customApiObj->updateTrackingOption($tvc_setting_db);
66
+
67
+ }
68
+ //return true;
69
+ }
70
+ public function set_update_api_to_db($googleDetail = null){
71
+ if(empty($googleDetail)){
72
+ $google_detail = $this->customApiObj->getGoogleAnalyticDetail();
73
+ if(isset($google_detail->data['status']) && $google_detail->data['status'] == 200){
74
+ if (isset($google_detail->data['data'])) {
75
+ $googleDetail = $google_detail->data['data'];
76
+ }
77
+ }else{
78
+ //return 0;
79
+ }
80
+ }
81
+ $syncProductStat = [];
82
+ $syncProductList = [];
83
+ $campaigns_list = [];
84
+ if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
85
+
86
+ $syncProduct_list_res = $this->customApiObj->getSyncProductList(['merchant_id' => $this->get_merchantId()]);
87
+ if(isset($syncProduct_list_res->data) && isset($syncProduct_list_res->status) && $syncProduct_list_res->status == 200){
88
+ if (isset($syncProduct_list_res->data->statistics)) {
89
+ $syncProductStat = $syncProduct_list_res->data->statistics;
90
+ }
91
+ if (isset($syncProduct_list_res->data->products)) {
92
+ $syncProductList = $syncProduct_list_res->data->products;
93
+ }
94
+ }
95
+
96
+ $shopping_api = new ShoppingApi();
97
+ $campaigns_list_res = $shopping_api->getCampaigns();
98
+ if(isset($campaigns_list_res->data) && isset($campaigns_list_res->status) && $campaigns_list_res->status == 200) {
99
+ if (isset($campaigns_list_res->data['data'])) {
100
+ $campaigns_list = $campaigns_list_res->data['data'];
101
+ }
102
+ }
103
+ }
104
+ $this->set_ee_options_data(array("setting" => $googleDetail, "prod_sync_status" =>$syncProductStat,"prod_sync_list" =>$syncProductList, "campaigns_list"=>$campaigns_list, "sync_time"=>current_time( 'timestamp' )));
105
+ $tvc_msg ="";
106
+ if(!empty($googleDetail)){
107
+ $tvc_msg = "Configuration Setting";
108
+ }
109
+ if(!empty($syncProductList)){
110
+ $tvc_msg = ($tvc_msg != "")?$tvc_msg.", Product Sync":"Product Sync";
111
+ }
112
+ if(!empty($campaigns_list)){
113
+ $tvc_msg = ($tvc_msg != "")?$tvc_msg.", Shopping Campaigns":"Shopping Campaigns";
114
+ }
115
+ return "Success to sync up of ".$tvc_msg.".";
116
+ }
117
+
118
+ public function set_ee_options_data($ee_options_data){
119
+ update_option("ee_api_data", serialize($ee_options_data));
120
+ }
121
+
122
+ public function get_ee_options_settings(){
123
+ if(!empty($this->e_options_settings)){
124
+ return $this->e_options_settings;
125
+ }else{
126
+ $this->e_options_settings = unserialize(get_option('ee_options'));
127
+ return $this->e_options_settings;
128
+ }
129
+ }
130
+
131
+ public function get_subscriptionId(){
132
+ if(!empty($this->subscriptionId)){
133
+ return $this->subscriptionId;
134
+ }else{
135
+ $ee_options_settings = "";
136
+ if(!isset($GLOBALS['tatvicData']['tvc_subscription'])){
137
+ $ee_options_settings = $this->get_ee_options_settings();
138
+ }
139
+ $this->subscriptionId = (isset($GLOBALS['tatvicData']['tvc_subscription'])) ? $GLOBALS['tatvicData']['tvc_subscription'] : $ee_options_settings['subscription_id'];
140
+ return $this->subscriptionId;
141
+ }
142
+
143
+ }
144
+ public function get_merchantId(){
145
+ if(!empty($this->merchantId)){
146
+ return $this->merchantId;
147
+ }else{
148
+ $tvc_merchant = "";
149
+ $google_detail = $this->get_ee_options_data();
150
+ if(!isset($GLOBALS['tatvicData']['tvc_merchant']) && isset($google_detail['setting']->google_merchant_center_id)){
151
+ $tvc_merchant = $google_detail['setting']->google_merchant_center_id;
152
+ }
153
+ $this->merchantId = (isset($GLOBALS['tatvicData']['tvc_merchant'])) ? $GLOBALS['tatvicData']['tvc_merchant'] : $tvc_merchant;
154
+ return $this->merchantId;
155
+ }
156
+ }
157
+ public function get_main_merchantId(){
158
+ if(!empty($this->main_merchantId)){
159
+ return $this->main_merchantId;
160
+ }else{
161
+ $main_merchantId = "";
162
+ $google_detail = $this->get_ee_options_data();
163
+ if(!isset($GLOBALS['tatvicData']['tvc_main_merchant_id']) && isset($google_detail['setting']->merchant_id)){
164
+ $main_merchantId = $google_detail['setting']->merchant_id;
165
+ }
166
+ $this->main_merchantId = (isset($GLOBALS['tatvicData']['tvc_main_merchant_id'])) ? $GLOBALS['tatvicData']['tvc_main_merchant_id'] : $main_merchantId;
167
+ return $this->main_merchantId;
168
+ }
169
+ }
170
+
171
+ public function get_time_zone(){
172
+ if(!empty($this->time_zone)){
173
+ return $this->time_zone;
174
+ }else{
175
+ $timezone = get_option('timezone_string');
176
+ if($timezone == ""){
177
+ $timezone = "America/New_York";
178
+ }
179
+ $this->time_zone = $timezone;
180
+ return $this->time_zone;
181
+ }
182
+ }
183
+
184
+ public function get_connect_actual_link(){
185
+ if(!empty($this->connect_actual_link)){
186
+ return $this->connect_actual_link;
187
+ }else{
188
+ $this->connect_actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
189
+ return $this->connect_actual_link;
190
+ }
191
+ }
192
+
193
+ public function get_connect_url(){
194
+ if(!empty($this->connect_url)){
195
+ return $this->connect_url;
196
+ }else{
197
+ $this->connect_url = "https://".TVC_AUTH_CONNECT_URL."/config/ga_rdr_gmc.php?return_url=".TVC_AUTH_CONNECT_URL."/config/ads-analytics-form.php?domain=" . $this->get_connect_actual_link() . "&amp;country=" . $this->get_woo_country(). "&amp;user_currency=".$this->get_woo_currency()."&amp;subscription_id=" . $this->get_subscriptionId() . "&amp;confirm_url=" . admin_url() . "&amp;timezone=".$this->get_time_zone();
198
+ return $this->connect_url;
199
+ }
200
+ }
201
+
202
+ public function get_woo_currency(){
203
+ if(!empty($this->woo_currency)){
204
+ return $this->woo_currency;
205
+ }else{
206
+ $this->woo_currency = get_option('woocommerce_currency');
207
+ return $this->woo_currency;
208
+ }
209
+ }
210
+
211
+ public function get_woo_country(){
212
+ if(!empty($this->woo_country)){
213
+ return $this->woo_country;
214
+ }else{
215
+ $store_raw_country = get_option('woocommerce_default_country');
216
+ $country = explode(":", $store_raw_country);
217
+ $this->woo_country = (isset($country[0]))?$country[0]:"";
218
+ return $this->woo_country;
219
+ }
220
+ }
221
+ //tvc_customer = >google_ads_id
222
+ public function get_currentCustomerId(){
223
+ if(!empty($this->currentCustomerId)){
224
+ return $this->currentCustomerId;
225
+ }else{
226
+ $ee_options_settings = "";
227
+ if(!isset($GLOBALS['tatvicData']['tvc_customer'])){
228
+ $ee_options_settings = $this->get_ee_options_settings();
229
+ }
230
+ $this->currentCustomerId = (isset($GLOBALS['tatvicData']['tvc_customer'])) ? $GLOBALS['tatvicData']['tvc_customer'] : $ee_options_settings['google_ads_id'];
231
+ return $this->currentCustomerId;
232
+ }
233
+ }
234
+ public function get_user_currency_symbol(){
235
+ if(!empty($this->get_user_currency_symbol)){
236
+ return $this->get_user_currency_symbol;
237
+ }else{
238
+ $currency_symbol="";
239
+ $currency_symbol_rs = $this->customApiObj->getCampaignCurrencySymbol(['customer_id' => $this->get_currentCustomerId()]);
240
+ if(isset($currency_symbol_rs->data) && isset($currency_symbol_rs->data['status']) && $currency_symbol_rs->data['status'] == 200){
241
+ $currency_symbol = get_woocommerce_currency_symbol($currency_symbol_rs->data['data']->currency);
242
+ }else{
243
+ $currency_symbol = get_woocommerce_currency_symbol("USD");
244
+ }
245
+ $this->currentCustomerId = $currency_symbol;
246
+ return $this->currentCustomerId;
247
+ }
248
+ }
249
+
250
+ public function add_tvc_log($log_string){
251
+ $log = "User: ".date("F j, Y, g:i a").PHP_EOL." Attempt: ".$log_string;
252
+ //Save string to log, use FILE_APPEND to append.
253
+ file_put_contents('log_tvc.log', $log, FILE_APPEND);
254
+ }
255
+
256
+ public function add_spinner_html(){
257
+ $spinner_gif = ENHANCAD_PLUGIN_URL . '/images/ajax-loader.gif';
258
+ echo '<div class="feed-spinner" id="feed-spinner" style="display:none;">
259
+ <img id="img-spinner" src="' . $spinner_gif . '" alt="Loading" />
260
+ </div>';
261
+ }
262
+
263
+ public function get_gmcAttributes() {
264
+ $path = TVC_CHANNEL_DATA_DIR . '/google/gmc_attrbutes.json';
265
+ $str = file_get_contents($path);
266
+ $attributes = $str ? json_decode($str, true) : [];
267
+ return $attributes;
268
+ }
269
+
270
+ public function check_setting_status(){
271
+ if(!empty($this->setting_status)){
272
+ return $this->setting_status;
273
+ }else{
274
+ $google_detail = $this->get_ee_options_data();
275
+ $setting_status = array();
276
+ if(isset($google_detail['setting'])){
277
+ $googleDetail = $google_detail['setting'];
278
+ //for google analytic
279
+ if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "BOTH" ){
280
+ if($googleDetail->property_id != "" && $googleDetail->measurement_id != ""){
281
+ $setting_status['google_analytic']= true;
282
+ $setting_status['google_analytic_msg']= "";
283
+ }else if($googleDetail->property_id == "" ){
284
+ $setting_status['google_analytic']= false;
285
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
286
+ }else if($googleDetail->measurement_id == "" ){
287
+ $setting_status['google_analytic']= false;
288
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
289
+ }
290
+ }else if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && $googleDetail->tracking_option == "GA4"){
291
+ if( $googleDetail->measurement_id != ""){
292
+ $setting_status['google_analytic']= true;
293
+ $setting_status['google_analytic_msg']= "";
294
+ }else{
295
+ $setting_status['google_analytic']= false;
296
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
297
+ }
298
+ }else if(isset($googleDetail->tracking_option) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "UA" ){
299
+ if($googleDetail->property_id != ""){
300
+ $setting_status['google_analytic']= true;
301
+ $setting_status['google_analytic_msg']= "";
302
+ }else{
303
+ $setting_status['google_analytic']= false;
304
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
305
+ }
306
+ }else{
307
+ $setting_status['google_analytic']= false;
308
+ $setting_status['google_analytic_msg']= "";
309
+ }
310
+ // for google shopping
311
+ if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"google_ads_id") ){
312
+ //main tab
313
+ if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
314
+ $setting_status['google_shopping']= true;
315
+ $setting_status['google_shopping_msg']= "";
316
+ }else if($googleDetail->google_merchant_center_id == ""){
317
+ $setting_status['google_shopping']= false;
318
+ $setting_status['google_shopping_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
319
+ }else if($googleDetail->google_ads_id == ""){
320
+ $setting_status['google_shopping']= false;
321
+ $setting_status['google_shopping_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
322
+ }
323
+ }else{
324
+ $setting_status['google_shopping']= false;
325
+ $setting_status['google_shopping_msg']= "";
326
+ }
327
+
328
+ //google_ads_id
329
+ if(property_exists($googleDetail,"google_ads_id") && property_exists($googleDetail,"google_merchant_center_id") ){
330
+ if( $googleDetail->google_ads_id != "" && $googleDetail->google_merchant_center_id != ""){
331
+ $setting_status['google_ads']= true;
332
+ $setting_status['google_ads_msg']= "";
333
+ }else if($googleDetail->google_merchant_center_id == ""){
334
+ $setting_status['google_ads']= false;
335
+ $setting_status['google_ads_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
336
+ }else if($googleDetail->google_ads_id == ""){
337
+ $setting_status['google_ads']= false;
338
+ $setting_status['google_ads_msg']= "Configure Google Ads account to reach to millions of interested shoppers <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
339
+ }
340
+ }else{
341
+ $setting_status['google_ads']= false;
342
+ $setting_status['google_ads_msg']= "";
343
+ }
344
+ }
345
+ $this->setting_status = $setting_status;
346
+ return $setting_status;
347
+ }
348
+ }
349
+ public function check_setting_status_sub_tabs(){
350
+ $google_detail = $this->get_ee_options_data();
351
+ $setting_status = array();
352
+ if(isset($google_detail['setting'])){
353
+ $googleDetail = $google_detail['setting'];
354
+ //sub tab shopping config
355
+ if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"is_site_verified") && property_exists($googleDetail,"is_domain_claim") && property_exists($googleDetail,"google_ads_id")){
356
+ if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != "" && $googleDetail->is_site_verified == 1 && $googleDetail->is_domain_claim == 1 ){
357
+ $setting_status['google_shopping_conf']= true;
358
+ $setting_status['google_shopping_conf_msg']= "Google Shopping Configuration Success.";
359
+ }else if($googleDetail->google_merchant_center_id == "" || $googleDetail->google_ads_id == "" ){
360
+ $setting_status['google_shopping_conf']= false;
361
+ $setting_status['google_shopping_conf_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
362
+ }else if($googleDetail->is_site_verified ==0 && $googleDetail->is_domain_claim ==0 ){
363
+ $setting_status['google_shopping_conf']= false;
364
+ $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
365
+ }else if($googleDetail->is_site_verified ==0 ){
366
+ $setting_status['google_shopping_conf']= false;
367
+ $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
368
+ }else if($googleDetail->is_domain_claim ==0 ){
369
+ $setting_status['google_shopping_conf']= false;
370
+ $setting_status['google_shopping_conf_msg']= "Domain claim is pending. Your store url may be linked to other merchant center account.";
371
+ }
372
+ }else{
373
+ $setting_status['google_shopping_conf']= false;
374
+ $missing="";
375
+ }
376
+ //sub tab product sync
377
+ $syncProductList = [];
378
+ $syncProductStat = [];
379
+ if(property_exists($googleDetail,"google_merchant_center_id") && $googleDetail->google_merchant_center_id != ''){
380
+ if(isset($google_detail['prod_sync_status']) && $google_detail['prod_sync_status']){
381
+ $syncProductStat = $google_detail['prod_sync_status'];
382
+ $sync_product_total = (!empty($syncProductStat)) ? $syncProductStat->total : "0";
383
+ $sync_product_approved = (!empty($syncProductStat)) ? $syncProductStat->approved : "0";
384
+ $sync_product_disapproved = (!empty($syncProductStat)) ? $syncProductStat->disapproved : "0";
385
+ $sync_product_pending = (!empty($syncProductStat)) ? $syncProductStat->pending : "0";
386
+
387
+ if($sync_product_total > 1 && $sync_product_approved > 1 && $sync_product_disapproved < 1){
388
+ $setting_status['google_shopping_p_sync']= true;
389
+ $setting_status['google_shopping_p_sync_msg']= "Google Shopping product sync is a success.";
390
+ }else if($sync_product_total < 1){
391
+ $setting_status['google_shopping_p_sync']= false;
392
+ $setting_status['google_shopping_p_sync_msg']= "Sync your product data into Merchant center and get eligible for free listing across Google.";
393
+ }else if($sync_product_disapproved > 0){
394
+ $setting_status['google_shopping_p_sync']= false;
395
+ $setting_status['google_shopping_p_sync_msg']= "There seems to be some problem with your product data. Rectify the issues by selecting right attributes.";
396
+ }
397
+ }
398
+ }else{
399
+ $setting_status['google_shopping_p_sync']= false;
400
+ $setting_status['google_shopping_p_sync_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
401
+ }
402
+
403
+ //sub tab product Campaigns
404
+ if(property_exists($googleDetail,"google_merchant_center_id") && $googleDetail->google_merchant_center_id != ''){
405
+ if(isset($google_detail['campaigns_list']) && $google_detail['campaigns_list']){
406
+ $campaigns_list = $google_detail['campaigns_list'];
407
+ $totalCampaigns = count($campaigns_list);
408
+ if($totalCampaigns < 1){
409
+ $setting_status['google_shopping_p_campaigns']= false;
410
+ $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
411
+ }else{
412
+ $setting_status['google_shopping_p_campaigns']= true;
413
+ }
414
+ }else{
415
+ $setting_status['google_shopping_p_campaigns']= false;
416
+ $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
417
+ }
418
+ }else{
419
+ $setting_status['google_shopping_p_campaigns']= false;
420
+ $setting_status['google_shopping_p_campaigns_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
421
+ }
422
+ }
423
+ return $setting_status;
424
+ }
425
+
426
+ public function is_current_tab_in($tabs){
427
+ if(isset($_GET['tab']) && is_array($tabs) && in_array($_GET['tab'], $tabs)){
428
+ return true;
429
+ }else if(isset($_GET['tab']) && $_GET['tab'] ==$tabs){
430
+ return true;
431
+ }
432
+ return false;
433
+ }
434
+ }
435
+ ?>
admin/css/enhanced-ecommerce-google-analytics-admin.css CHANGED
@@ -2,6 +2,7 @@
2
  * All of the CSS for your admin-specific functionality should be
3
  * included in this file.
4
  */
 
5
  *{
6
  box-sizing: border-box;
7
  margin:0px;
@@ -10,6 +11,16 @@
10
  body{
11
  background: #f1f1f1 !important;
12
  }
 
 
 
 
 
 
 
 
 
 
13
  .nav-link.active{
14
  color: #fff !important;
15
  background-color: #2D73C5 !important;
@@ -154,3 +165,355 @@ h5{
154
  .left {
155
  float: left;
156
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  * All of the CSS for your admin-specific functionality should be
3
  * included in this file.
4
  */
5
+ @import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&display=swap');
6
  *{
7
  box-sizing: border-box;
8
  margin:0px;
11
  body{
12
  background: #f1f1f1 !important;
13
  }
14
+ .tvc_plugin_container{
15
+ font-family: 'Lato', sans-serif;
16
+ font-size: 16px;
17
+ }
18
+ .tvc_plugin_container .tvc_plugin_sidebar, .tvc_plugin_container .right-content ol li{
19
+ font-size: 14px;
20
+ }
21
+ .tvc_plugin_container .right-content p, .tvc_plugin_container .right-content ol{
22
+ margin-bottom: 0.5rem;
23
+ }
24
  .nav-link.active{
25
  color: #fff !important;
26
  background-color: #2D73C5 !important;
165
  .left {
166
  float: left;
167
  }
168
+ /* checkbox admin*/
169
+ .wizard-section .wizard-content .wizard .actions ul li a.next-step, .wizard-section .wizard-content .wizard .actions ul li a.prev-step{
170
+ color: #fff !important;
171
+ background-color: #1e7e34 !important;
172
+ border-color: #1c7430;
173
+ cursor: pointer;
174
+ text-decoration: none;
175
+ display: inline-block;
176
+ font-weight: 400;
177
+ color: #212529;
178
+ text-align: center;
179
+ vertical-align: middle;
180
+ -webkit-user-select: none;
181
+ -moz-user-select: none;
182
+ -ms-user-select: none;
183
+ user-select: none;
184
+ background-color: transparent;
185
+ border: 1px solid transparent;
186
+ padding: .375rem .75rem;
187
+ font-size: 1rem;
188
+ line-height: 1.5;
189
+ border-radius: .25rem;
190
+ transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
191
+ }
192
+
193
+ .tvc_ee_plugin_form .align-middle{margin: 0 auto;}
194
+ .tvc_ee_plugin_form .align-middle label, label.tvc-custom-control-input{margin: 0 auto; font-size: 15px;}
195
+ .tvc_ee_plugin_form [type="checkbox"]:not(:checked),
196
+ .tvc_ee_plugin_form [type="checkbox"]:checked {
197
+ position: absolute;
198
+ left: 1px;
199
+ top: 7px;
200
+ opacity: 0;
201
+ }
202
+ #ee_plugin_form #ga_PrivacyPolicy{
203
+ left: 1px;
204
+ top: 7px;
205
+ opacity: 0;
206
+ }
207
+
208
+ .tvc_ee_plugin_form [type="checkbox"]:not(:checked)+label,
209
+ .tvc_ee_plugin_form [type="checkbox"]:checked+label {
210
+ position: relative;
211
+ padding-left: 22px;
212
+ cursor: pointer;
213
+ }
214
+
215
+ .tvc_ee_plugin_form [type="checkbox"]:not(:checked)+label:before,
216
+ .tvc_ee_plugin_form [type="checkbox"]:checked+label:before {
217
+ content: '';
218
+ position: absolute;
219
+ left: 0;
220
+ top: 2px;
221
+ width: 16px;
222
+ height: 16px;
223
+ background: #fff;
224
+ border-radius: 3px;
225
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, .1);
226
+ background-color: #eee;
227
+ outline: none;
228
+ }
229
+
230
+ .tvc_ee_plugin_form [type="checkbox"]:checked+label:before {
231
+ background-color: #2D73C5;
232
+ }
233
+
234
+ .tvc_ee_plugin_form [type="checkbox"]:not(:checked)+label:after,
235
+ .tvc_ee_plugin_form [type="checkbox"]:checked+label:after {
236
+ content: '\2713';
237
+ position: absolute;
238
+ top: 4px;
239
+ left: 2px;
240
+ font-size: 14px;
241
+ font-weight: bold;
242
+ line-height: 0.8;
243
+ color: #fff;
244
+ transition: all .2s;
245
+ }
246
+
247
+
248
+ .tvc_ee_plugin_form [type="checkbox"]:not(:checked)+label:after {
249
+ opacity: 0;
250
+ transform: scale(0);
251
+ }
252
+
253
+ .tvc_ee_plugin_form [type="checkbox"]:checked+label:after {
254
+ opacity: 1;
255
+ transform: scale(1);
256
+ }
257
+ /* Admin nav menu item config-success */
258
+ .nav-tabs .nav-link.active a{color: #fff; text-decoration: none; }
259
+ .nav-tabs .nav-link a{text-decoration: none; max-height: 15px; display: inline-block;}
260
+ .nav-tabs .nav-link.active {
261
+ z-index: 9;
262
+ border-radius: 0;
263
+ }
264
+
265
+ .nav-tabs .nav-link{text-align: center;
266
+ padding: .8rem 0; width: 160px; z-index: 9; border: none;}
267
+
268
+ img.config-success, .nav-tabs li img.config-success, .nav-tabs li img.config-fail{
269
+ width: 16px;
270
+ margin: 3px;
271
+ margin-top: 0px;
272
+ }
273
+ .configuration-section img.config-success, .configuration-section img.config-fail {
274
+ width: 16px;
275
+ margin-left: 5px;
276
+ margin-top: 1px;
277
+ }
278
+ .tvc-tooltip {
279
+ position: relative;
280
+ display: inline-block;
281
+ width: 100%;
282
+ /*margin-top: 3px;*/
283
+ }
284
+ .tvc-tooltip:hover .tvc-tooltiptext {
285
+ visibility: visible;
286
+ opacity: 1;
287
+ z-index: 999;
288
+ }
289
+ .tvc-tooltip .tvc-tooltiptext {
290
+ visibility: hidden;
291
+ position: absolute;
292
+ min-width: 400px;
293
+ background-color: #fff;
294
+ border:1px solid #2D73C5;
295
+ color: #212529;
296
+ text-align: center;
297
+ padding: 8px 0;
298
+ border-radius: 6px;
299
+ z-index: 999;
300
+
301
+ transition: opacity .6s;
302
+ cursor: auto;
303
+ }
304
+ .tvc-tooltip .tvc-tooltiptext a{
305
+ color: #2D73C5;
306
+ }
307
+ .tvc-tooltip-top {
308
+ bottom: 115%;
309
+ left: 50%;
310
+ margin-left: -60px;
311
+ }
312
+ .tvc-tooltip-right{
313
+ top: -2px;
314
+ left: 98%;
315
+ }
316
+ .configuration-section .tvc-tooltip-right{
317
+ top: -4px;
318
+ left: 102%;
319
+ }
320
+ .tvc-tooltip.active .tvc-tooltip-right {
321
+ top: -2px;
322
+ left: 103%;
323
+ }
324
+ .tvc-tooltip-right::after {
325
+ content: "";
326
+ position: absolute;
327
+ top: 50%;
328
+ right: 100%;
329
+ margin-top: -5px;
330
+ border-width: 5px;
331
+ border-style: solid;
332
+ border-color: transparent #2D73C5 transparent transparent;
333
+ }
334
+ .tvc-tooltip-top::after {
335
+ content: "";
336
+ position: absolute;
337
+ top: 100%;
338
+ left: 50%;
339
+ margin-left: -5px;
340
+ border-width: 5px;
341
+ border-style: solid;
342
+ border-color: #555 transparent transparent transparent;
343
+ }
344
+ #ee_plugin_form .align-middle{position: relative;}
345
+
346
+
347
+ /* animate button effect */
348
+ .tvc_animate_btn_wrap {
349
+ height: 100%;
350
+ display: flex;
351
+ /*align-items: center;
352
+ justify-content: center;*/
353
+ }
354
+ .btn.tvc_animate_btn {
355
+ min-width: 114px;
356
+ min-height: 30px;
357
+ letter-spacing: 1.3px;
358
+ color: #fff;
359
+ background: linear-gradient(90deg, rgba(45,105,197,1) 0%, rgba(0,105,217,1) 100%);
360
+ border: none;
361
+ border-radius: 1000px;
362
+ box-shadow: 12px 12px 24px rgba(45,105,197,.64);
363
+ transition: all 0.3s ease-in-out 0s;
364
+ cursor: pointer;
365
+ outline: none;
366
+ position: relative;
367
+ padding: 6px;
368
+ padding-right: 25px;
369
+ }
370
+
371
+ button.tvc_animate_btn::before {
372
+ content: '';
373
+ border-radius: 1000px;
374
+ min-width: calc(112px + 12px);
375
+ min-height: calc(32px + 12px);
376
+ border: 2px solid #2D73C5;
377
+ box-shadow: 0 0 30px rgba(45,105,197,.64);
378
+ position: absolute;
379
+ top: 50%;
380
+ left: 50%;
381
+ transform: translate(-50%, -50%);
382
+ opacity: 0;
383
+ transition: all .3s ease-in-out 0s;
384
+ }
385
+
386
+ .btn.tvc_animate_btn:hover, .btn.tvc_animate_btn:focus {
387
+ color: #fff;
388
+ transform: translateX(4px);
389
+ padding-right: 6px;
390
+ }
391
+
392
+ button.tvc_animate_btn:hover::before, button.tvc_animate_btn:focus::before {
393
+ opacity: 1;
394
+ }
395
+
396
+ button.tvc_animate_btn::after {
397
+ content: '';
398
+ width: 30px; height: 30px;
399
+ border-radius: 100%;
400
+ border: 2px solid #fff;
401
+ position: absolute;
402
+ z-index: 1;
403
+ top: 50%;
404
+ left: 85%;
405
+ transform: translate(-50%, -50%);
406
+ animation: tvc_ring 1.5s infinite;
407
+ }
408
+
409
+ button.tvc_animate_btn:hover::after, button.tvc_animate_btn:focus::after {
410
+ animation: none;
411
+ display: none;
412
+ }
413
+
414
+ @keyframes tvc_ring {
415
+ 0% {
416
+ width: 1px;
417
+ height: 1px;
418
+ opacity: 1;
419
+ }
420
+ 100% {
421
+ width: 35px;
422
+ height: 35px;
423
+ opacity: 0;
424
+ }
425
+ }
426
+ .tvc_title_val{
427
+ width: 144px;