Google Analyticator - Version 6.1.3

Version Description

  • Fixes a Javascript error on the WordPress login page.
  • Improves profile id logic to hopefully fix dashboard errors for the people that experience them.
  • Fixes PHP warnings on the dashboard widget with really old Analytics accounts.
Download this release

Release Info

Developer cavemonkey50
Plugin Icon 128x128 Google Analyticator
Version 6.1.3
Comparing to
See all releases

Code changes from version 6.1.2 to 6.1.3

google-analyticator.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/*
3
* Plugin Name: Google Analyticator
4
- * Version: 6.1.2
5
* Plugin URI: http://ronaldheft.com/code/analyticator/
6
* Description: Adds the necessary JavaScript code to enable <a href="http://www.google.com/analytics/">Google's Analytics</a>. After enabling this plugin visit <a href="options-general.php?page=google-analyticator.php">the settings page</a> and enter your Google Analytics' UID and enable logging.
7
* Author: Ronald Heft
@@ -9,7 +9,7 @@
9
* Text Domain: google-analyticator
10
*/
11
12
- define('GOOGLE_ANALYTICATOR_VERSION', '6.1.2');
13
14
// Constants for enabled/disabled state
15
define("ga_enabled", "enabled", true);
@@ -96,6 +96,7 @@ function ga_admin_init() {
96
97
# Add the core Google Analytics script, with a high priority to ensure last script for async tracking
98
add_action('wp_head', 'add_google_analytics', 999999);
99
100
# Initialize outbound link tracking
101
add_action('init', 'ga_outgoing_links');
1
<?php
2
/*
3
* Plugin Name: Google Analyticator
4
+ * Version: 6.1.3
5
* Plugin URI: http://ronaldheft.com/code/analyticator/
6
* Description: Adds the necessary JavaScript code to enable <a href="http://www.google.com/analytics/">Google's Analytics</a>. After enabling this plugin visit <a href="options-general.php?page=google-analyticator.php">the settings page</a> and enter your Google Analytics' UID and enable logging.
7
* Author: Ronald Heft
9
* Text Domain: google-analyticator
10
*/
11
12
+ define('GOOGLE_ANALYTICATOR_VERSION', '6.1.3');
13
14
// Constants for enabled/disabled state
15
define("ga_enabled", "enabled", true);
96
97
# Add the core Google Analytics script, with a high priority to ensure last script for async tracking
98
add_action('wp_head', 'add_google_analytics', 999999);
99
+ add_action('login_head', 'add_google_analytics', 999999);
100
101
# Initialize outbound link tracking
102
add_action('init', 'ga_outgoing_links');
google-analytics-summary-widget.php CHANGED
@@ -101,14 +101,21 @@ class GoogleAnalyticsSummary
101
check_ajax_referer('google-analyticator-statsWidget_get');
102
103
# Attempt to login and get the current account
104
- $this->id = $this->getAnalyticsAccount();
105
$profile_id = get_option('ga_profileid');
106
- if ( trim($profile_id) != '' )
107
- $this->id = 'ga:' . $profile_id;
108
$this->api->setAccount($this->id);
109
110
# Check that we can display the widget before continuing
111
- if ( $this->id == false ) {
112
# Output error message
113
echo '<p style="margin: 0;">' . __('No Analytics account selected. Double check you are authenticated with Google on Google Analyticator\'s settings page and make sure an account is selected.', 'google-analyticator') . '</p>';
114
@@ -302,6 +309,7 @@ class GoogleAnalyticsSummary
302
}
303
304
# Create the site usage table
305
?>
306
<table width="100%">
307
<tr>
@@ -340,6 +348,7 @@ class GoogleAnalyticsSummary
340
</tr>
341
</table>
342
<?php
343
}
344
345
/**
101
check_ajax_referer('google-analyticator-statsWidget_get');
102
103
# Attempt to login and get the current account
104
+ $account = $this->getAnalyticsAccount();
105
$profile_id = get_option('ga_profileid');
106
+ if ( trim($profile_id) != '' ) {
107
+ if ( substr($profile_id, 0, 3) == 'ga:' ) {
108
+ $this->id = $profile_id;
109
+ } else {
110
+ $this->id = 'ga:' . $profile_id;
111
+ }
112
+ } else {
113
+ $this->id = $account;
114
+ }
115
$this->api->setAccount($this->id);
116
117
# Check that we can display the widget before continuing
118
+ if ( $account == false || $this->id == false ) {
119
# Output error message
120
echo '<p style="margin: 0;">' . __('No Analytics account selected. Double check you are authenticated with Google on Google Analyticator\'s settings page and make sure an account is selected.', 'google-analyticator') . '</p>';
121
309
}
310
311
# Create the site usage table
312
+ if ( isset($stats[0]) ) {
313
?>
314
<table width="100%">
315
<tr>
348
</tr>
349
</table>
350
<?php
351
+ }
352
}
353
354
/**
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: cavemonkey50
3
Donate link: http://ronaldheft.com/code/donate/
4
Tags: stats, statistics, google, analytics, google analytics, tracking, widget
5
Requires at least: 2.7
6
- Tested up to: 3.1
7
- Stable tag: 6.1.2
8
9
Adds the necessary JavaScript code to enable Google Analytics. Includes widgets for Analytics data display.
10
@@ -49,6 +49,11 @@ Please visit [Google Analyticator's support forum](http://forums.ronaldheft.com/
49
50
== Changelog ==
51
52
= 6.1.2 =
53
* Fixes deprecated warnings when wp_debug is enabled.
54
* Fixes tracking code issues when trying to disabled certain user roles.
3
Donate link: http://ronaldheft.com/code/donate/
4
Tags: stats, statistics, google, analytics, google analytics, tracking, widget
5
Requires at least: 2.7
6
+ Tested up to: 3.2
7
+ Stable tag: 6.1.3
8
9
Adds the necessary JavaScript code to enable Google Analytics. Includes widgets for Analytics data display.
10
49
50
== Changelog ==
51
52
+ = 6.1.3 =
53
+ * Fixes a Javascript error on the WordPress login page.
54
+ * Improves profile id logic to hopefully fix dashboard errors for the people that experience them.
55
+ * Fixes PHP warnings on the dashboard widget with really old Analytics accounts.
56
+
57
= 6.1.2 =
58
* Fixes deprecated warnings when wp_debug is enabled.
59
* Fixes tracking code issues when trying to disabled certain user roles.