wp-cron.php - added to dashboard

I added this to the bottom of wp-cron.php (1.1a) so I can see that it is loaded and when it last ran. Needs de-geeking for general consumption.


//// MENUs

function wp_cron_add_pages($s) {
add_submenu_page('index.php', 'wp-cron', 'WP-Cron', 1, __FILE__, 'wp_cron_menu')
;
return $s;
}
add_action('admin_menu', 'wp_cron_add_pages');

function wp_cron_menu() {
$format = "%X %x";
print "<table>";
print "<tr><td>Now<td>".strftime($format,time())."</td></tr>";
print "<tr><td>15 minutely lastrun<td>".strftime($format,
get_option('wp_cron_15_lastrun'))."</td></tr>";
print "<tr><td>Hourly lastrun<td>".strftime($format,
get_option('wp_cron_hourly_lastrun'))."</td></tr>";
print "<tr><td>Daily lastrun<td>".strftime($format,
get_option('wp_cron_daily_lastrun'))."</td></tr>";
print "</table>";

global $wp_filter;
print "<pre>";
$all = array('wp_cron_15', 'wp_cron_hourly', 'wp_cron_daily');
foreach ($all as $entry) {
print $entry." ";
print_r($wp_filter[$entry]);
}
print "</pre>";
}

?>

Related Posts

Leave a Reply