However it suggests that pingchilds.php is used for Ping Child Sites, Check Sites Status, Check Sites Health and Reconnect Sites.
If I check /wp-content/plugins/mainwp/cron/ I can see the following files:
backups.php
backups_continue.php
bootstrap.php
updatescheck.php
checkstatuschilds.php
stats.php
sitehealthmonitoring.php
Can somebody please clarify which files should be used for which cron job please ?
Most are obvious, however there is nothing for reconnecting sites and no mention of back, bootstrap and stats ?
Wouldn’t a simpler approach be to offload the Wordpress cron to wp cli and then all the other MainWP crons will run at the time selected in the MainWP interface?
I’m using WP CLI for the core WP system cron as it tends to be more performant. However I’ve also tended to run it less frequently, say every 5 to 10 mins.
For more frequent crons I’ve been using the specific plugin crons prescribed for that plugin.
Would it be better to increase the frequency of the WP core CLI cron and drop the plugin specific crons (it would be simpler, would it perform better though) ?
@bogdan I think I didn’t explain clearly what I was suggesting as a simpler and better way to implement MainWP (in fact any Wordpress plugin) crons.
Disable Wordpress built in default cron
This is done by adding a directive to the wp-config.php file:
define( 'DISABLE_WP_CRON', true );
Run the following command as the cron job (every 1 or even 5 mins depending on the site):
cd /path/to/wordpress && wp cron event run --due-now
… you can add > /dev/null 2>&1 to the end as well if you wish to suppress the output.
Now any scheduled task configured in Wordpress (MainWP) will run on time and far more efficiently in my opinion. This was is simpler as you only have one cron to worry about, the rest is configured in MainWP.
So if you disable WP CRON for system CRON then you should not disable the plugins hook (in misc settings) to WP CRON otherwise the WP CLI cron won’t trigger the plugins CRON jobs.
That way you can have just the one system CRON job.