Heray-Was-Here
Server : Apache
System : Linux hybrid3195.ca.ns.planethoster.net 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
User : alliancerealtynb ( 1004)
PHP Version : 7.4.33
Disable Function : noop
Directory :  /home/alliancerealtynb/sitepress-multilingual-cmsOLDOLD/classes/ATE/Retranslation/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alliancerealtynb/sitepress-multilingual-cmsOLDOLD/classes/ATE/Retranslation/Scheduler.php
<?php

namespace WPML\TM\ATE\Retranslation;

/**
 * The class is responsible for determining if the re-translation should be run and when.
 * It is used inside WPML\TM\ATE\Loader::add_hooks() to schedule the re-translation.
 */
class Scheduler {

	const LAST_CALL_OPTION = 'wpml_ate_retranslation_last_call';

	const INTERVAL = 60 * 2; // 2 minutes

	public function shouldRun(): bool {
		$lastCall = get_option( self::LAST_CALL_OPTION );

		return $lastCall ? ( time() - $lastCall ) > self::INTERVAL : $lastCall;
	}

	public function scheduleNextRun() {
		update_option( self::LAST_CALL_OPTION, time() );
	}

	public function disable() {
		delete_option( self::LAST_CALL_OPTION );
	}
}

Hry