Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 4.5.2

Version Description

  • 23/12/2021 =

  • In this release, we have focused on code optimization and performance improvement.

Download this release

Release Info

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

Code changes from version 4.5.1 to 4.5.2

Files changed (39) hide show
  1. admin/class-conversios-admin.php +21 -22
  2. admin/class-conversios-onboarding.php +171 -182
  3. admin/class-enhanced-ecommerce-google-analytics-admin.php +34 -45
  4. admin/class-enhanced-ecommerce-google-analytics-settings.php +5 -5
  5. admin/class-survey.php +22 -29
  6. admin/class-tvc-admin-auto-product-sync-helper.php +33 -77
  7. admin/class-tvc-admin-helper.php +63 -72
  8. admin/css/bootstrap.rtl.min.css +0 -7
  9. admin/css/custom-style.css +2 -22
  10. admin/css/dataTables.bootstrap4.min.css +0 -1
  11. admin/css/dataTables.bootstrap5.min.css +5 -0
  12. admin/css/enhanced-ecommerce-google-analytics-admin.css +8 -4
  13. admin/css/style.css +24 -0
  14. admin/helper/class-dashboard-helper.php +16 -24
  15. admin/helper/class-onboarding-helper.php +303 -262
  16. admin/js/bootstrap.min.js +0 -7
  17. admin/js/chart.js +1495 -1530
  18. admin/js/dataTables.bootstrap5.min.js +14 -0
  19. admin/js/popper.min.js +0 -5
  20. admin/partials/class-conversios-header.php +22 -59
  21. admin/partials/general-fields.php +72 -102
  22. admin/partials/pricings.php +222 -226
  23. enhanced-ecommerce-google-analytics.php +2 -2
  24. includes/class-enhanced-ecommerce-google-analytics-activator.php +1 -1
  25. includes/class-enhanced-ecommerce-google-analytics.php +8 -10
  26. includes/class-tvc-register-scripts.php +2 -2
  27. includes/data/class-tvc-ajax-file.php +37 -207
  28. includes/setup/CustomApi.php +55 -249
  29. includes/setup/ShoppingApi.php +36 -36
  30. includes/setup/account.php +18 -25
  31. includes/setup/add-campaign.php +88 -118
  32. includes/setup/class-conversios-dashboard.php +161 -161
  33. includes/setup/class-tatvic-category-selector-element.php +9 -9
  34. includes/setup/class-tvc-product-sync-helper.php +55 -49
  35. includes/setup/google-ads.php +24 -26
  36. includes/setup/google-shopping-feed-gaa-config.php +23 -31
  37. includes/setup/google-shopping-feed-shopping-campaigns.php +284 -167
  38. includes/setup/google-shopping-feed-sync-product.php +42 -57
  39. includes/setup/google-shopping-feed.php +66 -69
admin/class-conversios-admin.php CHANGED
@@ -55,19 +55,19 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
55
  */
56
  public function enqueue_styles() {
57
  $screen = get_current_screen();
58
- if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos($_GET['page'], 'conversios') !== false) ) {
59
  //developres hook to custom css
60
- do_action('add_conversios_css_'.$_GET['page']);
61
  //conversios page css
62
- if($_GET['page'] == "conversios"){
63
- wp_register_style('conversios-slick-css', esc_url(ENHANCAD_PLUGIN_URL.'/admin/css/slick.css') );
64
  wp_enqueue_style('conversios-slick-css');
65
- wp_register_style('conversios-daterangepicker-css', esc_url(ENHANCAD_PLUGIN_URL.'/admin/css/daterangepicker.css') );
66
  wp_enqueue_style('conversios-daterangepicker-css');
67
  }
68
  //all conversios page css
69
- wp_enqueue_style('conversios-style-css', esc_url(ENHANCAD_PLUGIN_URL . '/admin/css/style.css'), array(), $this->version, 'all' );
70
- wp_enqueue_style('conversios-responsive-css', esc_url(ENHANCAD_PLUGIN_URL . '/admin/css/responsive.css'), array(), $this->version, 'all');
71
  }
72
  }
73
 
@@ -78,19 +78,18 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
78
  */
79
  public function enqueue_scripts() {
80
  $screen = get_current_screen();
81
- if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos($_GET['page'], 'conversios') !== false) ) {
82
- if($_GET['page'] == "conversios"){
83
- wp_enqueue_script( 'conversios-jquery-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js') );
84
 
85
- wp_enqueue_script( 'conversios-chart-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js') );
86
- wp_enqueue_script( 'conversios-chart-datalabels-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/chartjs-plugin-datalabels.js') );
87
- wp_enqueue_script( 'conversios-basictable-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery.basictable.min.js') );
88
- wp_enqueue_script( 'conversios-moment-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/moment.min.js') );
89
- wp_enqueue_script( 'conversios-daterangepicker-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/daterangepicker.js') );
90
 
91
- wp_enqueue_script( 'tvc-ee-custom-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js'), array( 'jquery' ), $this->version, false );
92
  }
93
- do_action('add_conversios_js_'.esc_attr($_GET['page']) );
94
  }
95
  }
96
 
@@ -110,7 +109,7 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
110
  }
111
 
112
  add_menu_page(
113
- esc_html__('Tatvic EE Plugin','conversios'), esc_html__('Tatvic EE Plugin','conversios'), 'manage_options', "conversios", array($this, 'showPage'), plugin_dir_url(__FILE__) . 'images/tatvic_logo.png', 26
114
  );
115
  add_submenu_page(
116
  'conversios',
@@ -170,10 +169,10 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
170
  */
171
  public function showPage() {
172
  do_action('add_conversios_header');
173
- if (!empty($_GET['page'])) {
174
- $get_action = str_replace("-", "_", $_GET['page']);
175
  } else {
176
- $get_action = "conversios";
177
  }
178
  if (method_exists($this, $get_action)) {
179
  $this->$get_action();
@@ -207,7 +206,7 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
207
  public function conversios_google_shopping_feed() {
208
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
209
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed.php');
210
- $action_tab = (isset($_GET['tab']))?$_GET['tab']:"";
211
  if($action_tab!=""){
212
  $this->$action_tab();
213
  }else{
55
  */
56
  public function enqueue_styles() {
57
  $screen = get_current_screen();
58
+ if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos(sanitize_text_field($_GET['page']), 'conversios') !== false) ) {
59
  //developres hook to custom css
60
+ do_action('add_conversios_css_'.sanitize_text_field($_GET['page']));
61
  //conversios page css
62
+ if(sanitize_text_field($_GET['page']) == "conversios"){
63
+ wp_register_style('conversios-slick-css', esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/css/slick.css') );
64
  wp_enqueue_style('conversios-slick-css');
65
+ wp_register_style('conversios-daterangepicker-css', esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/css/daterangepicker.css') );
66
  wp_enqueue_style('conversios-daterangepicker-css');
67
  }
68
  //all conversios page css
69
+ wp_enqueue_style('conversios-style-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/style.css'), array(), $this->version, 'all' );
70
+ wp_enqueue_style('conversios-responsive-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/responsive.css'), array(), $this->version, 'all');
71
  }
72
  }
73
 
78
  */
79
  public function enqueue_scripts() {
80
  $screen = get_current_screen();
81
+ if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos(sanitize_text_field($_GET['page']), 'conversios') !== false) ) {
82
+ if(sanitize_text_field($_GET['page']) == "conversios"){
83
+ wp_enqueue_script( 'conversios-jquery-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js') );
84
 
85
+ wp_enqueue_script( 'conversios-chart-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js') );
86
+ wp_enqueue_script( 'conversios-chart-datalabels-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/chartjs-plugin-datalabels.js') );
87
+ wp_enqueue_script( 'conversios-basictable-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/jquery.basictable.min.js') );
88
+ wp_enqueue_script( 'conversios-moment-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/moment.min.js') );
89
+ wp_enqueue_script( 'conversios-daterangepicker-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/daterangepicker.js') );
90
 
91
+ wp_enqueue_script( 'tvc-ee-custom-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js'), array( 'jquery' ), $this->version, false );
92
  }
 
93
  }
94
  }
95
 
109
  }
110
 
111
  add_menu_page(
112
+ esc_html__('Tatvic EE Plugin','conversios'), esc_html__('Tatvic EE Plugin','conversios'), 'manage_options', "conversios", array($this, 'showPage'), esc_url_raw(plugin_dir_url(__FILE__) . 'images/tatvic_logo.png'), 26
113
  );
