Last active
March 27, 2021 15:07
-
-
Save paulgoodchild/6a4d299a21246ca1c058335dfb352a29 to your computer and use it in GitHub Desktop.
Specify the hour of the day that the Shield Security plugin executes its daily cron
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Scanner cron job run by the Shield plugin is responsible for executing the scans. | |
* If you're running ShieldFREE, the scans runs automatically once per day. On ShieldPRO, it can repeat up to every hour. | |
* | |
* The Cron is configured to have a start time - i.e. the first time that the cron will execute. Then it repeats based on your settings. | |
* | |
* If the hour at which the cron is set to run is 3 a.m. (the default), it will first run the next day at 3am, and then | |
* every day thereafter at 3 a.m. If this default hour doesn't suit, you can change it using a WordPress filter. | |
* | |
* The following example will change the hour to 5 a.m. instead of the default, 3 a.m. | |
* | |
* Note: The hour is 24hr notation, so 5 a.m. is '5', and 5 p.m. is '17'. | |
* | |
* Note: Shield crons are reset/setup at instant the plugin is upgraded/activated - ensure that this filter is in-place beforehand so your preferences are applied. | |
*/ | |
add_filter( 'shield/scan_cron_start_hour', function ( $hour ) { | |
return 5; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment