WP_Cron doesn’t do the job: Multisite stats

It is set_site_transient, not set_site_site_transient.

You should be aware that a single user will still wait that half a minute for this to complete. wp_cron does not run on clock time. It runs when a user visits the site.

If you have the ability to create a system cron job then hook your callback to an AJAX API action, and use the system cron to trigger it. That should give you a true clock-time activation and avoid having to force some unlucky user to wait.

Related:

WordPress Cron Schedule the if and else statement
Should I use set_transient or update_option?

Leave a Comment