# jetpack/16.3-a.5/modules/wordads/php/class-wordads-cron.php

Jetpack – WP Security, Backup, Speed, &amp; Growth, version 16.3-a.5. 58 lines.

- Page: https://pluginprobe.com/plugins/jetpack/16.3-a.5/code/modules/wordads/php/class-wordads-cron.php
- Raw: https://pluginprobe.com/plugins/jetpack/16.3-a.5/raw/modules/wordads/php/class-wordads-cron.php
- Modified: 2025-11-24T17:00:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetpack/16.3-a.5/code/modules/wordads/php/class-wordads-cron.php#L10-L20`.

```php
<?php
/**
 * WordAds cron tasks.
 *
 * @package automattic/jetpack
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit( 0 );
}

/**
 * WordAds cron tasks
 *
 * @since 4.5.0
 */
class WordAds_Cron {

	/**
	 * Add the actions the cron tasks will use
	 *
	 * @since 4.5.0
	 */
	public function __construct() {
		add_action( 'wordads_cron_status', array( $this, 'update_wordads_status' ) );
	}

	/**
	 * Registered scheduled events on activation
	 *
	 * @since 4.5.0
	 */
	public static function activate() {
		wp_schedule_event( time(), 'daily', 'wordads_cron_status' );
	}

	/**
	 * Clear scheduled hooks on deactivation
	 *
	 * @since 4.5.0
	 */
	public static function deactivate() {
		wp_clear_scheduled_hook( 'wordads_cron_status' );
	}

	/**
	 * Grab WordAds status from WP.com API
	 *
	 * @since 4.5.0
	 */
	public static function update_wordads_status() {
		WordAds_API::update_wordads_status_from_api();
	}
}

global $wordads_cron;
$wordads_cron = new WordAds_Cron();

```
