commentor-1 Commentor is a new BlogEngine extension that should make your life a little easier when you have problem with spam comments. At first, I simply wanted to try existing extension to filter spam. My intention was to use anti-spam service as automated moderator and workflow for the task supposed to be pretty simple and look somewhat like this:

  • Visitor submits comment
  • Extension validates it against anti-spam service
  • Valid comment gets published, spam is awaiting approval

But after closer look I found that this scenario runs into couple of road blocks in the existing BE implementation. So I started to look into ways for workarounds and ended up with extension that perfectly matches scenario I wanted with some extra features that others might appreciate too.

Here is how it all works. You download and extract ZIP archive, then copy files to the corresponding locations, the usual routine. Then go to Admin/Extensions and click "edit" link to get to Commentor settings page. The form on top let you select anti-spam service you want to use. It can be none - that means manual moderation. Or you can choose Waegis or Akismet as your spam filter. You going to need an application key to use any of those services, the good news is they both free for personal use. Once you get your application key, enter it into the text box along with URL of your web site, select service and save settings.

commentor-2

The reporting is useful feature that both services implement for on-the-job training. When it turned on by checking "Report mistakes back to service", it'll send missed spam or wrongly blocked comments to the service helping to improve filtering algorithm. First will be triggered by deleting any comment on the site, second - by manually approving comment in the Commentor admin page.

From now on, everything is going to follow simple work-flow I've described in the beginning of this post. All comments that did not get approval from anti-spam service will show up in the second section on the same settings page and won't be published unless you approve them. You can do bulk approve/delete too. And if you click "inspect" (blue button with "i" on it) it'll load comment details. The comment body itself is editable - you can censor it from there if you want to.

commentor-3

Commentor also keeps track on basic statistics - how many comments were blocked or approved. So, if you got annoyed with spam - try it. Let me know what you like/hate about this extension – I’m running it for a few days on my site and very satisfied with results, but there is always room for improvement.

Update (12/05/08): I’ve uploaded new version (1.1) that fixes couple of small issues you might run into, you can download latest using the same link below.

Commentor.zip (21.11 kb)

Share/Save/Bookmark
Signature

Comments

12/2/2008 2:48:49 PM #

Chris

Very nice!

I have previously installed the Waegis extension file into my App_Code folder.  Do I need to remove this before installing your extension?

Chris |

12/2/2008 3:11:14 PM #

rtur.net

Do I need to remove this before installing your extension?
Yes Chris, you should remove it. Commentor does all the Waegis calls and you'll get double counts on Waegis site plus possible side effects.

rtur.net |

12/2/2008 3:40:18 PM #

Ben Amada

Awesome extension!  I have a couple of new BE blogs that don't have a lot of comments yet, but I can definitely see this extension being very helpful.  I'll try it out.

Ben Amada |

12/2/2008 3:49:43 PM #

Keyvan Nayyeri

This is very nice.

Thank you for the helpful extension that offers better features for spam filtering Smile

Keyvan Nayyeri |

12/2/2008 4:39:55 PM #

Ben Amada

I'm having some troubles.  I put the files in the folders.  When I navigate to my blog, I first see the error described at http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=33524.  I've never experienced this before.  I was using the 1.4.5 BE DLLs, so I copied the 1.4.5.12 DLLs in my bin folder, but I still get this error the first time I hit the website, even though I thought this error was fixed in 1.4.5.12.  Error is "The process cannot access the file '...\App_Data\datastore\extensions\BBCode.xml' because it is being used by another process."

Anyways, after the initial error, I can go into Admin/Widgets, but when I click to Edit the Commentor, I get an error on line 146 of User controls\Commentor\Admin.aspx.cs.  The error is "Object reference not set to an instance of an object." because _settings is null.  Stepping thru the code, in LoadData(), at the line "_settings = ExtensionManager.GetSettings("Commentor");", null is being returned.  In GetSettings() (Manager.cs), the Commentor extension is in the _extensions List, but Settings.Count is 0 so the IF statement can't check if setting.Name == extensionName.

There is a Commentor.xml file in App_Data\datastore\extensions.  The content of the XML file is:



  1.0
  Commentor integrates comment moderation and spam filtering
  <a href="http://rtur.net">rtur.net</a>
  
  true
  true


I'll see if I can figure out why I'm getting these errors.  Just thought I'd post here in case anything comes to your mind.  Thanks.

