After upgrading to WordPress 2.01 the wp-shortstat plugin doesn’t work anymore. A google session later I found the reason for this problem in http://wordpress.org/support/topic/34905/page/2. The Goolge Sitemap plugin includes some WordPress admin functions and now wp-shortstat always thinks, you are admin and does not count any page. The suggested solution was to fix the sitemap plugin, but I think this plugin behaves correctly. So I fixed wp-shortstat the way that it does not test for admin functions anymore.
Meanwhile there are a couple of changes made to the plugin. Please send me your patches, if you want them included.
I created a special page for wp-shortstat now. Please move to https://www.happyarts.de/wp-shortstat/. The old german article is here.
thanks so much for this.. i was wondering why my stats stopped working ;)
Downloaded the file but the zip archive is corrupt. Please make another version available. Thanks for working on this.
I happen to get an error in the line: $url = parse_url($r->referer);
is that a bug or is it only me. Thanks for the fixes.
Pingback: Retro-PC » WordPress WP-ShortStat Plugin Fix
Thanks for this fix. But interstingly, my stats are now off by several hours. Meaning, it’s logging hits as „February 6“ when it’s still „February 5.“ It’s almost as if it were on German time…
Any idea how to get it back into my time zone?
Oh, just to clarify, this is only affecting the „Hits in the last week“ box. The „Recent Referrers“ shows proper times, as does the „Just today as of…“ stat. But those hits were being atributed to the 6th instead of the 5th in the „Hits in the last week“ panel. Maybe that will sort itself out now that it’s past midnight here. The gap of time my wp-shortstat wasn’t working seems to approximate the time the stats are off by.
Thanks for all the comments. I’ve fixed the date/time handling for the Todays Hits box. The other boxes where fixed already by someone other. You have to configure the correct time offset in the WordPress|Options|Date and Time section. In the new version I also included the CSS changes from WebKeyDesign (Thx!). I don’t now something about the parse_url-Error reported by blimmer.
Excellent. Thank you so much for this fix. I told about it on the french WP forum : http://www.wordpress-fr.net/support/viewtopic.php?id=607
for the admin check I’d suggest an addon, as there are blogs out in the wild where you can’t post comments without logging in as a spectator – and these spectators should be counted. So my suggestion is to check whether the current user has admin privileges.
Another idea would be to change the filter where ShortStat steps into the action. Currently it fires at each html response (resulting in being started in admin panel as well) – it would be advisable to use another filter like the page-footer, coz this way there’d be no problem anymore with the admin panel.
Another issue isn’t fixed yet as well – the post preview. As there exists a conditional tag is_preview() – as far as i know at least ;) – it should be applied as well to make sure that no previews get into account by accident.
CountZero: you are right, sometimes logged in users should be counted. I changed the code in the next version to:
if($wpdb->is_admin()
|| is_404()
|| is_preview()
|| isset($_COOKIE[‚wordpressuser_‘.$cookiehash])
|| strstr($_SERVER[‚PHP_SELF‘], ‚wp-login.php‘)
)return;
Your suggestion is_preview is now included. But about the filter: wp-shotstat hooks in as shutdown code:
add_action(’shutdown‘, array(&$wpss, ‚track‘));
Do you see a better solution?
I’m not that deep into the WP sources yet, but I assume that this shutdown filter is applied near the end of all code that is parsed in the process of a response generation (i.e.: rendering a page). One should find a filter that’s not fired up in the admin panel at all – this would result in the effect that there’d be no need to check against that area anymore.
another nice suggestion would be a complete localization of the plugin with the .po/.mo facilities ;) it looks harder than it is, actually; I got that stuff working fine for my theme thanks to the good documentation on the wordpress sites almost instantly. :D
Pingback: Anonymous
Pingback: Renew Your Mind » Upgrades
I’ve upgraded to 1.3.6 but the time-shift problem is still there, sort of. My time zone is set correctly in the options and is working for posts, comments, etc. WP-shortstat is reading it properly in all places except the „Hits in the last week“ section where it attributes hits to the wrong day. Here’s a screen shot for an example.
http://www.davidvanwert.com/wp-content/uploads/wpss-shot.jpg
The stat counts match now, however. Previously, the „Just now as of time/date“ number would be different than the number in the Current Day (tomorrow!) slot. But you can see that short stat gets my time/date right in the „Just now as of“ slot.
Perhaps I’m just a man ahead of my time. By a day. Or am I behind the times? I can’t tell.
Hi and thanks for updating this wonderful plugin. I wish to know how could i reset my shortstat stats and to inform you that even with this 1.3.6 vesrion, my WP 2.0.1 still cannot determine the visitors‘ country origin…..anyway of fixing it?
Hmm, the screenshot link doesn’t seem to be allowed. Me and my htaccess…
Here’s a page displaying it:
http://www.davidvanwert.com/screenshot/
Pingback: 880012: A Ship and a Dream » The Fix is In: wp-shortstat in Wordpress 2.0.1
Markus, with regards to the parse error I mentioned earlier, it has been resolved after I reverted to php4 from php5. It was a server side error, nothing whatsoever to do with your plugin fix.
danke
Thanks for the plugin! It’s very useful and its port for 2.0 was very apreciated!
But is there any chance to know why on my 2.0.1 installation of WP which is upgrade from 1.5.1.3 the page generation time for the statistics page is about 40 (FORTY!!!!!) seconds?
I’ve added the calculation of unique users and expanded the statistics to two weeks, this is very slow on some old MySQL servers. I’ll change this in a future version.
Thanks for this patch.
I just noticed that the new plugin don’t detect correctly the countries. All my visits are counted as „indeterminable“.
Thanks for bringing this plug-in into WP2. And thanks for figuring out that little date shift issue.
Hello there, thanks for your work! I’m now working on localization. ATM only an italian test version is available, but I plan to release a localizable version, using .po and .mo files. Please find here my slighty modified file:
http://www.duechiacchiere.it/uploads/2006/02/wp-shortstat.zip
Have a nice day,
coolmann.
Hi there. In version 1.6 there is no is_preview() function. Where is that function?
Cezary: the is_preview() function is in wordpresswp-includesfunctions.php
Yes, you right. It is, but in 2.0 version. I’ve just looked in 1.5x version :/ argh…
Pingback: aBlogByGus » Stats Plugins for WordPress
Awesome, finally I found a fix for Shortstat which refused to work after I upgrade my wordpress. Thanks!
Wickid fix, thanks mate.
Pingback: Confessions of a Geeky Mama » Blog Archive » Shortstat for WP 2.01 and other stat miscellany