* If a constant is already defined and isn't what we expect, log it
*/
privatefunctionset_constants(){
$constants=array(
'DISABLE_WP_CRON'=>true,
'ALTERNATE_WP_CRON'=>false,
);
foreach($constantsas$constant=>$expected_value){
if(defined($constant)){
if(constant($constant)!==$expected_value){
error_log(sprintf(__('%s: %s set to unexpected value; must be corrected for proper behaviour.','wp-cron-control-revisited'),'WP-Cron Control Revisited',$constant));
}
}else{
define($constant,$expected_value);
}
}
}
/**
* Block direct cron execution as early as possible