| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/robotics/wp-content/plugins/wp-optimize/includes/ |
Upload File : |
<?php
if (!defined('ABSPATH')) die('No direct access allowed');
if (!class_exists('WP_Optimize_404_Detector_Cron')) :
class WP_Optimize_404_Detector_Cron {
/**
* Class constructor
*/
private function __construct() {
$this->initialize();
}
/**
* Initialize the class as a singleton
*
* @return WP_Optimize_404_Detector_Cron
*/
public static function get_instance() {
static $_instance = null;
if (null === $_instance) {
$_instance = new self();
}
return $_instance;
}
/**
* Initialize class actions
*/
public function initialize() {
if (WP_Optimize()->get_options()->get_option('404_detector')) {
$this->setup_cron_event();
} else {
$this->remove_cron_event();
}
}
/**
* Schedule cron event
*/
private function setup_cron_event() {
if (!wp_next_scheduled('wpo_prune_404_log')) {
wp_schedule_event(time(), 'wpo_daily', 'wpo_prune_404_log');
}
}
/**
* Remove scheduled cron event
*/
private function remove_cron_event() {
wp_clear_scheduled_hook('wpo_prune_404_log');
}
}
endif;