Background Jobs

The plugin keeps each site’s user records up to date with a user sync: every user with a role on the site gets a last activity date, a BuddyPress blog record and a profile name. Since 1.1.3 the sync is scheduled through LH_Buddypress_Multi_Network_Queue (includes/class-lh-buddypress-multi-network-queue.php). It runs on Action Scheduler when the current site has it, in the lh-buddypress-multi-network group (listed under Tools → Scheduled Actions), and on WP-Cron otherwise. The same hooks are used on both runners, and on Action Scheduler any WP-Cron copy of a job is cleared so it runs once.

A user added to a site is handled while WordPress is switched to that site, so that sync goes to the site’s WP-Cron: Action Scheduler is only safe for the site the request is running on. On deactivation the whole Action Scheduler group is cancelled on the current site and every WP-Cron instance of the plugin’s hooks is removed, including the retired lh_bmn_process; on network deactivation WP-Cron is also cleared on every other site.

Filters