[wp-hackers] Addition to check_comment(): return false if thepost is older than 21 days

Ryan Boren ryan at boren.nu
Fri Oct 1 19:35:26 UTC 2004


> The only stumbling block I see is that the plugin architecture only
> passes a single value to the plugin function.  As a result, this value
> would need to be a structure of some kind to hold all of the comment
> info, which is possible, but isn't something any other hook does.   We
> couldn't simply pass the comment ID as previously suggested, since at
> the point that a comment is being processed for spamminess, the comment
> has (thankfully) not yet been stored in the database.

Passing a structure is not a big deal.

> Every suggestion that has passed the list so far could be implemented
> using this plugin.  If the hook was installed, you could be writing your
> custom comment spam filters immediately, without worrying about
> modifying core code or lobbying for a dev to include your idea.

The problem is that comment moderation doesn't lend itself well to the
plugin architecture.  Plugins are more geared toward being filters;
comment moderation requires more of an authentication stack.  You cannot
pile multiple plugins onto a moderation action without some choreography. 
If the first plugin says that the comment is approved, it should be passed
along to the next one until one of the plugins says that the comment
should be moderated or deleted.  Of course, you get into plugin order
problems and whether each plugin should be optional, required, or
sufficient.  In other words, you end up implementing PAM, which does not
fit well into the plugin architecture.

What we should probably do is allow people to replace check_comment in its
entirety so that they can implement their own moderation policy wholesale.
 This means only one moderation policy plugin could be active.  This is
the easiest way to handle it and avoids getting into implementing an
authentication stack.

Ryan



More information about the hackers mailing list