Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 4.7.4

Version Description

  • 01/06/2022 =
  • Code optimization in terms of backand load time, onboarding spin wheel load time.
Download this release

Release Info

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

Code changes from version 4.7.3 to 4.7.4

admin/class-tvc-admin-helper.php CHANGED
@@ -109,6 +109,9 @@ Class TVC_Admin_Helper{
109
  if( version_compare($ee_p_version , PLUGIN_TVC_VERSION, ">=")){
110
  return;
111
  }
 
 
 
112
  $ee_additional_data['ee_p_version'] = PLUGIN_TVC_VERSION;
113
  $this->set_ee_additional_data($ee_additional_data);
114
  $this->update_app_status();
109
  if( version_compare($ee_p_version , PLUGIN_TVC_VERSION, ">=")){
110
  return;
111
  }
112
+ if(!isset($ee_additional_data['ee_p_version']) || empty($ee_additional_data)){
113
+ $ee_additional_data = array();
114
+ }
115
  $ee_additional_data['ee_p_version'] = PLUGIN_TVC_VERSION;
116
  $this->set_ee_additional_data($ee_additional_data);
117
  $this->update_app_status();
admin/js/onboarding-custom.js CHANGED
@@ -590,8 +590,8 @@ function link_google_Ads_to_merchant_center(link_data, tvc_data, subscription_id
590
  if(response.error === false){
591
  add_message("success",response.data.message);
592
  }else if(response.error == true && response.errors != undefined){
593
- const errors = JSON.parse(response.errors[0]);
594
- add_message("error",errors.message);
595
  }else{
596
  add_message("error","There was an error while link account");
597
  }
590
  if(response.error === false){
591
  add_message("success",response.data.message);
592
  }else if(response.error == true && response.errors != undefined){
593
+ //const errors = JSON.parse(response.errors[0]);
594
+ //add_message("error",errors.message);
595
  }else{
596
  add_message("error","There was an error while link account");
597
  }
enhanced-ecommerce-google-analytics.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Conversios.io - Google Analytics and Google Shopping plugin for WooCommerce
16
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
17
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
18
- * Version: 4.7.3
19
  * Author: Tatvic
20
  * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
@@ -37,7 +37,7 @@ if ( ! defined( 'WPINC' ) ) {
37
  * Start at version 1.0.0 and use SemVer - https://semver.org
38
  * Rename this for your plugin and update it as you release new versions.
39
  */
40
- define( 'PLUGIN_TVC_VERSION', '4.7.3' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
15
  * Plugin Name: Conversios.io - Google Analytics and Google Shopping plugin for WooCommerce
16
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
17
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
18
+ * Version: 4.7.4
19
  * Author: Tatvic
20
  * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
37
  * Start at version 1.0.0 and use SemVer - https://semver.org
38
  * Rename this for your plugin and update it as you release new versions.
39
  */
40
+ define( 'PLUGIN_TVC_VERSION', '4.7.4' );
41
  $fullName = plugin_basename( __FILE__ );
42
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
43
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
includes/setup/CustomApi.php CHANGED
@@ -68,38 +68,42 @@ class CustomApi{
68
  }
69
 
70
  public function update_app_status($status=1){
71
- try {
72
- $url = $this->apiDomain . '/customer-subscriptions/update-app-status';
73
- $header = array(
74
- "Authorization: Bearer ".$this->token,
75
- "Content-Type" => "application/json"
76
- );
77
-
78
- $options = unserialize(get_option('ee_options'));
79
- $fb_pixel_enable = "0";
80
- if(isset($options['fb_pixel_id']) && $options['fb_pixel_id'] != ""){
81
- $fb_pixel_enable = "1";
82
- }
83
  $TVC_Admin_Helper = new TVC_Admin_Helper();
84
- $postData = array(
85
- "subscription_id" => sanitize_text_field($TVC_Admin_Helper->get_subscriptionId()),
86
- "domain" => esc_url_raw(get_site_url()),
87
- "app_status_data" => array(
88
- "app_settings" => array(
89
- "app_status" => sanitize_text_field($status),
90
- "fb_pixel_enable" => $fb_pixel_enable,
91
- "app_verstion" => PLUGIN_TVC_VERSION,
92
- "domain" => esc_url_raw(get_site_url()),
93
- "update_date" => date("Y-m-d")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  )
95
- )
96
- );
97
- $args = array(
98
- 'headers' =>$header,
99
- 'method' => 'POST',
100
- 'body' => wp_json_encode($postData)
101
- );
102
- $this->tc_wp_remot_call_post(esc_url_raw($url), $args);
 
103
  } catch (Exception $e) {
104
  return $e->getMessage();
105
  }
68
  }
69
 
70
  public function update_app_status($status=1){
71
+ try {
 
 
 
 
 
 
 
 
 
 
 
72
  $TVC_Admin_Helper = new TVC_Admin_Helper();
73
+ $subscription_id = sanitize_text_field($TVC_Admin_Helper->get_subscriptionId());
74
+ if($subscription_id != ""){
75
+ $url = $this->apiDomain . '/customer-subscriptions/update-app-status';
76
+ $header = array(
77
+ "Authorization: Bearer ".$this->token,
78
+ "Content-Type" => "application/json"
79
+ );
80
+
81
+ $options = unserialize(get_option('ee_options'));
82
+ $fb_pixel_enable = "0";
83
+ if(isset($options['fb_pixel_id']) && $options['fb_pixel_id'] != ""){
84
+ $fb_pixel_enable = "1";
85
+ }
86
+ $postData = array(
87
+ "subscription_id" => $subscription_id,
88
+ "domain" => esc_url_raw(get_site_url()),
89
+ "app_status_data" => array(
90
+ "app_settings" => array(
91
+ "app_status" => sanitize_text_field($status),
92
+ "fb_pixel_enable" => $fb_pixel_enable,
93
+ "app_verstion" => PLUGIN_TVC_VERSION,
94
+ "domain" => esc_url_raw(get_site_url()),
95
+ "update_date" => date("Y-m-d")
96
+ )
97
  )
98
+ );
99
+ $args = array(
100
+ 'headers' =>$header,
101
+ 'method' => 'POST',
102
+ 'body' => wp_json_encode($postData)
103
+ );
104
+ wp_remote_post(esc_url_raw($url), $args);
105
+ //$this->tc_wp_remot_call_post(esc_url_raw($url), $args);
106
+ }
107
  } catch (Exception $e) {
108
  return $e->getMessage();
109
  }
includes/setup/google-shopping-feed.php CHANGED
@@ -69,10 +69,11 @@ class GoogleShoppingFeed {
69
  }
70
  }
71
 
72
- $syncProductStat = [];
73
- $args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1);
74
- $products = new WP_Query($args);
75
- $totalActiveWooProduct = $products->found_posts;
 
76
  if(isset($google_detail['prod_sync_status'])){
77
  if ($google_detail['prod_sync_status']) {
78
  $syncProductStat = $google_detail['prod_sync_status'];
@@ -110,7 +111,7 @@ class GoogleShoppingFeed {
110
  $campaignActive = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($campaignActive) : '0');
111
  $campaignCost = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($currency) . esc_attr($campaignCost) : '0');
112
  $campaignClicks = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? $campaignClicks : '0');
113
- $campaignConversions = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($campaignConversions) . "%" : '0');
114
  $campaignSales = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($currency) . esc_attr($campaignSales) : '0');
115
  }
