Google Analytics Opt-Out - Version 0.1.3

Version Description

  • Made the plugin compatible with the latest version of the Google Analytics plugin by Yoast
Download this release

Release Info

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

Code changes from version 0.1.2 to 0.1.3

classes/functions.php CHANGED
@@ -6,66 +6,7 @@
6
  * @return bool
7
  */
8
  function gaoo_yoast_plugin_active() {
9
- if ( is_admin() ) {
10
- global $ga_admin;
11
-
12
- if ( ! isset( $ga_admin ) ) {
13
- return false;
14
- }
15
-
16
- if ( ! $ga_admin instanceof GA_Admin ) {
17
- return false;
18
- }
19
-
20
- return true;
21
- }
22
- else {
23
- global $yoast_ga;
24
-
25
- if ( ! isset( $yoast_ga ) ) {
26
- return false;
27
- }
28
-
29
- if ( ! $yoast_ga instanceof GA_Filter ) {
30
- return false;
31
- }
32
-
33
- return true;
34
- }
35
- }
36
-
37
- /**
38
- * Checks if the Yoast Analytics Plugin is active
39
- * @since 0.1.2
40
- * @return bool
41
- */
42
- function gaoop_yoast_plugin_active() {
43
- if ( is_admin() ) {
44
- global $ga_admin;
45
-
46
- if ( ! isset( $ga_admin ) ) {
47
- return false;
48
- }
49
-
50
- if ( ! $ga_admin instanceof GA_Admin ) {
51
- return false;
52
- }
53
-
54
- return true;
55
- }
56
- else {
57
- global $yoast_ga;
58
-
59
- if ( ! isset( $yoast_ga ) ) {
60
- return false;
61
- }
62
-
63
- if ( ! $yoast_ga instanceof GA_Filter ) {
64
- return false;
65
- }
66
-
67
- return true;
68
- }
69
  }
70
 
71
  /**
@@ -77,37 +18,29 @@ function gaoop_yoast_plugin_active() {
77
  */
78
  function gaoo_get_yoast_ua() {
79
 
80
- if ( ! gaoop_yoast_plugin_active() ) {
81
  return '';
82
  }
83
 
 
 
84
  if ( is_admin() ) {
85
- global $ga_admin;
86
 
87
- if ( ! isset( $ga_admin->optionname ) ) {
88
- return '';
89
  }
90
 
91
- $yoast_settings = get_option( $ga_admin->optionname );
92
- }
93
- else {
94
- global $yoast_ga;
95
 
96
- if ( ! isset( $yoast_ga->options ) ) {
97
- return '';
98
  }
99
 
100
- $yoast_settings = $yoast_ga->options;
101
-
102
  }
103
 
104
-
105
- if ( ! isset( $yoast_settings['uastring'] ) ) {
106
- return '';
107
- }
108
-
109
- return $yoast_settings['uastring'];
110
-
111
  }
112
 
113
  /**
6
  * @return bool
7
  */
8
  function gaoo_yoast_plugin_active() {
9
+ return defined( 'GAWP_VERSION' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
 
12
  /**
18
  */
19
  function gaoo_get_yoast_ua() {
20
 
21
+ if ( ! gaoo_yoast_plugin_active() ) {
22
  return '';
23
  }
24
 
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
  }
42
 
43
+ return $ua_code;
 
 
 
 
 
 
44
  }
45
 
46
  /**
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.2
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.3
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.2
6
  Requires at least: 3.7
7
- Stable tag: 0.1.2
8
- Tested up to: 4.0
9
  License: GPLv2
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -62,6 +62,9 @@ if ( function_exists( 'gaoo_js' ) ) {
62
 
63
  == Changelog ==
64
 
 
 
 
65
  = 0.1.2 =
66
  * Works again with 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.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
 
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
+
68
  = 0.1.2 =
69
  * Works again with the Google Analytics plugin by Yoast
70