Digital Sovereignty for everyone

Background jobs

LH Membership runs its background work on Action Scheduler where a site has it, falling back to WP-Cron, following the LocalHero background-jobs convention. One class, LH_Membership_queue_class (includes/lh-membership-queue-class.php), owns every scheduling and unscheduling call in the plugin; nothing else calls wp_schedule_* or as_* directly.

The jobs

  • Initial run (lh_membership_initial_run): one-off, queued on every site when the plugin is activated; creates the user and organisation consent terms and runs the post-status gates’ first-time setup.
  • Ongoing run (lh_membership_ongoing_run): hourly on every site; cleans up expired one-time codes.
  • Invitation reminders (lh_membership_org_invite_reminders): hourly on every site where reminders are on (see Reminders for unfinished applications).
  • Club address uses backfill (lh_membership_address_uses_backfill): one-off batches on the main site, each queuing the next until done; never a second batch while one is waiting.

How they are scheduled

  • Action Scheduler is used only when its functions are loaded on the site, after action_scheduler_init, and never while switched to another site, since its tables belong to the site that is running. Actions go in the lh-membership group, listed under Tools > Scheduled Actions.
  • Recurring jobs are created by a self-healing check on init (priority 30), at most once an hour per job per site (a transient per job), so a lost job comes back on its own and nothing needs scheduling on activation. Scheduling on Action Scheduler also clears any WP-Cron copy, so only one runner fires.
  • The WP-Cron fallback uses core’s hourly schedule.
  • Deactivation removes the plugin’s jobs from both runners (on each site, WP-Cron only while switched).

Filters

  • lh_membership_uses_action_scheduler ( bool ): return false to keep a site on WP-Cron.
  • Hook names: lh_membership_initial_run_hook, lh_membership_ongoing_run_hook, lh_membership_org_invite_reminders_hook, lh_membership_address_uses_backfill_hook.
  • lh_membership_ongoing_run_interval (seconds, default one hour) and lh_membership_scheduled_hooks (the hooks removed on deactivation).

(Since 2.119.0; before that every job was on WP-Cron directly.)

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.