Christian Little

Information on Everything!

Comment Stats Plugin for WordPress – Made by Me!

By Christian Little • Sep 26th, 2008 • Category: Wordpress

This is my first attempt at creating a WordPress Plugin, and I think it actually turned out pretty decent for the 4 hours I spent building it.

The standard comments page and dashboard in the WordPress admin panel will give you some very basic information on your comments, such as how many comments you’ve received, how many are awaiting moderation, and how many Akismet has blocked (if you use that plugin). But I wanted to take this a step further, I wanted to see detailed stats on the comments made to my blog, not just a few basic summary figures.

So here is the Comment Stats plugin:

Comment Stats Plugin for WordPress

It basically breaks down statistics on your blog comments since the launch of your blog, and displays it as a monthly report. This very simple interface shows you the following information:

  • Period is the Month and Year. Let me make it clear here – this plugin will show you the stats for every year and every month since your blog has been in operation, not since you installed this plugin. It doesn’t collect this information, it uses the internal data that WordPress keeps in it’s database, as such you can install this right now and see stats on comments from 6 months ago if your blog existed back then!
  • Approved Comments is how many comments were posted and approved on your blog (Approved meaning not blocked by a spam filter and not deleted – an Approved comment is one that actually appears under your blog posts).
  • Posts Discussed tells you how many posts during the specific period received at least 1 comment.
  • Commentator Names tells you how many different Names (anchor texts) were entered by your commentators.
  • Emails tells you how many unique email addresses were entered by your commentators.
  • URL’s tells you how many unique URL’s were entered by your commentators.
  • IP’s tells you how many unique IP addresses were used to leave a comment.
  • Most Commented Post(s) shows you which of your posts received comments (and how many) during the period.

IMPORTANT NOTE: I want to make this very clear so there is no confusion – it is common for a post to receive comments over a period of several months (maybe even years). If you have a blog post like this, expect to see the blog post show up in each period under the Most Commented Post(s) section each month, listing how many comments it received during that specific month.

IMPORTANT NOTE #2: I am going through the process of getting this plugin listed in the offical WordPress Plugin Directory, and once it is listed you can automatically download upgrades to the plugin without having to check this site (woohoo!). However I have never done this before, so until it gets approved and entered into the directory, please check back on this posting from time to time for updated versions.

If you spot any problems with the stats, or would like to see additions made to it, please comment on this posting. I have several other reports that I plan to include to upgrade this plugin, but I only have so much time at once and would love to hear how your ideas on how I can make it better for you.

Updates/Version Control

What is Wrong with the Version Number?

The initial version of this plugin is “One”, not “1.00″ that you typically see with other plugins. Why? Because I felt like being different, but once this plugin gets approved by WordPress.com I may shift it over to the more conventional version standards.

Revision History
“One” released on Sept 25, 2008. It has the groundwork for future upgrades and displays a single report, showing statistics for all months. Upgrades are planned for the near future.

Installation Instructions

It’s so easy! Just follow these steps:

  1. Download the zip file below, unzip it to your “wp-content/plugins” directory.
  2. Login to your WordPress Administration panel, click on Plugins, and click on Activate next to the “Comment Stats” plugin

Comment Stats Plugin

Once you have followed those two simple steps, just go to the Comment Stats page, which will appear under the Comments section.

Now I should issue some sort of warning here, if your blog is over a year old and gets hundreds of comments each month, it may take a minute or two for the stats page to generate. It also depends on your server, as all the data is pulled in real time.

For you PHP geeks out there, the speed of this plugin is 1+n mysql queries, where n is the number of months that your blog has been in operation. So a blog that has been up for 7 months will run 8 queries in MySQL to generate the stats, and if you get 100+ comments per month you are looking at processing 7 months x 100 comments = 700 rows of data from MySQL. To be honest, unless you have several thousand comments this shouldn’t really be an issue at all.

Yeah, Yeah, Where’s the File Already

The link is below, but before you download it I want to reiterate a few points on this:

  1. This is a beta version plugin. I haven’t found any bugs, but chances are you good people will. If you do, please leave a comment below (be sure to include your email address in the right field so I can contact you if needs be).
  2. Until this plugin gets approved by the WordPress Directory, please check back every 2-3 weeks for updated versions. I will make a huge update to this page once it has been moved to the official directory, after which point you can do automatic upgrades!
  3. Lastly, this plugin was only tested on Wordpress 2.6.0+ versions. I do not expect it to work on earlier versions (besides, you should always have the most up-to-date installation).

CLICK HERE TO DOWNLOAD THE PLUGIN


Christian Little is a web monkey and owner of this website. Aside from blogging about webmastering, SEO, and marketing, he spends his time with his family, running too many websites, playing counter-strike, and provides SEO consulting for a few select clients around the world.
Email this author | All posts by Christian Little

8 Responses »

  1. You have done nice job Christian good luck :)

    make money onlines last blog post..Earncow Contest Needs Gifts from Sponsors

    Rate this comment:
    2.5
  2. Nice plugin. Nice work.

    Rate this comment:
    2.5
  3. This plugin has been approved for the official directory, woohoo! I’ll be updating it and putting it into their repository soon!

    Rate this comment:
    2.5
  4. Hello,
    I am, John
    great posts on here
    my site:

    http://ZNHcYS7.spaces.live.com/

    Rate this comment:
    2.5
  5. Pingback from christianlittle.com/spam/learn-the-full-benefits-of-your-softwareplugins on November 26th, 2008 at 5:37 pm
  6. Hi. Your site displays incorrectly in Firefox, but content excellent! Thanks for your wise words :)

    Rate this comment:
    2.5
  7. Does this work with WPMU? I keep getting the error:

    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/brooklyn/public_html/bp/wp-content/plugins/comment-stats/comment-stats.php on line 63

    Rate this comment:
    2.5
  8. Got the same problem from ratpack, but I’m using the latest Wordpress, version 2.9.1, not MU.

    Strange :(

    Rate this comment:
    2.5

Leave a Reply