Ben Amada |

12/2/2008 4:47:19 PM #

Ben Amada

Figured out my problem -- sorry about the last, long post.  The first error (The process cannot access the file ... because it is being used by another process.) was causing the second error.  I obviously needed to update more than just the BE DLLs to be at version 1.4.5.12.  After updating all the 1.4.5.12 files, the first error went away, and so did the second error.  Looking forward to giving the new extension a try!

Ben Amada |

12/2/2008 5:57:51 PM #

Keyvan Nayyeri

Rulsan,

I just wanted to ask for your permission to republish your extension on Waegis site with your name:

http://waegis.com/download/

Do you allow that?

Keyvan Nayyeri |

12/2/2008 8:45:49 PM #

Janko

Niiiiiice work! thanks!

Janko |

12/3/2008 12:38:22 AM #

trackback

Trackback from Web Development Community

Commentor - new extension for BlogEngine

Web Development Community |

12/3/2008 12:59:03 AM #

Al Nyveldt

Very cool Ruslan!  I'll try it out when I get the chance.

Al Nyveldt |

12/3/2008 1:39:22 AM #

rtur.net

I just wanted to ask for your permission to republish your extension on Waegis site
Sure, and thanks for Waegis - it is lightning fast and very intelligent.

rtur.net |

12/3/2008 2:12:53 AM #

Keyvan Nayyeri

Thank you, Rulsan Smile

Keyvan Nayyeri |

12/3/2008 2:42:06 AM #

Cristiano

Nice work Ruslan ! Laughing
This extension now is very useful, thank you Smile

Some question:
1) How are treated administrator's (editor) comments ?
2) Do you remember my extension to edit comments(http://www.cristianofino.net/post/comment-manager-extension-ovvero-come-modificare-i-commenti-con-BlogEngineNET.aspx#english) ?
We can merge this with your extension ?

Cristiano |

12/3/2008 3:00:10 AM #

rtur.net

1) How are treated administrator's (editor) comments ?
2) Do you remember my extension ... We can merge this with your extension ?

Cristiano,
1. if visitor logged in - there is no call to service. May be it should be optional - but I did not wanted to complicate interface.
2. I did look into your extension (unfortunately, too late - I could use some ideas from there). I think everybody would win if we team together and made a line: 1. commentor 2. manager 3. combination of two. What do you think?

rtur.net |

12/3/2008 3:17:33 AM #

Cristiano

1. if visitor logged in - there is no call to service. May be it should be optional - but I did not wanted to complicate interface.
Good choice !

I think everybody would win if we team together and made a line: 1. commentor 2. manager 3. combination of two. What do you think?
Yes, we can work together on this. Let me a bit of time to take a look on your code Wink
Meanwhile I found a conflict between your extension and my Adsenseinjector extension: I am investigating the causes ... :-(

Cristiano |

12/5/2008 9:55:06 AM #

Chris

Using your excellent tool I created an add-on extension which provides a blacklist of author names.  This way even if Waegis marks it as ham you can prevent obnoxious authors from leaving comments on your blog...

http://www.dscoduc.com/post/2008/12/04/Blacklist-Extension-for-Author-Names.aspx

Chris |

12/5/2008 4:19:54 PM #

ck

There needs to be a way to delete a comment without reporting it as spam.  Not all deleted comments are spam.

ck |

12/6/2008 4:13:49 AM #

rtur.net

I created an add-on extension which provides a blacklist of author names. This way even if Waegis marks it as ham you can prevent obnoxious authors from leaving comments on your blog...
This "Busby" thing really got us on the move ;)
There needs to be a way to delete a comment without reporting it as spam. Not all deleted comments are spam.
Sure - that's why I've added "report mistakes to service" option. Set it to false and delete all comments that aren't spam. Just don't forget to check it back after you done - it is really useful feature.  

rtur.net |

12/6/2008 4:08:00 PM #

ck

Just seems like that's an added step that can be avoided.

Delete - Just deletes
Report - Deletes and Reports...

ck |

12/10/2008 9:01:18 PM #

Anant Anand Gupta

Hi there,

i have just installed the extension. After placing all of my files in there required locations i went in the admin/extensions page. There when i clicked the Edit link. it gave me following error. Can you please help me out finding what might have went wrong.

Object reference not set to an instance of an object.

