Blog Stats Plugin for WordPress

April 9, 2008

WP DashboardIn addition to a visual overhaul, WordPress 2.5 added several new plugin hooks, including a widgetized dashboard. The new Blog Stats Plugin for WordPress adds blog stats to the dashboard, and makes integrating the tracking code into a theme simple.

It’s also the first use of W3Counter’s “visitor labeling” I previewed in October (spooky visitor labeling). By using the plugin instead of inserting the tracking code manually, the names of any previous commentors on your blog is picked up from the cookie WordPress sets and passed on to W3Counter.

Creating a dashboard widget was surprisingly easy. Of course, most of the code isn’t in the plugin — I just fill the widget’s box with an iframe that pulls up the stats from a specially formatted w3counter.com page. Some JavaScript trickery passes in the width of the box on your screen — if it’s narrow, you get two columns of stats, but if your window is approximately 800 pixels or wider, you get three.

If you’re using W3Counter on your blog, and have upgraded to WordPress 2.5, download it now.

12 Responses

  1. Very nice, Dan! I’d imagine this will quickly become a rather popular plugin. Also surprising is the number of spam comments you have had Akismet caught. :)

  2. Hey Dan. Looks like a great plugin. I was going to do a post about it on my blog but the wordpress plugin doesnt seem to be working. I installed the plugin in 2.5 wp powered blog and entered my code but stats are not being tracked.

    Any ideas what could be wrong?

    Kevin

  3. For tracking, the plugin adds a sidebar widget with the tracking code. You have to add the widget to your theme in the widget management page for it to show up.

  4. I don’t like using widgets, I prefer to just add the code directly. Do you know the code to place the stat code in my footer or something. I can just use the standard w3counter code but I wanted to integrate it with the wp dashboard

    thanks dan

  5. The standard tracking code is all the widget is inserting. You don’t need special code to use the dashboard, it’s coming right from your W3Counter account.

  6. Oh right. I thought the widget added the tracking code directly. My bad. I’ve got the code installed now. I’m sure ill see stats shortly :)

  7. Niiiiiice Dan. Going to install it now. Been waiting for this one!

  8. I use shortstat on all my WP blogs. It’s not very detailed, and I do check server stats on top of that and even have GA on the more important sites, but it does give you a good quick glance at traffic.

    Will try this one out though, on my 2.5 blogs. Not too many of those yet, Call me a conservative, but I’m not too fond of the new admin interface.

  9. Hi Dan, I was happy to come across this plugin whilst browsing the WordPress website.

    I created an account with W3Counter and was happy to see it tracking my stats right away.

    I proceeded to upload the plugin as instructed and added the widget to my sidebar, the counter graphic has appeared happily.

    My admin dashboard loads the area reserved for your plugin is displaying, a blank box and no stats (that are viewable on W3Counter.com)

    I suspect this may have something to do with the WordPress Dashboard Widgets displaying “Loading…” (WordPress Development Blog, Incoming Links, Plugins) but would like to run it past you incase you are across this issue whilst I wait for WordPress to reply.

    Many thanks, and keep up the good work, Scott

  10. Hi Dan. I’ve tried this in 2.5.1, but I keep getting a 404 error message from the server at W3 counter saying the page doesn’t exist.
    Plugin activated fine, the screen is there for the stats but only the 404 message shows. I’ve inserted the URL correctly, tried it with and without a password {stats are public} and I’m still not having any luck.
    Bit puzzled here
    Cheers
    Maureen

  11. it’s awesome plugins. thanks

  12. Plug in dont works on Wp 2.7.1
    Warning: extract() [function.extract]: First argument should be an array in /mounted-storage/home63a/sub001/sc12372-ILOB/xxxxxxx/wp-content/plugins/w3counter.php on line 99

Leave a Reply