/SparkStats Wordpress Plugin

(Latest version: v0.3.1 - 17 Aug 2006)

SparkStats is a plugin for the Wordpress blogging platform. SparkStats uses the Sparkline PHP Graphing Library to generate word-like graphs that represent the posting and commenting activity on your blog over a period of days, weeks, or months. Sparklines are small, lightweight bits of graphical information, perfect for adding a little statistical information and visual style to your blog at the same time.

What Do They Look Like?

SparkStats are very simple bar graphs. Each bar represents a different day, week, or month, with the height of the post showing the number of posts published during that interval and the varying color of the bar showing the number of comments received during that interval. The current interval’s bar (on the far right) can be colored differently for ease of interpretation. Below is an example of a SparkStats graph.

SparkStats Example

You can see a live example of SparkStats in action over at alwaysBETA.

Download Current Version - v0.3.1

Click here to download the current version of SparkStats.


SparkStats has only been tested with Wordpress 2+. Versions like 1.5.X might work too, but there are no guarantees.

Upgrade Instructions

To upgrade to the newest version of SparkStats, you should just replace all of the files in the plugin folder with the newest files (with the exception of the statslegend.gif image.) Then navigate to the options page and check out the new features!

Installation Instructions

To install and use SparkStats, just follow these easy steps:

  1. Upload the sparkstats folder to your Wordpress plugins directory.
  2. Make sure the sparkstats folder is writable by PHP on your server. (chmod 755 should work.)
  3. Activate the plugin from your admin interface.
  4. Go to Options->SparkStats in your admin interface and adjust the options to your liking.
  5. Wherever you want the image to show up in your theme, just use code like this:
    <img src="<?php sparkStats_imgURI(); ?>" alt="SparkStats"/>
  6. You can also use the helper functions to explain the graph like this:
    Activity: Last <?php sparkStats_numIntervals(); ?> <?php sparkStats_intervalType(); ?>
    <img src="<?php sparkStats_imgURI(); ?>" alt="SparkStats"/>
  7. Optionally, you can also alter the statslegend.gif image in the plugin folder and include it in your theme with this code:
    <img src="<?php sparkStats_legendURI(); ?>" alt="SparkStats Legend"/>

By default, SparkStats will automatically rebuild your sparkline image once every hour (this can also be changed in the options). Submitting the options in the admin panel will also cause the image to be rebuilt.

If you’re having trouble and your server can’t create the image file in the folder, just drop a blank file called “curstats.png” into the plugin’s folder and make sure to chmod it to 666 or something similar.


  • v0.3.1 - (17 Aug 2006) Some bug fixes. Changes:

    • Fixed bug where unapproved comments (and spam) were counted.
    • Fixed bug where publishing posts in the future would cause a flatline.
    • Fixed a grammar error in the options screen (thanks Eli.)
  • v0.3 - (16 Aug 2006) First major revision. Changes include:

    • Bars can now represent days, weeks, or months.
    • The background color can now be set via an option.
    • The rendering interval can now be set via an option.
    • A live preview of the current SparkStats graph is now included on the options page.
    • “Invalid foreach” bug fixed.

    Many thanks to Steffen S, Joshua W, Stefan P, Eli F, Henri L, Piotr U, Sean H, Adrian G, Lech, Amit K, Billy G, Zac Z, and everyone else who sent be feedback on the first version. Sorry it took so long!

  • v0.2 - (21 Feb 2006) Initial public release.


Shoot me an email: sean (a) seanmcb (.) com.

Sean McBride
Engineer / Web Developer
Boston, MA - Billings, MT

"Old school is so yesterday..."

Subscribe to My RSS Feed