<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>scompt.com &#187; cron</title>
	<atom:link href="http://scompt.com/blog/archives/tag/cron/feed/" rel="self" type="application/rss+xml" />
	<link>http://scompt.com</link>
	<description>The website of Edward Dale</description>
	<lastBuildDate>Sun, 04 Sep 2011 15:54:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Use WP-Crontrol to keep track of Akismet</title>
		<link>http://scompt.com/blog/archives/2008/06/18/use-wp-crontrol-to-keep-track-of-akismet</link>
		<comments>http://scompt.com/blog/archives/2008/06/18/use-wp-crontrol-to-keep-track-of-akismet#comments</comments>
		<pubDate>Wed, 18 Jun 2008 10:20:41 +0000</pubDate>
		<dc:creator>scompt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://scompt.com/?p=228</guid>
		<description><![CDATA[If you&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using <a href="http://akismet.com/">Akismet</a> 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 <a href="http://scompt.com/projects/wp-crontrol">WordPress Cron</a> with WP-Crontrol and a couple lines of code, you can receive this information sent by mail every day.</p>
<p><span id="more-228"></span></p>
<p>As discussed <a href="http://scompt.com/archives/2008/06/16/using-wordpress-cron-and-wp-crontrol-to-make-you-post-more">previously</a> in this <a href="http://scompt.com/archives/series/taking-control-of-wp-cron-using-wp-crontrol">series</a>, you&#8217;ll need to have <a href="http://scompt.com/projects/wp-crontrol">WP-Crontrol</a> installed and go to the Add PHP Cron Entry screen under Manage->Crontrol.  For Hook Code, enter the following snippet:</p>
<p><code>
<pre name="code" class="php">    $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);</pre>
<p></code></p>
<p>Notice that all we&#8217;re doing is tossing a string together and sending it off to the <code>wp_mail</code> function to be emailed.  You&#8217;ll of course want to change the email address.  I personally don&#8217;t need to know how much spam you&#8217;re getting&#8230; I&#8217;ve got problems of my own.</p>
]]></content:encoded>
			<wfw:commentRss>http://scompt.com/blog/archives/2008/06/18/use-wp-crontrol-to-keep-track-of-akismet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<series:name><![CDATA[Taking control of WP-Cron using WP-Crontrol]]></series:name>
	</item>
		<item>
		<title>Using WordPress Cron and WP-Crontrol to make you post more</title>
		<link>http://scompt.com/blog/archives/2008/06/16/using-wordpress-cron-and-wp-crontrol-to-make-you-post-more</link>
		<comments>http://scompt.com/blog/archives/2008/06/16/using-wordpress-cron-and-wp-crontrol-to-make-you-post-more#comments</comments>
		<pubDate>Mon, 16 Jun 2008 10:32:18 +0000</pubDate>
		<dc:creator>scompt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://scompt.com/?p=225</guid>
		<description><![CDATA[The new version of WP-Crontrol allows you to add new cron entries with code. This allows you to write code that will repeatedly be executed without actually touching any .PHP files. Below, I present a way to utilize this functionality to remind you to post something if you haven&#8217;t done so in the past two [...]]]></description>
			<content:encoded><![CDATA[<p>The new version of <a href="http://scompt.com/projects/wp-crontrol">WP-Crontrol</a> allows you to add new cron entries with code.  This allows you to write code that will repeatedly be executed without actually touching any .PHP files.  Below, I present a way to utilize this functionality to remind you to post something if you haven&#8217;t done so in the past two days.</p>
<p><span id="more-225"></span></p>
<div class="imageright">
<a title="PHP Cron Entry Screen" href="http://scompt.com/wordpress/wp-content/uploads/2008/06/php_cron_entry_screen.jpg"><img alt="PHP Cron Entry Screen" src="http://scompt.com/wordpress/wp-content/uploads/2008/06/php_cron_entry_screen-150x150.jpg"/></a></p>
<p>PHP Cron Entry Screen</p>
</div>
<p>The first requirement is to install <a href="http://scompt.com/projects/wp-crontrol">WP-Crontrol</a>.  This will add the Manage->Crontrol admin screen.  Head there and you&#8217;ll get a quick insight into what&#8217;s going on behind the scenes in the WP-Cron system.  We want to add a new PHP cron entry, so click on the small link next to &#8216;Add Cron Entry&#8217;.  Now you should have something like the screen to the right.</p>
<p>The code that we&#8217;re going to use for the hook is below.  I won&#8217;t go deep into it.  Suffice to say, it looks at the date of the most recent post.  If it&#8217;s more than 2 days old, it sends out an email reminder.</p>
<p><code>
<pre name="code" class="php">    global $post;
    $recent = new WP_Query("showposts=1");
    if( $recent->have_posts() ) {
        $recent->the_post();
        if(time()-strtotime($post->post_date)>60*60*24*2)
            mail('scompt@scompt.com', 'Post reminder',
                 "Hey!  You haven't posted in a while.");
    }</pre>
<p></code></p>
<p>The only other options to set are when to run the hook and how often.  After saving the hook, it should run immediately.  Depending on how good you&#8217;ve been, you&#8217;ll get an email.</p>
]]></content:encoded>
			<wfw:commentRss>http://scompt.com/blog/archives/2008/06/16/using-wordpress-cron-and-wp-crontrol-to-make-you-post-more/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<series:name><![CDATA[Taking control of WP-Cron using WP-Crontrol]]></series:name>
	</item>
	</channel>
</rss>

