Version Description
Download this release
Release Info
Developer | Bueltge |
Plugin | Statify |
Version | 1.5.4 |
Comparing to | |
See all releases |
Code changes from version 1.5.3 to 1.5.4
- LICENSE.md → LICENSE +0 -0
- css/dashboard.min.css +1 -1
- inc/statify_backend.class.php +3 -2
- inc/statify_dashboard.class.php +4 -4
- inc/statify_frontend.class.php +1 -2
- js/dashboard.min.js +6 -5
- js/raphael.helper.min.js +4 -5
- readme.txt +5 -1
- statify.php +1 -1
- views/widget_back.view.php +24 -24
LICENSE.md → LICENSE
RENAMED
File without changes
|
css/dashboard.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#statify_chart{color:#aaa;height:140px;margin:0 -4px;text-align:center}#statify_chart_data{display:none}#statify_dashboard .inside{height:1%;margin:0;padding-bottom:0;overflow:hidden;position:relative}#statify_dashboard .table{padding-bottom:12px}#statify_dashboard .table p.sub{color:#BBB;margin:0 0 -4px}#statify_dashboard .table div{overflow:hidden}#statify_dashboard .table.referrer{float:left;width:45%}#statify_dashboard .table.target{float:right;width:55%}#statify_dashboard td{padding:8px 0 0;line-height:1.4em}#statify_dashboard td.b{text-align:right;padding-right:4px;color:#777}#statify_dashboard label{display:block;margin-bottom:1.1em
|
1 |
+
#statify_chart{color:#aaa;height:140px;margin:0 -4px;text-align:center}#statify_chart_data{display:none}#statify_dashboard .inside{height:1%;margin:0;padding-bottom:0;overflow:hidden;position:relative}#statify_dashboard .table{padding-bottom:12px}#statify_dashboard .table p.sub{color:#BBB;margin:0 0 -4px}#statify_dashboard .table div{overflow:hidden}#statify_dashboard .table.referrer{float:left;width:45%}#statify_dashboard .table.target{float:right;width:55%}#statify_dashboard td{padding:8px 0 0;line-height:1.4em}#statify_dashboard td.b{text-align:right;padding-right:4px;color:#777}#statify_dashboard label{display:block;margin-bottom:1.1em!important}#statify_dashboard form{padding:18px 0}#statify_dashboard input[type="number"]{width:100px}#statify_dashboard .meta-links{float:right;margin:0;line-height:28px}
|
inc/statify_backend.class.php
CHANGED
@@ -60,11 +60,12 @@ class Statify_Backend {
|
|
60 |
sprintf(
|
61 |
/** @lang Disable language injection for Url query argument. */
|
62 |
'<a href="%s">%s</a>',
|
63 |
-
add_query_arg(
|
|
|
64 |
admin_url( '/' )
|
65 |
),
|
66 |
esc_html__( 'Settings', 'statify' )
|
67 |
-
)
|
68 |
)
|
69 |
);
|
70 |
}
|
60 |
sprintf(
|
61 |
/** @lang Disable language injection for Url query argument. */
|
62 |
'<a href="%s">%s</a>',
|
63 |
+
add_query_arg(
|
64 |
+
array( 'edit' => 'statify_dashboard#statify_dashboard' ),
|
65 |
admin_url( '/' )
|
66 |
),
|
67 |
esc_html__( 'Settings', 'statify' )
|
68 |
+
),
|
69 |
)
|
70 |
);
|
71 |
}
|
inc/statify_dashboard.class.php
CHANGED
@@ -195,7 +195,7 @@ class Statify_Dashboard extends Statify {
|
|
195 |
|
196 |
/** Get checkbox values from POST variables */
|
197 |
foreach ( array( 'today', 'snippet', 'blacklist' ) as $option_name ) {
|
198 |
-
if ( isset( $_POST['statify'][ $option_name ] ) && (int) $_POST['statify'][ $option_name ]
|
199 |
$options[ $option_name ] = 1;
|
200 |
} else {
|
201 |
$options[ $option_name ] = 0;
|
@@ -294,18 +294,18 @@ class Statify_Dashboard extends Statify {
|
|
294 |
),
|
295 |
'target' => $wpdb->get_results(
|
296 |
$wpdb->prepare(
|
297 |
-
"SELECT COUNT(`target`) as `count`, `target` as `url` FROM `$wpdb->statify` " . ( $today ? 'WHERE created = DATE(NOW())' : '' ) .
|
298 |
$limit
|
299 |
),
|
300 |
ARRAY_A
|
301 |
),
|
302 |
'referrer' => $wpdb->get_results(
|
303 |
$wpdb->prepare(
|
304 |
-
"SELECT COUNT(`referrer`) as `count`, `referrer` as `url`, SUBSTRING_INDEX(SUBSTRING_INDEX(TRIM(LEADING 'www.' FROM(TRIM(LEADING 'https://' FROM TRIM(LEADING 'http://' FROM TRIM(`referrer`))))), '/', 1), ':', 1) as `host` FROM `$wpdb->statify` WHERE `referrer` != '' " . ( $today ? 'AND created = DATE(NOW())' : '' ) .
|
305 |
$limit
|
306 |
),
|
307 |
ARRAY_A
|
308 |
-
)
|
309 |
);
|
310 |
}
|
311 |
}
|
195 |
|
196 |
/** Get checkbox values from POST variables */
|
197 |
foreach ( array( 'today', 'snippet', 'blacklist' ) as $option_name ) {
|
198 |
+
if ( isset( $_POST['statify'][ $option_name ] ) && 1 === (int) $_POST['statify'][ $option_name ] ) {
|
199 |
$options[ $option_name ] = 1;
|
200 |
} else {
|
201 |
$options[ $option_name ] = 0;
|
294 |
),
|
295 |
'target' => $wpdb->get_results(
|
296 |
$wpdb->prepare(
|
297 |
+
"SELECT COUNT(`target`) as `count`, `target` as `url` FROM `$wpdb->statify` " . ( $today ? 'WHERE created = DATE(NOW())' : '' ) . ' GROUP BY `target` ORDER BY `count` DESC LIMIT %d',
|
298 |
$limit
|
299 |
),
|
300 |
ARRAY_A
|
301 |
),
|
302 |
'referrer' => $wpdb->get_results(
|
303 |
$wpdb->prepare(
|
304 |
+
"SELECT COUNT(`referrer`) as `count`, `referrer` as `url`, SUBSTRING_INDEX(SUBSTRING_INDEX(TRIM(LEADING 'www.' FROM(TRIM(LEADING 'https://' FROM TRIM(LEADING 'http://' FROM TRIM(`referrer`))))), '/', 1), ':', 1) as `host` FROM `$wpdb->statify` WHERE `referrer` != '' " . ( $today ? 'AND created = DATE(NOW())' : '' ) . ' GROUP BY `host` ORDER BY `count` DESC LIMIT %d',
|
305 |
$limit
|
306 |
),
|
307 |
ARRAY_A
|
308 |
+
),
|
309 |
);
|
310 |
}
|
311 |
}
|
inc/statify_frontend.class.php
CHANGED
@@ -126,7 +126,6 @@ class Statify_Frontend extends Statify {
|
|
126 |
return $skip_hook;
|
127 |
}
|
128 |
|
129 |
-
|
130 |
// Skip tracking via User Agent
|
131 |
// @codingStandardsIgnoreStart The globals are checked.
|
132 |
if ( ! isset( $_SERVER['HTTP_USER_AGENT'] )
|
@@ -137,7 +136,7 @@ class Statify_Frontend extends Statify {
|
|
137 |
|
138 |
/** Skip tracking via Referrer check and Conditional_Tags. */
|
139 |
return ( self::check_referrer() || is_feed() || is_trackback() || is_robots()
|
140 |
-
|
141 |
);
|
142 |
}
|
143 |
|
126 |
return $skip_hook;
|
127 |
}
|
128 |
|
|
|
129 |
// Skip tracking via User Agent
|
130 |
// @codingStandardsIgnoreStart The globals are checked.
|
131 |
if ( ! isset( $_SERVER['HTTP_USER_AGENT'] )
|
136 |
|
137 |
/** Skip tracking via Referrer check and Conditional_Tags. */
|
138 |
return ( self::check_referrer() || is_feed() || is_trackback() || is_robots()
|
139 |
+
|| is_preview() || is_user_logged_in() || is_404() || is_search()
|
140 |
);
|
141 |
}
|
142 |
|
js/dashboard.min.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
-
(function(){var
|
2 |
-
"stroke-linejoin":"round"}),
|
3 |
-
|
4 |
-
|
5 |
-
|
|
1 |
+
(function(){var labels=[],data=[],statify_chart_id='statify_chart',$statify_data_table=jQuery('#statify_chart_data');if(!$statify_data_table.length){return}
|
2 |
+
jQuery('th',$statify_data_table).each(function(){labels.push(jQuery(this).text())});jQuery('td',$statify_data_table).each(function(){data.push(jQuery(this).text())});var width=jQuery('#'+statify_chart_id).parent().width()+8,height=140,leftgutter=0,bottomgutter=22,topgutter=22,color='#0074a2',r=Raphael(statify_chart_id,width,height),txt={font:'bold 12px "Open Sans", sans-serif',fill:"#333"},X=(width-leftgutter*2)/labels.length,max=Math.max.apply(Math,data),Y=(height-bottomgutter-topgutter)/max;r.text(16,16,max).attr({'font':'normal 10px "Open Sans", sans-serif',fill:"#bbb"});var path=r.path().attr({stroke:color,"stroke-width":2,"stroke-linejoin":"round"}),bgp=r.path().attr({stroke:"none",opacity:.3,fill:color}),label=r.set(),lx=0,ly=0,is_label_visible=!1,leave_timer,blanket=r.set();label.push(r.text(60,12,"7777 Pageviews").attr(txt));label.push(r.text(60,27,"23.12.2013").attr(txt).attr({fill:color}));label.hide();var frame=r.popup(100,100,label,"right").attr({fill:"#fff",stroke:"#444","stroke-width":1}).hide();var p,bgpp;for(var i=0,ii=labels.length;i<ii;i++){var y=Math.round(height-bottomgutter-Y*data[i]),x=Math.round(leftgutter+X*(i+.5));if(!i){p=["M",x,y,"C",x,y];bgpp=["M",leftgutter+X*.5,height-bottomgutter,"L",x,y,"C",x,y]}
|
3 |
+
if(i&&i<ii-1){var Y0=Math.round(height-bottomgutter-Y*data[i-1]),X0=Math.round(leftgutter+X*(i-.5)),Y2=Math.round(height-bottomgutter-Y*data[i+1]),X2=Math.round(leftgutter+X*(i+1.5));var a=getAnchors(X0,Y0,x,y,X2,Y2);p=p.concat([a.x1,a.y1,x,y,a.x2,a.y2]);bgpp=bgpp.concat([a.x1,a.y1,x,y,a.x2,a.y2])}
|
4 |
+
var dot=r.circle(x,y,4).attr({fill:"#fff",stroke:color,"stroke-width":1});blanket.push(r.rect(leftgutter+X*i,0,X,height-bottomgutter).attr({stroke:"none",fill:'#fff',opacity:.2}));var rect=blanket[blanket.length-1];(function(x,y,data,lbl,dot){var timer,i=0;rect.hover(function(){clearTimeout(leave_timer);var side="right";if(x+frame.getBBox().width>width){side="left"}
|
5 |
+
var ppp=r.popup(x,y,label,side,1),anim=Raphael.animation({path:ppp.path,transform:["t",ppp.dx,ppp.dy]},200*is_label_visible);lx=label[0].transform()[0][1]+ppp.dx;ly=label[0].transform()[0][2]+ppp.dy;frame.show().stop().animate(anim);label[0].attr({text:data+" "+(data>1?statify_translations.pageviews:statify_translations.pageview)}).show().stop().animateWith(frame,anim,{transform:["t",lx,ly]},200*is_label_visible);label[1].attr({text:lbl}).show().stop().animateWith(frame,anim,{transform:["t",lx,ly]},200*is_label_visible);dot.attr("r",6);is_label_visible=!0},function(){dot.attr("r",4);leave_timer=setTimeout(function(){frame.hide();label[0].hide();label[1].hide();is_label_visible=!1},1)})})(x,y,data[i],labels[i],dot)}
|
6 |
+
p=p.concat([x,y,x,y]);bgpp=bgpp.concat([x,y,x,y,"L",x,height-bottomgutter,"z"]);path.attr({path:p});bgp.attr({path:bgpp});frame.toFront();label[0].toFront();label[1].toFront();blanket.toFront()})()
|
js/raphael.helper.min.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
-
var tokenRegex=/\{([^\}]+)\}/g,objNotationRegex=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,replacer=function(
|
2 |
-
Raphael.fn.popup=function(
|
3 |
-
|
4 |
-
|
5 |
-
{path:k,dx:m,dy:n};g.translate(m,n);return q};function getAnchors(c,h,g,a,k,b){var f=(g-c)/2,d=(k-g)/2;c=Math.atan((g-c)/Math.abs(a-h));k=Math.atan((k-g)/Math.abs(a-b));c=h<a?Math.PI-c:c;k=b<a?Math.PI-k:k;b=Math.PI/2-(c+k)%(2*Math.PI)/2;h=f*Math.sin(b+c);f*=Math.cos(b+c);c=d*Math.sin(b+k);d*=Math.cos(b+k);return{x1:g-h,y1:a+f,x2:g+c,y2:a+d}};
|
1 |
+
var tokenRegex=/\{([^\}]+)\}/g,objNotationRegex=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,replacer=function(all,key,obj){var res=obj;key.replace(objNotationRegex,function(all,name,quote,quotedName,isFunc){name=name||quotedName;if(res){if(name in res){res=res[name]}
|
2 |
+
typeof res=="function"&&isFunc&&(res=res())}});res=(res==null||res==obj?all:res)+"";return res},fill=function(str,obj){return String(str).replace(tokenRegex,function(all,key){return replacer(all,key,obj)})};Raphael.fn.popup=function(X,Y,set,pos,ret){pos=String(pos||"top-middle").split("-");pos[1]=pos[1]||"middle";var r=5,bb=set.getBBox(),w=Math.round(bb.width),h=Math.round(bb.height),x=Math.round(bb.x)-r,y=Math.round(bb.y)-r,gap=Math.min(h/2,w/2,10),shapes={top:"M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}l-{right},0-{gap},{gap}-{gap}-{gap}-{left},0a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z",bottom:"M{x},{y}l{left},0,{gap}-{gap},{gap},{gap},{right},0a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z",right:"M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}l0-{bottom}-{gap}-{gap},{gap}-{gap},0-{top}a{r},{r},0,0,1,{r}-{r}z",left:"M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}l0,{top},{gap},{gap}-{gap},{gap},0,{bottom}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z"},offset={hx0:X-(x+r+w-gap*2),hx1:X-(x+r+w/2-gap),hx2:X-(x+r+gap),vhy:Y-(y+r+h+r+gap),"^hy":Y-(y-gap)},mask=[{x:x+r,y:y,w:w,w4:w/4,h4:h/4,right:0,left:w-gap*2,bottom:0,top:h-gap*2,r:r,h:h,gap:gap},{x:x+r,y:y,w:w,w4:w/4,h4:h/4,left:w/2-gap,right:w/2-gap,top:h/2-gap,bottom:h/2-gap,r:r,h:h,gap:gap},{x:x+r,y:y,w:w,w4:w/4,h4:h/4,left:0,right:w-gap*2,top:0,bottom:h-gap*2,r:r,h:h,gap:gap}][pos[1]=="middle"?1:(pos[1]=="top"||pos[1]=="left")*2];var dx=0,dy=0,out=this.path(fill(shapes[pos[0]],mask)).insertBefore(set);switch(pos[0]){case "top":dx=X-(x+r+mask.left+gap);dy=Y-(y+r+h+r+gap);break;case "bottom":dx=X-(x+r+mask.left+gap);dy=Y-(y-gap);break;case "left":dx=X-(x+r+w+r+gap);dy=Y-(y+r+mask.top+gap);break;case "right":dx=X-(x-gap);dy=Y-(y+r+mask.top+gap);break}
|
3 |
+
out.translate(dx,dy);if(ret){ret=out.attr("path");out.remove();return{path:ret,dx:dx,dy:dy}}
|
4 |
+
set.translate(dx,dy);return out};function getAnchors(p1x,p1y,p2x,p2y,p3x,p3y){var l1=(p2x-p1x)/2,l2=(p3x-p2x)/2,a=Math.atan((p2x-p1x)/Math.abs(p2y-p1y)),b=Math.atan((p3x-p2x)/Math.abs(p2y-p3y));a=p1y<p2y?Math.PI-a:a;b=p3y<p2y?Math.PI-b:b;var alpha=Math.PI/2-((a+b)%(Math.PI*2))/2,dx1=l1*Math.sin(alpha+a),dy1=l1*Math.cos(alpha+a),dx2=l2*Math.sin(alpha+b),dy2=l2*Math.cos(alpha+b);return{x1:p2x-dx1,y1:p2y+dy1,x2:p2x+dx2,y2:p2y+dy2}}
|
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Requires at least: 4.7
|
6 |
* Tested up to: 4.9
|
7 |
* Requires PHP: 5.6
|
8 |
-
* Stable tag: 1.5.
|
9 |
* License: GPLv3 or later
|
10 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -117,6 +117,10 @@ has to be added to the theme's `functions.php`. The condition has modified such
|
|
117 |
## Changelog ##
|
118 |
You can find the full changelog in [our GitHub repository](https://github.com/pluginkollektiv/statify/blob/master/CHANGELOG.md).
|
119 |
|
|
|
|
|
|
|
|
|
120 |
### 1.5.3 (2017-11-28) ##
|
121 |
* Replace javascript library to fixed several problems.
|
122 |
|
5 |
* Requires at least: 4.7
|
6 |
* Tested up to: 4.9
|
7 |
* Requires PHP: 5.6
|
8 |
+
* Stable tag: 1.5.4
|
9 |
* License: GPLv3 or later
|
10 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
117 |
## Changelog ##
|
118 |
You can find the full changelog in [our GitHub repository](https://github.com/pluginkollektiv/statify/blob/master/CHANGELOG.md).
|
119 |
|
120 |
+
### 1.5.4 (2017-11-30)
|
121 |
+
* Use minified version of javascripts and stylesheets.
|
122 |
+
* Different updates on the development repository.
|
123 |
+
|
124 |
### 1.5.3 (2017-11-28) ##
|
125 |
* Replace javascript library to fixed several problems.
|
126 |
|
statify.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* Author URI: http://pluginkollektiv.org
|
8 |
* Plugin URI: https://wordpress.org/plugins/statify/
|
9 |
* License: GPLv3 or later
|
10 |
-
* Version: 1.5.
|
11 |
*
|
12 |
* Copyright (C) 2011-2017 Sergej Müller, pluginkollektiv
|
13 |
*
|
7 |
* Author URI: http://pluginkollektiv.org
|
8 |
* Plugin URI: https://wordpress.org/plugins/statify/
|
9 |
* License: GPLv3 or later
|
10 |
+
* Version: 1.5.4
|
11 |
*
|
12 |
* Copyright (C) 2011-2017 Sergej Müller, pluginkollektiv
|
13 |
*
|
views/widget_back.view.php
CHANGED
@@ -3,30 +3,30 @@
|
|
3 |
class_exists( 'Statify' ) || exit; ?>
|
4 |
|
5 |
<fieldset>
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
</fieldset>
|
31 |
<?php wp_nonce_field( 'statify-dashboard' ); ?>
|
32 |
|
3 |
class_exists( 'Statify' ) || exit; ?>
|
4 |
|
5 |
<fieldset>
|
6 |
+
<label for="statify_days">
|
7 |
+
<input name="statify[days]" id="statify_days" type="number" min="1"
|
8 |
+
value="<?php echo esc_attr( Statify::$_options['days'] ); ?>">
|
9 |
+
<?php esc_html_e( 'days', 'statify' ); ?> -
|
10 |
+
<?php esc_html_e( 'Period of data saving', 'statify' ); ?>
|
11 |
+
</label>
|
12 |
+
<label for="statify_limit">
|
13 |
+
<input name="statify[limit]" id="statify_limit" type="number" min="1" max="100"
|
14 |
+
value="<?php echo esc_attr( Statify::$_options['limit'] ); ?>">
|
15 |
+
<?php esc_html_e( 'Number of entries in top lists', 'statify' ); ?>
|
16 |
+
</label>
|
17 |
+
<label for="statify_today">
|
18 |
+
<input type="checkbox" name="statify[today]" id="statify_today" value="1" <?php checked( Statify::$_options['today'], 1 ); ?> />
|
19 |
+
<?php esc_html_e( 'Entries in top lists only for today', 'statify' ); ?>
|
20 |
+
</label>
|
21 |
+
<label for="statify_snippet">
|
22 |
+
<input type="checkbox" name="statify[snippet]" id="statify_snippet" value="1" <?php checked( Statify::$_options['snippet'], 1 ); ?> />
|
23 |
+
<?php esc_html_e( 'Page tracking via JavaScript', 'statify' ); ?>
|
24 |
+
<small>(<?php esc_html_e( 'recommended if caching is in use', 'statify' ); ?>)</small>
|
25 |
+
</label>
|
26 |
+
<label for="statify_blacklist">
|
27 |
+
<input type="checkbox" name="statify[blacklist]" id="statify_blacklist" value="1" <?php checked( Statify::$_options['blacklist'], 1 ); ?> />
|
28 |
+
<?php esc_html_e( 'Skip tracking for referrers listed in the comment blacklist', 'statify' ); ?>
|
29 |
+
</label>
|
30 |
</fieldset>
|
31 |
<?php wp_nonce_field( 'statify-dashboard' ); ?>
|
32 |
|