| Server IP : 167.235.67.158 / Your IP : 216.73.216.95 Web Server : Apache System : Linux ubuntu-8gb-nbg1-1 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : upstairsbar.co.uk ( 982) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/pawsandpatience.co.uk/wp-content/plugins/wp-smushit/core/ |
Upload File : |
<?php
namespace Smush\Core;
class Cron_Controller extends Controller {
private static $cron_hook = 'wp_smush_daily_cron';
/**
* Static instance
*
* @var self
*/
private static $instance;
/**
* Static instance getter
*/
public static function get_instance() {
if ( empty( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
public function __construct() {
$this->register_action( 'admin_init', array( $this, 'schedule_cron' ) );
}
/**
* Schedule cron
*/
public function schedule_cron() {
if ( ! wp_next_scheduled( self::$cron_hook ) ) {
wp_schedule_event( time(), 'daily', self::$cron_hook );
}
}
/**
* Unschedule cron
*/
public function unschedule_cron() {
wp_clear_scheduled_hook( self::$cron_hook );
}
/**
* Get cron_hook.
*
* @return string
*/
public static function get_cron_hook() {
return self::$cron_hook;
}
}