WP-shortstat 1.3 and WP 2.0 (14 posts)

  1. emeff
    Posted 10 years ago #


    according to the compatibily list "WP-ShortStat 1.3" should work with WP 2.0.
    But when I open the "shortstat"'s in dashboard I get the following message:

    Since Fatal error: Cannot access empty property in /<path>/wp-content/plugins/wp-shortstat.php on line 771

    Any ideas? Does WP-ShortStats run on one of your 2.0 installations? Can someone advise another statistics plugin which similar information that works with WP 2.0?


  2. rjacob
    Posted 10 years ago #

    I have read this can be fixed by changing:

  3. rjacob
    Posted 10 years ago #

    Now...I am having my own problem. I have been using wp-shortstat for quite while now. I have even heavily modified my own version add new stats for search engines, top pages for the day, etc.
    I upgraded to WP2 yesterday, and wp-shortstat stopped logging traffic to my site. I switched to the original version, and same thing. The stats display page works fine. I dropped the tables, and it recreated fine. Everything seems to be working fine except it is not logging any visits to my site. It is like the track hook is not being triggered. Anybody else seeing this?

    update: I just read else where that wp-shortstat worked fine with 2.0, but stopped working with wp 2.0.1. So maybe the shutdown hook got toasted in 2.0.1?

  4. wkd
    Posted 10 years ago #

    The 2.0.1 Update broke WP-shortstat 1.3.

  5. wkd
    Posted 10 years ago #

    It looks like there is still a conflict with the Google Sitemap plugin.

    See HappyArts Blog.

  6. Austin Matzko
    Posted 10 years ago #

    Any ideas where 2.0.1 messes up wp-shortstat? The hooks it uses look pretty standard to me.

  7. Austin Matzko
    Posted 10 years ago #

    Okay, I fixed the wp-shortstat problem. Here's the deal: in order to avoid recording admin page hits, the plugin was testing whether or not a function named "check_admin_referer" was defined. That worked until WP 2.0.1, when that function moved from the admin functions to pluggable functions, meaning it's now always defined.

    To fix it, I replaced the test for that function with a test for this function: "user_can_access_admin_page," which should work even for WP 1.5.

    The bottom line: to fix it, swap out line 13 of the plugin like so.

    < if (function_exists('check_admin_referer')) {
    > if (function_exists('user_can_access_admin_page')) {

    In other words, the first few lines of the plugin should now look like this:

    Plugin Name: WP-ShortStat
    Plugin URI: http://dev.wp-plugins.org/wiki/wp-shortstat
    Description: Track your blog stats. Based on <a href="http://shortstat.shauninman.com/">Shaun Inman's ShortStat</a>.
    Version: 1.3
    Author: Jeff Minard
    Author URI: http://jrm.cc/

    if( !function_exists('is_admin_page') ) {
    function is_admin_page() {
    if (function_exists('user_can_access_admin_page')) {
    return true;
    else {
    return false;

  8. davidchait
    Posted 10 years ago #

    Or, just check if /wp-admin is in the current request... That'd work too.


  9. jennmiller
    Posted 10 years ago #

    Or just use the actual Shortstat and not the plugin.

  10. nnutter
    Posted 10 years ago #

    I just wanted to confirm filosofo's fix. wp-shortstat started working.

  11. notphotomatt
    Posted 10 years ago #

    I switched out the two lines and started getting the following error:

    Parse error: syntax error, unexpected T_DNUMBER in /wp-content/plugins/wp-shortstat.php on line 98

    I swapped the two lines back and still got the error. So I deleted the plug-in. I also have the Google Sitemap file. So what's the answer? Thanks for any help.

  12. yosemite
    Posted 10 years ago #

    I still have to comment out line 95 (with above fix) to get shortstat 1.3 to work.

    // || check_admin_referer()

    And that's regardless of whether I use check_admin_referer or user_can_access_admin_page (On either line 13 or 95).

  13. notphotomatt
    Posted 10 years ago #

    Commenting out the line (88 in my case) worked.

  14. Kongtechnology
    Posted 9 years ago #

    filosofo fix is perfect. The stats on my blog started working! Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic