Home mail me! RSS Feed RSS Comments Feed

WordPress Plugins

So far I’ve only written one plugin for WordPress, Comment Analysis, which provides a suite of functions for displaying various statistics about the comments on your blog. Full details for it are below. When I get around to writing more plugins I’ll add them here.

Lorelle has suggested that plugin users should show their love by giving plugin authors money, the virtual equivalent of taking them out to dinner. This is a noble and appreciated sentiment, but I’m happy with just an occasional “Hey, thanks for doing this, you rock” comment or email. If you really feel the need to part with some of your money then it would make me really happy if you made a donation to the WWF or the Sierra Club.

Comment Analysis

This plugin contains a suite of functions which examine the comments on your blog. The plugin is now hosted in the wordpress.org repository, here:

Installation

  1. Download the appropriate version using the above link
  2. Put it into your /wp-content/plugins/ directory.
  3. Activate the plugin from your WordPress admin ‘Plugins’ page.
  4. Make use of the functions in your template (see examples below).

Function Reference

ca_comment_count()

Show total count of comments for your blog, excluding pingbacks and trackbacks.

ca_pingback_count()

Show total count of pingbacks for your blog.

ca_trackback_count()

Show total count of trackbacks for your blog.

ca_spam_count()

Show total count of comments marked as spam. (Version 2.1 only)

ca_comment_last ($format=”)

Show date of last comment. The optional parameter allows you to format the date using standard date formatting.

ca_pingback_last ($format=”)

Show date of last pingback. The optional parameter allows you to format the date using standard date formatting.

ca_trackback_last ($format=”)

Show date of last trackback. The optional parameter allows you to format the date using standard date formatting.

ca_commentor_latest ($count=10, $exclude=”, $before=’<li>’, $after=’</li>’)

Shows latest $count commentors, with links to their websites if provided. $exclude is a comma separated list of commentors not to include in the list. $before and $after define the tags which will be output at the start and end of each line.