116
  $last_api_sync_up = "";
@@ -231,8 +232,8 @@ class GoogleShoppingFeed {
231
  .$this->add_list_html(esc_html__("Active campaigns","conversios"), $campaignActive)
232
  .$this->add_list_html(esc_html__("Cost","conversios"), $campaignCost)
233
  .$this->add_list_html(esc_html__("Click","conversios"), $campaignClicks)
234
- .$this->add_list_html(esc_html__("Conversion%","conversios"), $campaignConversions)
235
- .$this->add_list_html(esc_html__("Sales","conversios"), $campaignSales); ?>
236
  </ul>
237
  </div>
238
  <?php if (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "") { ?>
69
  }
70
  }
71
 
72
+ $syncProductStat = [];
73
+ global $wpdb;
74
+ $tablename = esc_sql($wpdb->prefix .'posts');
75
+ $sql = "select count(ID) from $tablename where post_type = 'product' and post_status = 'publish'";
76
+ $totalActiveWooProduct = $wpdb->get_var($sql);
77
  if(isset($google_detail['prod_sync_status'])){
78
  if ($google_detail['prod_sync_status']) {
79
  $syncProductStat = $google_detail['prod_sync_status'];
111
  $campaignActive = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($campaignActive) : '0');
112
  $campaignCost = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($currency) . esc_attr($campaignCost) : '0');
113
  $campaignClicks = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? $campaignClicks : '0');
114
+ $campaignConversions = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($campaignConversions) : '0');
115
  $campaignSales = (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "" ? esc_attr($currency) . esc_attr($campaignSales) : '0');
116
  }
117
  $last_api_sync_up = "";
232
  .$this->add_list_html(esc_html__("Active campaigns","conversios"), $campaignActive)
233
  .$this->add_list_html(esc_html__("Cost","conversios"), $campaignCost)
234
  .$this->add_list_html(esc_html__("Click","conversios"), $campaignClicks)
235
+ .$this->add_list_html(esc_html__("Conversion","conversios"), (int) $campaignConversions)
236
+ .$this->add_list_html(esc_html__("Sales","conversios"), (int) $campaignSales); ?>
237
  </ul>
238
  </div>
239
  <?php if (isset($googleDetail->google_ads_id) && esc_attr($googleDetail->google_ads_id) != "") { ?>
readme.txt CHANGED
@@ -6,10 +6,10 @@ Tags: GA4, Google Analytics tracking, Dynamic Remarketing, Google Shopping autom
6
  Author URI: https://conversios.io/
7
  Author: Tatvic
8
  Requires at least: 3.5.0
9
- Tested up to: 5.9.3
10
  Requires PHP: 5.6 or Higher
11
- Stable tag: 4.7.3
12
- Version: 4.7.3
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
@@ -406,6 +406,9 @@ You can resolve the duplication of data by removing the manually implemented GA
406
 
407
  == Changelog ==
408
 
 
 
 
409
  = 4.7.3 - 12/05/2022 =
410
  * Update: Google Ads API Libraries
411
  * Fix: Fetch GA4 measurement id list on the onboarding page, the issue for some users.
6
  Author URI: https://conversios.io/
7
  Author: Tatvic
8
  Requires at least: 3.5.0
9
+ Tested up to: 6.0
10
  Requires PHP: 5.6 or Higher
11
+ Stable tag: 4.7.4
12
+ Version: 4.7.4
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
406
 
407
  == Changelog ==
408
 
409
+ = 4.7.4 - 01/06/2022 =
410
+ * Code optimization in terms of backand load time, onboarding spin wheel load time.
411
+
412
  = 4.7.3 - 12/05/2022 =
413
  * Update: Google Ads API Libraries
414
  * Fix: Fetch GA4 measurement id list on the onboarding page, the issue for some users.