Use WP-Crontrol to keep track of Akismet

This entry is part 3 of 3 in the series Taking control of WP-Cron using WP-Crontrol

If you’re using Akismet to tackle spam on WordPress, there are a number of statistics available to you about your current spam situation. These are all available in the Comments page of your blog, but who wants to go there every day to check up on things. By taking control of WordPress Cron with WP-Crontrol and a couple lines of code, you can receive this information sent by mail every day.

As discussed previously in this series, you’ll need to have WP-Crontrol installed and go to the Add PHP Cron Entry screen under Manage->Crontrol. For Hook Code, enter the following snippet:

    $email  = 'There are currently ';
    $email .= akismet_spam_count();
    $email .= ' spams identified by Akismet, of which ';
    $email .= akismet_spam_count('comment');
    $email .= ' are comment spams and ';
    $email .= akismet_spam_count('trackback');
    $email .= ' are trackback spams.  Akismet has caught ';
    $email .= number_format_i18n(get_option('akismet_spam_count'));
    $email .= ' spams since you first installed it.';
    wp_mail('scompt@scompt.com', 'Spam statistics', $email);

Notice that all we’re doing is tossing a string together and sending it off to the wp_mail function to be emailed. You’ll of course want to change the email address. I personally don’t need to know how much spam you’re getting… I’ve got problems of my own.

Series Navigation«Using WordPress Cron and WP-Crontrol to make you post more

Possibly Related Posts

1 Comment

  1. Dy Said,

    June 27, 2008 @ 5:00 am

    Hi

    I have Crontrol and Postie installed and all is working fine. However I am struggling to to Crontrol to run Postie.

    This is the file that needs to be run every 30 mins

    http://domain/wordpressInstallDir/wp-content/plugins/postie/get_mail.php?Submit=Run+Postie

    the text with [] needs to be replace with the actual domain and folder names.

    Can you tell me what “Hook” to use to run the Postie every 30 mins or so?

    Many Thanks for an excellent plugin

    Kind Regards

    Dy

RSS feed for comments on this post