Heya,
I am using Comment Notifier on a couple of blogs to alert non-admin users of new comments. This is great, but the only thing that is winding us up is that the plug-in seems to send out notifications for comments that are subsequently picked up by Akismet and marked as spam.
Has anyone worked out a way to get the plug-in to wait until the comments have been filtered by anti-spam before emailing out to the specified email addresses?
Thanks
Right here, on line 195:
http://plugins.trac.wordpress.org/browser/comments-notifier/trunk/comments-notifier.php#L195
Change that to be this:
function wp_notify_allmods($comment_id, $approved) {
if ($approved == 'spam') return;
global $wpdb;
...
Then, at the very bottom of the plugin, change the last line to this:
add_action('comment_post', 'wp_notify_allmods',10,2);
That should do the trick.
Hey Otto! Thanks for the rapid response... I will have a go at implementing your suggested solution today and report back.
Wouldn't this be the kind of improvement that the original developers would want to include in updates of this plug-in btw..?
Cheers
No idea. Talk to the plugin author.
Hey Otto - I entered the changes.. we have tested it for the past 24 hours.. the good news is that there are no spam comments being emailed out - the bad news is that no comments are being mailed out at all from this plug-in any longer ;-)
Are there any further tips you can pass on to help us troubleshoot what might be going wrong?
Still waiting to hear back from IDSociety...
Thanks again for your input
Paul
I have no idea. I didn't write the plugin.
However, my suggested change would not cause what you're talking about. If you'll notice, it only adds one line, and that is checking explicitly for "spam". Not every comment is marked as spam.
So you must have made some other change that broke the plugin entirely. Make sure that the plugin is still activated in the plugins screen, because if you broke the plugin entirely, then WordPress may have simply auto-deactivated it.
Well I don't 'do' PHP (apart from following recipes) so I didn't really understand what your code did so well... although having looked at it some more - I do wonder what the "10,2" in the last line is for - the rest is vaguely logical.
BTW - I do understand that you did not write the plug-in, and that you are a moderator of the support forum and are trying to be helpful, and yet have no obligation to do so. I *have* attempted to contact the authors of the plug-in. Not trying to be a burden :-)
The plug-in *is* activated - I am not *that* much of a n00b.
Don't trouble yourself further though - I will get a developer to look at it. Or use plan b.
Thanks again
Just a little update...
With the tweaks outlined above - we are only getting comments sent out from the original post author... interesting...
planb is changing the admin address to be a new email address, which will forward comments for moderation to other addresses of my choosing, which should do the trick!
Cheers