114
  add_submenu_page(
115
  'conversios',
169
  */
170
  public function showPage() {
171
  do_action('add_conversios_header');
172
+ if (!empty(sanitize_text_field($_GET['page']))) {
173
+ $get_action = str_replace("-", "_", sanitize_text_field($_GET['page']));
174
  } else {
175
+ $get_action = esc_attr("conversios");
176
  }
177
  if (method_exists($this, $get_action)) {
178
  $this->$get_action();
206
  public function conversios_google_shopping_feed() {
207
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
208
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed.php');
209
+ $action_tab = (isset($_GET['tab']))?sanitize_text_field($_GET['tab']):"";
210
  if($action_tab!=""){
211
  $this->$action_tab();
212
  }else{
admin/class-conversios-onboarding.php CHANGED
@@ -45,7 +45,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
45
  $g_mail = get_option('ee_customer_gmail');
46
  $this->tvc_data['g_mail']="";
47
  if($g_mail){
48
- $this->tvc_data['g_mail']=$g_mail;
49
  }
50
  }
51
  }
@@ -72,7 +72,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
72
  $contData = json_decode($getCountris);
73
  if (!empty($user_country)) {
74
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx' readonly='true'>";
75
- $data .= "<option value=''>".__("Please select country","conversios")."</option>";
76
  foreach ($contData as $key => $value) {
77
  $selected = ($value->code == $user_country) ? "selected='selected'" : "";
78
  $data .= "<option value=" . esc_attr($value->code) . " " . $selected . " >" . esc_attr($value->name) . "</option>";
@@ -80,7 +80,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
80
  $data .= "</select>";
81
  } else {
82
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx'>";
83
- $data .= "<option value=''>".__("Please select country","conversios")."</option>";
84
  foreach ($contData as $key => $value) {
85
  $data .= "<option value=" . esc_attr($value->code) . ">" . esc_attr($value->name) . "</option>";
86
  }
@@ -98,21 +98,21 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
98
  */
99
  public function welcome_screen() {
100
  $googleDetail = "";
101
- $defaulSelection = 1;
102
- $tracking_option = "UA";
103
  $login_customer_id ="";
104
- $completed_last_step ="step-0";
105
  $complete_step = array("step-0"=>1,"step-1"=>0,"step-2"=>0,"step-3"=>0);
106
 
107
- if ( isset($_GET['subscription_id']) && $_GET['subscription_id']){
108
- $this->subscriptionId = $_GET['subscription_id'];
109
- if ( isset($_GET['g_mail']) && $_GET['g_mail']){
110
- $this->tvc_data['g_mail'] = $_GET['g_mail'];
111
- $completed_last_step ="step-1";
112
- $complete_step["step-0"] = 1;
113
 
114
  $ee_additional_data = $this->TVC_Admin_Helper->get_ee_additional_data();
115
- $ee_additional_data['ee_last_login'] = current_time( 'timestamp' );
116
  $this->TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
117
 
118
  $this->is_refresh_token_expire = false;
@@ -126,8 +126,8 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
126
  if( property_exists($google_detail, "data") && $google_detail->data != "" ){
127
  $googleDetail = $google_detail->data;
128
  $this->tvc_data['subscription_id'] = $googleDetail->id;
129
- $this->tvc_data['access_token'] = $googleDetail->access_token;
130
- $this->tvc_data['refresh_token'] = $googleDetail->refresh_token;
131
  $this->plan_id = $googleDetail->plan_id;
132
  $login_customer_id = $googleDetail->customer_id;
133
  $tracking_option = $googleDetail->tracking_option;
@@ -185,33 +185,33 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
185
  #wpadminbar{display: none;}
186
  </style>
187
  <div class="bodyrightpart onbordingbody-wapper">
188
- <div class="loader-section" id="loader-section"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/ajax-loader.gif');?>" alt="loader"></div>
189
  <div class="alert-message" id="tvc_onboarding_popup_box"></div>
190
  <div class="onbordingbody">
191
  <div class="site-header">
192
  <div class="container">
193
- <div class="brand"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/logo.png');?>" alt="Conversios" /></div>
194
  </div>
195
  </div>
196
  <div class="onbording-wrapper">
197
  <div class="container">
198
  <div class="smallcontainer">
199
  <div class="onbordingtop">
200
- <h2><?php _e("Let’s get you started.","conversios"); ?></h2>
201
- <p><?php _e("Automate Google Analytics, Dynamic Remarketing & Google Shopping in just 5 minutes.","conversios"); ?></p>
202
  </div>
203
  <div class="row">
204
  <!-- onborading left start -->
205
  <div class="onboardingstepwrap">
206
  <!-- step-0 start -->
207
- <div class="onbordording-step onbrdstep-0 gglanystep <?php if($this->subscriptionId == "" || $this->tvc_data['g_mail']=="" || $this->is_refresh_token_expire == true ){ echo "activestep"; }else{echo "selectedactivestep";} ?>">
208
  <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-0']); ?>" id="google-signing" data-id="step_0">
209
  <div class="stepleftround">
210
- <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
211
  </div>
212
  <div class="stepdetwrap">
213
- <h4><?php _e("Connect Conversios with your website","conversios"); ?></h4>
214
- <p><?php echo esc_attr((isset($this->tvc_data['g_mail']) && $this->subscriptionId)?$this->tvc_data['g_mail']:""); ?></p>
215
  </div>
216
  </div>
217
  <div class="stepmoredtlwrp">
@@ -219,64 +219,64 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
219
  <?php if(!isset($this->tvc_data['g_mail']) || $this->tvc_data['g_mail'] == "" || $this->subscriptionId == ""){?>
220
  <div class="google_connect_url google-btn">
221
  <div class="google-icon-wrapper">
222
- <img class="google-icon" src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
223
  </div>
224
- <p class="btn-text"><b><?php _e("Sign in with google","conversios"); ?></b></p>
225
  </div>
226
  <?php } else{?>
227
 
228
  <?php if($this->is_refresh_token_expire == true){?>
229
- <p class="alert alert-primary"><?php _e("It seems the token to access your Google accounts is expired. Sign in again to continue.","conversios"); ?></p>
230
  <div class="google_connect_url google-btn">
231
  <div class="google-icon-wrapper">
232
- <img class="google-icon" src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
233
  </div>
234
- <p class="btn-text"><b><?php _e("Sign in with google","conversios"); ?></b></p>
235
  </div>
236
  <?php } else{ ?>
237
  <div class="google_connect_url google-btn">
238
  <div class="google-icon-wrapper">
239
- <img class="google-icon" src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
240
  </div>
241
- <p class="btn-text mr-35"><b><?php _e("Reauthorize","conversios"); ?></b></p>
242
  </div>
243
  <?php } ?>
244
  <?php } ?>
245
- <p><?php _e("Make sure you sign in with the google account that has all privileges to access google analytics, google ads and google merchant center account.","conversios"); ?></p>
246
  </div>
247
  </div>
248
  </div>
249
  <!-- step-0 over -->
250
  <!-- step-1 start -->
251
- <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false){ echo "activestep"; } ?>">
252
- <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-1']; ?>" id="google-analytics" data-id="step_1">
253
  <div class="stepleftround">
254
- <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
255
  </div>
256
  <div class="stepdetwrap">
257
- <h4><?php _e("Connect Google Analytics Account","conversios"); ?></h4>
258
- <p><?php _e("Tag your website with all important e-commerce events in Google Analytics.","conversios"); ?></p>
259
  </div>
260
  </div>
261
  <div class="stepmoredtlwrp">
262
  <div class="stepmoredtl">
263
  <form action="#">
264
  <div class="form-row">
265
- <h5><?php _e("How do you plan to tag your website?","conversios"); ?></h5>
266
  <div class="cstmrdobtn-item">
267
  <label for="univeral">
268
- <input type="radio" <?php echo $this->is_checked($tracking_option, "UA"); ?> name="analytic_tag_type" id="univeral" value="UA">
269
  <span class="checkmark"></span>
270
- <?php _e("Universal Analytics (Google Analytics 3)","conversios"); ?>
271
  </label>
272
  <div id="UA" class="slctunivr-filed">
273
  <div class="tvc-dropdown">
274
- <div class="tvc-dropdown-header" id="ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo $googleDetail->ua_analytic_account_id; } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>"><?php if($googleDetail->property_id){
275
  echo esc_attr($googleDetail->property_id);
276
- }else{?><?php _e("Select Property Id","conversios"); ?><?php } ?></div>
277
  <div class="tvc-dropdown-content" id="ua_web_property_id_option">
278
- <div class="tvc-select-items"><option value=""><?php _e("Select Property Id","conversios"); ?></option></div>
279
- <div class="tvc-ua-option-more option"><?php _e("Load More","conversios"); ?></div>
280
  </div>
281
  </div>
282
 
@@ -286,19 +286,19 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
286
  <label for="gglanytc">
287
  <input type="radio" <?php echo $this->is_checked($tracking_option, "GA4"); ?> name="analytic_tag_type" id="gglanytc" value="GA4">
288
  <span class="checkmark"></span>
289
- <?php _e("Google Analytics 4","conversios"); ?>
290
  </label>
291
  <div id="GA4" class="slctunivr-filed">
292
 
293
  <div class="tvc-dropdown">
294
- <div class="tvc-dropdown-header" id="ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo $googleDetail->ga4_analytic_account_id; } ?>" data-val="<?php if($googleDetail->measurement_id){ echo $googleDetail->measurement_id; } ?>">
295
  <?php if($googleDetail->measurement_id){
296
  echo esc_attr($googleDetail->measurement_id);
297
- }else{?><?php _e("Select Measurement Id","conversios"); ?>
298
  <?php } ?></div>
299
  <div class="tvc-dropdown-content" id="ga4_web_measurement_id_option">
300
- <div class="tvc-select-items"><option value=""><?php _e("Select Measurement Id","conversios"); ?></option></div>
301
- <div class="tvc-ga4-option-more option"><?php _e("Load More","conversios"); ?></div>
302
  </div>
303
  </div>
304
 
@@ -308,18 +308,18 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
308
  <label for="both">
309
  <input type="radio" <?php echo $this->is_checked($tracking_option, "BOTH"); ?> name="analytic_tag_type" id="both" value="BOTH">
310
  <span class="checkmark"></span>
311
- Both
312
  </label>
313
  <div id="BOTH" class="slctunivr-filed">
314
  <div class="botslectbxitem">
315
 
316
  <div class="tvc-dropdown">
317
- <div class="tvc-dropdown-header" id="both_ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo $googleDetail->ua_analytic_account_id; } ?>" data-val="<?php if($googleDetail->property_id){ echo $googleDetail->property_id; } ?>"><?php if($googleDetail->property_id){
318
  echo esc_attr($googleDetail->property_id);
319
- }else{?><?php _e("Select Property Id","conversios"); ?><?php } ?></div>
320
  <div class="tvc-dropdown-content" id="both_ua_web_property_id_option">
321
- <div class="tvc-select-items"><option value=""><?php _e("Select Property Id","conversios"); ?></option></div>
322
- <div class="tvc-ua-option-more option"><?php _e("Load More","conversios"); ?></div>
323
  </div>
324
  </div>
325
 
@@ -327,44 +327,44 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
327
  <div class="botslectbxitem">
328
 
329
  <div class="tvc-dropdown">
330
- <div class="tvc-dropdown-header" id="both_ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo $googleDetail->ga4_analytic_account_id; } ?>" data-val="<?php if($googleDetail->measurement_id){ echo $googleDetail->measurement_id; } ?>">
331
  <?php if($googleDetail->measurement_id){
332
  echo esc_attr($googleDetail->measurement_id);
333
- }else{?><?php _e("Select Measurement Id","conversios"); ?>
334
  <?php } ?></div>
335
  <div class="tvc-dropdown-content" id="both_ga4_web_measurement_id_option">
336
- <div class="tvc-select-items"><option value=""><?php _e("Select Measurement Id","conversios"); ?></option></div>
337
- <div class="tvc-ga4-option-more option"><?php _e("Load More","conversios"); ?></div>
338
  </div>
339
  </div>
340
  </div>
341
- <div id="old_tracking" data-tracking_option="<?php echo $tracking_option; ?>" data-measurement_id="<?php echo $googleDetail->measurement_id; ?>" data-property_id="<?php echo $googleDetail->property_id; ?>"></div>
342
  </div>
343
  </div>
344
  </div>
345
  <div class="form-row">
346
- <h5>Advance Settings (Optional)</h5>
347
  <div class="chckbxbgbx">
348
  <div class="cstmcheck-item">
349
  <label for="enhanced_e_commerce_tracking">
350
- <input type="checkbox" class="custom-control-input" name="enhanced_e_commerce_tracking" id="enhanced_e_commerce_tracking" <?php echo $is_e_e_tracking; ?>>
351
  <span class="checkmark"></span>
352
- <?php _e("Enhaced e-commerce tracking","conversios"); ?>
353
  </label>
354
  </div>
355
  <div class="cstmcheck-item">
356
  <label for="add_gtag_snippet">
357
- <input type="checkbox" class="custom-control-input" name="add_gtag_snippe" id="add_gtag_snippet" <?php echo $is_a_g_snippet; ?>>
358
  <span class="checkmark"></span>
359
- <?php _e("Add gtag.js snippet","conversios"); ?>
360
  </label>
361
  </div>
362
  </div>
363
  </div>
364
  <div class="stepsbmtbtn">
365
- <input type="hidden" id="subscriptionPropertyId" name="subscriptionPropertyId" value="<?php echo (property_exists($googleDetail,"property_id"))?$googleDetail->property_id:""; ?>">
366
- <input type="hidden" id="subscriptionMeasurementId" name="subscriptionMeasurementId" value="<?php echo (property_exists($googleDetail,"measurement_id"))?$googleDetail->measurement_id:""; ?>">
367
- <button type="button" disabled id="step_1" class="stepnextbtn stpnxttrgr"><?php _e("Next","conversios"); ?></button>
368
  </div>
369
  </form>
370
  </div>
@@ -373,13 +373,13 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
373
  <!-- step-1 over -->
374
  <!-- step-2 start -->
375
  <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1 && $this->is_refresh_token_expire == false)?'selectedactivestep':''; ?>">
376
- <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-2']; ?>" id="google-ads" data-id="step_2">
377
  <div class="stepleftround">
378
- <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
379
  </div>
380
  <div class="stepdetwrap">
381
- <h4><?php _e("Select Google Ads account","conversios"); ?></h4>
382
- <p><?php _e("With dynamic reamarketing tags, you will be able to show ads to your past visitors with specific product information tailored to your customer’s previous site visit.","conversios"); ?></p>
383
  </div>
384
  </div>
385
  <div class="stepmoredtlwrp">
@@ -387,25 +387,25 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
387
  <form action="#">
388
  <div class="selcttopwrap" id="tvc_ads_section">
389
  <div class="ggladsselectbx">
390
- <input type="hidden" id="subscriptionGoogleAdsId" name="subscriptionGoogleAdsId" value="<?php echo property_exists($googleDetail,"google_ads_id")?$googleDetail->google_ads_id:""; ?>">
391
  <select class="slect2bx google_ads_sel" id="ads-account" name="customer_id">
392
- <option value=''><?php _e("Select Google Ads Account","conversios"); ?></option>
393
  </select>
394
  </div>
395
  <div class="orwrp">or</div>
396
  <div class="creatnewwrp">
397
- <button type="button" class="cretnewbtn newggladsbtn"><span class="plusicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php _e("Create New","conversios"); ?></button>
398
  </div>
399
  </div>
400
 
401
  <div class="selcttopwrap">
402
  <div class="onbrdpp-body alert alert-primary" style="display:none;" id="new_google_ads_section">
403
- <h4><?php _e("Account Created","conversios"); ?></h4>
404
- <p><?php _e("Your Google Ads Account has been created","conversios"); ?> <strong>(<b><span id="new_google_ads_id"></span></b>).</strong></p>
405
- <h5><?php _e("Steps to claim your Google Ads Account:","conversios"); ?></h5>
406
  <ol>
407
- <li><?php _e("Accept invitation mail from Google Ads sent to your email address","conversios"); ?> <em><?php echo (isset($this->tvc_data['g_mail']))?$this->tvc_data['g_mail']:""; ?></em></li>
408
- <li><?php _e("Log into your Google Ads account and set up your <em>billing preferences</em>","conversios"); ?></li>
409
  </ol>
410
  </div>
411
  </div>
@@ -417,44 +417,44 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
417
  $is_d_r_tags = (property_exists($googleDetail,"dynamic_remarketing_tags") && $googleDetail->dynamic_remarketing_tags == 1)?"checked":(($defaulSelection == 1)?"checked":"");
418
  $is_g_ad_c_tracking = (property_exists($googleDetail,"google_ads_conversion_tracking") && $googleDetail->google_ads_conversion_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
419
  ?>
420
- <h5><?php _e("Advance Settings (Optional)","conversios"); ?></h5>
421
  <div class="chckbxbgbx dsplcolmview">
422
  <div class="cstmcheck-item">
423
  <label for="remarketing_tag">
424
- <input type="checkbox" class="custom-control-input" name="remarketing_tag" id="remarketing_tag" value="1" <?php echo $is_r_tags; ?>>
425
  <span class="checkmark"></span>
426
- <?php _e("Enable Google Remarketing Tag","conversios"); ?>
427
  </label>
428
  </div>
429
  <div class="cstmcheck-item">
430
  <label for="dynamic_remarketing_tags">
431
- <input type="checkbox" class="custom-control-input" name="dynamic_remarketing_tags" id="dynamic_remarketing_tags" value="1" <?php echo $is_d_r_tags; ?>>
432
  <span class="checkmark"></span>
433
- <?php _e("Enable Dynamic Remarketing Tag","conversios"); ?>
434
  </label>
435
  </div>
436
  <div class="cstmcheck-item <?php if($this->plan_id == 1){?>cstmcheck-item-pro <?php } ?>">
437
  <label for="google_ads_conversion_tracking">
438
  <?php if($this->plan_id != 1){?>
439
- <input type="checkbox" class="custom-control-input" name="google_ads_conversion_tracking" id="google_ads_conversion_tracking" value="1" <?php echo $is_g_ad_c_tracking; ?>>
440
  <span class="checkmark"></span>
441
- <?php _e("Google Ads conversion tracking","conversios"); ?>
442
  <?php }else{?>
443
- <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/icon/lock.svg'); ?>"><label><?php _e("Google Ads conversion tracking (Pro Plan)","conversios"); ?></label>
444
  <?php } ?>
445
  </label>
446
  </div>
447
  <div class="cstmcheck-item">
448
  <label for="link_google_analytics_with_google_ads">
449
- <input type="checkbox" class="custom-control-input" name="link_google_analytics_with_google_ads" id="link_google_analytics_with_google_ads" value="1" <?php echo $is_l_g_an_w_g_ad; ?>>
450
  <span class="checkmark"></span>
451
- <?php _e("Link Google Analytics with Google Ads","conversios"); ?>
452
  </label>
453
  </div>
454
  </div>
455
  </div>
456
  <div class="stepsbmtbtn">
457
- <button type="button" id="step_2" class="stepnextbtn stpnxttrgr"><?php _e("Next","conversios"); ?></button>
458
  <!-- add dslbbtn class for disable button -->
459
  </div>
460
  </form>
@@ -463,14 +463,14 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
463
  </div>
464
  <!-- step-2 over -->
465
  <!-- step-3 start -->
466
- <div class="onbordording-step onbrdstep-3 gglmrchntstep <?php echo ($complete_step['step-3']==1 && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?>">
467
- <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-3']; ?>" id="gmc-account" data-id="step_3">
468
  <div class="stepleftround">
469
- <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
470
  </div>
471
  <div class="stepdetwrap">
472
- <h4><?php _e("Select Google Merchant Center Account","conversios"); ?></h4>
473
- <p><?php _e("Make your WooCommerce shop and products available to millions of shoppers across google.","conversios"); ?></p>
474
  </div>
475
  </div>
476
  <div class="stepmoredtlwrp">
@@ -480,37 +480,37 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
480
  <div class="form-group" style="display:none;" id="new_merchant_section">
481
  <div class="text-center">
482
  <div class="alert alert-primary" style="padding: 10px;" role="alert">
483
- <label class="form-label-control font-weight-bold"><?php _e("We have created new merchant center account with ID: ","conversios"); ?><span id="new_merchant_id"></span>. <?php _e("Click on finish button to save new account.","conversios"); ?></label>
484
  </div>
485
  </div>
486
  </div>
487
  <div id="tvc_merchant_section">
488
  <div class="ggladsselectbx">
489
  <select class="slect2bx" id="google_merchant_center_id" name="google_merchant_center_id">
490
- <option value=''><?php _e("Select Measurement Id","conversios"); ?></option>
491
  </select>
492
  </div>
493
  <div class="orwrp">or</div>
494
  <div class="creatnewwrp">
495
- <button type="button" class="cretnewbtn newmrchntbtn"><span class="plusicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php _e("Create New","conversios"); ?></button>
496
  </div>
497
  </div>
498
  </div>
499
  <div class="stepsbmtbtn">
500
- <button type="button" id="step_3" data-enchanter="finish" class="stepnextbtn finishbtn"><?php _e("Finish","conversios"); ?></button>
501
  <!-- add dslbbtn class for disable button -->
502
  </div>
503
- <input type="hidden" id="subscriptionMerchantCenId" name="subscriptionMerchantCenId" value="<?php echo property_exists($googleDetail,"google_merchant_center_id")?$googleDetail->google_merchant_center_id:""; ?>">
504
  <input type="hidden" id="loginCustomerId" name="loginCustomerId" value="<?php echo esc_attr($login_customer_id); ?>">
505
  <input type="hidden" id="subscriptionId" name="subscriptionId" value="<?php echo esc_attr($this->subscriptionId); ?>">
506
- <input type="hidden" id="plan_id" name="plan_id" value="<?php echo $this->plan_id; ?>">
507
  <input type="hidden" id="conversios_onboarding_nonce" name="conversios_onboarding_nonce" value="<?php echo wp_create_nonce( 'conversios_onboarding_nonce' ); ?>">
508
 
509
  <input type="hidden" id="ga_view_id" name="ga_view_id" value="<?php echo esc_attr(get_option('ee_ga_view_id')); ?>">
510
  </form>
511
  </div>
512
  <div class="stepnotewrp">
513
- <?php _e('If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at <a href="">Google Merchant Center Help</a> website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.','conversios'); ?>
514
  </div>
515
  </div>
516
  </div>
@@ -522,17 +522,17 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
522
  <div class="sidebrcontainer">
523
  <div class="onbrd-rdmbx">
524
  <div class="rdm-amnt">
525
- <small><?php _e("Redeem upto","conversios"); ?></small>
526
- <?php echo $off_credit_amt; ?>
527
  </div>
528
- <p><?php _e("Create your first Google Ads account with us and redeem upto","conversios"); ?> <?php echo $off_credit_amt; ?> <?php _e("on the spend you make in the next 31 days.","conversios"); ?></p>
529
- <a target="_blank" href="https://conversios.io/help-center/Google-Spend-Match.pdf" class="lrnmorbtn"><?php _e("Learn more","conversios"); ?> <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/arrow_right.png'); ?>" alt="" /></a>
530
  </div>
531
  <div class="onbrdrgt-nav">
532
  <ul>
533
- <li><a target="_blank" href="<?php echo esc_url("https://conversios.io/help-center/Installation-Manual.pdf"); ?>"><?php echo _e("Installation Manual","conversios"); ?></a></li>
534
- <li><a target="_blank" href="<?php echo esc_url("https://conversios.io/help-center/Google-shopping-Guide.pdf"); ?>" href=""><?php _e("Google Shopping Guide","conversios"); ?></a></li>
535
- <li><a target="_blank" href="<?php echo esc_url("https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/"); ?>" href=""><?php _e("FAQ","conversios"); ?></a></li>
536
  </ul>
537
  </div>
538
  </div>
@@ -549,21 +549,21 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
549
  <div class="onbrdppmain" role="document">
550
  <div class="onbrdnpp-cntner acccretppcntnr">
551
  <div class="onbrdnpp-hdr">
552
- <h4><?php _e("You have not selected Google Ads account.","conversios"); ?></h4>
553
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
554
  </div>
555
  <div class="onbrdpp-body">
556
- <p><?php _e("If you do not select Google Ads account, you will not be able to use some of the major features like:","conversios"); ?></p>
557
  <ul>
558
- <li><?php _e("Dynamic Remarketing Tags","conversios"); ?> </li>
559
- <li><?php _e("Google Smart Shopping Campaigns","conversios"); ?></li>
560
- <li><?php _e("Google Analytics and Google Ads linking","conversios"); ?></li>
561
  </ul>
562
- <p><?php _e("Are you sure you want to continue without selecting Google Ads account?","conversios"); ?></p>
563
  </div>
564
  <div class="ppfooterbtn">
565
- <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="ads-skip-cancel"><?php _e("Cancel","conversios"); ?></button>
566
- <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="ads-skip-continue"><?php _e("Continue","conversios"); ?></button>
567
  </div>
568
  </div>
569
  </div>
@@ -573,14 +573,14 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
573
  <div class="onbrdppmain">
574
  <div class="onbrdnpp-cntner ggladsppcntnr">
575
  <div class="onbrdnpp-hdr">
576
- <h4><?php _e("Enable Google Ads Account","conversios"); ?></h4>
577
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
578
  </div>
579
  <div class="onbrdpp-body">
580
- <p><?php _e("You’ll receive an invite from Google on your email. Accept the invitation to enable your Google Ads Account.","conversios"); ?></p>
581
  </div>
582
  <div class="ppfooterbtn">
583
- <button type="button" id="ads-continue" class="ppblubtn sndinvitebtn"><?php _e("Send Invite","conversios"); ?></button>
584
  </div>
585
  </div>
586
  </div>
@@ -590,16 +590,16 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
590
  <div class="onbrdppmain">
591
  <div class="onbrdnpp-cntner acccretppcntnr">
592
  <div class="onbrdnpp-hdr">
593
- <h4><?php _e("You have not selected Google merchant center account.","conversios"); ?></h4>
594
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
595
  </div>
596
  <div class="onbrdpp-body">
597
- <p><?php _e("If you do not select a merchant center account, you will not be able to use complete google shopping features.","conversios"); ?></p>
598
- <p><?php _e("Are you sure you want to continue without selecting a merchant center account?","conversios"); ?></p>
599
  </div>
600
  <div class="ppfooterbtn">
601
- <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="merchant-center-skip-cancel"><?php _e("Cancel","conversios"); ?></button>
602
- <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="merchant-center-skip-continue"><?php _e("Continue","conversios"); ?></button>
603
  </div>
604
  </div>
605
  </div>
@@ -608,34 +608,34 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
608
  <div id="createmerchantpopup" class="pp-modal onbrd-popupwrp crtemrchntpp">
609
  <div class="onbrdppmain">
610
  <div class="onbrdnpp-cntner crtemrchntppcntnr">
611
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'); ?>" alt="" /></div>
612
  <div class="onbrdpp-body">
613
  <div class="row">
614
  <div class="crtemrchnpp-lft">
615
  <div class="crtemrchpplft-top">
616
- <h4><?php _e("Create Google Merchant Center Account","conversios"); ?></h4>
617
- <p><?php _e("Before you can upload product data, you’ll need to verify and claim your store’s website URL. Claiming associates your website URL with your Google Merchant Center account.","conversios"); ?></p>
618
  </div>
619
  <div class="claimedbx">
620
- <?php _e("Your site will automatically be claimed and verified.","conversios"); ?>
621
  </div>
622
  <div class="mrchntformwrp">
623
  <form action="#">
624
  <div class="form-row">
625
- <input type="hidden" id="get-mail" name="g_email" value="<?php echo esc_attr(isset($this->tvc_data['g_mail'])?$this->tvc_data['g_mail']:""); ?>">
626
  <input type="text" value="<?php echo esc_attr($this->tvc_data['user_domain']); ?>" class="fromfiled" name="url" id="url" placeholder="Enter Website">
627
  <div class="cstmcheck-item mt15">
628
  <label for="adult_content">
629
  <input class="" type="checkbox" name="adult_content" id="adult_content">
630
  <span class="checkmark"></span>
631
- <?php _e("My site contains","conversios"); ?>
632
  </label>
633
- <strong><?php _e("Adult Content","conversios"); ?></strong>
634
  </div>
635
  </div>
636
  <div class="form-row">
637
- <input type="text" class="fromfiled" name="store_name" id="store_name" placeholder="<?php _e("Enter Store Name","conversios"); ?>" required>
638
- <div class="inputinfotxt"><?php _e("This name will appear in your Shopping Ads.","conversios"); ?></div>
639
  </div>
640
  <div class="form-row">
641
  <?php echo $this->get_countries($this->tvc_data['user_country']); ?>
@@ -645,27 +645,27 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
645
  <label for="terms_conditions">
646
  <input class="" type="checkbox" name="concent" id="terms_conditions">
647
  <span class="checkmark"></span>
648
- <?php _e("I accept the","conversios"); ?>
649
  </label>
650
- <a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/160173?hl=en"); ?>"><?php _e("terms & conditions","conversios"); ?></a>
651
  </div>
652
  </div>
653
  </form>
654
  </div>
655
  <div class="ppfooterbtn">
656
- <button type="button" id="create_merchant_account" class="cretemrchntbtn"><?php _e("Create Account","conversios"); ?>
657
  </button>
658
  </div>
659
  </div>
660
  <div class="crtemrchnpp-right">
661
- <h6><?php _e("To use Google Shopping, your website must meet these requirements:","conversios"); ?></h6>
662
  <ul>
663
- <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6149970?hl=en"); ?>"><?php _e("Google Shopping ads policies","conversios"); ?></a></li>
664
- <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150127"); ?>"><?php _e("Accurate Contact Information","conversios"); ?></a></li>
665
- <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150122"); ?>"><?php _e("Secure collection of process and personal data","conversios"); ?></a></li>
666
- <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150127"); ?>"><?php _e("Return Policy","conversios"); ?></a></li>
667
- <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150127"); ?>"><?php _e("Billing terms & conditions","conversios"); ?></a></li>
668
- <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150118"); ?>"><?php _e("Complete checkout process","conversios"); ?></a></li>
669
  </ul>
670
  </div>
671
  </div>
@@ -680,44 +680,44 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
680
  <div class="onbrdppmain">
681
  <div class="onbrdnpp-cntner congratppcntnr">
682
  <div class="onbrdnpp-hdr txtcnter">
683
- <h2><?php _e("Congratulations!!","conversios"); ?></h2>
684
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'); ?>" alt="" /></div>
685
  </div>
686
  <div class="onbrdpp-body congratppbody">
687
- <p><?php _e("You have been successfully onboarded. Please check the account summary below and confirm.","conversios"); ?></p>
688
  <div class="congratppdtlwrp">
689
  <div class="cngrtppdtl-item" id="google_analytics_property_id_info">
690
  <div class="cngtrpplft">
691
- <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
692
- <?php _e("Google Analytics Property Id:","conversios"); ?>
693
  </div>
694
  <div class="cngtrpprgt" id="selected_google_analytics_property"></div>
695
  </div>
696
  <div class="cngrtppdtl-item" id="google_analytics_measurement_id_info">
697
  <div class="cngtrpplft">
698
- <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
699
- <?php _e("Google Analytics Measurement Id:","conversios"); ?>
700
  </div>
701
  <div class="cngtrpprgt" id="selected_google_analytics_measurement"></div>
702
  </div>
703
  <div class="cngrtppdtl-item" id="google_ads_info">
704
  <div class="cngtrpplft">
705
- <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
706
- <?php _e("Google Ads Account:","conversios"); ?>
707
  </div>
708
  <div class="cngtrpprgt" id="selected_google_ads_account"></div>
709
  </div>
710
  <div class="cngrtppdtl-item" id="google_merchant_center_info">
711
  <div class="cngtrpplft">
712
- <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
713
- <?php _e("Google Merchant Center Account","conversios"); ?>
714
  </div>
715
  <div class="cngtrpprgt" id="selected_google_merchant_center"></div>
716
  </div>
717
  </div>
718
  </div>
719
  <div class="ppfooterbtn">
720
- <button type="button" id="confirm_selection" class="ppblubtn"><?php _e("Confirm","conversios"); ?></button>
721
  </div>
722
  </div>
723
  </div>
@@ -734,9 +734,9 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
734
  <script>
735
  let tvc_data = <?php echo $j_tvc_data; ?>;
736
  var tvc_ajax_url = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
737
- let subscription_id ="<?php echo $this->subscriptionId; ?>";
738
- let plan_id ="<?php echo $this->plan_id; ?>";
739
- let app_id ="<?php echo $this->app_id; ?>";
740
  /**
741
  * Convesios custom script
742
  */
@@ -1000,17 +1000,17 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
1000
  * onboarding page add scripts file
1001
  */
1002
  public function add_scripts(){
1003
- if(isset($_GET['page']) && $_GET['page'] == "conversios_onboarding"){
1004
- wp_register_style('conversios-select2-css',ENHANCAD_PLUGIN_URL . '/admin/css/select2.css');
1005
- wp_enqueue_style('conversios-style-css',ENHANCAD_PLUGIN_URL . '/admin/css/style.css', array(), $this->version, 'all');
1006
- wp_enqueue_style('conversios-responsive-css',ENHANCAD_PLUGIN_URL . '/admin/css/responsive.css', array(), $this->version, 'all');
1007
  wp_enqueue_style('conversios-select2-css');
1008
 
1009
 
1010
- wp_enqueue_script( 'conversios-jquery-js', ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js', array( 'jquery' ), $this->version, false );
1011
- wp_register_script('conversios-select2-js', ENHANCAD_PLUGIN_URL.'/admin/js/select2.min.js');
1012
  wp_enqueue_script('conversios-select2-js');
1013
- wp_enqueue_script( 'conversios-onboarding-js', ENHANCAD_PLUGIN_URL . '/admin/js/onboarding-custom.js', array( 'jquery' ), $this->version, false );
1014
  }
1015
  }
1016
  /**
@@ -1018,7 +1018,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
1018
  */
1019
  public function register() {
1020
  // Getting started - shows after installation.
1021
- if(isset($_GET['page']) && $_GET['page'] == "conversios_onboarding"){
1022
  add_dashboard_page(
1023
  esc_html__( 'Welcome to Conversios Onboarding', 'conversios' ),
1024
  esc_html__( 'Welcome to Conversios Onboarding', 'conversios' ),
@@ -1026,30 +1026,19 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
1026
  'conversios_onboarding',
1027
  array( $this, 'welcome_screen' )
1028
  );
1029
- /*add_submenu_page(
1030
- '__FILE__',
1031
- esc_html__('Welcome to Conversios Onboarding', 'conversios'),
1032
- esc_html__('Welcome to Conversios Onboarding', 'conversios'),
1033
- 'administrator',
1034
- 'conversios_onboarding',
1035
- array($this, 'welcome_screen'),10
1036
- );*/
1037
  }
1038
  }
1039
  /**
1040
  * Check if we should do any redirect.
1041
  */
1042
  public function maybe_redirect() {
1043
-
1044
- // Bail if no activation redirect.
1045
  if ( ! get_transient( '_conversios_activation_redirect' ) || isset( $_GET['conversios-redirect'] ) ) {
1046
  return;
1047
  }
1048
  // Delete the redirect transient.
1049
  delete_transient( '_conversios_activation_redirect' );
1050
-
1051
- // Bail if activating from network, or bulk.
1052
- if ( isset( $_GET['activate-multi'] ) ) { // WPCS: CSRF ok, input var ok.
1053
  return;
1054
  }
1055
 
45
  $g_mail = get_option('ee_customer_gmail');
46
  $this->tvc_data['g_mail']="";
47
  if($g_mail){
48
+ $this->tvc_data['g_mail']= sanitize_email($g_mail);
49
  }
50
  }
51
  }
72
  $contData = json_decode($getCountris);
73
  if (!empty($user_country)) {
74
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx' readonly='true'>";
75
+ $data .= "<option value=''>".esc_html__("Please select country","conversios")."</option>";
76
  foreach ($contData as $key => $value) {
77
  $selected = ($value->code == $user_country) ? "selected='selected'" : "";
78
  $data .= "<option value=" . esc_attr($value->code) . " " . $selected . " >" . esc_attr($value->name) . "</option>";
80
  $data .= "</select>";
81
  } else {
82
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx'>";
83
+ $data .= "<option value=''>".esc_html__("Please select country","conversios")."</option>";
84
  foreach ($contData as $key => $value) {
85
  $data .= "<option value=" . esc_attr($value->code) . ">" . esc_attr($value->name) . "</option>";
86
  }
98
  */
99
  public function welcome_screen() {
100
  $googleDetail = "";
101
+ $defaulSelection = esc_attr(1);
102
+ $tracking_option = esc_attr("UA");
103
  $login_customer_id ="";
104
+ $completed_last_step =esc_attr("step-0");
105
  $complete_step = array("step-0"=>1,"step-1"=>0,"step-2"=>0,"step-3"=>0);
106
 
107
+ if ( isset($_GET['subscription_id']) && sanitize_text_field($_GET['subscription_id'])){
108
+ $this->subscriptionId = sanitize_text_field($_GET['subscription_id']);
109
+ if ( isset($_GET['g_mail']) && sanitize_email($_GET['g_mail'])){
110
+ $this->tvc_data['g_mail'] = sanitize_email($_GET['g_mail']);
111
+ $completed_last_step =esc_attr("step-1");
112
+ $complete_step["step-0"] = esc_attr(1);
113
 
114
  $ee_additional_data = $this->TVC_Admin_Helper->get_ee_additional_data();
115
+ $ee_additional_data['ee_last_login'] = sanitize_text_field(current_time( 'timestamp' ));
116
  $this->TVC_Admin_Helper->set_ee_additional_data($ee_additional_data);
117
 
118
  $this->is_refresh_token_expire = false;
126
  if( property_exists($google_detail, "data") && $google_detail->data != "" ){
127
  $googleDetail = $google_detail->data;
128
  $this->tvc_data['subscription_id'] = $googleDetail->id;
129
+ $this->tvc_data['access_token'] = base64_encode($googleDetail->access_token);
130
+ $this->tvc_data['refresh_token'] = base64_encode($googleDetail->refresh_token);
131
  $this->plan_id = $googleDetail->plan_id;
132
  $login_customer_id = $googleDetail->customer_id;
133
  $tracking_option = $googleDetail->tracking_option;
185
  #wpadminbar{display: none;}
186
  </style>
187
  <div class="bodyrightpart onbordingbody-wapper">
188
+ <div class="loader-section" id="loader-section"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/ajax-loader.gif');?>" alt="loader"></div>
189
  <div class="alert-message" id="tvc_onboarding_popup_box"></div>
190
  <div class="onbordingbody">
191
  <div class="site-header">
192
  <div class="container">
193
+ <div class="brand"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/logo.png');?>" alt="Conversios" /></div>
194
  </div>
195
  </div>
196
  <div class="onbording-wrapper">
197
  <div class="container">
198
  <div class="smallcontainer">
199
  <div class="onbordingtop">
200
+ <h2><?php esc_html_e("Let’s get you started.","conversios"); ?></h2>
201
+ <p><?php esc_html_e("Automate Google Analytics, Dynamic Remarketing & Google Shopping in just 5 minutes.","conversios"); ?></p>
202
  </div>
203
  <div class="row">
204
  <!-- onborading left start -->
205
  <div class="onboardingstepwrap">
206
  <!-- step-0 start -->
207
+ <div class="onbordording-step onbrdstep-0 gglanystep <?php if($this->subscriptionId == "" || $this->tvc_data['g_mail']=="" || $this->is_refresh_token_expire == true ){ echo esc_attr("activestep"); }else{echo esc_attr("selectedactivestep"); } ?>">
208
  <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-0']); ?>" id="google-signing" data-id="step_0">
209
  <div class="stepleftround">
210
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
211
  </div>
212
  <div class="stepdetwrap">
213
+ <h4><?php esc_html_e("Connect Conversios with your website","conversios"); ?></h4>
214
+ <p><?php echo (isset($this->tvc_data['g_mail']) && esc_attr($this->subscriptionId) )?esc_attr($this->tvc_data['g_mail']):""; ?></p>
215
  </div>
216
  </div>
217
  <div class="stepmoredtlwrp">
219
  <?php if(!isset($this->tvc_data['g_mail']) || $this->tvc_data['g_mail'] == "" || $this->subscriptionId == ""){?>
220
  <div class="google_connect_url google-btn">
221
  <div class="google-icon-wrapper">
222
+ <img class="google-icon" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
223
  </div>
224
+ <p class="btn-text"><b><?php esc_html_e("Sign in with google","conversios"); ?></b></p>
225
  </div>
226
  <?php } else{?>
227
 
228
  <?php if($this->is_refresh_token_expire == true){?>
229
+ <p class="alert alert-primary"><?php esc_html_e("It seems the token to access your Google accounts is expired. Sign in again to continue.","conversios"); ?></p>
230
  <div class="google_connect_url google-btn">
231
  <div class="google-icon-wrapper">
232
+ <img class="google-icon" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
233
  </div>
234
+ <p class="btn-text"><b><?php esc_html_e("Sign in with google","conversios"); ?></b></p>
235
  </div>
236
  <?php } else{ ?>
237
  <div class="google_connect_url google-btn">
238
  <div class="google-icon-wrapper">
239
+ <img class="google-icon" src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
240
  </div>
241
+ <p class="btn-text mr-35"><b><?php esc_html_e("Reauthorize","conversios"); ?></b></p>
242
  </div>
243
  <?php } ?>
244
  <?php } ?>
245
+ <p><?php esc_html_e("Make sure you sign in with the google account that has all privileges to access google analytics, google ads and google merchant center account.","conversios"); ?></p>
246
  </div>
247
  </div>
248
  </div>
249
  <!-- step-0 over -->
250
  <!-- step-1 start -->
251
+ <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false )?esc_attr('selectedactivestep'):''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false){ echo esc_attr("activestep"); } ?>">
252
+ <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-1']); ?>" id="google-analytics" data-id="step_1">
253
  <div class="stepleftround">
254
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
255
  </div>
256
  <div class="stepdetwrap">
257
+ <h4><?php esc_html_e("Connect Google Analytics Account","conversios"); ?></h4>
258
+ <p><?php esc_html_e("Tag your website with all important e-commerce events in Google Analytics.","conversios"); ?></p>
259
  </div>
260
  </div>
261
  <div class="stepmoredtlwrp">
262
  <div class="stepmoredtl">
263
  <form action="#">
264
  <div class="form-row">
265
+ <h5><?php esc_html_e("How do you plan to tag your website?","conversios"); ?></h5>
266
  <div class="cstmrdobtn-item">
267
  <label for="univeral">
268
+ <input type="radio" <?php echo esc_attr($this->is_checked($tracking_option, "UA")); ?> name="analytic_tag_type" id="univeral" value="UA">
269
  <span class="checkmark"></span>
270
+ <?php esc_html_e("Universal Analytics (Google Analytics 3)","conversios"); ?>
271
  </label>
272
  <div id="UA" class="slctunivr-filed">
273
  <div class="tvc-dropdown">
274
+ <div class="tvc-dropdown-header" id="ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>"><?php if($googleDetail->property_id){
275
  echo esc_attr($googleDetail->property_id);
276
+ }else{?><?php esc_html_e("Select Property Id","conversios"); ?><?php } ?></div>
277
  <div class="tvc-dropdown-content" id="ua_web_property_id_option">
278
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Property Id","conversios"); ?></option></div>
279
+ <div class="tvc-ua-option-more option"><?php esc_html_e("Load More","conversios"); ?></div>
280
  </div>
281
  </div>
282
 
286
  <label for="gglanytc">
287
  <input type="radio" <?php echo $this->is_checked($tracking_option, "GA4"); ?> name="analytic_tag_type" id="gglanytc" value="GA4">
288
  <span class="checkmark"></span>
289
+ <?php esc_html_e("Google Analytics 4","conversios"); ?>
290
  </label>
291
  <div id="GA4" class="slctunivr-filed">
292
 
293
  <div class="tvc-dropdown">
294
+ <div class="tvc-dropdown-header" id="ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>" data-val="<?php if($googleDetail->measurement_id){ echo esc_attr($googleDetail->measurement_id); } ?>">
295
  <?php if($googleDetail->measurement_id){
296
  echo esc_attr($googleDetail->measurement_id);
297
+ }else{?><?php esc_html_e("Select Measurement Id","conversios"); ?>
298
  <?php } ?></div>
299
  <div class="tvc-dropdown-content" id="ga4_web_measurement_id_option">
300
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Measurement Id","conversios"); ?></option></div>
301
+ <div class="tvc-ga4-option-more option"><?php esc_html_e("Load More","conversios"); ?></div>
302
  </div>
303
  </div>
304
 
308
  <label for="both">
309
  <input type="radio" <?php echo $this->is_checked($tracking_option, "BOTH"); ?> name="analytic_tag_type" id="both" value="BOTH">
310
  <span class="checkmark"></span>
311
+ <?php esc_html_e("Both","conversios"); ?>
312
  </label>
313
  <div id="BOTH" class="slctunivr-filed">
314
  <div class="botslectbxitem">
315
 
316
  <div class="tvc-dropdown">
317
+ <div class="tvc-dropdown-header" id="both_ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo esc_attr($googleDetail->ua_analytic_account_id); } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>"><?php if($googleDetail->property_id){
318
  echo esc_attr($googleDetail->property_id);
319
+ }else{?><?php esc_html_e("Select Property Id","conversios"); ?><?php } ?></div>
320
  <div class="tvc-dropdown-content" id="both_ua_web_property_id_option">
321
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Property Id","conversios"); ?></option></div>
322
+ <div class="tvc-ua-option-more option"><?php esc_html_e("Load More","conversios"); ?></div>
323
  </div>
324
  </div>
325
 
327
  <div class="botslectbxitem">
328
 
329
  <div class="tvc-dropdown">
330
+ <div class="tvc-dropdown-header" id="both_ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo esc_attr($googleDetail->ga4_analytic_account_id); } ?>" data-val="<?php if($googleDetail->measurement_id){ echo esc_attr($googleDetail->measurement_id); } ?>">
331
  <?php if($googleDetail->measurement_id){
332
  echo esc_attr($googleDetail->measurement_id);
333
+ }else{?><?php esc_html_e("Select Measurement Id","conversios"); ?>
334
  <?php } ?></div>
335
  <div class="tvc-dropdown-content" id="both_ga4_web_measurement_id_option">
336
+ <div class="tvc-select-items"><option value=""><?php esc_html_e("Select Measurement Id","conversios"); ?></option></div>
337
+ <div class="tvc-ga4-option-more option"><?php esc_html_e("Load More","conversios"); ?></div>
338
  </div>
339
  </div>
340
  </div>
341
+ <div id="old_tracking" data-tracking_option="<?php echo esc_attr($tracking_option); ?>" data-measurement_id="<?php echo esc_attr($googleDetail->measurement_id); ?>" data-property_id="<?php echo esc_attr($googleDetail->property_id); ?>"></div>
342
  </div>
343
  </div>
344
  </div>
345
  <div class="form-row">
346
+ <h5><?php esc_html_e("Advance Settings (Optional)","conversios"); ?></h5>
347
  <div class="chckbxbgbx">
348
  <div class="cstmcheck-item">
349
  <label for="enhanced_e_commerce_tracking">
350
+ <input type="checkbox" class="custom-control-input" name="enhanced_e_commerce_tracking" id="enhanced_e_commerce_tracking" <?php echo esc_attr($is_e_e_tracking); ?>>
351
  <span class="checkmark"></span>
352
+ <?php esc_html_e("Enhaced e-commerce tracking","conversios"); ?>
353
  </label>
354
  </div>
355
  <div class="cstmcheck-item">
356
  <label for="add_gtag_snippet">
357
+ <input type="checkbox" class="custom-control-input" name="add_gtag_snippe" id="add_gtag_snippet" <?php echo esc_attr($is_a_g_snippet); ?>>
358
  <span class="checkmark"></span>
359
+ <?php esc_html_e("Add gtag.js snippet","conversios"); ?>
360
  </label>
361
  </div>
362
  </div>
363
  </div>
364
  <div class="stepsbmtbtn">
365
+ <input type="hidden" id="subscriptionPropertyId" name="subscriptionPropertyId" value="<?php echo (property_exists($googleDetail,"property_id"))?esc_attr($googleDetail->property_id):""; ?>">
366
+ <input type="hidden" id="subscriptionMeasurementId" name="subscriptionMeasurementId" value="<?php echo (property_exists($googleDetail,"measurement_id"))?esc_attr($googleDetail->measurement_id):""; ?>">
367
+ <button type="button" disabled id="step_1" class="stepnextbtn stpnxttrgr"><?php esc_html_e("Next","conversios"); ?></button>
368
  </div>
369
  </form>
370
  </div>
373
  <!-- step-1 over -->
374
  <!-- step-2 start -->
375
  <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1 && $this->is_refresh_token_expire == false)?'selectedactivestep':''; ?>">
376
+ <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-2']); ?>" id="google-ads" data-id="step_2">
377
  <div class="stepleftround">
378
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
379
  </div>
380
  <div class="stepdetwrap">
381
+ <h4><?php esc_html_e("Select Google Ads account","conversios"); ?></h4>
382
+ <p><?php esc_html_e("With dynamic reamarketing tags, you will be able to show ads to your past visitors with specific product information tailored to your customer’s previous site visit.","conversios"); ?></p>
383
  </div>
384
  </div>
385
  <div class="stepmoredtlwrp">
387
  <form action="#">
388
  <div class="selcttopwrap" id="tvc_ads_section">
389
  <div class="ggladsselectbx">
390
+ <input type="hidden" id="subscriptionGoogleAdsId" name="subscriptionGoogleAdsId" value="<?php echo property_exists($googleDetail,"google_ads_id")?esc_attr($googleDetail->google_ads_id):""; ?>">
391
  <select class="slect2bx google_ads_sel" id="ads-account" name="customer_id">
392
+ <option value=''><?php esc_html_e("Select Google Ads Account","conversios"); ?></option>
393
  </select>
394
  </div>
395
  <div class="orwrp">or</div>
396
  <div class="creatnewwrp">
397
+ <button type="button" class="cretnewbtn newggladsbtn"><span class="plusicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php esc_html_e("Create New","conversios"); ?></button>
398
  </div>
399
  </div>
400
 
401
  <div class="selcttopwrap">
402
  <div class="onbrdpp-body alert alert-primary" style="display:none;" id="new_google_ads_section">
403
+ <h4><?php esc_html_e("Account Created","conversios"); ?></h4>
404
+ <p><?php esc_html_e("Your Google Ads Account has been created","conversios"); ?> <strong>(<b><span id="new_google_ads_id"></span></b>).</strong></p>
405
+ <h5><?php esc_html_e("Steps to claim your Google Ads Account:","conversios"); ?></h5>
406
  <ol>
407
+ <li><?php esc_html_e("Accept invitation mail from Google Ads sent to your email address","conversios"); ?> <em><?php echo (isset($this->tvc_data['g_mail']))?$this->tvc_data['g_mail']:""; ?></em></li>
408
+ <li><?php esc_html_e("Log into your Google Ads account and set up your <em>billing preferences</em>","conversios"); ?></li>
409
  </ol>
410
  </div>
411
  </div>
417
  $is_d_r_tags = (property_exists($googleDetail,"dynamic_remarketing_tags") && $googleDetail->dynamic_remarketing_tags == 1)?"checked":(($defaulSelection == 1)?"checked":"");
418
  $is_g_ad_c_tracking = (property_exists($googleDetail,"google_ads_conversion_tracking") && $googleDetail->google_ads_conversion_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
419
  ?>
420
+ <h5><?php esc_html_e("Advance Settings (Optional)","conversios"); ?></h5>
421
  <div class="chckbxbgbx dsplcolmview">
422
  <div class="cstmcheck-item">
423
  <label for="remarketing_tag">
424
+ <input type="checkbox" class="custom-control-input" name="remarketing_tag" id="remarketing_tag" value="1" <?php echo esc_attr($is_r_tags); ?>>
425
  <span class="checkmark"></span>
426
+ <?php esc_html_e("Enable Google Remarketing Tag","conversios"); ?>
427
  </label>
428
  </div>
429
  <div class="cstmcheck-item">
430
  <label for="dynamic_remarketing_tags">
431
+ <input type="checkbox" class="custom-control-input" name="dynamic_remarketing_tags" id="dynamic_remarketing_tags" value="1" <?php echo esc_attr($is_d_r_tags); ?>>
432
  <span class="checkmark"></span>
433
+ <?php esc_html_e("Enable Dynamic Remarketing Tag","conversios"); ?>
434
  </label>
435
  </div>
436
  <div class="cstmcheck-item <?php if($this->plan_id == 1){?>cstmcheck-item-pro <?php } ?>">
437
  <label for="google_ads_conversion_tracking">
438
  <?php if($this->plan_id != 1){?>
439
+ <input type="checkbox" class="custom-control-input" name="google_ads_conversion_tracking" id="google_ads_conversion_tracking" value="1" <?php echo esc_attr($is_g_ad_c_tracking); ?>>
440
  <span class="checkmark"></span>
441
+ <?php esc_html_e("Google Ads conversion tracking","conversios"); ?>
442
  <?php }else{?>
443
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/icon/lock.svg'); ?>"><label><?php esc_html_e("Google Ads conversion tracking (Pro Plan)","conversios"); ?></label>
444
  <?php } ?>
445
  </label>
446
  </div>
447
  <div class="cstmcheck-item">
448
  <label for="link_google_analytics_with_google_ads">
449
+ <input type="checkbox" class="custom-control-input" name="link_google_analytics_with_google_ads" id="link_google_analytics_with_google_ads" value="1" <?php echo esc_attr($is_l_g_an_w_g_ad); ?>>
450
  <span class="checkmark"></span>
451
+ <?php esc_html_e("Link Google Analytics with Google Ads","conversios"); ?>
452
  </label>
453
  </div>
454
  </div>
455
  </div>
456
  <div class="stepsbmtbtn">
457
+ <button type="button" id="step_2" class="stepnextbtn stpnxttrgr"><?php esc_html_e("Next","conversios"); ?></button>
458
  <!-- add dslbbtn class for disable button -->
459
  </div>
460
  </form>
463
  </div>
464
  <!-- step-2 over -->
465
  <!-- step-3 start -->
466
+ <div class="onbordording-step onbrdstep-3 gglmrchntstep <?php echo ($complete_step['step-3']==1 && $this->is_refresh_token_expire == false )?esc_attr('selectedactivestep'):''; ?>">
467
+ <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-3']); ?>" id="gmc-account" data-id="step_3">
468
  <div class="stepleftround">
469
+ <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
470
  </div>
471
  <div class="stepdetwrap">
472
+ <h4><?php esc_html_e("Select Google Merchant Center Account","conversios"); ?></h4>
473
+ <p><?php esc_html_e("Make your WooCommerce shop and products available to millions of shoppers across google.","conversios"); ?></p>
474
  </div>
475
  </div>
476
  <div class="stepmoredtlwrp">
480
  <div class="form-group" style="display:none;" id="new_merchant_section">
481
  <div class="text-center">
482
  <div class="alert alert-primary" style="padding: 10px;" role="alert">
483
+ <label class="form-label-control font-weight-bold"><?php esc_html_e("We have created new merchant center account with ID: ","conversios"); ?><span id="new_merchant_id"></span>. <?php esc_html_e("Click on finish button to save new account.","conversios"); ?></label>
484
  </div>
485
  </div>
486
  </div>
487
  <div id="tvc_merchant_section">
488
  <div class="ggladsselectbx">
489
  <select class="slect2bx" id="google_merchant_center_id" name="google_merchant_center_id">
490
+ <option value=''><?php esc_html_e("Select Google Merchant Center","conversios"); ?></option>
491
  </select>
492
  </div>
493
  <div class="orwrp">or</div>
494
  <div class="creatnewwrp">
495
+ <button type="button" class="cretnewbtn newmrchntbtn"><span class="plusicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php esc_html_e("Create New","conversios"); ?></button>
496
  </div>
497
  </div>
498
  </div>
499
  <div class="stepsbmtbtn">
500
+ <button type="button" id="step_3" data-enchanter="finish" class="stepnextbtn finishbtn"><?php esc_html_e("Finish","conversios"); ?></button>
501
  <!-- add dslbbtn class for disable button -->
502
  </div>
503
+ <input type="hidden" id="subscriptionMerchantCenId" name="subscriptionMerchantCenId" value="<?php echo property_exists($googleDetail,"google_merchant_center_id")?esc_attr($googleDetail->google_merchant_center_id):""; ?>">
504
  <input type="hidden" id="loginCustomerId" name="loginCustomerId" value="<?php echo esc_attr($login_customer_id); ?>">
505
  <input type="hidden" id="subscriptionId" name="subscriptionId" value="<?php echo esc_attr($this->subscriptionId); ?>">
506
+ <input type="hidden" id="plan_id" name="plan_id" value="<?php echo esc_attr($this->plan_id); ?>">
507
  <input type="hidden" id="conversios_onboarding_nonce" name="conversios_onboarding_nonce" value="<?php echo wp_create_nonce( 'conversios_onboarding_nonce' ); ?>">
508
 
509
  <input type="hidden" id="ga_view_id" name="ga_view_id" value="<?php echo esc_attr(get_option('ee_ga_view_id')); ?>">
510
  </form>
511
  </div>
512
  <div class="stepnotewrp">
513
+ <?php esc_html_e('If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at <a href="">Google Merchant Center Help</a> website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.','conversios'); ?>
514
  </div>
515
  </div>
516
  </div>
522
  <div class="sidebrcontainer">
523
  <div class="onbrd-rdmbx">
524
  <div class="rdm-amnt">
525
+ <small><?php esc_html_e("Redeem upto","conversios"); ?></small>
526
+ <?php echo esc_attr($off_credit_amt); ?>
527
  </div>
528
+ <p><?php esc_html_e("Create your first Google Ads account with us and redeem upto","conversios"); ?> <?php echo esc_attr($off_credit_amt); ?> <?php esc_html_e("on the spend you make in the next 31 days.","conversios"); ?></p>
529
+ <a target="_blank" href="<?php echo esc_url_raw("https://conversios.io/help-center/Google-Spend-Match.pdf"); ?>" class="lrnmorbtn"><?php esc_html_e("Learn more","conversios"); ?> <img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/arrow_right.png'); ?>" alt="" /></a>
530
  </div>
531
  <div class="onbrdrgt-nav">
532
  <ul>
533
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://conversios.io/help-center/Installation-Manual.pdf"); ?>"><?php echo esc_html_e("Installation Manual","conversios"); ?></a></li>
534
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://conversios.io/help-center/Google-shopping-Guide.pdf"); ?>" href=""><?php esc_html_e("Google Shopping Guide","conversios"); ?></a></li>
535
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/"); ?>" href=""><?php esc_html_e("FAQ","conversios"); ?></a></li>
536
  </ul>
537
  </div>
538
  </div>
549
  <div class="onbrdppmain" role="document">
550
  <div class="onbrdnpp-cntner acccretppcntnr">
551
  <div class="onbrdnpp-hdr">
552
+ <h4><?php esc_html_e("You have not selected Google Ads account.","conversios"); ?></h4>
553
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
554
  </div>
555
  <div class="onbrdpp-body">
556
+ <p><?php esc_html_e("If you do not select Google Ads account, you will not be able to use some of the major features like:","conversios"); ?></p>
557
  <ul>
558
+ <li><?php esc_html_e("Dynamic Remarketing Tags","conversios"); ?> </li>
559
+ <li><?php esc_html_e("Google Smart Shopping Campaigns","conversios"); ?></li>
560
+ <li><?php esc_html_e("Google Analytics and Google Ads linking","conversios"); ?></li>
561
  </ul>
562
+ <p><?php esc_html_e("Are you sure you want to continue without selecting Google Ads account?","conversios"); ?></p>
563
  </div>
564
  <div class="ppfooterbtn">
565
+ <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="ads-skip-cancel"><?php esc_html_e("Cancel","conversios"); ?></button>
566
+ <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="ads-skip-continue"><?php esc_html_e("Continue","conversios"); ?></button>
567
  </div>
568
  </div>
569
  </div>
573
  <div class="onbrdppmain">
574
  <div class="onbrdnpp-cntner ggladsppcntnr">
575
  <div class="onbrdnpp-hdr">
576
+ <h4><?php esc_html_e("Enable Google Ads Account","conversios"); ?></h4>
577
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
578
  </div>
579
  <div class="onbrdpp-body">
580
+ <p><?php esc_html_e("You’ll receive an invite from Google on your email. Accept the invitation to enable your Google Ads Account.","conversios"); ?></p>
581
  </div>
582
  <div class="ppfooterbtn">
583
+ <button type="button" id="ads-continue" class="ppblubtn sndinvitebtn"><?php esc_html_e("Send Invite","conversios"); ?></button>
584
  </div>
585
  </div>
586
  </div>
590
  <div class="onbrdppmain">
591
  <div class="onbrdnpp-cntner acccretppcntnr">
592
  <div class="onbrdnpp-hdr">
593
+ <h4><?php esc_html_e("You have not selected Google merchant center account.","conversios"); ?></h4>
594
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
595
  </div>
596
  <div class="onbrdpp-body">
597
+ <p><?php esc_html_e("If you do not select a merchant center account, you will not be able to use complete google shopping features.","conversios"); ?></p>
598
+ <p><?php esc_html_e("Are you sure you want to continue without selecting a merchant center account?","conversios"); ?></p>
599
  </div>
600
  <div class="ppfooterbtn">
601
+ <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="merchant-center-skip-cancel"><?php esc_html_e("Cancel","conversios"); ?></button>
602
+ <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="merchant-center-skip-continue"><?php esc_html_e("Continue","conversios"); ?></button>
603
  </div>
604
  </div>
605
  </div>
608
  <div id="createmerchantpopup" class="pp-modal onbrd-popupwrp crtemrchntpp">
609
  <div class="onbrdppmain">
610
  <div class="onbrdnpp-cntner crtemrchntppcntnr">
611
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'); ?>" alt="" /></div>
612
  <div class="onbrdpp-body">
613
  <div class="row">
614
  <div class="crtemrchnpp-lft">
615
  <div class="crtemrchpplft-top">
616
+ <h4><?php esc_html_e("Create Google Merchant Center Account","conversios"); ?></h4>
617
+ <p><?php esc_html_e("Before you can upload product data, you’ll need to verify and claim your store’s website URL. Claiming associates your website URL with your Google Merchant Center account.","conversios"); ?></p>
618
  </div>
619
  <div class="claimedbx">
620
+ <?php esc_html_e("Your site will automatically be claimed and verified.","conversios"); ?>
621
  </div>
622
  <div class="mrchntformwrp">
623
  <form action="#">
624
  <div class="form-row">
625
+ <input type="hidden" id="get-mail" name="g_email" value="<?php echo isset($this->tvc_data['g_mail'])?esc_attr($this->tvc_data['g_mail']):""; ?>">
626
  <input type="text" value="<?php echo esc_attr($this->tvc_data['user_domain']); ?>" class="fromfiled" name="url" id="url" placeholder="Enter Website">
627
  <div class="cstmcheck-item mt15">
628
  <label for="adult_content">
629
  <input class="" type="checkbox" name="adult_content" id="adult_content">
630
  <span class="checkmark"></span>
631
+ <?php esc_html_e("My site contains","conversios"); ?>
632
  </label>
633
+ <strong><?php esc_html_e("Adult Content","conversios"); ?></strong>
634
  </div>
635
  </div>
636
  <div class="form-row">
637
+ <input type="text" class="fromfiled" name="store_name" id="store_name" placeholder="<?php esc_html_e("Enter Store Name","conversios"); ?>" required>
638
+ <div class="inputinfotxt"><?php esc_html_e("This name will appear in your Shopping Ads.","conversios"); ?></div>
639
  </div>
640
  <div class="form-row">
641
  <?php echo $this->get_countries($this->tvc_data['user_country']); ?>
645
  <label for="terms_conditions">
646
  <input class="" type="checkbox" name="concent" id="terms_conditions">
647
  <span class="checkmark"></span>
648
+ <?php esc_html_e("I accept the","conversios"); ?>
649
  </label>
650
+ <a target="_blank" href="<?php echo esc_url_raw("https://support.google.com/merchants/answer/160173?hl=en"); ?>"><?php esc_html_e("terms & conditions","conversios"); ?></a>
651
  </div>
652
  </div>
653
  </form>
654
  </div>
655
  <div class="ppfooterbtn">
656
+ <button type="button" id="create_merchant_account" class="cretemrchntbtn"><?php esc_html_e("Create Account","conversios"); ?>
657
  </button>
658
  </div>
659
  </div>
660
  <div class="crtemrchnpp-right">
661
+ <h6><?php esc_html_e("To use Google Shopping, your website must meet these requirements:","conversios"); ?></h6>
662
  <ul>
663
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://support.google.com/merchants/answer/6149970?hl=en"); ?>"><?php esc_html_e("Google Shopping ads policies","conversios"); ?></a></li>
664
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://support.google.com/merchants/answer/6150127"); ?>"><?php esc_html_e("Accurate Contact Information","conversios"); ?></a></li>
665
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://support.google.com/merchants/answer/6150122"); ?>"><?php esc_html_e("Secure collection of process and personal data","conversios"); ?></a></li>
666
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://support.google.com/merchants/answer/6150127"); ?>"><?php esc_html_e("Return Policy","conversios"); ?></a></li>
667
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://support.google.com/merchants/answer/6150127"); ?>"><?php esc_html_e("Billing terms & conditions","conversios"); ?></a></li>
668
+ <li><a target="_blank" href="<?php echo esc_url_raw("https://support.google.com/merchants/answer/6150118"); ?>"><?php esc_html_e("Complete checkout process","conversios"); ?></a></li>
669
  </ul>
670
  </div>
671
  </div>
680
  <div class="onbrdppmain">
681
  <div class="onbrdnpp-cntner congratppcntnr">
682
  <div class="onbrdnpp-hdr txtcnter">
683
+ <h2><?php esc_html_e("Congratulations!!","conversios"); ?></h2>
684
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'); ?>" alt="" /></div>
685
  </div>
686
  <div class="onbrdpp-body congratppbody">
687
+ <p><?php esc_html_e("You have been successfully onboarded. Please check the account summary below and confirm.","conversios"); ?></p>
688
  <div class="congratppdtlwrp">
689
  <div class="cngrtppdtl-item" id="google_analytics_property_id_info">
690
  <div class="cngtrpplft">
691
+ <span class="cngrtchckicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
692
+ <?php esc_html_e("Google Analytics Property Id:","conversios"); ?>
693
  </div>
694
  <div class="cngtrpprgt" id="selected_google_analytics_property"></div>
695
  </div>
696
  <div class="cngrtppdtl-item" id="google_analytics_measurement_id_info">
697
  <div class="cngtrpplft">
698
+ <span class="cngrtchckicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
699
+ <?php esc_html_e("Google Analytics Measurement Id:","conversios"); ?>
700
  </div>
701
  <div class="cngtrpprgt" id="selected_google_analytics_measurement"></div>
702
  </div>
703
  <div class="cngrtppdtl-item" id="google_ads_info">
704
  <div class="cngtrpplft">
705
+ <span class="cngrtchckicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
706
+ <?php esc_html_e("Google Ads Account:","conversios"); ?>
707
  </div>
708
  <div class="cngtrpprgt" id="selected_google_ads_account"></div>
709
  </div>
710
  <div class="cngrtppdtl-item" id="google_merchant_center_info">
711
  <div class="cngtrpplft">
712
+ <span class="cngrtchckicon"><img src="<?php echo esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
713
+ <?php esc_html_e("Google Merchant Center Account","conversios"); ?>
714
  </div>
715
  <div class="cngtrpprgt" id="selected_google_merchant_center"></div>
716
  </div>
717
  </div>
718
  </div>
719
  <div class="ppfooterbtn">
720
+ <button type="button" id="confirm_selection" class="ppblubtn"><?php esc_html_e("Confirm","conversios"); ?></button>
721
  </div>
722
  </div>
723
  </div>
734
  <script>
735
  let tvc_data = <?php echo $j_tvc_data; ?>;
736
  var tvc_ajax_url = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
737
+ let subscription_id ="<?php echo esc_attr($this->subscriptionId); ?>";
738
+ let plan_id ="<?php echo esc_attr($this->plan_id); ?>";
739
+ let app_id ="<?php echo esc_attr($this->app_id); ?>";
740
  /**
741
  * Convesios custom script
742
  */
1000
  * onboarding page add scripts file
1001
  */
1002
  public function add_scripts(){
1003
+ if(isset($_GET['page']) && sanitize_text_field($_GET['page']) == "conversios_onboarding"){
1004
+ wp_register_style('conversios-select2-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/select2.css'));
1005
+ wp_enqueue_style('conversios-style-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/style.css'), array(), $this->version, 'all');
1006
+ wp_enqueue_style('conversios-responsive-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/responsive.css'), array(), $this->version, 'all');
1007
  wp_enqueue_style('conversios-select2-css');
1008
 
1009
 
1010
+ wp_enqueue_script( 'conversios-jquery-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js'), array( 'jquery' ), $this->version, false );
1011
+ wp_register_script('conversios-select2-js', esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/js/select2.min.js') );
1012
  wp_enqueue_script('conversios-select2-js');
1013
+ wp_enqueue_script( 'conversios-onboarding-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/onboarding-custom.js') , array( 'jquery' ), $this->version, false );
1014
  }
1015
  }
1016
  /**
1018
  */
1019
  public function register() {
1020
  // Getting started - shows after installation.
1021
+ if(isset($_GET['page']) && sanitize_text_field($_GET['page']) == "conversios_onboarding"){
1022
  add_dashboard_page(
1023
  esc_html__( 'Welcome to Conversios Onboarding', 'conversios' ),
1024
  esc_html__( 'Welcome to Conversios Onboarding', 'conversios' ),
1026
  'conversios_onboarding',
1027
  array( $this, 'welcome_screen' )
1028
  );
 
 
 
 
 
 
 
 
1029
  }
1030
  }
1031
  /**
1032
  * Check if we should do any redirect.
1033
  */
1034
  public function maybe_redirect() {
 
 
1035
  if ( ! get_transient( '_conversios_activation_redirect' ) || isset( $_GET['conversios-redirect'] ) ) {
1036
  return;
1037
  }
1038
  // Delete the redirect transient.
1039
  delete_transient( '_conversios_activation_redirect' );
1040
+
1041
+ if ( isset( $_GET['activate-multi'] ) ) {
 
1042
  return;
1043
  }
1044
 
admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * The admin-specific functionality of the plugin.
5
  *
@@ -8,16 +7,6 @@
8
  *
9
  * @package Enhanced_Ecommerce_Google_Analytics
10
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
11
- */
12
-
13
- /**
14
- * The admin-specific functionality of the plugin.
15
- *
16
- * Defines the plugin name, version, and two examples hooks for how to
17
- * enqueue the admin-specific stylesheet and JavaScript.
18
- *
19
- * @package Enhanced_Ecommerce_Google_Analytics
20
- * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
  * @author Tatvic
22
  */
23
 
@@ -61,8 +50,6 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
61
  $this->site_url = "admin.php?page=conversios";
62
  $this->pro_plan_site = $this->get_pro_plan_site();
63
  $this->google_detail = $this->get_ee_options_data();
64
- //remove container_old_ui_head hook once new UI all implemented
65
- //add_action('container_old_ui_head',array($this,'create_head'));
66
  }
67
  public function tvc_admin_notice(){
68
  // add fixed message notification
@@ -72,7 +59,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
72
  }else{
73
  if(!$this->get_subscriptionId()){
74
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_a">
75
- <p>'. __("Tatvic EE plugin is now fully compatible with Google Analytics 4. Also, explore the new features of Google Shopping and Dynamic remarketing to reach million of shoppers across Google and scale your eCommerce business faster.","conversios").' <a href="admin.php?page=conversios"><b><u>'. __("CONFIGURE NOW","conversios").'</u></b></a></p>
76
  </div>';
77
  }
78
  }
@@ -83,7 +70,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
83
  $googleDetail = $google_detail['setting'];
84
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id =="" && $this->subscriptionId != "" ){
85
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_b">
86
- <p>'. __("Leverage the power of Google Shopping to reach out millions of shoppers across Google. Automate entire Google Shopping and get eligible for free listing when user searches on Google for products similar to your eCommerce business.","conversios").' <a href="admin.php?page=conversios"><b><u>'. __("Automate now","conversios").'</u></b></a></p>
87
  </div>';
88
 
89
  }
@@ -92,13 +79,13 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
92
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_c']) && $ee_additional_data['dismissed_ee_adimin_notic_c'] == 1){
93
  }else{
94
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_c">
95
- <p>'. __("Now access important eCommerce KPIs and Google Ads campaign performance data directly in your wordpress backend to improve your marketing ROI.","conversios").' <a href="admin.php?page=conversios"><b><u>'. __("View it from here.","conversios").'</u></b></a></p>
96
  </div>';
97
 
98
  }
99
  ?>
100
  <script>
101
- var tvc_ajax_url = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
102
  (function( $ ) {
103
  $( function() {
104
  $( '.notice' ).on( 'click', '.notice-dismiss', function( event, el ) {
@@ -124,30 +111,34 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
124
  */
125
  public function enqueue_styles() {
126
  $screen = get_current_screen();
127
- if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos($_GET['page'], 'conversios') !== false) ) {
128
- if($_GET['page'] == "conversios_onboarding"){
129
  return;
130
  }
131
- wp_register_style('plugin-bootstrap', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.min.css') );
 
 
 
 
 
132
  wp_enqueue_style('plugin-bootstrap');
133
- wp_enqueue_style('custom-css', esc_url(ENHANCAD_PLUGIN_URL . '/admin/css/custom-style.css'), array(), $this->version, 'all' );
134
  //if(is_rtl()){ }
135
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
136
- wp_register_style('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css') );
137
  wp_enqueue_style('plugin-select2');
138
- wp_register_style('plugin-steps', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.css'));
139
  wp_enqueue_style('plugin-steps');
140
- wp_register_style('tvc-dataTables-css', esc_url(ENHANCAD_PLUGIN_URL.'/admin/css/dataTables.bootstrap4.min.css'));
141
  wp_enqueue_style('tvc-dataTables-css');
142
- }
143
- if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
144
 
145
- wp_register_style('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css') );
146
  wp_enqueue_style('plugin-select2');
147
- wp_register_style('tvc-bootstrap-datepicker-css', esc_url(ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.css'));
148
  wp_enqueue_style('tvc-bootstrap-datepicker-css');
149
  }
150
- wp_enqueue_style($this->plugin_name, esc_url(plugin_dir_url(__FILE__) . 'css/enhanced-ecommerce-google-analytics-admin.css'), array(), $this->version, 'all');
151
  }
152
  }
153
 
@@ -158,38 +149,36 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
158
  */
159
  public function enqueue_scripts() {
160
  $screen = get_current_screen();
161
- if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos($_GET['page'], 'conversios') !== false) ) {
162
- if($_GET['page'] == "conversios_onboarding"){
163
  return;
164
  }
165
- wp_enqueue_script( 'custom-jquery', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js'), array( 'jquery' ), $this->version, false );
166
- wp_register_script('popper_bootstrap', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/popper.min.js') );
167
  wp_enqueue_script('popper_bootstrap');
168
- wp_register_script('atvc_bootstrap', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/bootstrap.min.js') );
169
  wp_enqueue_script('atvc_bootstrap');
170
- //wp_register_script('tvc_bootstrap_mod', 'https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js');
171
- //wp_enqueue_script('tvc_bootstrap_mod');
172
 
173
- wp_enqueue_script( 'tvc-ee-custom-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js'), array( 'jquery' ), $this->version, false );
174
 
175
- wp_enqueue_script( 'tvc-ee-slick-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/slick.min.js'), array( 'jquery' ), $this->version, false );
176
 
177
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
178
- wp_register_script('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js') );
179
  wp_enqueue_script('plugin-select2');
180
- wp_register_script('plugin-step-js', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.js') );
181
  wp_enqueue_script('plugin-step-js');
182
  }
183
  if($this->is_current_tab_in(array('sync_product_page'))){
184
- wp_enqueue_script( 'tvc-ee-dataTables-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery.dataTables.min.js'), array( 'jquery' ), $this->version, false );
185
- wp_enqueue_script( 'tvc-ee-dataTables-1-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/dataTables.bootstrap4.min.js'), array( 'jquery' ), $this->version, false );
186
  }
187
  if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
188
- wp_register_script('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js') );
189
  wp_enqueue_script('plugin-select2');
190
- wp_register_script('plugin-chart', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/chart/chart.js'));
191
  wp_enqueue_script('plugin-chart');
192
- wp_register_script('tvc-bootstrap-datepicker-js', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js'));
193
  wp_enqueue_script('tvc-bootstrap-datepicker-js');
194
  }
195
  }
1
  <?php
 
2
  /**
3
  * The admin-specific functionality of the plugin.
4
  *
7
  *
8
  * @package Enhanced_Ecommerce_Google_Analytics
9
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
 
 
 
 
 
 
 
 
 
 
10
  * @author Tatvic
11
  */
12
 
50
  $this->site_url = "admin.php?page=conversios";
51
  $this->pro_plan_site = $this->get_pro_plan_site();
52
  $this->google_detail = $this->get_ee_options_data();
 
 
53
  }
54
  public function tvc_admin_notice(){
55
  // add fixed message notification
59
  }else{
60
  if(!$this->get_subscriptionId()){
61
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_a">
62
+ <p>'. esc_html__("Tatvic EE plugin is now fully compatible with Google Analytics 4. Also, explore the new features of Google Shopping and Dynamic remarketing to reach million of shoppers across Google and scale your eCommerce business faster.","conversios").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("CONFIGURE NOW","conversios").'</u></b></a></p>
63
  </div>';
64
  }
65
  }
70
  $googleDetail = $google_detail['setting'];
71
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id =="" && $this->subscriptionId != "" ){
72
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_b">
73
+ <p>'. esc_html__("Leverage the power of Google Shopping to reach out millions of shoppers across Google. Automate entire Google Shopping and get eligible for free listing when user searches on Google for products similar to your eCommerce business.","conversios").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("Automate now","conversios").'</u></b></a></p>
74
  </div>';
75
 
76
  }
79
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_c']) && $ee_additional_data['dismissed_ee_adimin_notic_c'] == 1){
80
  }else{
81
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_c">
82
+ <p>'. esc_html__("Now access important eCommerce KPIs and Google Ads campaign performance data directly in your wordpress backend to improve your marketing ROI.","conversios").' <a href="'.esc_url_raw('admin.php?page=conversios').'"><b><u>'. esc_html__("View it from here.","conversios").'</u></b></a></p>
83
  </div>';
84
 
85
  }
86
  ?>
87
  <script>
88
+ var tvc_ajax_url = '<?php echo esc_url_raw(admin_url( 'admin-ajax.php' )); ?>';
89
  (function( $ ) {
90
  $( function() {
91
  $( '.notice' ).on( 'click', '.notice-dismiss', function( event, el ) {
111
  */
112
  public function enqueue_styles() {
113
  $screen = get_current_screen();
114
+ if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos(sanitize_text_field($_GET['page']), 'conversios') !== false) ) {
115
+ if(sanitize_text_field($_GET['page']) == "conversios_onboarding"){
116
  return;
117
  }
118
+
119
+ if(is_rtl()){
120
+ wp_register_style('plugin-bootstrap', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.rtl.min.css') );
121
+ }else{
122
+ wp_register_style('plugin-bootstrap', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.min.css') );
123
+ }
124
  wp_enqueue_style('plugin-bootstrap');
125
+ wp_enqueue_style('custom-css', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/custom-style.css'), array(), esc_attr($this->version), 'all' );
126
  //if(is_rtl()){ }
127
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
128
+ wp_register_style('plugin-select2', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/select2.css') );
129
  wp_enqueue_style('plugin-select2');
130
+ wp_register_style('plugin-steps', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.css'));
131
  wp_enqueue_style('plugin-steps');
132
+ wp_register_style('tvc-dataTables-css', esc_url_raw(ENHANCAD_PLUGIN_URL.'/admin/css/dataTables.bootstrap5.min.css'));
133
  wp_enqueue_style('tvc-dataTables-css');
134
+ }else if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
 
135
 
136
+ wp_register_style('plugin-select2', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/css/select2.css') );
137
  wp_enqueue_style('plugin-select2');
138
+ wp_register_style('tvc-bootstrap-datepicker-css', esc_url_raw(ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.css'));
139
  wp_enqueue_style('tvc-bootstrap-datepicker-css');
140
  }
141
+ wp_enqueue_style(esc_attr($this->plugin_name), esc_url_raw(plugin_dir_url(__FILE__) . 'css/enhanced-ecommerce-google-analytics-admin.css'), array(), esc_attr($this->version), 'all');
142
  }
143
  }
144
 
149
  */
150
  public function enqueue_scripts() {
151
  $screen = get_current_screen();
152
+ if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos(sanitize_text_field($_GET['page']), 'conversios') !== false) ) {
153
+ if(sanitize_text_field($_GET['page']) == "conversios_onboarding"){
154
  return;
155
  }
156
+ wp_enqueue_script( 'custom-jquery', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js'), array( 'jquery' ), esc_attr($this->version), false );
157
+ wp_register_script('popper_bootstrap', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/js/popper.min.js') );
158
  wp_enqueue_script('popper_bootstrap');
159
+ wp_register_script('atvc_bootstrap', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/js/bootstrap.min.js') );
160
  wp_enqueue_script('atvc_bootstrap');
 
 
161
 
162
+ wp_enqueue_script( 'tvc-ee-custom-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js'), array( 'jquery' ), esc_attr($this->version), false );
163
 
164
+ wp_enqueue_script( 'tvc-ee-slick-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/slick.min.js'), array( 'jquery' ), esc_attr($this->version), false );
165
 
166
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
167
+ wp_register_script('plugin-select2', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/select2.min.js') );
168
  wp_enqueue_script('plugin-select2');
169
+ wp_register_script('plugin-step-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.js') );
170
  wp_enqueue_script('plugin-step-js');
171
  }
172
  if($this->is_current_tab_in(array('sync_product_page'))){
173
+ wp_enqueue_script( 'tvc-ee-dataTables-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/jquery.dataTables.min.js'), array( 'jquery' ), esc_attr($this->version), false );
174
+ wp_enqueue_script( 'tvc-ee-dataTables-v5-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/dataTables.bootstrap5.min.js'), array( 'jquery' ), esc_attr($this->version), false );
175
  }
176
  if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
177
+ wp_register_script('plugin-select2', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/select2.min.js') );
178
  wp_enqueue_script('plugin-select2');
179
+ wp_register_script('plugin-chart', esc_url_raw(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js'));
180
  wp_enqueue_script('plugin-chart');
181
+ wp_register_script('tvc-bootstrap-datepicker-js', esc_url_raw(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js'));
182
  wp_enqueue_script('tvc-bootstrap-datepicker-js');
183
  }
184
  }
admin/class-enhanced-ecommerce-google-analytics-settings.php CHANGED
@@ -33,8 +33,8 @@ class Enhanced_Ecommerce_Google_Settings {
33
  }
34
  }
35
  }
36
- if(!add_option( $settings, serialize( $ee_options ) )){
37
- update_option($settings, serialize( $ee_options ));
38
  }
39
  }
40
  else {
@@ -65,7 +65,7 @@ class Enhanced_Ecommerce_Google_Settings {
65
  }
66
  }
67
 
68
- update_option($settings, serialize( $get_ee_settings ));
69
  }
70
  }
71
 
@@ -86,7 +86,7 @@ class Enhanced_Ecommerce_Google_Settings {
86
  }
87
  }
88
  }
89
- add_option( $settings, serialize( $ee_options ) );
90
  } else {
91
  $get_ee_settings = unserialize(get_option($settings));
92
  if(is_array($get_ee_settings)) {
@@ -115,7 +115,7 @@ class Enhanced_Ecommerce_Google_Settings {
115
  }
116
  }
117
  }
118
- update_option($settings, serialize( $get_ee_settings ));
119
  }
120
  }
121
  }
33
  }
34
  }
35
  }
36
+ if(!add_option( $settings, serialize(sanitize_option($settings, $ee_options) ) )){
37
+ update_option($settings, serialize( sanitize_option($settings, $ee_options) ));
38
  }
39
  }
