April 26, 2023, 11:06am
This page >
https://kb.mainwp.com/disable-wp-cron/ lists the cron files to be run.
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:
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 ?
April 26, 2023, 11:11am
Ok, so bootstrap is required by each cron file.
April 26, 2023, 11:31am
There is also no mention of setting a cron jobs for
Maintenance files are actually
its a bit of a mess …
I’m guessing the jobs from the files I see and the previous formats of cron jobs that have start, sync and alert etc.
April 26, 2023, 11:33am
We are looking into this now and will update you via this thread as soon as possible.
April 26, 2023, 5:48pm
We have updated our documentation for MainWP Dashboard and Maintenance crons:
Thanks for bringing this to our attention.
April 29, 2023, 9:47pm
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?
May 1, 2023, 2:03pm
WP-CLI is not a replacement for Cron Jobs but rather a tool that offers two options for completing tasks.
The user may choose to use WP-CLI or Cron Jobs based on their needs, as WP-CLI may work a bit differently from Cron Jobs.
Therefore, the user can useWP-CLI commands or Cron Jobs based on their expectations and requirements.
May 1, 2023, 5:38pm
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) ?
I think it’s simpler, and better for performance.
@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.
… just my personal opinions here…
May 2, 2023, 5:48am
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.
May 2, 2023, 7:40pm
Thanks for the update.
I will consult with the dev team, and update you via this thread as soon as I have more information.
June 1, 2023, 7:41pm
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.