ca_commentor_most ($count=10, $exclude=”, $before=’<li>’, $after=’</li>’, $before_count=’(', $after_count=’)')

Show the top $count commentors, with links. $exclude is a comma separated list of commentors not to include in the list. $before and $after define the tags which will be output at the start and end of each line. $before_count and $after_count define the text which will appear around the comment comment count.

ca_comment_latest ($count=10, $length=60, $before=’<li>’, $after=’</li>’, $linktext=’Go’)

Shows the first $length chars of the latest $count comments. $before and $after define the tags which will be output at the start and end of each line. $linktext defines the text of the link which takes the user to the full comment.

ca_comment_latest_posts ($count=10, $show_count=’yes’, $before=’<li>’, $after=’</li>’, $before_count=’(', $after_count=’)')

Show the latest $count posts with comments (with a count of comments if $show_count is not no. $before and $after define the tags which will be output at the start and end of each line. $before_count and $after_count define the text which will appear around the comment comment count.

ca_comment_most($count=10, $show_count=’yes’, $before=’<li>’, $after=’</li>’, $before_count=’(', $after_count=’)')

Show the top $count commented posts (with a count of comments if $show_count is not no. $before and $after define the tags which will be output at the start and end of each line. $before_count and $after_count define the text which will appear around the comment comment count.

ca_author_most ($count=10, $exclude=”, $before=’<li>’, $after=’</li>’, $before_count=’(', $after_count=’)')

Show the top $count authors on your blog (with a count of posts written). I realise this isn’t comment related, but someone asked for it and I was too lazy to write a new plugin for it. $before_count and $after_count define the text which will appear around the comment comment count.

Example

To add lots of comment data to your sidebar you could edit your sidebar.php and add the following code:

<ul>
<li>Total comments: <?php ca_comment_count(); ?></li>
<li>Total pingbacks: <?php ca_pingback_count(); ?></li>
<li>Total trackbacks: <?php ca_trackback_count(); ?></li>
<li>Last comment: <?php ca_comment_last(); ?></li>
<li>Last pingback: <?php ca_pingback_last(); ?></li>
<li>Last trackback: <?php ca_trackback_last(); ?></li>
<li>Latest comments
<ul><?php ca_comment_latest(10,23); ?></ul>
</li>
<li>Latest commented posts
<ul><?php ca_comment_latest_posts(10); ?></ul>
</li>
<li>Most commented posts
<ul><?php ca_comment_most(10); ?></ul>
</li>
</ul>

December 15, 2006 @ 10:04 am

Be Lambic or Green » Comment Analysis said

[...] I finally got around to documenting the plugin properly, so you can read more about it here. [...]

February 1, 2007 @ 5:47 pm

Comment Analysis 2.1 WP Plugin : BlogBuster said

[...] ret så avanceret stykke værktøj, som kan give en del statistik over de kommentarer du modtager på din WP weblog. Af: admin | [...]

February 1, 2007 @ 10:53 pm

Lorelle said

This is a neat idea and very versatile looking Plugin. One tiny recommendation. Could you make the first paragraph be ALL about the Plugin and what it does and move the compensation request lower. That will help immediately explain to folks what this does and all the possibilities they can do with it. Use a lot of words. ;-) You can then delete this.

Good luck with it!

February 2, 2007 @ 1:36 am

Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 2/02 said

[...] Comment Analysis contains a suite of functions which examine the comments on your blog. [...]

February 2, 2007 @ 4:18 am

ad said

Nice Plugin, Thanks.

The Download doesn’t work on FF2.0, Win, so i have to copy and paste the code in a new file.

February 4, 2007 @ 7:55 am

WPã®ãƒ—ラグイン:Comment Analysis | Standing Tall said

[...] ダウンロード:Be Lambic or Green » WordPress Plugins [...]

February 5, 2007 @ 3:27 am

Hacks, Information, and More » WordPress Plugin Releases for 2/02 said

[...] Comment Analysis contains a suite of functions which examine the comments on your blog. [...]

February 8, 2007 @ 9:27 am

ad said

I’ve got a community blog (apfelquak.de) and i’m looking for plugin similar like the function Top Commentors - but Top Authors. Something that’s showing the authors with the most postings.

Maybe you’ve got an idea?

February 8, 2007 @ 11:58 am

lambic said

ad, I’ve added the function ca_author_most to this plugin for you.

February 8, 2007 @ 2:49 pm

ad said

Wow, cool!

Thank you very much! :)

February 8, 2007 @ 3:31 pm

ad said

Works fine!

http://www.apfelquak.de/

February 13, 2007 @ 2:58 am

Plugin Parade - Reloaded » admartinator.de said

[...] Plugin Comment Analysis könnte man auch in die nächste Kategorie einordnen. Es zeigt umfassende [...]

February 15, 2007 @ 3:47 pm

links for 2007-02-03 en newdisco said

[...] Be Lambic or Green » WordPress Plugins Plugin de Wordpress para obtener estadisticas de los comentarios, a diversos niveles… chori… (tags: wordpress plugin plugins comments) [...]

February 28, 2007 @ 9:16 pm

Grant said

great plugin…

anyway to exclude certain commentors - like say the author/admin of the blog?

February 28, 2007 @ 9:19 pm

lambic said

Grant, some of the functions have an exclude parameter which takes a comma separated list of authors to exclude.

March 5, 2007 @ 1:44 pm

Angetreten: Plugins auf Station » Station 9.111 said

[...] Comment Analysis -> Bietet einige Funktionen für unterschiedliche Kommentarstatistiken, z.B. für den Einbau in die Sidebar (letzte Kommentare, Top-Kommentatoren, etc.). [...]

March 21, 2007 @ 3:11 am

Vinod Ponmanadiyil said

Thanks buddy!. I have used this plugin to create a ‘popular post’ option.

March 28, 2007 @ 3:24 am

ad said

I’ve modified the Top Commentors section a little bit, because it didn’t work well.
Better use the email address for this, because some of the commentors don’t have an URL:

$comments=$wpdb->get_results(”SELECT comment_author_email
, comment_author_url
, comment_author
, COUNT(*) cnt
FROM $wpdb->comments
WHERE comment_approved = ‘1′
AND comment_type NOT IN (’pingback’,'trackback’)
GROUP BY comment_author_email, comment_author
ORDER BY 4 DESC”);

April 1, 2007 @ 9:20 am

Anton Blog » Wordpress : add comments plugin said

[...] http://www.lambic.co.uk/blog/wordpress-plugins/  This entry is filed under Belajar WP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. Prev/Next Posts « Wordtracker Keyword Research Guide | Home Leave a Reply [...]

April 3, 2007 @ 3:30 am

links for 2007-04-02 | Endl.de | Zielpublikum Weblog said

[...] Be Lambic or Green » WordPress Plugins Kommentatoren Statistik für Wordpress (tags: blogs wordpress) Artikelansicht: Artikel anzeigen Blog-Tags: No Tags Kommentare: Abgelegt unter: Links Trackback-Link: TrackBack-URI Artikel-Adresse: Permalink-URI  Keine Kommentare - jetzt Kommentar schreiben » Noch keine Kommentare. RSS-Feed für Kommentare zu diesem Beitrag. Einen Kommentar hinterlassen [...]

April 5, 2007 @ 3:23 am

The Daily Blitz » Blog Archive » Great Wordpress Plugins We Use said

[...] Comment Analysis by Mark Styles Wordpress doesn’t contain any functionality to tally up how many comments each person has written; or how many comments each post has. This plugin neatly compiles several lists into custom top-10 lists for you. [...]

April 19, 2007 @ 4:05 pm

Steve Wordpressguy said

Nice plugin, very versatile, just came in VERY handy!

April 19, 2007 @ 4:54 pm

Wordpress guy is one month old : Wordpress guy said

[...] is always a backlink, so here you go guys! (If I missed you, I’m sorry, blame this neat plugin, I was [...]

April 21, 2007 @ 10:38 am

Die besten WordPress Plugins - Kommentare » Tipps zur Suchmaschinenoptimierung said

[...] Comment Analysis Produce various comment statistics. [...]

April 23, 2007 @ 7:56 am

Davide Maggio said

Hi, I tried to use Your plugin puttin’ the code in a text widget but it doesn’t work (as i tought). Could You suggest me something to make it work? I tried unsuccessfully EXEC-PHP. What to do? :-)

April 23, 2007 @ 6:52 pm

lambic said

I’ve never used widgets, so I can’t tell you. I am however planning on widgetizing it at some point in the future.

April 27, 2007 @ 11:50 am

Fepe said

Great Plugin :). Thanks

April 28, 2007 @ 11:11 pm

Great Wordpress Plugins We Use » The Daily Blitz said

[...] Comment Analysis by Mark Styles Wordpress doesn’t contain any functionality to tally up how many comments each person has written; or how many comments each post has. This plugin neatly compiles several lists into custom top-10 lists for you. [...]

May 17, 2007 @ 2:50 pm

Louis said

Ho do you do to avoid a [br/] between the name of the commentator and the count?

Thanks.

May 17, 2007 @ 3:12 pm

Louis said

Hmmm. I think I understand that [li]…

But is it possible to write something beside the the count?

My main problem is that if I exclude nobody, I get people with a web site and the count UNDER their name, and people without a web sit with the count BESIDES their name. It’s not very beautiful to the eye. Is it possible to always put the count UNDER the name AND to add a text besides the comment.

Example:

John
(154 comments)

Thanks.

May 17, 2007 @ 3:14 pm

lambic said

As you can see in my rightmost sidebar, all the names have the number of comments right next to them, so I’m not sure why you’re getting something different.

May 17, 2007 @ 4:41 pm

Louis said

Hi,

I think it is because of my theme…

But that would be ok, as long as I would be able to add some texte besides each count and be able to “format” the thing so as people with no URL would appear the same as people with URL…

Thanks.

May 17, 2007 @ 7:29 pm

Louis said

Would you be kind enough to show me what code I could add to be able to display the count and text e.g. John (453 comments) instead of John (453)

Thanks. Great plugin certainly.

May 18, 2007 @ 9:13 am

lambic said

Louis, I’ve added $before_count and $after_count parameters to the functions which show counts after names. By default they are ( and ), but you can change them to whatever you want.

May 18, 2007 @ 11:46 am

Louis said

Thank you very much!

Where exactly do I put this?

I tried:

function ca_commentor_most ($count=10, $exclude=”, $before=”, $after=”, $after_count=’commentaires’) {
global $wpdb, $comment;

$comments=$wpdb->get_results(”SELECT comment_author_email
, comment_author_url
, comment_author
, COUNT(*) cnt
FROM $wpdb->comments
WHERE comment_approved = ‘1′
AND comment_type NOT IN (’pingback’,'trackback’)
GROUP BY comment_author_email, comment_author
ORDER BY 4 DESC”);

$excludes=explode(’,', $exclude);

foreach($comments as $comment) {
if (!in_array($comment->comment_author, $excludes)) {
echo $before;
comment_author_link();
echo ‘(’.$comment->cnt.’)’.$after;
if (++$ccount == $count) break;
}
}
}

but does not work… I’ll try to put the $after_count elsewhere, but I am not sure exactly where I need to put it. I don’t know much about code writing as you can see… Still learning :)

May 18, 2007 @ 11:56 am

Louis said

Ok I’ve redownloaded the new code and I see the change you’ve made:

… $after=”, $before_count=’(', $after_count=’)')…

I tried to add text here

$after=”, $before_count=’(', $after_count=’text’)')

didn’t work

Tried this way

$after=”, $before_count=’(', $after_count=’text)’)

didn’t work either.

I think I should get some coding class soon… lol You must be laughing reading this :P

May 18, 2007 @ 12:30 pm

Louis said

It works!! Thanks a lot! Looks great now!

:D

May 23, 2007 @ 9:42 am

  Comment Analysis Plugin said

[...] Download : here [...]

May 30, 2007 @ 7:20 pm

  links for 2007-05-30 by SridhaReena said

[...] Be Lambic or Green » WordPress Plugins contains a suite of functions which examine the comments on your blog. (tags: wordpress plugin comments) [...]

June 6, 2007 @ 8:26 pm

Hedi said

Very useful plugin, discovered it via Lorelle’s blog!

Thanks!

July 1, 2007 @ 10:35 am

nakliyat said

But I couldn’t download :(

July 1, 2007 @ 12:47 pm

lambic said

Why not?

July 1, 2007 @ 6:19 pm

WordPress Plugins said

[...] Comment Analysis [...]

July 25, 2007 @ 6:28 am

Website Design Bolton Manchester said

Excellent plugin…!

July 27, 2007 @ 3:03 am

musnazdotnet said

Excuse me, err… what’s the ‘top commentors’ code again? when i’m copiying all the codes below, theres no ‘top commentors’ included :(

Total comments:
Total pingbacks:
Total trackbacks:
Last comment:
Last pingback:
Last trackback:
Latest comments

Latest commented posts

Most commented posts

sorry… i’m really a newbie here :D

July 27, 2007 @ 9:37 am

lambic said

ca_commentor_most ($count=10, $exclude=â€, $before=’<li>’,$after=’</li>’,$before_count=’(’,$after_count=’)’)

Show the top $count commentors, with links. $exclude is a comma separated list of commentors not to include in the list. $before and $after define the tags which will be output at the start and end of each line. $before_count and $after_count define the text which will appear around the comment comment count.

August 1, 2007 @ 3:15 pm

evden eve nakliyat said

ı couldn t download how is it work

August 1, 2007 @ 3:40 pm

lambic said

Why couldn’t you download it?

August 7, 2007 @ 11:30 am

Website Promotion, Affiliate Marketing and .Net Development Blog: » Blog Archive » New Blog Template And Some Behind The Scenes Changes said

[...] of the blog, but also the last five comments that are posted. If your interested in the plug, the authors site is here. Remember guys those links now also pass on [...]

August 10, 2007 @ 6:23 pm

ana said

I would like to display the last comments posted, followed by the name of the person who posted them and the blog post title to which they related. How can I do that?

August 10, 2007 @ 9:11 pm

lambic said

ana, ca_comment_latest will do most of that for you, but it doesn’t show the title of the blog post the comment is related to. If I get a chance I’ll add an option to do that.

August 28, 2007 @ 12:05 pm

videokeman said

hi lambic, i ave been using your plugin for a week and it works very great! thanks a lot for creating such a handy plugin.

can i use the ‘$exclude=’ option for the ‘ca_comment_most”? i have some posts that i wanna exclude in the generated list.

and what variables should i fill in on the ‘$exclude=’? can i use the post_ID?

thanks so much.

August 31, 2007 @ 5:25 am

manele said

i can’t download the file :( can you fix it please?

September 10, 2007 @ 3:08 pm

lambic said

videokeman: Sorry that function doesn’t have the $exclude option, but I’ll add it to my todo list.

manele: what problem are you having?

September 15, 2007 @ 4:04 pm

evden eve nakliyat said

hmm ok ı understand problem thanks

September 18, 2007 @ 5:50 pm

simon from sardinien said

Hi lambic,
thanks for your great work. I love your plugin, keep the good work going.

October 13, 2007 @ 4:49 pm

Google Reklam said

Thank you

can i use the ‘$exclude=’ option for the ‘ca_comment_most� i have some posts that i wanna exclude in the generated list.

and what variables should i fill in on the ‘$exclude=’? can i use the post_ID?

this code

October 15, 2007 @ 3:22 pm

lambic said

no, ca_comment_most doesn’t currently have the $exclude parameter, it’s on my todo list.

October 24, 2007 @ 6:45 pm

GreenA said

Please fix :)
function ca_author_most ($count=10, $exclude=”, $before=”, $after=”, $berfore_count=’(', $after_count=’)') {

thanks for the plugin

October 28, 2007 @ 2:51 pm

Pritesh Patel said

Nice plugin - thanks.

November 7, 2007 @ 6:48 am

Evden Eve Nakliyat said

i coludnt ‘top commentors’ code? Can you please write again?

November 20, 2007 @ 8:46 am

ad said

Hi Mark,

ist it possible to integrate the author’s url in “ca_author_most”?

Would be great! :)

Thx
Martin

December 6, 2007 @ 8:53 am

zac said

thanks for the great plugin. just wondering is it possible to have option to remove the nofollow in the links? for example used together with ca_comment_most to encourage readers to post more comments.

December 6, 2007 @ 10:31 am

lambic said

You’re probably better off using one of the plugins that removes nofollow. I use DoFollow by Kimmo Suominen

December 13, 2007 @ 4:14 am

Mark said

Do you have a way to restrict the “Most Commented Posts” (ca_comment_most) to a specific time frame? If not, what do you think the best way to go about that would be?

I’m after something for the last 24 hours and can’t think of an efficient way to do it.

December 13, 2007 @ 11:58 am

lambic said

I’ve added two new parameters to ca_comment_most:

$exclude - can contain a comma separated list of post IDs to exclude from the query

$hours - if this is not zero then the query will only look at comments posted in the last $hours hours.

December 15, 2007 @ 4:59 am

houserocker said

thanks for this great and very easy to use plugin!!

January 1, 2008 @ 7:29 am

coutie said

Thanks for that great plugin!!! Was searhin for something like that for along time!!!

February 2, 2008 @ 9:54 pm

Innstikk som blir brukt på norske plugins | Norske plugins said

[...] Comment Analysis Dette innstikket er også ganske omfattende, og man kan presentere / analysere kommentarene som blir gitt på bloggen, og også dets forfattere, på en mengde forskjellige måter. Jeg bruker dette for å vise de som skriver flest kommenaterer, men det er også mange andre funskjoner man kan bruke. [...]

March 7, 2008 @ 8:02 am

manele noi said

great plugin…works fine.. ;)

March 8, 2008 @ 5:21 pm

radiohode said

Your plugin is great, but I have a small problem. By using the inline php plugin, I’ve been able to present the ca_commentor_most in a static page. However, the margins are a problem. Where in the php file can I adjust this?

Take a look here if you wonder how it looks:
http://radiohode.org/tallting/

March 9, 2008 @ 1:34 am

lambic said

Margins are a CSS issue, you probably need to tweak your stylesheet

March 15, 2008 @ 8:58 am

radiohode said

What class is this plugin using? Or do I have to make a new class for it?

March 17, 2008 @ 8:52 am

lambic said

I don’t do any styling, you’ll need to define your own class for whatever structure you choose to use to display the results. By default I output lists with <li> tags around each item, so you can add a class to your <ul> definition, or you can override that default and use whatever structure you wish.

March 26, 2008 @ 5:06 am

burnio fashion news said

great plugin, did help me a lot!!!

April 23, 2008 @ 8:53 am

dog lover said

This is a nice plugin. Also check out comment luv plugin. Works great as well.

April 28, 2008 @ 8:19 pm

Online Seo Service » Wordpress Plugins said

[...] Comment Analysis 2.5 [...]

June 25, 2008 @ 3:07 pm

lambic said

I’ll look into adding those when I have a few spare minutes

June 29, 2008 @ 3:50 pm

Wordpress 2.5 Uyumlu Eklentiler (Liste) | Wordpress Tema Ve Eklenti said

[...] Comment Analysis 2.5 [...]

July 6, 2008 @ 11:43 am

wordpress 2.5 Uyumlu Eklentiler Listesi | Nazlı Reklam Reklam ve Hosting said

[...] Comment Analysis 2.5 [...]

July 6, 2008 @ 5:38 pm

Wordpress 2.5 Uyumlu Eklentiler Listesi | Taha'nın Yeri said

[...] Comment Analysis 2.5 [...]

July 19, 2008 @ 7:25 pm

Jarek said

Great plugin! Congrats!:) I’m using version 2.1 and found a bug - in ca_author_most left bracket cannot be displayed because of spelling error in the plugin file. Probably you found that years ago. Anyway, thank you very much, you rock!:)

July 23, 2008 @ 10:46 pm

Advice for the noob in choosing the best WordPress Plugins | Alex Higgins Blog said

[...] Comment Analysis WordPress Plugin is a comment statistics plugin that can show total comments, most popular comments, number of ping backs, track backs, spam comments and more. Again this one goes into the usability category. [...]

July 29, 2008 @ 5:14 am

Wordpress 2.5+ Uyumlu Eklentiler (Liste) - Yorumla.Net said

[...] Comment Analysis 2.5 (Yorumlar için geniþ bilgi sunan eklenti). [...]

August 4, 2008 @ 8:18 am

shopping said

I think it’s good to reimburse guys who create such amazing plugins for the rest of us to use for nothing. But it really is up to them. I appreciate your heart on this thing, and I’m glad you mentioned at least some option – donating to the WWF or Sierra. As for the plugin, it seems nice and neatly done. A lot of plugins can be quite a pain, because the rough edges don’t seem to be ironed out very well or whatever. This looks like it might be a good one.

August 6, 2008 @ 6:40 pm

Wordpress eklenti listesi | h7x Software & Technology Center said

[...] Comment Analysis 2.5 [...]

RSS feed for comments on this post · TrackBack URI

Leave a Comment