Jetpack_Heartbeat::cron_exec PHP Method

cron_exec() public method

Method that gets executed on the wp-cron call
Since: 2.3.3
public cron_exec ( )
    public function cron_exec()
    {
        $jetpack = Jetpack::init();
        /*
         * This should run daily.  Figuring in for variances in
         * WP_CRON, don't let it run more than every 23 hours at most.
         *
         * i.e. if it ran less than 23 hours ago, fail out.
         */
        $last = (int) Jetpack_Options::get_option('last_heartbeat');
        if ($last && $last + DAY_IN_SECONDS - HOUR_IN_SECONDS > time()) {
            return;
        }
        /*
         * Check for an identity crisis
         *
         * If one exists:
         * - Bump stat for ID crisis
         * - Email site admin about potential ID crisis
         */
        // Coming Soon!
        foreach (self::generate_stats_array('v2-') as $key => $value) {
            $jetpack->stat($key, $value);
        }
        Jetpack_Options::update_option('last_heartbeat', time());
        $jetpack->do_stats('server_side');
        /**
         * Fires when we synchronize all registered options on heartbeat.
         *
         * @since 3.3.0
         */
        do_action('jetpack_heartbeat');
    }