Google Analytics Opt-Out - Version 0.1.4

Version Description

  • Solves the issue that the opt-out link does not appear when the UA-Code was entered manually.
  • Also fixes an issue that the tracking code could not be found due to some code changes of the Yoast Google Analytics for WordPress Plugin (Yoast_GA_Frontend class no longer extends Yoast_GA_Options)
Download this release

Release Info

Developer wp-buddy
Plugin Icon 128x128 Google Analytics Opt-Out
Version 0.1.4
Comparing to
See all releases

Code changes from version 0.1.3 to 0.1.4

classes/functions.php CHANGED
@@ -25,17 +25,23 @@ function gaoo_get_yoast_ua() {
25
  $ua_code = '';
26
 
27
  if ( is_admin() ) {
 
 
 
28
  global $yoast_ga_admin;
29
 
30
- if ( method_exists( $yoast_ga_admin, 'get_tracking_code' ) ) {
31
  $ua_code = $yoast_ga_admin->get_tracking_code();
32
  }
33
 
34
  } else {
35
- global $yoast_ga_frontend;
36
 
37
- if ( method_exists( $yoast_ga_frontend, 'get_tracking_code' ) ) {
38
- $ua_code = $yoast_ga_frontend->get_tracking_code();
 
 
 
 
39
  }
40
 
41
  }
@@ -50,7 +56,7 @@ function gaoo_get_yoast_ua() {
50
  */
51
  function gaoo_get_ua_code() {
52
 
53
- if ( gaoo_yoast_plugin_active() ) {
54
  return apply_filters( 'gaoo_get_ua_code', gaoo_get_yoast_ua() );
55
  }
56
 
25
  $ua_code = '';
26
 
27
  if ( is_admin() ) {
28
+ /**
29
+ * @var Yoast_GA_Admin $yoast_ga_admin
30
+ */
31
  global $yoast_ga_admin;
32
 
33
+ if ( isset( $yoast_ga_admin ) && method_exists( $yoast_ga_admin, 'get_tracking_code' ) ) {
34
  $ua_code = $yoast_ga_admin->get_tracking_code();
35
  }
36
 
37
  } else {
 
38
 
39
+ if ( class_exists( 'Yoast_GA_Options' ) ) {
40
+ $yoast_ga_options = Yoast_GA_Options::instance();
41
+
42
+ if ( method_exists( $yoast_ga_options, 'get_tracking_code' ) ) {
43
+ $ua_code = $yoast_ga_options->get_tracking_code();
44
+ }
45
  }
46
 
47
  }
56
  */
57
  function gaoo_get_ua_code() {
58
 
59
+ if ( gaoo_yoast_plugin_active() && (bool) get_option( 'gaoo_yoast', 0 ) ) {
60
  return apply_filters( 'gaoo_get_ua_code', gaoo_get_yoast_ua() );
61
  }
62
 
classes/settings.php CHANGED
@@ -104,9 +104,8 @@ function gaoo_options_yoast() {
104
  */
105
  function gaoo_options_property() {
106
  $yoast_active = gaoo_yoast_plugin_active();
107
- $option = get_option( 'gaoo_yoast', null );
108
 
109
- if ( $yoast_active && 1 == $option ) {
110
  $value = gaoo_get_yoast_ua();
111
  }
112
  else {
104
  */
105
  function gaoo_options_property() {
106
  $yoast_active = gaoo_yoast_plugin_active();
 
107
 
108
+ if ( $yoast_active && (bool) get_option( 'gaoo_yoast', null ) ) {
109
  $value = gaoo_get_yoast_ua();
110
  }
111
  else {
google-analytics-opt-out.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Google Analytics Opt-Out
4
  Plugin URI: http://wp-buddy.com/products/plugins/google-analytics-opt-out
5
  Description: Provides an Opt-Out functionality for Google Analytics
6
- Version: 0.1.3
7
  Author: WP-Buddy
8
  Author URI: http://wp-buddy.com
9
  License: GPL2
3
  Plugin Name: Google Analytics Opt-Out
4
  Plugin URI: http://wp-buddy.com/products/plugins/google-analytics-opt-out
5
  Description: Provides an Opt-Out functionality for Google Analytics
6
+ Version: 0.1.4
7
  Author: WP-Buddy
8
  Author URI: http://wp-buddy.com
9
  License: GPL2
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: wp-buddy
3
  Donate link: http://wp-buddy.com/products/plugins/google-analytics-opt-out/
4
  Tags: google analytics, analytics, analytics opt-out, analytics opt out
5
- Version: 0.1.3
6
  Requires at least: 3.7
7
- Stable tag: 0.1.3
8
- Tested up to: 4.1
9
  License: GPLv2
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -24,8 +24,7 @@ Please by the Pro Version of the [Google Analytics Opt Out WordPress Plugin](htt
24
 
25
  * Install and activate the plugin via your WordPress Administration panel
26
  * Go the "Settings" -> "Analytics Opt Out" and enter your UA-code (you don't need this step if Yoasts Analytics plugin is active)
27
- *
28
- * IMPORTANT: Check the sourcecode of your website and make sure that the Analytics code follows AFTER the opt-out code. Otherwise the Opt-Out feature will not work.
29
  * Read the FAQ for more information.
30
 
31
  == Frequently Asked Questions ==
@@ -62,6 +61,10 @@ if ( function_exists( 'gaoo_js' ) ) {
62
 
63
  == Changelog ==
64
 
 
 
 
 
65
  = 0.1.3 =
66
  * Made the plugin compatible with the latest version of the Google Analytics plugin by Yoast
67
 
2
  Contributors: wp-buddy
3
  Donate link: http://wp-buddy.com/products/plugins/google-analytics-opt-out/
4
  Tags: google analytics, analytics, analytics opt-out, analytics opt out
5
+ Version: 0.1.4
6
  Requires at least: 3.7
7
+ Stable tag: 0.1.4
8
+ Tested up to: 4.2
9
  License: GPLv2
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
24
 
25
  * Install and activate the plugin via your WordPress Administration panel
26
  * Go the "Settings" -> "Analytics Opt Out" and enter your UA-code (you don't need this step if Yoasts Analytics plugin is active)
27
+ * IMPORTANT: Check the sourcecode of your website and make sure that the Analytics code is entered AFTER the opt-out code. Otherwise the Opt-Out feature will not work.
 
28
  * Read the FAQ for more information.
29
 
30
  == Frequently Asked Questions ==
61
 
62
  == Changelog ==
63
 
64
+ = 0.1.4 =
65
+ * Solves the issue that the opt-out link does not appear when the UA-Code was entered manually.
66
+ * Also fixes an issue that the tracking code could not be found due to some code changes of the Yoast Google Analytics for WordPress Plugin (Yoast_GA_Frontend class no longer extends Yoast_GA_Options)
67
+
68
  = 0.1.3 =
69
  * Made the plugin compatible with the latest version of the Google Analytics plugin by Yoast
70