== WP-Cron == tags: cron, perioidic, schedule Contributors: MCincubus (http://www.txfx.net/), Lionfire (http://the.lostrealm.com/) WP-Cron provides a rudimentary support for scheduled exection of actions; a sort of "delayed action" processing for WordPress. It is nowhere near as robust as the actual UNIX cron facility, but should be good enough to "do stuff" on a fairly regular basis. What with human beings, search engine spiders, and content aggregators, we can be fairly sure that even the most uninteresting (public) blog will be visited with some regularity. WP-Cron relies on this regularity to schedule the execution of three new plugin hooks. These hooks execute (roughly) once every fifteen minutes, every hour, or every day. Again: this plugin is nowhere near as robust as the UNIX cron facility. It is not guaranteed to be reliable in any way. Do not use this plugin to schedule nuclear attacks against your enemies. Do not rely on this pluign to remind you when to take your medication. == Installation == Drop the wp-cron.php file into /wp-content/plugins/, and activate the plugin. The plugin will automatically create in your database the three options it requires. == Usage == Installing and activating this plugin won't do a whole lot, by itself. Included with it are two additional plugins, to serve as examples of how to use WP-Cron. * WP-Cron Dashboard: uses WP-Cron to update the data in your WordPress dashboard (roughly) every hour. * WP-Cron Reminder: sends out a generic reminder email to the blog admin (roughly) every 15 and 60 minutes. You can use this to prove to yourself that WP-Cron is working. * WP-Cron Future Pings: suppresses outgoing pingbacks and trackbacks when publishing a post with a date in the future; then uses WP-Cron to periodically check if any such future-dated posts are visible, sending pingbacks and trackbacks as necessary. WP-Cron creates three new hooks against which plugins may register: * wp_cron_15 * wp_cron_hourly * wp_cron_daily WP-Cron compares the current time (at which WordPress is presently executing) against three timestamps stored in the database. If the timestamps are stale, WP-Cron updates them and then schedules the appropriate hook for execution at the end of the current session. You probably don't want to schedule too many tasks against any one hook; nor do you want to schedule any particularly time-intensive tasks. == Frequently Asked Questions == Q. What would I use this for? A. Making sure that something happens on a semi-regular basis. For example, the bundled plugin wp-cron-dashboard.php makes sure that your WordPress Dashboard is updated roughly every hour. This not only ensures that you have the latest nwws in your Dashboard, it makes sure you don't need to spend your time waiting for the Dashboard to fetch said latest news! Q. What else can I do? A. Quite I bit, I imagine. If your web host does not allow you to schedule _real_ cron jobs, you might be able to use this to run the scheduled task necessary to support "blog-by-email". == Credits == Copyright (c) 2005 Scott Merrill (skippy@skippy.net) Released under the terms of the GNU GPL