Version Description
- Temporarily disable [analytics] shortcode to fix a bug
Download this release
Release Info
Developer | grimmdude |
Plugin | Google Analyticator |
Version | 6.4.9.2 |
Comparing to | |
See all releases |
Code changes from version 6.4.9.1 to 6.4.9.2
- google-analyticator.php +4 -2
- google-analytics-summary-widget.php +168 -157
- readme.txt +4 -1
google-analyticator.php
CHANGED
@@ -490,7 +490,7 @@ if(!$addons){?>
|
|
490 |
<p>2- <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/google-analyticator">Leave a :) Review</a></p>
|
491 |
<p>3- Have a great day!</p>
|
492 |
<h3 style="text-align:center">Show off your analytics</h3>
|
493 |
-
|
494 |
<p>Use short code <b>[analytics-counter]</b> anywhere on your site to display the page view counter widget.</p>
|
495 |
</div>
|
496 |
<?php }?>
|
@@ -1324,6 +1324,7 @@ function add_ga_admin_footer(){
|
|
1324 |
*/
|
1325 |
|
1326 |
//[analytics]
|
|
|
1327 |
function ga_analyticator_shortcode( $atts ) {
|
1328 |
# Include the Google Analytics Summary widget
|
1329 |
require_once('google-analytics-summary-widget.php');
|
@@ -1337,8 +1338,9 @@ function ga_analyticator_shortcode( $atts ) {
|
|
1337 |
|
1338 |
return ob_get_clean();
|
1339 |
}
|
|
|
1340 |
|
1341 |
-
//[analytics]
|
1342 |
function ga_analyticator_counter_shortcode( $atts ) {
|
1343 |
# Include Google Analytics Stats widget
|
1344 |
require_once('google-analytics-stats-widget.php');
|
490 |
<p>2- <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/google-analyticator">Leave a :) Review</a></p>
|
491 |
<p>3- Have a great day!</p>
|
492 |
<h3 style="text-align:center">Show off your analytics</h3>
|
493 |
+
<!--<p>Use short code <b>[analytics]</b> anywhere on your site to show your analytics publicly.</p>-->
|
494 |
<p>Use short code <b>[analytics-counter]</b> anywhere on your site to display the page view counter widget.</p>
|
495 |
</div>
|
496 |
<?php }?>
|
1324 |
*/
|
1325 |
|
1326 |
//[analytics]
|
1327 |
+
/*
|
1328 |
function ga_analyticator_shortcode( $atts ) {
|
1329 |
# Include the Google Analytics Summary widget
|
1330 |
require_once('google-analytics-summary-widget.php');
|
1338 |
|
1339 |
return ob_get_clean();
|
1340 |
}
|
1341 |
+
*/
|
1342 |
|
1343 |
+
//[analytics-counter]
|
1344 |
function ga_analyticator_counter_shortcode( $atts ) {
|
1345 |
# Include Google Analytics Stats widget
|
1346 |
require_once('google-analytics-stats-widget.php');
|
google-analytics-summary-widget.php
CHANGED
@@ -15,6 +15,8 @@ class GoogleAnalyticsSummary
|
|
15 |
**/
|
16 |
function GoogleAnalyticsSummary($options = array('shortcode' => FALSE))
|
17 |
{
|
|
|
|
|
18 |
add_action('wp_dashboard_setup', array(
|
19 |
$this,
|
20 |
'addDashboardWidget'
|
@@ -28,15 +30,20 @@ class GoogleAnalyticsSummary
|
|
28 |
'addTopJs'
|
29 |
));
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
'
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
$this->qa_selecteddate = isset( $_REQUEST['qa_selecteddate'] ) ? wp_filter_kses( $_REQUEST['qa_selecteddate'] ) : '31';
|
42 |
$this->date_before = date('Y-m-d', strtotime( '-'.$this->qa_selecteddate.' days', strtotime( current_time( 'mysql' ) ) ) );
|
@@ -79,154 +86,158 @@ class GoogleAnalyticsSummary
|
|
79 |
**/
|
80 |
function addTopJs()
|
81 |
{
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
230 |
<?php
|
231 |
}
|
232 |
|
15 |
**/
|
16 |
function GoogleAnalyticsSummary($options = array('shortcode' => FALSE))
|
17 |
{
|
18 |
+
$this->options = $options;
|
19 |
+
|
20 |
add_action('wp_dashboard_setup', array(
|
21 |
$this,
|
22 |
'addDashboardWidget'
|
30 |
'addTopJs'
|
31 |
));
|
32 |
|
33 |
+
/*
|
34 |
+
if ($this->options['shortcode']) {
|
35 |
+
// For shortcode
|
36 |
+
add_action('wp_footer', array(
|
37 |
+
$this,
|
38 |
+
'addJavascript'
|
39 |
+
));
|
40 |
+
|
41 |
+
add_action('wp_head', array(
|
42 |
+
$this,
|
43 |
+
'addTopJs'
|
44 |
+
));
|
45 |
+
}
|
46 |
+
*/
|
47 |
|
48 |
$this->qa_selecteddate = isset( $_REQUEST['qa_selecteddate'] ) ? wp_filter_kses( $_REQUEST['qa_selecteddate'] ) : '31';
|
49 |
$this->date_before = date('Y-m-d', strtotime( '-'.$this->qa_selecteddate.' days', strtotime( current_time( 'mysql' ) ) ) );
|
86 |
**/
|
87 |
function addTopJs()
|
88 |
{
|
89 |
+
print_r($this->options);
|
90 |
+
|
91 |
+
?>
|
92 |
+
|
93 |
+
|
94 |
+
<style type="text/css">
|
95 |
+
#google-analytics-summary .legend table {width:auto;border:0;margin:0;}
|
96 |
+
</style>
|
97 |
+
<script type="text/javascript">
|
98 |
+
|
99 |
+
//Tooltip
|
100 |
+
jQuery.fn.UseTooltip = function () {
|
101 |
+
var previousPoint = null;
|
102 |
+
|
103 |
+
jQuery(this).bind("plothover", function (event, pos, item) {
|
104 |
+
if (item) {
|
105 |
+
if (previousPoint != item.dataIndex) {
|
106 |
+
previousPoint = item.dataIndex;
|
107 |
+
|
108 |
+
jQuery("#vumtooltip").remove();
|
109 |
+
|
110 |
+
var x = item.datapoint[0];
|
111 |
+
var y = item.datapoint[1];
|
112 |
+
showTooltip(item.pageX, item.pageY, "<b>"+d2[ x- 1] + "</b><br/>" + item.series.label + ": <strong>" + y + "</strong>");
|
113 |
+
}
|
114 |
+
}
|
115 |
+
else {
|
116 |
+
jQuery("#vumtooltip").remove();
|
117 |
+
previousPoint = null;
|
118 |
+
}
|
119 |
+
});
|
120 |
+
};
|
121 |
+
|
122 |
+
function showTooltip(x, y, contents) {
|
123 |
+
jQuery('<div id="vumtooltip">' + contents + '</div>').css({
|
124 |
+
position: 'absolute',
|
125 |
+
display: 'none',
|
126 |
+
top: y + 5,
|
127 |
+
left: x + 20,
|
128 |
+
border: '1px solid #D0D0D0',
|
129 |
+
padding: '6px',
|
130 |
+
size: '9',
|
131 |
+
'background-color': '#fff',
|
132 |
+
opacity: 0.80
|
133 |
+
}).appendTo("body").fadeIn(200);
|
134 |
+
}
|
135 |
+
|
136 |
+
jQuery(document).ready(function($){
|
137 |
+
// Add a link to see full stats on the Analytics website
|
138 |
+
jQuery('#google-analytics-summary h3.hndle span').append('<span class="postbox-title-action"><a href="http://google.com/analytics/" class="edit-box open-box"><?php _e('View Full Stat Report', 'google-analyticator');?></a></span>');
|
139 |
+
|
140 |
+
// Onload call analytics
|
141 |
+
getAnalytics();
|
142 |
+
|
143 |
+
//On date selection change
|
144 |
+
jQuery("#qa_selecteddate").change(function(){
|
145 |
+
getAnalytics();
|
146 |
+
});
|
147 |
+
|
148 |
+
});
|
149 |
+
|
150 |
+
function getAnalytics(){
|
151 |
+
|
152 |
+
// console.log( 'Start getAnalytics();' );
|
153 |
+
// Grab the widget data
|
154 |
+
jQuery.ajax({
|
155 |
+
type: 'post',
|
156 |
+
url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
|
157 |
+
data: {
|
158 |
+
action: 'ga_stats_widget',
|
159 |
+
qa_selecteddate: jQuery("#qa_selecteddate :selected").val(),
|
160 |
+
_ajax_nonce: '<?php echo wp_create_nonce("google-analyticator-statsWidget_get");?>'
|
161 |
+
},
|
162 |
+
beforeSend: function() {
|
163 |
+
jQuery("#analyticsloading").html('<img src="<?php echo admin_url("images/wpspin_light.gif")?>" border="0" /> ').show();
|
164 |
+
},
|
165 |
+
success: function(html) {
|
166 |
+
jQuery("#analyticsloading").hide();
|
167 |
+
// Hide the loading message
|
168 |
+
jQuery('#google-analytics-summary .inside small').remove();
|
169 |
+
|
170 |
+
// console.log(html);
|
171 |
+
|
172 |
+
// Place the widget data in the area
|
173 |
+
jQuery('#google-analytics-summary .inside .target').html(html);
|
174 |
+
|
175 |
+
// Display the widget data
|
176 |
+
jQuery('#google-analytics-summary .inside .target').slideDown();
|
177 |
+
|
178 |
+
// Handle displaying the graph
|
179 |
+
var divElement = jQuery('div'); //log all div elements
|
180 |
+
var placeholder = jQuery(".flotcontainer");
|
181 |
+
|
182 |
+
//disable graph if the selected is yesterday or today
|
183 |
+
placeholder.show();
|
184 |
+
if(jQuery("#qa_selecteddate :selected").val() == '0' || jQuery("#qa_selecteddate :selected").val() == '1') {
|
185 |
+
placeholder.hide();
|
186 |
+
return false;
|
187 |
+
}
|
188 |
+
|
189 |
+
//graph options
|
190 |
+
var options = {
|
191 |
+
grid: {
|
192 |
+
show: true,
|
193 |
+
aboveData: true,
|
194 |
+
color: "#3f3f3f" ,
|
195 |
+
labelMargin: 5,
|
196 |
+
axisMargin: 0,
|
197 |
+
borderWidth: 0,
|
198 |
+
borderColor:null,
|
199 |
+
minBorderMargin: 5 ,
|
200 |
+
clickable: true,
|
201 |
+
hoverable: true,
|
202 |
+
autoHighlight: true,
|
203 |
+
mouseActiveRadius: 10
|
204 |
+
},
|
205 |
+
series: {
|
206 |
+
grow: {active:false},
|
207 |
+
lines: {
|
208 |
+
show: true,
|
209 |
+
fill: true,
|
210 |
+
lineWidth: 2,
|
211 |
+
steps: false
|
212 |
+
},
|
213 |
+
points: {show:true}
|
214 |
+
},
|
215 |
+
legend: { position: "se" },
|
216 |
+
yaxis: { min: 0 },
|
217 |
+
xaxis: {ticks : datelabel, tickDecimals : 0},
|
218 |
+
colors: ['#88bbc8', '#ed7a53', '#9FC569', '#bbdce3', '#9a3b1b', '#5a8022', '#2c7282'],
|
219 |
+
shadowSize:1,
|
220 |
+
tooltip: false, //activate tooltip
|
221 |
+
};
|
222 |
+
|
223 |
+
jQuery.plot(placeholder, [
|
224 |
+
{
|
225 |
+
label: "<?php _e('Visits', 'google-analyticator')?>",
|
226 |
+
data: d1,
|
227 |
+
lines: {fillColor: "#f2f7f9"},
|
228 |
+
points: {fillColor: "#88bbc8"}
|
229 |
+
}
|
230 |
+
|
231 |
+
], options);
|
232 |
+
jQuery(".flotcontainer").UseTooltip();
|
233 |
+
|
234 |
+
}
|
235 |
+
});
|
236 |
+
}
|
237 |
+
jQuery(window).resize(function() {
|
238 |
+
getAnalytics();
|
239 |
+
});
|
240 |
+
</script>
|
241 |
<?php
|
242 |
}
|
243 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: noahkagan
|
|
3 |
Tags: google analytics plugin, stats, statistics, google, analytics, dashboard, google analytics, tracking, widget, marketing,pageviews,visits, web stats, javascript
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 4.2.2
|
6 |
-
Stable tag: 6.4.9.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -74,6 +74,9 @@ For any support issues, please use the official WordPress support forums.
|
|
74 |
|
75 |
== Changelog ==
|
76 |
|
|
|
|
|
|
|
77 |
= 6.4.9.1 =
|
78 |
* Added [analytics-counter] shortcode so you can display the page view counter widget anywhere
|
79 |
|
3 |
Tags: google analytics plugin, stats, statistics, google, analytics, dashboard, google analytics, tracking, widget, marketing,pageviews,visits, web stats, javascript
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 4.2.2
|
6 |
+
Stable tag: 6.4.9.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
74 |
|
75 |
== Changelog ==
|
76 |
|
77 |
+
= 6.4.9.2 =
|
78 |
+
* Temporarily disable [analytics] shortcode to fix a bug
|
79 |
+
|
80 |
= 6.4.9.1 =
|
81 |
* Added [analytics-counter] shortcode so you can display the page view counter widget anywhere
|
82 |
|