40
  else {
65
  }
66
  }
67
 
68
+ update_option($settings, serialize( sanitize_option($settings, $get_ee_settings) ));
69
  }
70
  }
71
 
86
  }
87
  }
88
  }
89
+ add_option( $settings, serialize( sanitize_option($settings, $ee_options) ) );
90
  } else {
91
  $get_ee_settings = unserialize(get_option($settings));
92
  if(is_array($get_ee_settings)) {
115
  }
116
  }
117
  }
118
+ update_option($settings, serialize( sanitize_option($settings, $get_ee_settings) ));
119
  }
120
  }
121
  }
admin/class-survey.php CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
25
  $url = network_site_url( '/' );
26
  $is_local_url = false;
27
  // Trim it up
28
- $url = strtolower( trim( $url ) );
29
  if ( false === strpos( $url, 'http://' ) && false === strpos( $url, 'https://' ) ) {
30
  $url = 'http://' . $url;
31
  }
@@ -60,7 +60,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
60
  }
61
  }
62
  }
63
- return $is_local_url;
64
  }
65
  public function is_plugin_page() {
66
  $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
@@ -77,7 +77,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
77
  ?>
78
  <script type="text/javascript">
79
  jQuery(function($){
80
- var $deactivateLink = $('#the-list').find('[data-slug="<?php echo $this->plugin; ?>"] span.deactivate a'),
81
  $overlay = $('#ee-survey-<?php echo esc_attr($this->plugin); ?>'),
82
  $form = $overlay.find('form'),
83
  formOpen = false;
@@ -104,7 +104,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
104
  subscription_id:'<?php echo esc_attr($this->subscriptionId); ?>',
105
  radio_option_val: "skip",
106
  other_reason: "",
107
- site_url: '<?php echo esc_url( home_url() ); ?>',
108
  plugin_name: 'ee-woocommerce'
109
  }
110
  add_survey(data);
@@ -113,7 +113,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
113
  $form.submit(function(event) {
114
  event.preventDefault();
115
  if (! $form.find('input[type=radio]:checked').val()) {
116
- $form.find('.ee-survey-footer').prepend('<span class="error"><?php echo esc_js( __( 'Please select an option', 'google-analytics-for-wordpress' ) ); ?></span>');
117
  return;
118
  }
119
  var data = {
@@ -122,7 +122,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
122
  subscription_id:'<?php echo esc_attr($this->subscriptionId); ?>',
123
  radio_option_val: $form.find('.selected input[type=radio]').val(),
124
  other_reason: $form.find('.selected input[type=text]').val(),
125
- site_url: '<?php echo esc_url( home_url() ); ?>',
126
  plugin_name: 'ee-woocommerce'
127
  }
128
  add_survey(data);
@@ -241,7 +241,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
241
  }
242
  .ee-survey-wrap .dashicons{
243
  font-size: 24px;
244
- color: #3C434A;
245
  }
246
  </style>
247
  <?php
@@ -254,61 +254,54 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
254
 
255
  $options = array(
256
  1 => array(
257
- "title" => esc_html__("No longer need the plugin","enhanced-e-commerce-for-woocommerce-store"),
258
  ),
259
  2 => array(
260
- 'title' => esc_html__("Switching to a different plugin","enhanced-e-commerce-for-woocommerce-store"),
261
- 'details' => esc_html__( 'Please share which plugin', 'google-analytics-for-wordpress' ),
262
  ),
263
  3 => array(
264
- 'title' => esc_html__("Couldn't get the plugin to work","enhanced-e-commerce-for-woocommerce-store"),
265
  ),
266
  4 => array(
267
- 'title' => esc_html__("It's a temporary deactivation","enhanced-e-commerce-for-woocommerce-store"),
268
  ),
269
  5 => array(
270
- 'title' => esc_html__("Other","enhanced-e-commerce-for-woocommerce-store"),
271
- 'details' => esc_html__( 'Please share the reason', 'google-analytics-for-wordpress' ),
272
  ),
273
  );
274
  ?>
275
  <div class="ee-survey-modal" id="ee-survey-<?php echo $this->plugin; ?>">
276
  <div class="ee-survey-wrap">
277
  <form class="ee-survey" method="post">
278
- <span class="ee-survey-title"><span class="dashicons dashicons-admin-customizer"></span><?php echo ' ' . esc_html__( 'Quick Feedback', 'google-analytics-for-wordpress' ); ?></span>
279
  <span class="ee-survey-desc">
280
  <?php
281
  // Translators: Placeholder for the plugin name.
282
- echo sprintf( esc_html__('If you have a moment, please share why you are deactivating %s:', 'google-analytics-for-wordpress' ), $this->name );
283
  ?>
284
  </span>
285
  <div class="ee-survey-options">
286
  <?php foreach ( $options as $id => $option ) :
287
- //$slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $option['title']);
288
  $slug = sanitize_title($option['title']); ?>
289
  <div class="ee-survey-option">
290
- <label for="ee-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>" class="ee-survey-option-label">
291
- <input id="ee-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>" class="ee-survey-option-input" type="radio" name="code" value="<?php echo $slug; ?>" />
292
- <span class="ee-survey-option-reason"><?php echo $option['title']; ?></span>
293
  </label>
294
  <?php if ( ! empty( $option['details'] ) ) : ?>
295
- <input class="ee-survey-option-details" type="text" placeholder="<?php echo $option['details']; ?>" />
296
  <?php endif; ?>
297
  </div>
298
  <?php endforeach; ?>
299
  </div>
300
  <div class="ee-survey-footer">
301
  <button type="submit" class="ee-survey-submit button button-primary button-large">
302
- <?php
303
- // Translators: Adds an ampersand.
304
- echo sprintf( esc_html__('Submit %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
305
- ?>
306
  </button>
307
  <a href="#" class="ee-survey-deactivate">
308
- <?php
309
- // Translators: Adds an ampersand.
310
- echo sprintf( esc_html__('Skip %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
311
- ?>
312
  </a>
313
  </div>
314
  </form>
25
  $url = network_site_url( '/' );
26
  $is_local_url = false;
27
  // Trim it up
28
+ $url = esc_url(strtolower( trim( $url ) ) );
29
  if ( false === strpos( $url, 'http://' ) && false === strpos( $url, 'https://' ) ) {
30
  $url = 'http://' . $url;
31
  }
60
  }
61
  }
62
  }
63
+ return esc_url_raw($is_local_url);
64
  }
65
  public function is_plugin_page() {
66
  $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
77
  ?>
78
  <script type="text/javascript">
79
  jQuery(function($){
80
+ var $deactivateLink = $('#the-list').find('[data-slug="<?php echo esc_attr($this->plugin); ?>"] span.deactivate a'),
81
  $overlay = $('#ee-survey-<?php echo esc_attr($this->plugin); ?>'),
82
  $form = $overlay.find('form'),
83
  formOpen = false;
104
  subscription_id:'<?php echo esc_attr($this->subscriptionId); ?>',
105
  radio_option_val: "skip",
106
  other_reason: "",
107
+ site_url: '<?php echo esc_url_raw( home_url() ); ?>',
108
  plugin_name: 'ee-woocommerce'
109
  }
110
  add_survey(data);
113
  $form.submit(function(event) {
114
  event.preventDefault();
115
  if (! $form.find('input[type=radio]:checked').val()) {
116
+ $form.find('.ee-survey-footer').prepend('<span class="error"><?php echo esc_js( esc_html__( 'Please select an option', 'conversios' ) ); ?></span>');
117
  return;
118
  }
119
  var data = {
122
  subscription_id:'<?php echo esc_attr($this->subscriptionId); ?>',
123
  radio_option_val: $form.find('.selected input[type=radio]').val(),
124
  other_reason: $form.find('.selected input[type=text]').val(),
125
+ site_url: '<?php echo esc_url_raw( home_url() ); ?>',
126
  plugin_name: 'ee-woocommerce'
127
  }
128
  add_survey(data);
241
  }
242
  .ee-survey-wrap .dashicons{
243
  font-size: 24px;
244
+ color: #3C434A;
245
  }
246
  </style>
247
  <?php
254
 
255
  $options = array(
256
  1 => array(
257
+ "title" => esc_html__("No longer need the plugin","enhanced-e-commerce-for-woocommerce-store", "conversios"),
258
  ),
259
  2 => array(
260
+ 'title' => esc_html__("Switching to a different plugin","conversios"),
261
+ 'details' => esc_html__( 'Please share which plugin', 'conversios' ),
262
  ),
263
  3 => array(
264
+ 'title' => esc_html__("Couldn't get the plugin to work","conversios"),
265
  ),
266
  4 => array(
267
+ 'title' => esc_html__("It's a temporary deactivation","conversios"),
268
  ),
269
  5 => array(
270
+ 'title' => esc_html__("Other","conversios"),
271
+ 'details' => esc_html__( 'Please share the reason', 'conversios' ),
272
  ),
273
  );
274
  ?>
275
  <div class="ee-survey-modal" id="ee-survey-<?php echo $this->plugin; ?>">
276
  <div class="ee-survey-wrap">
277
  <form class="ee-survey" method="post">
278
+ <span class="ee-survey-title"><span class="dashicons dashicons-admin-customizer"></span><?php echo ' ' . esc_html__( 'Quick Feedback', 'conversios' ); ?></span>
279
  <span class="ee-survey-desc">
280
  <?php
281
  // Translators: Placeholder for the plugin name.
282
+ echo sprintf( esc_html__('If you have a moment, please share why you are deactivating %s:', 'conversios' ), esc_attr($this->name) );
283
  ?>
284
  </span>
285
  <div class="ee-survey-options">
286
  <?php foreach ( $options as $id => $option ) :
 
287
  $slug = sanitize_title($option['title']); ?>
288
  <div class="ee-survey-option">
289
+ <label for="ee-survey-option-<?php echo esc_attr($this->plugin); ?>-<?php echo esc_attr($id); ?>" class="ee-survey-option-label">
290
+ <input id="ee-survey-option-<?php echo esc_attr($this->plugin); ?>-<?php echo esc_attr($id); ?>" class="ee-survey-option-input" type="radio" name="code" value="<?php echo esc_attr($slug); ?>" />
291
+ <span class="ee-survey-option-reason"><?php echo esc_attr($option['title']); ?></span>
292
  </label>
293
  <?php if ( ! empty( $option['details'] ) ) : ?>
294
+ <input class="ee-survey-option-details" type="text" placeholder="<?php echo esc_attr($option['details']); ?>" />
295
  <?php endif; ?>
296
  </div>
297
  <?php endforeach; ?>
298
  </div>
299
  <div class="ee-survey-footer">
300
  <button type="submit" class="ee-survey-submit button button-primary button-large">
301
+ <?php echo sprintf( esc_html__('Submit %s Deactivate', 'conversios' ), '&amp;' ); ?>
 
 
 
302
  </button>
303
  <a href="#" class="ee-survey-deactivate">
304
+ <?php echo sprintf( esc_html__('Skip %s Deactivate', 'conversios' ), '&amp;' ); ?>
 
 
 
305
  </a>
306
  </div>
307
  </form>
admin/class-tvc-admin-auto-product-sync-helper.php CHANGED
@@ -47,9 +47,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
47
 
48
  }else{
49
  $sql_create = "CREATE TABLE ".esc_sql($tablename)." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , `w_product_id` BIGINT(20) NOT NULL , `w_cat_id` INT(10) NOT NULL , `g_cat_id` INT(10) NOT NULL , `g_attribute_mapping` LONGTEXT NOT NULL , `update_date` DATE NOT NULL , `status` INT(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) );";
50
- if(maybe_create_table( $tablename, $sql_create )){
51
- //$this->import_last_sync_in_db();
52
- }
53
  }
54
  /* cteate table for save auto sync product call */
55
  $tablename = $wpdb->prefix ."ee_product_sync_call";
@@ -108,48 +106,6 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
108
  $output = array_values($output);
109
  return $output;
110
  }
111
- /*public function import_last_sync_in_db(){
112
- $ee_prod_mapped_cats = unserialize(get_option('ee_prod_mapped_cats'));
113
- $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
114
- if($ee_prod_mapped_cats != "" && $ee_prod_mapped_attrs != ""){
115
- global $wpdb;
116
- //$table, $field_name = "*"
117
- $row_count = $this->TVC_Admin_DB_Helper->tvc_row_count('ee_product_sync_data');
118
- if($row_count == 0){
119
- if(!empty($ee_prod_mapped_cats)){
120
- foreach($ee_prod_mapped_cats as $mc_key => $mappedCat){
121
- $args= array(
122
- 'post_type' => 'product',
123
- 'numberposts' => -1,
124
- 'post_status' => 'publish',
125
- 'tax_query' => array( array(
126
- 'taxonomy' => 'product_cat',
127
- 'field' => 'term_id',
128
- 'terms' =>$mc_key,
129
- 'operator' => 'IN'
130
- )
131
- )
132
- );
133
- $all_products = get_posts($args);
134
- if(!empty($all_products)){
135
- foreach($all_products as $postkey => $postvalue){
136
- $t_data = array(
137
- 'w_product_id'=>$postvalue->ID,
138
- 'w_cat_id'=>$mc_key,
139
- 'g_cat_id'=>$mappedCat['id'],
140
- 'g_attribute_mapping'=> json_encode($ee_prod_mapped_attrs),
141
- 'update_date'=>date('Y-m-d')
142
- );
143
-
144
- $this->TVC_Admin_DB_Helper->tvc_add_row('ee_product_sync_data', $t_data);
145
- }
146
- wp_reset_postdata();
147
- }
148
- }
149
- }
150
- }
151
- }
152
- }*/
153
  /*
154
  * update last product sync data in DB table "ee_product_sync_data"
155
  */
@@ -161,8 +117,8 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
161
  $ee_product_sync_data =$wpdb->prefix ."ee_product_sync_data";
162
  foreach($ee_prod_mapped_cats as $mc_key => $mappedCat){
163
  //delete old product data of the category
164
- $query = "DELETE FROM $ee_product_sync_data where w_cat_id = %s";
165
- $wpdb->query($wpdb->prepare( "$query", $mc_key ));
166
  $args= array(
167
  'post_type' => 'product',
168
  'numberposts' => -1,
@@ -177,7 +133,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
177
  )
178
  );
179
  $all_products = get_posts($args);
180
- $where ="w_cat_id = ".$mc_key;
181
  $p_c_ids = $this->TVC_Admin_DB_Helper->tvc_get_results_in_array('ee_product_sync_data', $where, array('w_product_id','w_cat_id'), true);
182
  if(!empty($all_products)){
183
  foreach($all_products as $postkey => $postvalue){
@@ -186,7 +142,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
186
  'w_cat_id'=>esc_sql($mc_key),
187
  'g_cat_id'=>esc_sql($mappedCat['id']),
188
  'g_attribute_mapping'=> json_encode($ee_prod_mapped_attrs),
189
- 'update_date'=>date('Y-m-d')
190
  );
191
  //$table, $where, $field_name = "*"
192
  $p_c_id = $postvalue->ID."_".$mc_key;
@@ -244,26 +200,31 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
244
  $product = array_merge($temp_product,$product);
245
  // for variable
246
  if( !empty($prd) && $prd->get_type() == "variable" ){
247
- //$variation_attributes = $prd->get_variation_attributes();
248
- $p_variations = $prd->get_available_variations();
249
  if(!empty($p_variations)){
250
- foreach ($p_variations as $v_key => $v_value) {
251
- $postmeta_var = (object)$this->TVC_Admin_Helper->tvc_get_post_meta($v_value['variation_id']);
 
 
 
 
 
 
252
  $formArray_val = $formArray['title'];
253
  $product['title'] = (isset($postObj->$formArray_val))?$postObj->$formArray_val:get_the_title($postvalue->w_product_id);
254
  $tvc_temp_desc_key = $formArray['description'];
255
- $product['description'] = (isset($v_value['variation_description']) && $v_value['variation_description'] != "")?$v_value['variation_description']:$postObj->$tvc_temp_desc_key;
256
- $product['offer_id'] = esc_attr($v_value['variation_id']);
257
- $product['id'] = esc_attr($v_value['variation_id']);
258
  $product['item_group_id'] = esc_attr($postvalue->w_product_id);
259
  $productTypes = $this->get_product_category($postvalue->w_product_id);
260
  if(!empty($productTypes)){
261
  $product['productTypes'] = $productTypes;
262
  }
263
- $image_id = $v_value['image_id'];
264
  $product['image_link'] = wp_get_attachment_image_url($image_id, 'full');
265
- if(isset($v_value['attributes']) && !empty($v_value['attributes']) ){
266
- foreach($v_value['attributes'] as $va_key => $va_value ){
267
  $va_key = str_replace("_", " ", $va_key);
268
  if (strpos($va_key, 'color') !== false) {
269
  $product['color'] = $va_value;
@@ -317,7 +278,8 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
317
  $stock_status = str_replace($tvc_find,$tvc_replace,$stock_status);
318
  $product[$key] = $stock_status;
319
  }
320
- }else if(isset($postmeta_var->$value) && $postmeta_var->$value != ""){$product[$key] = $postmeta_var->$value;
 
321
  }else if(in_array($key, array("brand")) ){ //list of cutom option added
322
  $yith_product_brand = $this->TVC_Admin_Helper->add_additional_option_val_in_map_product_attribute($key, $postvalue->w_product_id);
323
  if($yith_product_brand != ""){
@@ -404,7 +366,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
404
  public function call_auto_sync_product($last_sync_product_id = array()){
405
  $product_count = $this->TVC_Admin_DB_Helper->tvc_row_count('ee_product_sync_data');
406
  //$count = 0;
407
- $pre_last_sync_product_id = $last_sync_product_id;
408
  if( $product_count > 0 ){
409
  $tvc_currency = esc_attr($this->TVC_Admin_Helper->get_woo_currency());
410
  $merchantId = esc_attr($this->TVC_Admin_Helper->get_merchantId());
@@ -414,7 +376,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
414
  $last_sync_product_id =esc_attr(( $last_sync_product_id > 0)?$last_sync_product_id:0);
415
  global $wpdb;
416
  $tablename = $wpdb->prefix .'ee_product_sync_data';
417
- $sql = "select * from ".esc_sql($tablename)." where id > ".esc_sql($last_sync_product_id)." LIMIT ".$this->batch_size;
418
  $products = $wpdb->get_results($sql, OBJECT);
419
  $entries = [];
420
  if(!empty($products)){
@@ -475,14 +437,14 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
475
  }
476
  $t_data = array(
477
  'sync_product_ids'=>json_encode($sync_product_ids),
478
- 'w_total_product'=>esc_attr($product_count),
479
- 'total_sync_product'=>esc_attr($total_sync_product),
480
- 'last_sync'=>$last_sync,
481
  'create_sync'=>date( 'Y-m-d H:i:s', current_time( 'timestamp') ),
482
- 'next_sync'=>$next_sync,
483
- 'last_sync_product_id'=>$last_sync_product_id,
484
- 'action_scheduler_id'=> $action_scheduler_id,
485
- 'status'=>$sync_status
486
  );
487
  $this->TVC_Admin_DB_Helper->tvc_add_row('ee_product_sync_call', $t_data);
488
  as_enqueue_async_action('ee_auto_product_sync_check', array('last_sync_product_id' => $last_sync_product_id));
@@ -555,12 +517,9 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
555
  public function get_tvc_access_token(){
556
  if(!empty($this->access_token)){
557
  return $this->access_token;
558
- }else if(isset($_SESSION['access_token']) && $_SESSION['access_token']){
559
- $this->access_token = $_SESSION['access_token'];
560
- return $this->access_token;
561
  }else{
562
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
563
- $this->access_token = $google_detail['setting']->access_token;
564
  return $this->access_token;
565
  }
566
  }
@@ -568,12 +527,9 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
568
  public function get_tvc_refresh_token(){
569
  if(!empty($this->refresh_token)){
570
  return $this->refresh_token;
571
- }else if(isset($_SESSION['refresh_token']) && $_SESSION['refresh_token']){
572
- $this->refresh_token = $_SESSION['refresh_token'];
573
- return $this->refresh_token;
574
  }else{
575
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
576
- $this->refresh_token = $google_detail['setting']->refresh_token;
577
  return $this->refresh_token;
578
  }
579
  }
47
 
48
  }else{
49
  $sql_create = "CREATE TABLE ".esc_sql($tablename)." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , `w_product_id` BIGINT(20) NOT NULL , `w_cat_id` INT(10) NOT NULL , `g_cat_id` INT(10) NOT NULL , `g_attribute_mapping` LONGTEXT NOT NULL , `update_date` DATE NOT NULL , `status` INT(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) );";
50
+ if(maybe_create_table( $tablename, $sql_create )){ }
 
 
51
  }
52
  /* cteate table for save auto sync product call */
53
  $tablename = $wpdb->prefix ."ee_product_sync_call";
106
  $output = array_values($output);
107
  return $output;
108
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  /*
110
  * update last product sync data in DB table "ee_product_sync_data"
111
  */
117
  $ee_product_sync_data =$wpdb->prefix ."ee_product_sync_data";
118
  foreach($ee_prod_mapped_cats as $mc_key => $mappedCat){
119
  //delete old product data of the category
120
+ $query = "DELETE FROM ".esc_sql($ee_product_sync_data)." where w_cat_id = %s";
121
+ $wpdb->query($wpdb->prepare( "$query", esc_sql($mc_key) ));
122
  $args= array(
123
  'post_type' => 'product',
124
  'numberposts' => -1,
133
  )
134
  );
135
  $all_products = get_posts($args);
136
+ $where ="w_cat_id = ".esc_sql($mc_key);
137
  $p_c_ids = $this->TVC_Admin_DB_Helper->tvc_get_results_in_array('ee_product_sync_data', $where, array('w_product_id','w_cat_id'), true);
138
  if(!empty($all_products)){
139
  foreach($all_products as $postkey => $postvalue){
142
  'w_cat_id'=>esc_sql($mc_key),
143
  'g_cat_id'=>esc_sql($mappedCat['id']),
144
  'g_attribute_mapping'=> json_encode($ee_prod_mapped_attrs),
145
+ 'update_date'=>esc_sql(date('Y-m-d'))
146
  );
147
  //$table, $where, $field_name = "*"
148
  $p_c_id = $postvalue->ID."_".$mc_key;
200
  $product = array_merge($temp_product,$product);
201
  // for variable
202
  if( !empty($prd) && $prd->get_type() == "variable" ){
203
+ $p_variations = $prd->get_children();
 
204
  if(!empty($p_variations)){
205
+ foreach ($p_variations as $v_key => $variation_id) {
206
+ $variation = wc_get_product( $variation_id );
207
+ if(empty($variation)){
208
+ continue;
209
+ }
210
+ $variation_description = wc_format_content($variation->get_description());
211
+ unset($product['customAttributes']);
212
+ $postmeta_var = (object)$this->TVC_Admin_Helper->tvc_get_post_meta($variation_id);
213
  $formArray_val = $formArray['title'];
214
  $product['title'] = (isset($postObj->$formArray_val))?$postObj->$formArray_val:get_the_title($postvalue->w_product_id);
215
  $tvc_temp_desc_key = $formArray['description'];
216
+ $product['description'] = ( $variation_description != "")?$variation_description:$postObj->$tvc_temp_desc_key;
217
+ $product['offer_id'] = esc_attr($variation_id);
218
+ $product['id'] = esc_attr($variation_id);
219
  $product['item_group_id'] = esc_attr($postvalue->w_product_id);
220
  $productTypes = $this->get_product_category($postvalue->w_product_id);
221
  if(!empty($productTypes)){
222
  $product['productTypes'] = $productTypes;
223
  }
224
+ $image_id = $variation->get_image_id();
225
  $product['image_link'] = wp_get_attachment_image_url($image_id, 'full');
226
+ if(isset($variation_attributes) && !empty($variation_attributes) ){
227
+ foreach($variation_attributes as $va_key => $va_value ){
228
  $va_key = str_replace("_", " ", $va_key);
229
  if (strpos($va_key, 'color') !== false) {
230
  $product['color'] = $va_value;
278
  $stock_status = str_replace($tvc_find,$tvc_replace,$stock_status);
279
  $product[$key] = $stock_status;
280
  }
281
+ }else if(isset($postmeta_var->$value) && $postmeta_var->$value != ""){
282
+ $product[$key] = $postmeta_var->$value;
283
  }else if(in_array($key, array("brand")) ){ //list of cutom option added
284
  $yith_product_brand = $this->TVC_Admin_Helper->add_additional_option_val_in_map_product_attribute($key, $postvalue->w_product_id);
285
  if($yith_product_brand != ""){
366
  public function call_auto_sync_product($last_sync_product_id = array()){
367
  $product_count = $this->TVC_Admin_DB_Helper->tvc_row_count('ee_product_sync_data');
368
  //$count = 0;
369
+ $pre_last_sync_product_id = sanitize_text_field($last_sync_product_id);
370
  if( $product_count > 0 ){
371
  $tvc_currency = esc_attr($this->TVC_Admin_Helper->get_woo_currency());
372
  $merchantId = esc_attr($this->TVC_Admin_Helper->get_merchantId());
376
  $last_sync_product_id =esc_attr(( $last_sync_product_id > 0)?$last_sync_product_id:0);
377
  global $wpdb;
378
  $tablename = $wpdb->prefix .'ee_product_sync_data';
379
+ $sql = "select * from ".esc_sql($tablename)." where id > ".esc_sql($last_sync_product_id)." LIMIT ".esc_sql($this->batch_size);
380
  $products = $wpdb->get_results($sql, OBJECT);
381
  $entries = [];
382
  if(!empty($products)){
437
  }
438
  $t_data = array(
439
  'sync_product_ids'=>json_encode($sync_product_ids),
440
+ 'w_total_product'=>esc_sql($product_count),
441
+ 'total_sync_product'=>esc_sql($total_sync_product),
442
+ 'last_sync'=>esc_sql($last_sync),
443
  'create_sync'=>date( 'Y-m-d H:i:s', current_time( 'timestamp') ),
444
+ 'next_sync'=>esc_sql($next_sync),
445
+ 'last_sync_product_id'=> esc_sql($last_sync_product_id),
446
+ 'action_scheduler_id'=> esc_sql($action_scheduler_id),
447
+ 'status'=>esc_sql($sync_status)
448
  );
449
  $this->TVC_Admin_DB_Helper->tvc_add_row('ee_product_sync_call', $t_data);
450
  as_enqueue_async_action('ee_auto_product_sync_check', array('last_sync_product_id' => $last_sync_product_id));
517
  public function get_tvc_access_token(){
518
  if(!empty($this->access_token)){
519
  return $this->access_token;
 
 
 
520
  }else{
521
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
522
+ $this->access_token = base64_decode(sanitize_text_field($google_detail['setting']->access_token));
523
  return $this->access_token;
524
  }
525
  }
527
  public function get_tvc_refresh_token(){
528
  if(!empty($this->refresh_token)){
529
  return $this->refresh_token;
 
 
 
530
  }else{
531
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
532
+ $this->refresh_token = base64_decode(sanitize_text_field($google_detail['setting']->refresh_token));
533
  return $this->refresh_token;
534
  }
535
  }
admin/class-tvc-admin-helper.php CHANGED
@@ -37,8 +37,8 @@ Class TVC_Admin_Helper{
37
  * verstion auto updated
38
  */
39
  public function need_auto_update_db(){
40
- $old_ee_auto_update_id = "tvc_3.0.4";
41
- $new_ee_auto_update_id = "tvc_4.0.0";
42
  $ee_auto_update_id = get_option('ee_auto_update_id');
43
  if($ee_auto_update_id!=""){
44
  if( $ee_auto_update_id != $new_ee_auto_update_id){
@@ -50,10 +50,13 @@ Class TVC_Admin_Helper{
50
  $tablename = $wpdb->prefix ."ee_product_sync_call";
51
  $this->TVC_Admin_DB_Helper->tvc_safe_truncate_table($tablename);
52
  new TVC_Admin_Auto_Product_sync_Helper();
53
- update_option("ee_auto_update_id", $new_ee_auto_update_id);
 
 
 
54
  }
55
  }else{
56
- update_option("ee_auto_update_id", $old_ee_auto_update_id);
57
  }
58
  }
59
  /*
@@ -63,7 +66,7 @@ Class TVC_Admin_Helper{
63
  if($this->get_subscriptionId() != ""){
64
  $google_detail = $this->get_ee_options_data();
65
  if(isset($google_detail['sync_time']) && $google_detail['sync_time']){
66
- $current = current_time( 'timestamp' );
67
  //echo date( 'M-d-Y H:i', current_time( 'timestamp' ))."==>".date( 'M-d-Y H:i', $google_detail['sync_time']);
68
  $diffrent_hours = floor(( $current - $google_detail['sync_time'])/(60*60));
69
  if($diffrent_hours > 11){
@@ -94,6 +97,8 @@ Class TVC_Admin_Helper{
94
  $google_detail = $this->customApiObj->getGoogleAnalyticDetail();
95
  if(property_exists($google_detail,"error") && $google_detail->error == false){
96
  if(property_exists($google_detail,"data") && $google_detail->data != ""){
 
 
97
  $googleDetail = $google_detail->data;
98
  }
99
  }
@@ -112,10 +117,12 @@ Class TVC_Admin_Helper{
112
  $google_detail = $this->customApiObj->getGoogleAnalyticDetail();
113
  if(property_exists($google_detail,"error") && $google_detail->error == false){
114
  if(property_exists($google_detail,"data") && $google_detail->data != "") {
 
 
115
  $googleDetail = $google_detail->data;
116
  }
117
  }else{
118
- return array("error"=>true, "message"=>__("Please try after some time.","conversios"));
119
  }
120
  }
121
  $syncProductStat = [];
@@ -157,7 +164,7 @@ Class TVC_Admin_Helper{
157
  }
158
 
159
  $this->set_ee_options_data(array("setting" => $googleDetail, "prod_sync_status" => (object) $syncProductStat, "campaigns_list"=>$campaigns_list, "sync_time"=>current_time( 'timestamp' )));
160
- return array("error"=>false, "message"=>__("Details updated successfully.","conversios"));
161
  }
162
  /*
163
  * update remarketing snippets
@@ -173,7 +180,7 @@ Class TVC_Admin_Helper{
173
  $remarketing_snippets["id"]=$rs->data->id;
174
  }
175
  }
176
- update_option("ee_remarketing_snippets", serialize($remarketing_snippets));
177
  }
178
  }
179
  /*
@@ -199,7 +206,7 @@ Class TVC_Admin_Helper{
199
  foreach ($con_array as $key => $con_value) {
200
  $con_val_array = explode(":", $con_value);
201
  if(in_array("send_to", $con_val_array)){
202
- update_option("ee_conversio_send_to", $con_val_array[1]);
203
  break 2;
204
  }
205
  }
@@ -252,14 +259,14 @@ Class TVC_Admin_Helper{
252
  $googleStatus = "pending";
253
  }
254
  $t_data = array(
255
- 'gmc_id' => $merchant_id,
256
- 'name'=>$value->name,
257
- 'product_id'=>$value->productId,
258
- 'google_status'=>$googleStatus,
259
- 'image_link'=> $value->imageLink,
260
  'issues'=>json_encode($value->issues)
261
  );
262
- $where ="product_id = '".$value->productId."'";
263
  $row_count = $this->TVC_Admin_DB_Helper->tvc_check_row('ee_products_sync_list', $where);
264
  if($row_count == 0){
265
  $this->TVC_Admin_DB_Helper->tvc_add_row('ee_products_sync_list', $t_data);
@@ -288,13 +295,13 @@ Class TVC_Admin_Helper{
288
  * set API data in DB
289
  */
290
  public function set_ee_options_data($ee_options_data){
291
- update_option("ee_api_data", serialize($ee_options_data));
292
  }
293
  /*
294
  * set additional data in DB
295
  */
296
  public function set_ee_additional_data($ee_additional_data){
297
- update_option("ee_additional_data", serialize($ee_additional_data));
298
  }
299
  /*
300
  * get additional data from DB
@@ -324,13 +331,9 @@ Class TVC_Admin_Helper{
324
  public function get_subscriptionId(){
325
  if(!empty($this->subscriptionId)){
326
  return $this->subscriptionId;
327
- }else{
328
- $ee_options_settings = "";
329
- if(!isset($GLOBALS['tatvicData']['tvc_subscription'])){
330
- $ee_options_settings = $this->get_ee_options_settings();
331
- }
332
- $this->subscriptionId = (isset($GLOBALS['tatvicData']['tvc_subscription'])) ? $GLOBALS['tatvicData']['tvc_subscription'] : ((isset($ee_options_settings['subscription_id']))?$ee_options_settings['subscription_id']:"");
333
- return $this->subscriptionId;
334
  }
335
  }
336
  /*
@@ -342,11 +345,7 @@ Class TVC_Admin_Helper{
342
  }else{
343
  $tvc_merchant = "";
344
  $google_detail = $this->get_ee_options_data();
345
- if(!isset($GLOBALS['tatvicData']['tvc_merchant']) && isset($google_detail['setting']->google_merchant_center_id)){
346
- $tvc_merchant = $google_detail['setting']->google_merchant_center_id;
347
- }
348
- $this->merchantId = (isset($GLOBALS['tatvicData']['tvc_merchant'])) ? $GLOBALS['tatvicData']['tvc_merchant'] : $tvc_merchant;
349
- return $this->merchantId;
350
  }
351
  }
352
  /*
@@ -357,12 +356,8 @@ Class TVC_Admin_Helper{
357
  return $this->main_merchantId;
358
  }else{
359
  $main_merchantId = "";
360
- $google_detail = $this->get_ee_options_data();
361
- if(!isset($GLOBALS['tatvicData']['tvc_main_merchant_id']) && isset($google_detail['setting']->merchant_id)){
362
- $main_merchantId = $google_detail['setting']->merchant_id;
363
- }
364
- $this->main_merchantId = (isset($GLOBALS['tatvicData']['tvc_main_merchant_id'])) ? $GLOBALS['tatvicData']['tvc_main_merchant_id'] : $main_merchantId;
365
- return $this->main_merchantId;
366
  }
367
  }
368
  /*
@@ -469,12 +464,8 @@ Class TVC_Admin_Helper{
469
  if(!empty($this->currentCustomerId)){
470
  return $this->currentCustomerId;
471
  }else{
472
- $ee_options_settings = "";
473
- if(!isset($GLOBALS['tatvicData']['tvc_customer'])){
474
- $ee_options_settings = $this->get_ee_options_settings();
475
- }
476
- $this->currentCustomerId = (isset($GLOBALS['tatvicData']['tvc_customer'])) ? $GLOBALS['tatvicData']['tvc_customer'] : ((isset($ee_options_settings['google_ads_id']))?$ee_options_settings['google_ads_id']:"");
477
- return $this->currentCustomerId;
478
  }
479
  }
480
  public function get_user_currency_symbol(){
@@ -496,7 +487,7 @@ Class TVC_Admin_Helper{
496
  public function add_spinner_html(){
497
  $spinner_gif = ENHANCAD_PLUGIN_URL . '/admin/images/ajax-loader.gif';
498
  echo '<div class="feed-spinner" id="feed-spinner" style="display:none;">
499
- <img id="img-spinner" src="' . $spinner_gif . '" alt="Loading" />
500
  </div>';
501
  }
502
 
@@ -697,16 +688,16 @@ Class TVC_Admin_Helper{
697
  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")){
698
  if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != "" && $googleDetail->is_site_verified == 1 && $googleDetail->is_domain_claim == 1 ){
699
  $setting_status['google_shopping_conf']= true;
700
- $setting_status['google_shopping_conf_msg']= __("Google Shopping Configuration Success.","conversios");
701
  }else if($googleDetail->google_merchant_center_id == "" || $googleDetail->google_ads_id == "" ){
702
  $setting_status['google_shopping_conf']= false;
703
  $setting_status['google_shopping_conf_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a href='".esc_url($this->get_onboarding_page_url())."'>click here</a>.";
704
  }else if($googleDetail->is_site_verified ==0 && $googleDetail->is_domain_claim ==0 ){
705
  $setting_status['google_shopping_conf']= false;
706
- $setting_status['google_shopping_conf_msg']= __("Site verification and domain claim for your merchant center account failed.","conversios");
707
  }else if($googleDetail->is_site_verified ==0 ){
708
  $setting_status['google_shopping_conf']= false;
709
- $setting_status['google_shopping_conf_msg']= __("Site verification and domain claim for your merchant center account failed.","conversios");
710
  }
711
  }else{
712
  $setting_status['google_shopping_conf']= false;
@@ -725,13 +716,13 @@ Class TVC_Admin_Helper{
725
 
726
  if($sync_product_total > 1 && $sync_product_approved > 1 && $sync_product_disapproved < 1){
727
  $setting_status['google_shopping_p_sync']= true;
728
- $setting_status['google_shopping_p_sync_msg']= __("Google Shopping product sync is a success.","conversios");
729
  }else if($sync_product_total < 1){
730
  $setting_status['google_shopping_p_sync']= false;
731
- $setting_status['google_shopping_p_sync_msg']= __("Sync your product data into Merchant center and get eligible for free listing across Google.","conversios");
732
  }else if($sync_product_disapproved > 0){
733
  $setting_status['google_shopping_p_sync']= false;
734
- $setting_status['google_shopping_p_sync_msg']= __("There seems to be some problem with your product data. Rectify the issues by selecting right attributes.","conversios");
735
  }
736
  }
737
  }else{
@@ -746,13 +737,13 @@ Class TVC_Admin_Helper{
746
  $totalCampaigns = count($campaigns_list);
747
  if($totalCampaigns < 1){
748
  $setting_status['google_shopping_p_campaigns']= false;
749
- $setting_status['google_shopping_p_campaigns_msg']= __("Reach out to customers based on their past site behavior by running start shopping campaign.","conversios");
750
  }else{
751
  $setting_status['google_shopping_p_campaigns']= true;
752
  }
753
  }else{
754
  $setting_status['google_shopping_p_campaigns']= false;
755
- $setting_status['google_shopping_p_campaigns_msg']= __("Reach out to customers based on their past site behavior by running start shopping campaign.","conversios");
756
  }
757
  }else{
758
  $setting_status['google_shopping_p_campaigns']= false;
@@ -763,9 +754,9 @@ Class TVC_Admin_Helper{
763
  }
764
 
765
  public function is_current_tab_in($tabs){
766
- if(isset($_GET['tab']) && is_array($tabs) && in_array($_GET['tab'], $tabs)){
767
  return true;
768
- }else if(isset($_GET['tab']) && $_GET['tab'] ==$tabs){
769
  return true;
770
  }
771
  return false;
@@ -808,16 +799,16 @@ Class TVC_Admin_Helper{
808
  $notice_text ="";
809
  $call_js_function_args="";
810
  if (isset($googleDetail->is_site_verified) && isset($googleDetail->is_domain_claim) && $googleDetail->is_site_verified == '0' && $googleDetail->is_domain_claim == '0') {
811
- $title = __("Site verification and Domain claim for merchant center account failed.","conversios");
812
- $message = __("Without a verified and claimed website, your product will get disapproved.","conversios");
813
  $call_js_function_args = "both";
814
  }else if(isset($googleDetail->is_site_verified) && $googleDetail->is_site_verified == '0'){
815
- $title = __("Site verification for merchant center account failed.","conversios");
816
- $message = __("Without a verified and claimed website, your product will get disapproved.","conversios");
817
  $call_js_function_args = "site_verified";
818
  }else if(isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
819
- $title = __("Site verification for merchant center account failed.","conversios");
820
- $message = __("Without a verified and claimed website, your product will get disapproved.","conversios");
821
  $call_js_function_args = "domain_claim";
822
  }
823
  if($message!= "" && $title != ""){
@@ -829,7 +820,7 @@ Class TVC_Admin_Helper{
829
  </div>
830
  <div class="erralertrigt">
831
  <h6><?php echo $title; ?></h6>
832
- <p><?php echo $message; ?> <a href="javascript:void(0)" id="call_both_verification" onclick="call_tvc_site_verified_and_domain_claim('<?php echo $call_js_function_args; ?>');">Click here</a> <?php _e("to verify and claim the domain.","conversios"); ?></p>
833
  </div>
834
  </div>
835
  </div>
@@ -896,7 +887,7 @@ Class TVC_Admin_Helper{
896
  if(isset($google_detail['setting']) && $google_detail['setting']){
897
  $googleDetail = $google_detail['setting'];
898
  if($googleDetail->is_site_verified == '0'){
899
- return array('error'=>true, 'msg'=>__("First need to verified your site. Click on site verification refresh icon to verified your site.","conversios"));
900
  }else if(property_exists($googleDetail,"is_domain_claim") && $googleDetail->is_domain_claim == '0'){
901
  //'website_url' => $googleDetail->site_url,
902
  $postData = [
@@ -910,10 +901,10 @@ Class TVC_Admin_Helper{
910
  return array('error'=>true, 'msg'=>$claimWebsite->errors[0]);
911
  }else{
912
  $this->update_subscription_details_api_to_db();
913
- return array('error'=>false, 'msg'=>__("Domain claimed successfully.", "conversios"));
914
  }
915
  }else{
916
- return array('error'=>false, 'msg'=>__("Already domain claimed successfully.", "conversios"));
917
  }
918
  }
919
  }
@@ -965,7 +956,7 @@ Class TVC_Admin_Helper{
965
  return array('error'=>true, 'msg'=>$siteVerification_tag->errors[0]);
966
  }else{
967
  $this->update_subscription_details_api_to_db();
968
- return array('error'=>false, 'msg'=>__("Site verification successfully.","conversios"));
969
  }
970
  }else{
971
  return array('error'=>true, 'msg'=>$siteVerificationToken_tag->errors[0]);
@@ -973,11 +964,11 @@ Class TVC_Admin_Helper{
973
  // one more try
974
  }else{
975
  $this->update_subscription_details_api_to_db();
976
- return array('error'=>false, 'msg'=>__("Site verification successfully.","conversios"));
977
  }
978
  }
979
  }else{
980
- return array('error'=>false, 'msg'=>__("Already site verification successfully.","conversios"));
981
  }
982
  }
983
  }
@@ -1034,7 +1025,7 @@ Class TVC_Admin_Helper{
1034
  }
1035
  /* message notification */
1036
  public function set_ee_msg_nofification_list($ee_msg_list){
1037
- update_option("ee_msg_nofifications", serialize($ee_msg_list));
1038
  }
1039
  public function get_ee_msg_nofification_list(){
1040
  return unserialize(get_option('ee_msg_nofifications'));
@@ -1067,14 +1058,14 @@ Class TVC_Admin_Helper{
1067
  * add fixed notification
1068
  */
1069
  $nofifications["tvc_f_notif_1"] = array(
1070
- "tittle"=>__("Congratulations..!! You are one step closer.","conversios"),
1071
- "html"=>__("Thanks for installing the new avatar of Enhanced Ecommerce for WooCommerce plugin. Explore the full potential of Google Analytics, Google Ads and Google shopping by setting up all your Google accounts and take data driven decisions to scale your eCommerce business faster.", "conversios")
1072
  );
1073
  $nofifications["tvc_f_notif_2"] = array(
1074
- "tittle"=>__("Share your feedback.","conversios"),
1075
- "html"=>__("Your feedback is very important to us. Please write about your experience and the new feature requests here.","conversios"),
1076
  "link"=>"https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/",
1077
- "link_title"=>__("Share Feedback", "conversios"),
1078
  "link_type"=>"external"
1079
  );
1080
  /*
@@ -1107,7 +1098,7 @@ Class TVC_Admin_Helper{
1107
  if($diffrent_day == 6 ){
1108
  $nofifications["tvc_expired_plan_not_".date("YYYY_m_d",$current)] = array(
1109
  "tittle"=>"Plan Expired..!!",
1110
- "html"=>__("Your plan is expired now. Contact “analytics2@tatvic.com” or call us at “(415) 968-6313” to renew your plan.", "conversios")
1111
  );
1112
  }
1113
  }
37
  * verstion auto updated
38
  */
39
  public function need_auto_update_db(){
40
+ $old_ee_auto_update_id = esc_attr(sanitize_text_field("tvc_4.0.0"));
41
+ $new_ee_auto_update_id = esc_attr(sanitize_text_field("tvc_4.5.1"));
42
  $ee_auto_update_id = get_option('ee_auto_update_id');
43
  if($ee_auto_update_id!=""){
44
  if( $ee_auto_update_id != $new_ee_auto_update_id){
50
  $tablename = $wpdb->prefix ."ee_product_sync_call";
51
  $this->TVC_Admin_DB_Helper->tvc_safe_truncate_table($tablename);
52
  new TVC_Admin_Auto_Product_sync_Helper();
53
+ update_option("ee_auto_update_id", sanitize_option("ee_auto_update_id", $new_ee_auto_update_id) );
54
+
55
+ //tvc_4.5.1
56
+ $this->update_subscription_details_api_to_db();
57
  }
58
  }else{
59
+ update_option("ee_auto_update_id", sanitize_option("ee_auto_update_id", $old_ee_auto_update_id) );
60
  }
61
  }
62
  /*
66
  if($this->get_subscriptionId() != ""){
67
  $google_detail = $this->get_ee_options_data();
68
  if(isset($google_detail['sync_time']) && $google_detail['sync_time']){
69
+ $current = sanitize_text_field(current_time( 'timestamp' ));
70
  //echo date( 'M-d-Y H:i', current_time( 'timestamp' ))."==>".date( 'M-d-Y H:i', $google_detail['sync_time']);
71
  $diffrent_hours = floor(( $current - $google_detail['sync_time'])/(60*60));
72
  if($diffrent_hours > 11){
97
  $google_detail = $this->customApiObj->getGoogleAnalyticDetail();
98
  if(property_exists($google_detail,"error") && $google_detail->error == false){
99
  if(property_exists($google_detail,"data") && $google_detail->data != ""){
100
+ $google_detail->data->access_token = base64_encode($google_detail->data->access_token);
101
+ $google_detail->data->refresh_token = base64_encode($google_detail->data->refresh_token);
102
  $googleDetail = $google_detail->data;
103
  }
104
  }
117
  $google_detail = $this->customApiObj->getGoogleAnalyticDetail();
118
  if(property_exists($google_detail,"error") && $google_detail->error == false){
119
  if(property_exists($google_detail,"data") && $google_detail->data != "") {
120
+ $google_detail->data->access_token = base64_encode($google_detail->data->access_token);
121
+ $google_detail->data->refresh_token = base64_encode($google_detail->data->refresh_token);
122
  $googleDetail = $google_detail->data;
123
  }
124
  }else{
125
+ return array("error"=>true, "message"=>esc_html__("Please try after some time.","conversios"));
126
  }
127
  }
128
  $syncProductStat = [];
164