UPDATE: The author of the plugin has provided a way to make both plugins work together without changing the code (see the comments below). So you may just ignore my rambling below and go directly to my follow-up post that explains the exact procedure to make these plugins work together.
When I installed the CommentLuv plugin on my blog, I wanted to make sure I can handle the additional comment spam that this would certainly cause. So I set out to find a good antispam plugin and managed to find it in the free AntiSpam Bee (I won’t go much into detail as to why I don’t use Akismet, suffice it to say that it is not free and it is controversial in many ways).
I soon had to discover though, that AntiSpam Bee is conflicting with the CommentLuv plugin. After a bit of tinkering, I found out why this is the case and can now show you a quick hack to get both of these to work together.
The problem comes from the fact that AntiSpam Bee replaces the standard comment entry
textarea field by a duplicate. The original
textarea field is hidden through CSS and is where commenting bots will leave their comments. The duplicate
textarea field is the one that is shown to human commenters.
The CommentLuv plugin uses the original
textarea field for some of its logic. This is what breaks it, as the original
textarea field does not work as originally intended.
A simple change in the plugin’s
commentluv.js file can correct this behaviour. I’ll show you how to do this below.
BEWARE: This is only a quick hack, not a definitive fix. It will simply be overwritten when the next update to CommentLuv gets installed.
- You have to edit the
commentluv.jsfile that’s included with the plugin. You can do this from right inside WordPress by opening the Plugins menu (1) and selecting the Editor (2).
- On the upper right side of the Editor, you first have to choose the correct plugin by opening the drop-down box (3) and selecting
- Then you have to select the correct file to edit. Choose
commentluv/js/commentluv.jsin the list of files on the right (5).
- Now comes the tricky part. Look for the line that starts with ‘
var comObj =[…]’ . It mentions a
textareafield and accesses its
nameproperty. This looks like the following: ‘
jquery("textarea[name= "[…]’ (6). Change the word ‘
name‘ into ‘
- You finish by clicking the
Update Filebutton below the editor window (7).
This should get rid of the error, and both plugins should now happily coexist. I hope this helps those people who try to run this combination of plugins.
I have introduced a support ticket through the wordpress.org site and assume that the author is working on a permanent fix. You can see the state of this ticket here.
Definitely give AntiSpam Bee a try if you haven’t done so already, it works wonders!