After yesterday’s upgrade I decided to enable the WP-ShortStat plugin, which seems to come bundled at least with version 2.0.6 (maybe even earlier, but I did not notice). I was quite surprised why, after I enabled it, its tables remained empty and the stats (logically!), were zero too.
Since I know that my blog does not have _that little_ visitors (well, at least I visit it, don’t I?), I decided to look for the reason. After some hacking through the code, I saw that because of some reason, this plugin looks for the function ‘is\_admin\_page’ and if such function is not defined, it defines it. Obviously, something was wrong with that function, because my debugging showed that if I just remove the call to it, everything goes smooth.
I did not want to search more. I have no idea what is going wrong, and honestly – I do not care. I even tend to think that the function is totally useless, since the plugin detects quite well the ‘admin pages’ by looking for ‘wp-admin’ in the page URL. What is important for me after the whole research is that my counters started to go up :).
If you observe the same problem and if you share my thoughts, you may try to fix your wp-shortstat.php file. It’s simple:
* Open the file in an editor
* look for “is\_admin\_page()” in this file. You will find a fragment, which will look like:
|| strstr($_SERVER['PHP_SELF'], 'wp-admin/')
* Once you find this fragment, delete the line “|| is_admin_page()”, or if you want to be good boy/gal, just add two back slashes _//_ in front of it like that:
|| strstr($_SERVER['PHP\_SELF'], 'wp-admin/')
* Save the file. You’re done. The thing should immediately start counting your visits.