Version Description
Download this release
Release Info
Developer | cavemonkey50 |
Plugin | Google Analyticator |
Version | 4.2.3 |
Comparing to | |
See all releases |
Code changes from version 4.2.2 to 4.2.3
- class.analytics.stats.php +13 -0
- google-analyticator.php +2 -2
- google-analytics-stats-widget.php +3 -1
- readme.txt +1 -1
class.analytics.stats.php
CHANGED
@@ -71,6 +71,19 @@ class GoogleAnalyticsStats
|
|
71 |
return curl_exec($curl);
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
/**
|
75 |
* Sets the account id to use for queries
|
76 |
*
|
71 |
return curl_exec($curl);
|
72 |
}
|
73 |
|
74 |
+
/**
|
75 |
+
* Checks if the username and password worked by looking at the token
|
76 |
+
*
|
77 |
+
* @return Boolean if the login details worked
|
78 |
+
**/
|
79 |
+
function checkLogin()
|
80 |
+
{
|
81 |
+
if ( $this->token != false )
|
82 |
+
return true;
|
83 |
+
else
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
|
87 |
/**
|
88 |
* Sets the account id to use for queries
|
89 |
*
|
google-analyticator.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Google Analyticator
|
4 |
-
* Version: 4.2.
|
5 |
* Plugin URI: http://plugins.spiralwebconsulting.com/analyticator.html
|
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: Spiral Web Consulting
|
8 |
* Author URI: http://spiralwebconsulting.com/
|
9 |
*/
|
10 |
|
11 |
-
define('GOOGLE_ANALYTICATOR_VERSION', '4.2.
|
12 |
|
13 |
# Include Google Analytics Stats widget
|
14 |
if ( function_exists('curl_init') ) {
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Google Analyticator
|
4 |
+
* Version: 4.2.3
|
5 |
* Plugin URI: http://plugins.spiralwebconsulting.com/analyticator.html
|
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: Spiral Web Consulting
|
8 |
* Author URI: http://spiralwebconsulting.com/
|
9 |
*/
|
10 |
|
11 |
+
define('GOOGLE_ANALYTICATOR_VERSION', '4.2.3');
|
12 |
|
13 |
# Include Google Analytics Stats widget
|
14 |
if ( function_exists('curl_init') ) {
|
google-analytics-stats-widget.php
CHANGED
@@ -95,8 +95,10 @@ class GoogleStatsWidget extends WP_Widget
|
|
95 |
echo '<select name="' . $this->get_field_name('account') . '" id="' . $this->get_field_id('account') . '" style="margin-top: -3px; margin-bottom: 10px;">';
|
96 |
if ( count($accounts) > 0 )
|
97 |
foreach ( $accounts AS $account ) { $select = ( $acnt == $account['id'] ) ? ' selected="selected"' : ''; echo '<option value="' . $account['id'] . '"' . $select . '>' . $account['title'] . '</option>'; }
|
|
|
|
|
98 |
else
|
99 |
-
echo '<option value="">No accounts
|
100 |
echo '</select></label></p>';
|
101 |
# Time frame
|
102 |
echo '<p style="text-align:right;"><label for="' . $this->get_field_name('timeFrame') . '">' . __('Days of data to get:') . ' <input style="width: 150px;" id="' . $this->get_field_id('timeFrame') . '" name="' . $this->get_field_name('timeFrame') . '" type="text" value="' . $timeFrame . '" /></label></p>';
|
95 |
echo '<select name="' . $this->get_field_name('account') . '" id="' . $this->get_field_id('account') . '" style="margin-top: -3px; margin-bottom: 10px;">';
|
96 |
if ( count($accounts) > 0 )
|
97 |
foreach ( $accounts AS $account ) { $select = ( $acnt == $account['id'] ) ? ' selected="selected"' : ''; echo '<option value="' . $account['id'] . '"' . $select . '>' . $account['title'] . '</option>'; }
|
98 |
+
elseif ( $stats->checkLogin() == false )
|
99 |
+
echo '<option value="">Wrong login. Set user/pass in settings.</option>';
|
100 |
else
|
101 |
+
echo '<option value="">No Analytics accounts available.</option>';
|
102 |
echo '</select></label></p>';
|
103 |
# Time frame
|
104 |
echo '<p style="text-align:right;"><label for="' . $this->get_field_name('timeFrame') . '">' . __('Days of data to get:') . ' <input style="width: 150px;" id="' . $this->get_field_id('timeFrame') . '" name="' . $this->get_field_name('timeFrame') . '" type="text" value="' . $timeFrame . '" /></label></p>';
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: cavemonkey50, spiralwebconsulting
|
|
3 |
Tags: stats, google, analytics, tracking
|
4 |
Requires at least: 2.7
|
5 |
Tested up to: 2.8
|
6 |
-
Stable tag: 4.2.
|
7 |
|
8 |
Adds the necessary JavaScript code to enable Google Analytics.
|
9 |
|
3 |
Tags: stats, google, analytics, tracking
|
4 |
Requires at least: 2.7
|
5 |
Tested up to: 2.8
|
6 |
+
Stable tag: 4.2.3
|
7 |
|
8 |
Adds the necessary JavaScript code to enable Google Analytics.
|
9 |
|