Der Rechtsklick ist für diese Website deaktiviert.

More updates for the wp-shortstat plugin

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 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 The old german article is here.

33 thoughts on “More updates for the wp-shortstat plugin”

  1. […] I just recently upgraded to WordPress 2.01 and found the wp-shortstat plugin did not work anymore. After a quick search on Google, I found that an update has been posted on the Happy Arts blog. The basic fixes seem to be that wp-shortstat does not test for admin functions anymore and it uses a new host for detecting the country code which had been causing many people problems. […]

  2. […] The plugin is by Jeff Minard and based work by Shaun Inman. When I noticed the plugin wasn’t working I Googled it. I found a fix at Happy Arts Blog but had a problem downloading the zip file. So checked Google again and found a copy at WebKeyDesign that included the fix and modified the CSS to match the style of the WordPress 2.0.1 admin panel. It worked immediately and looked great too. […]

  3. 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?

  4. 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.

  5. 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.

  6. 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.

  7. CountZero: you are right, sometimes logged in users should be counted. I changed the code in the next version to:

    || is_404()
    || is_preview()
    || isset($_COOKIE[‚wordpressuser_‘.$cookiehash])
    || strstr($_SERVER[‚PHP_SELF‘], ‚wp-login.php‘)

    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?

  8. 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

  9. […] 절? ?럽 : 절? ?럽?서 소개한 WP-shortstat? ?잘한 버그들? 수정한 버전? 올?와 있는 블로그 ?팔님? 블로그 : 우리 나?? 검색엔진? 추가한 wp-shortstat (? 플러그?? WordPress 2.0.1?서 작?하지 않는 버전입니다.) […]

  10. 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.

    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.

  11. 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?

  12. 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.


  13. 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 the page generation time for the statistics page is about 40 (FORTY!!!!!) seconds?

  14. […] This led me to look for other plugins that might offer similar functionality. After a few minutes of searching and playing around I’ve ended up with the ShortStats, TanTan, and Counterize plugins. The ShortStats plugin isn’t showing any stats yet but looks promising. The TanTan plugin is showing my Feedburner stats but nothing else since I don’t have a Google Analytics account. Finally, Counterize seems to be the one providing the closest to what I was looking for. […]

Leave a reply

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.