Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 2.1.1

Version Description

  • 26/07/2018 =
    • Admin User Tracking Issue resolved
    • Fatal Error Resolved
    • Minor Bug Fixes
Download this release

Release Info

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

Code changes from version 2.1.0 to 2.1.1

admin/class-enhanced-ecommerce-google-analytics-settings.php CHANGED
@@ -28,6 +28,7 @@ class Enhanced_Ecommerce_Google_Settings {
28
  public static function add_update_settings($settings) {
29
  if ( !get_option($settings)) {
30
  $ee_options = array();
 
31
  foreach ($_POST as $key => $value) {
32
  if(!isset($_POST[$key])){
33
  $_POST[$key] = '';
@@ -36,10 +37,12 @@ class Enhanced_Ecommerce_Google_Settings {
36
  $ee_options[$key] = $_POST[$key];
37
  }
38
  }
 
39
  add_option( $settings, serialize( $ee_options ) );
40
  }
41
  else {
42
  $get_ee_settings = unserialize(get_option($settings));
 
43
  foreach ($get_ee_settings as $key => $value) {
44
  if(!isset($_POST[$key])){
45
  $_POST[$key] = '';
@@ -49,10 +52,13 @@ class Enhanced_Ecommerce_Google_Settings {
49
  }
50
 
51
  }
 
 
52
  foreach($_POST as $key=>$value){
53
  if(!array_key_exists($key,$get_ee_settings)){
54
  $get_ee_settings[$key] = $value;
55
  }
 
56
  }
57
  update_option($settings, serialize( $get_ee_settings ));
58
  }
28
  public static function add_update_settings($settings) {
29
  if ( !get_option($settings)) {
30
  $ee_options = array();
31
+ if(is_array($_POST)) {
32
  foreach ($_POST as $key => $value) {
33
  if(!isset($_POST[$key])){
34
  $_POST[$key] = '';
37
  $ee_options[$key] = $_POST[$key];
38
  }
39
  }
40
+ }
41
  add_option( $settings, serialize( $ee_options ) );
42
  }
43
  else {
44
  $get_ee_settings = unserialize(get_option($settings));
45
+ if(is_array($get_ee_settings)) {
46
  foreach ($get_ee_settings as $key => $value) {
47
  if(!isset($_POST[$key])){
48
  $_POST[$key] = '';
52
  }
53
 
54
  }
55
+ }
56
+ if(is_array($_POST)) {
57
  foreach($_POST as $key=>$value){
58
  if(!array_key_exists($key,$get_ee_settings)){
59
  $get_ee_settings[$key] = $value;
60
  }
61
+ }
62
  }
63
  update_option($settings, serialize( $get_ee_settings ));
64
  }
enhanced-ecommerce-google-analytics.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
  * Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
19
- * Version: 2.1.0
20
  * Author: Tatvic
21
  * Author URI: tatvic.com
22
  * 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_NAME_VERSION', '2.1.0' );
41
  /**
42
  * The code that runs during plugin activation.
43
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-activator.php
@@ -76,8 +76,10 @@ require plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-
76
 
77
  function run_enhanced_ecommerce_google_analytics() {
78
 
79
- $plugin = new Enhanced_Ecommerce_Google_Analytics();
80
  $plugin->run();
 
 
81
 
82
  }
83
  run_enhanced_ecommerce_google_analytics();
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
  * Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
19
+ * Version: 2.1.1
20
  * Author: Tatvic
21
  * Author URI: tatvic.com
22
  * 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_NAME_VERSION', '2.1.1' );
41
  /**
42
  * The code that runs during plugin activation.
43
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-activator.php
76
 
77
  function run_enhanced_ecommerce_google_analytics() {
78
 
79
+ $plugin = new Enhanced_Ecommerce_Google_Analytics();
80
  $plugin->run();
81
+
82
+
83
 
84
  }
85
  run_enhanced_ecommerce_google_analytics();
includes/class-enhanced-ecommerce-google-analytics.php CHANGED
@@ -102,7 +102,6 @@ class Enhanced_Ecommerce_Google_Analytics {
102
  * The class responsible for orchestrating the actions and filters of the
103
  * core plugin.
104
  */
105
-
106
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-loader.php';
107
 
108
  /**
@@ -172,7 +171,6 @@ class Enhanced_Ecommerce_Google_Analytics {
172
  private function define_public_hooks() {
173
 
174
  $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
175
-
176
  $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
177
  $this->loader->add_action("wp_footer", $plugin_public, "t_products_impre_clicks");
178
  $this->loader->add_action("woocommerce_thankyou", $plugin_public, "ecommerce_tracking_code");
102
  * The class responsible for orchestrating the actions and filters of the
103
  * core plugin.
104
  */
 
105
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-loader.php';
106
 
107
  /**
171
  private function define_public_hooks() {
172
 
173
  $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
 
174
  $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
175
  $this->loader->add_action("wp_footer", $plugin_public, "t_products_impre_clicks");
176
  $this->loader->add_action("woocommerce_thankyou", $plugin_public, "ecommerce_tracking_code");
public/class-enhanced-ecommerce-google-analytics-public.php CHANGED
@@ -28,7 +28,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
28
  * @return void
29
  */
30
  //set plugin version
31
- public $tvc_eeVer = '2.1.0';
32
 
33
  protected $tvc_aga;
34
 
@@ -51,6 +51,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
51
  protected $ga_PrivacyPolicy;
52
 
53
  protected $ga_IPA;
 
54
  public function __construct($plugin_name, $version) {
55
 
56
 
@@ -75,9 +76,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
75
  $this->ga_OPTOUT = $this->get_option("ga_OPTOUT") == "on" ? true : false; //Google Analytics Opt Out
76
  $this->ga_PrivacyPolicy = $this->get_option("ga_PrivacyPolicy") == "on" ? true : false;
77
  $this->ga_IPA = $this->get_option("ga_IPA") == "on" ? true : false; //IP Anony.
78
- if (is_admin() ) {
79
- return;
80
- }
81
  if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
82
  // Put your plugin code here
83
  add_action('woocommerce_init' , function (){
@@ -86,14 +85,12 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
86
  });
87
  }
88
  }
89
-
90
  public function get_option($key){
91
  $ee_options = array();
92
-
93
- if(!empty(unserialize(get_option('ee_options')))){
94
- $ee_options = unserialize(get_option('ee_options'));
95
  }
96
- $ee_admin_settings = array_merge($ee_options);
97
  if(isset($ee_options[$key])){
98
  return $ee_options[$key];
99
  }
@@ -154,7 +151,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
154
  * @return bool
155
  */
156
  private function disable_tracking($type) {
157
- if (is_admin() || (!$this->ga_id ) || "" == $type) {
158
  return true;
159
  }
160
  }
@@ -184,7 +181,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
184
  global $woocommerce;
185
 
186
  //common validation----start
187
- if (is_admin() || $this->ga_ST == "") {
188
  return;
189
  }
190
  $tracking_id = $this->ga_id;
28
  * @return void
29
  */
30
  //set plugin version
31
+ public $tvc_eeVer = '2.1.1';
32
 
33
  protected $tvc_aga;
34
 
51
  protected $ga_PrivacyPolicy;
52
 
53
  protected $ga_IPA;
54
+
55
  public function __construct($plugin_name, $version) {
56
 
57
 
76
  $this->ga_OPTOUT = $this->get_option("ga_OPTOUT") == "on" ? true : false; //Google Analytics Opt Out
77
  $this->ga_PrivacyPolicy = $this->get_option("ga_PrivacyPolicy") == "on" ? true : false;
78
  $this->ga_IPA = $this->get_option("ga_IPA") == "on" ? true : false; //IP Anony.
79
+
 
 
80
  if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
81
  // Put your plugin code here
82
  add_action('woocommerce_init' , function (){
85
  });
86
  }
87
  }
 
88
  public function get_option($key){
89
  $ee_options = array();
90
+ $my_option = get_option( 'ee_options' );
91
+ if(!empty($my_option)){
92
+ $ee_options = unserialize($my_option);
93
  }
 
94
  if(isset($ee_options[$key])){
95
  return $ee_options[$key];
96
  }
151
  * @return bool
152
  */
153
  private function disable_tracking($type) {
154
+ if (is_admin() || (!$this->ga_id ) || "" == $type || current_user_can("manage_options")) {
155
  return true;
156
  }
157
  }
181
  global $woocommerce;
182
 
183
  //common validation----start
184
+ if (is_admin() || $this->ga_ST == "" || current_user_can("manage_options")) {
185
  return;
186
  }
187
  $tracking_id = $this->ga_id;
readme.txt CHANGED
@@ -7,8 +7,8 @@ Author URI: https://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 3.6
9
  Tested up to: 4.9
10
- Stable tag: 2.1.0
11
- Version: 2.1.0
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
@@ -319,4 +319,9 @@ Important Note: When you update the plugin, please save your settings again.
319
 
320
  = 2.1.0 - 19/07/2018 =
321
  * New User Interface
 
 
 
 
 
322
  * Minor Bug Fixes
7
  Author: Tatvic
8
  Requires at least: 3.6
9
  Tested up to: 4.9
10
+ Stable tag: 2.1.1
11
+ Version: 2.1.1
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
319
 
320
  = 2.1.0 - 19/07/2018 =
321
  * New User Interface
322
+ * Minor Bug Fixes
323
+
324
+ = 2.1.1 - 26/07/2018 =
325
+ * Admin User Tracking Issue resolved
326
+ * Fatal Error Resolved
327
  * Minor Bug Fixes