Real Comment Throttle plugin 0.1

Time I got back in several saddles, not the least of them Movable Type plugin writing. I’ve been thinking today about posting like it’s a dead fly on your tongue, and about posting like you didn’t know that weblog software company employees have to always remember the banjo, and their code equivalent, Release Early, Release Often. Of course, to make that work you really need to do both parts, not just the first, my usual course of action, but my intentions are, once again, good. As are commas.

Real Comment Throttle (the name has a wink in it, but an actual ;) would wind up causing me filename trouble) is a plugin to add the throttle that Jacques and I have been using since last January, to limit our exposure to floods of comments.

The builtin MT comment throttle, while well-meaning, is basically useless for anything but the most clueless of spammers and trolls. It blocks based solely on IP address, and any spammer worthy of even that low calling has thousands of anonymous proxies at his disposal, so he can still drop hundreds of comment-turds per hour in your weblog.

RCT simply refuses to accept more than the number of comments you specify, per hour and per day. If you’re sure you’ll never get more than 150 comments in 24 hours, and you don’t want to have to clean up after more than 50 in an hour, it’ll put on the brakes once you’ve got that many, waiting for you to flush out the crap or realize that you’ve actually become insanely popular (my most popular content-free entry did actually manage to trip my throttle with legitimate comments). At least with this plugin version, when you become popular beyond your wildest dreams, you only have to go to the plugin config page to increase your limits, unlike the hack that required you to find the magic numbers in the source.

There’s still plenty to be done to it: it only lets you set one limit, not a different limit for each blog (if your limit is 50 per hour, each blog can have 50 comments per hour, but you can’t set your main blog to 50 and your rarely-commented exercise blog to 5), it only notifies you that it has been triggered in the activity log, instead of emailing you (only once, which is where I’m stuck), so far you can’t return a custom message for a CommentThrottleFilter so even if you’re full of comments for the day it’ll still say “please wait a short while and try again,” it should really send throttled comments to moderation rather than refuse them, and the code is horribly inelegant (patches, or instruction, welcome), but it seems to work for me, and as long as you don’t have any pets that aren’t neutered, I think it’s pretty safe to use.

Requirements: the Storable Perl module, so it can store your settings in PluginData, and MT 3.1. Oh, 3.1 isn’t out yet, not until tomorrow? Well, I did say I was going to release early. Enjoy.


Comment by Jacques Distler #
2004-08-30 23:54:38