Line 156:        btnSave.Text = Resources.labels.saveSettings;
Line 157:
Line 158:        switch (_settings.GetSingleValue("SpamFilter"))
Line 159:        {  
Line 160:            case "Waegis":

- Anant Anand Gupta

Anant Anand Gupta |

12/11/2008 1:42:29 AM #

rtur.net

Anant, try to replace "Resources.labels.saveSettings" with "Save" in that file. It might be that resource in your language missing this entry. If it will work, you might add it to localized resource or just leave it hard-coded.

rtur.net |

12/11/2008 3:02:07 AM #

Anant Anand Gupta

Hi There,

sorry i missed out something in the previous comment, the error is coming in line 158. it seems that "_settings" object is not getting created.

this method is creating error while deleting the posted comments too. as i think the extension handles the events for adding and deleting both.

Anant Anand Gupta |

12/11/2008 3:04:51 AM #

Anant Anand Gupta

Here i am pasting the lines generating the error while deleting the comments:

Line 85:         // it means it passed anti-spam filter
Line 86:         // report it back to service as spam
Line 87:         if (bool.Parse(_settings.GetSingleValue("ReportBack")))
Line 88:         {
Line 89:             Comment comment = (Comment)sender;


Source File: d:\hosting\anantanand\anantanandgupta\App_Code\Extensions\Commentor.cs    Line: 87

Anant Anand Gupta |

12/11/2008 3:49:57 AM #

rtur.net

Anant, try to add this before the line that generates error:

if (_settings == null) InitSettings();

rtur.net |

12/11/2008 6:25:00 AM #

Anant Anand Gupta

sorry, but this also didn't solved the problem. below is the error stag.

Compiler Error Message: CS0103: The name 'InitSettings' does not exist in the current context

Source Error:

Line 155:    {
Line 156:        btnSave.Text = Resources.labels.saveSettings;
Line 157:    if (_settings == null) InitSettings();
Line 158:        switch (_settings.GetSingleValue("SpamFilter"))
Line 159:        {  


Source File: d:\hosting\anantanand\anantanandgupta\User controls\Commentor\Admin.aspx.cs    Line: 157
--------------------------------

one more thing i noticed that i am not receiving any mails from your blog even i have marked the check box below for the comment notification. same thing is happening with my blog too. this feature was working earlier when my blog was running on version 1.3. i know that it is out of context but still if you can help me out will be really appreciated.

thanks

Anant Anand Gupta |

12/11/2008 7:54:09 AM #

rtur.net

The name 'InitSettings' does not exist in the current context
That line needed to go to Extensions\Commentor.cs where InitSettings exists. It sort of jump-start for extension if for some reason settings wasn't created initially.

rtur.net |

12/11/2008 10:35:51 PM #

Anant Anand Gupta

Hi there,

sorry but that also didn't worked out. what i am thinking is that the setting init code file should create an .xml file which will have all the setting parameters stored. i checked in the datastore and found that the file is getting created but there are no settings stored in that. here i am pasting the code from commentor.xml:

<?xml version="1.0" encoding="utf-8"?>
<ManagedExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="Commentor">
  <Version>1.1</Version>
  <Description>Commentor integrates comment moderation and spam filtering</Description>
  <Author><a href="http://rtur.net">rtur.net</a></Author>
  <AdminPage />
  <Enabled>true</Enabled>
  <ShowSettings>true</ShowSettings>
</ManagedExtension>

the <Settings> node is missing from there. i was even not able to debug the app fully as when i debug the code, it says the BBCode.XML is in use by some other app.

i don't know how other people are able to execute the application with that extension. there is not a big configuration, where i can say that i might have missed out something.

my site is running on www.anantanandgupta.com. but after installing this extension i am not able to delete any posted comments too, entering in the admin page is a talk afterwords.

Anant Anand Gupta |

12/12/2008 1:46:35 AM #

rtur.net

Looks like you have file locking issue, it was resolved and you'll need to upgrade to change set newer than 16659 to fix it. Nothing to do with commentor, you'll run into this same issue with any extension that have to persist settings. You'll need to refresh both web files and DLL to get rid of that "used by another app" error.

rtur.net |

12/12/2008 1:52:01 AM #

Kelton

Nice tool! Thx. I was having the same issue as Anant but I moved the lines...
ExtensionManager.ImportSettings(settings);
        _settings = ExtensionManager.GetSettings("Commentor");

above the...

ExtensionManager.SetAdminPage("Commentor", "~/User controls/Commentor/Admin.aspx");

in the Commentor.cs code and it seems to work. It was leaving the Commentor.cs code before setting the value of _settings. I haven't test a whole lot but the page is displaying correctly now.

Kelton |

12/18/2008 5:29:56 AM #

Krishnan

When i tried to use this extension first it showed the error, which Anant reported. I fixed it with Helton's code. The issue is that when am using this the comment is not getting added. Should i change the comment moderation on the settings?

Krishnan |

12/18/2008 6:05:11 AM #

rtur.net

Krishnan, comment moderation should be off. When you saying "not getting added" do you mean it is not getting added to the site or to the list in commentor or it is just getting lost all together?

rtur.net |

12/19/2008 8:12:50 AM #

David Workman

Thanks, this is a great addition to BlogEngine!
www.HalfBakedLunatic.com

David Workman |

12/19/2008 11:44:53 AM #

John

Kelton's post helpful resolve the issue for me as well.

In Commentor.cs...InitSettings...~lines 118-123 now look like the below.

==========

ExtensionManager.ImportSettings(settings);
_settings = ExtensionManager.GetSettings("Commentor");
    
// set page that extension manager will use  
// instead of default settings page
ExtensionManager.SetAdminPage("Commentor", "~/User controls/Commentor/Admin.aspx");

==========

Thanks for the extension.

John |

12/23/2008 4:24:58 AM #

Krishnan

I tried with comment moderation off. but no way. The ajax rotating icon is rotationg infinitly. No comments added and no comments in the list also.

Actually what i wanted was to go away from this Busby SEO, and i got that extenstion from Chris.

Krishnan |

12/27/2008 7:25:10 AM #

Al Bsharah

I'm having the same issues as others above, so I removed it...looks like a great plug-in!  Look forward to a fix...

Thanks again!

Al Bsharah |

1/13/2009 10:22:38 PM #

trackback

Trackback from Community Blogs

Using Comment Blacklist Extension for BlogEngine.NET

Community Blogs |

1/23/2009 9:56:05 PM #

Ouran Figure

wow. nice work. It's guys like you that keep the internet ticking Smile

Thanks for making the extension available for free download.

Ouran Figure |

1/30/2009 12:14:36 AM #

Free Service Manual

I think this helpful so well, thanks.

Free Service Manual |

2/3/2009 6:20:33 AM #

PoiSoN

Hi Ruslan,

Thanks for your great extension!
I want to suggest few features that I would love to see in next release, if you don't mind?

1. It would be grate if you add "Approve" and "Delete" buttons in comment preview window, just next to "Save" and "Cancel" buttons.

Many times, after reviewing the comment, I hit "Cancel" and then approve or delete comment. It will save time.

2. "White List" by Username, Email or Website. These will be automatically approved.

3. "Black List" by IP or Website URL. These will be automatically caught as SPAM.


What do you think?

Thanks,
David.

PoiSoN |

2/3/2009 1:53:19 PM #

rtur.net

David, agree on having approve/delete buttons in the pop-up dialog, this is good for usability. Black/white lists are going to be in the form of generic filter, as shown here.

http://farm4.static.flickr.com/3029/3251473849_37886617d4.jpg

Also, unapproved comments will be integrated with the rest and all will be accessible from the single filtered list as you can see here.

http://farm4.static.flickr.com/3392/3252325480_751bc054da.jpg

Thanks for your suggestion!

rtur.net |

2/5/2009 5:14:50 PM #

PoiSoN

Hi Ruslan,

Well, thats a great news!
When will new version that support all these cool new features will be available for download?


Thanks,
David.

PoiSoN |

2/7/2009 10:32:26 AM #

Jason

Thanks for this plugin

Jason |

2/11/2009 1:23:42 PM #

rtur.net

When will new version that support all these cool new features will be available for download?
I think It should be completed this weekend.

rtur.net |

3/18/2009 4:09:13 PM #

friendster music code

When i tried to use this extension first it showed the error, which Anant reported. I fixed it with Helton's code. The issue is that when am using this the comment is not getting added. Should i change the comment moderation on the settings?

friendster music code |

Comments are closed
<<  July 2009  >>
SuMoTuWeThFrSa
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
Protected by Commentor
256 comments approved
370 spam caught
Since December 1, 2008
Powered by Spam Counter
Enhanced with Snapshots

Subscribe to Rtur.net