Background Jobs
Developer Guide Free & ProLearnomy does its slow and scheduled work in the background: sending email, delivering webhooks, releasing drip lessons, checking subscriptions. This page lists every job, how often it runs and what it does, so you can tell what should be happening on a healthy site and find the one that is not.
How jobs run#
Jobs run through Action Scheduler, which Learnomy bundles (WooCommerce and other plugins ship the same library and share it), with WP-Cron as the fallback. Either way they depend on your site's cron firing. On a low-traffic site, or one with DISABLE_WP_CRON set, add a real server cron that calls wp-cron.php every minute or two; without it, emails, drip releases and webhooks arrive late.
Recurring jobs are checked and armed from cron, wp-admin and WP-CLI requests only, never on a visitor's page view, so they add no queries to your front end. The first admin page load after an update arms any that are missing.
Two kinds of job appear below:
- Recurring jobs run on a schedule whether or not anything happened.
- When needed jobs are queued by an event (a purchase, a lesson completion, a webhook to send) and run once.
To see what is queued, open Tools > Scheduled Actions and filter by the hook name. wp learnomy selfcheck run reports whether the recurring jobs are in place.
Learnomy (Free)#
| Hook | Runs | What it does |
|---|---|---|
learnomy_expire_enrollments |
Hourly | Ends enrollments whose access period has run out. |
learnomy_send_expiry_reminders |
Daily | Emails members whose access is about to end. |
learnomy_engagement_splits |
Monthly | Works out the monthly engagement-based revenue share for instructors. |
learnomy_recompute_stats |
Daily | Refreshes the stored counts behind the dashboards. |
learnomy_cleanup_attempts |
Daily | Closes quiz attempts that were started and abandoned. |
learnomy_cleanup_tokens |
Daily | Deletes expired sign-in and verification tokens. |
learnomy_prune_audit_log |
Weekly | Applies Log Retention: removes old audit log entries and incoming-sale calls, and clears the stored body of old Stripe and PayPal events (the event ID is kept as replay protection). Failed and pending events are kept. |
learnomy_prune_email_log |
Weekly | Removes Email Log entries older than Email Log Retention. |
learnomy_cert_expiry_check |
Daily | Marks certificates that have reached their expiry date. |
learnomy_reconcile_payments |
Hourly | Looks up pending payments at the gateway in case a webhook was missed. |
learnomy_reconcile_provider_cancels |
Hourly | Tells the gateway to stop billing subscriptions cancelled in Learnomy, in case the first request failed. |
learnomy_membership_daily_sweep |
Daily | Ends cancelled subscriptions at period end, and unpaid ones after the grace period you set. |
learnomy_membership_trial_reminder |
Every 6 hours | Sends the trial-ending reminder. |
learnomy_membership_end_trials |
Hourly | Moves finished trials to paid or ended. |
learnomy_unlock_drip_lessons |
Hourly | Releases lessons whose drip date has arrived. |
learnomy_send_notification_async |
When needed | Sends one notification (email and in-app). |
learnomy_deliver_push |
When needed | Delivers one push notification to one device. |
learnomy_deliver_webhook |
When needed | Delivers one outgoing webhook. |
learnomy_recompute_course_progress |
When needed | Recalculates progress after a lesson is added or removed. |
learnomy_erase_authored_content |
When needed | Works through a privacy erasure request in batches. |
learnomy_migrate_content_batch |
When needed | Converts stored lesson content in batches. |
learnomy_migration_step |
When needed | One step of an import from another LMS. |
learnomy_protect_lesson_attachments |
When needed | Moves existing lesson attachments behind the permission check. |
Learnomy Pro#
Each job belongs to an extension and exists only while that extension is on.
| Hook | Extension | Runs | What it does |
|---|---|---|---|
learnomy_pro_cohort_status_tick |
Cohorts | Daily | Moves cohorts between upcoming, in progress and completed by their dates. |
learnomy_pro_space_subscription_sweep |
Spaces | Daily | Keeps Learning Space subscriptions in step with the payment provider. |
learnomy_pro_credly_sync |
Certificates Pro | Daily | Syncs issued badges with Credly. |
learnomy_pro_webhook_housekeeping |
Webhooks Pro | Daily | Prunes the webhook delivery log. |
learnomy_pro_process_pending_payouts |
Stripe Connect | Daily | Starts the instructor payout run. |
learnomy_pro_recompute_analytics |
Analytics | Daily | Recalculates the analytics dashboard. |
learnomy_pro_deliver_webhook |
Webhooks Pro | When needed | One webhook delivery attempt. |
learnomy_pro_retry_webhooks |
Webhooks Pro | When needed | Re-queues webhook deliveries due a retry. |
learnomy_pro_pay_instructor |
Stripe Connect | When needed | Pays one instructor. |
learnomy_pro_process_payout |
Stripe Connect | When needed | Handles one queued payout. |
learnomy_pro_spaces_send_batch |
Spaces | When needed | Sends one batch of a Learning Space announcement. |
learnomy_pro_space_group_enroll_batch |
Spaces | When needed | Enrolls one batch of a space group into its courses. |
learnomy_pro_space_group_unenroll_batch |
Spaces | When needed | Removes one batch of a space group from its courses. |
learnomy_pro_space_status_batch |
Spaces | When needed | Applies a space status change to one batch of members. |
learnomy_pro_space_course_scope_unenroll_batch |
Spaces | When needed | Removes access after a course leaves a space. |
learnomy_pro_space_deleted_revoke_batch |
Spaces | When needed | Revokes access after a space is deleted. |
learnomy_pro_wpf_apply_tags |
Wp Fusion | When needed | Applies CRM tags through WP Fusion. |
learnomy_pro_wpf_remove_tags |
Wp Fusion | When needed | Removes CRM tags through WP Fusion. |
learnomy_pro_auto_resume_subscription |
Membership Pro | When needed | Resumes a paused subscription on its resume date. |
learnomy_pro_dunning_retry |
Membership Pro | When needed | Retries a failed renewal charge. |
learnomy_pro_plan_change_scheduled |
Membership Pro | When needed | Applies a plan change scheduled for the end of a period. |
learnomy_pro_content_drip_schedule_unlocks |
Content Drip | When needed | Sends lesson-unlocked notices. |
learnomy_xapi_send |
Xapi | When needed | Sends one xAPI statement to the learning record store. |
learnomy_pro_membership_housekeeping |
Membership Pro | Daily | Removes dunning records of deleted subscriptions and cancels their queued retries. |
learnomy_pro_sweep_untouched_path_drafts |
Learning Paths | Daily | Deletes learning path drafts that were created and never edited. |
When something is not happening#
- Emails or webhooks are late. Cron is not firing. Check for a server cron, then look in Scheduled Actions for a growing list of pending
learnomy_send_notification_asyncorlearnomy_deliver_webhookactions. - A webhook endpoint stopped receiving events. It may have been paused after repeated failures. See Outgoing Webhooks.
- Drip lessons did not unlock on time.
learnomy_unlock_drip_lessonsruns hourly;wp learnomy dripruns it at once. - A payment is stuck on Pending.
learnomy_reconcile_paymentschecks the gateway hourly; a backlog usually means the gateway webhook is not configured. See Transactions.
Related#
Adding your own recurring job#
Register it with Learnomy instead of scheduling it yourself. Learnomy arms it (Action Scheduler first, WP-Cron as the fallback), checks it only on cron and admin requests, and clears it when Learnomy is deactivated:
add_filter( 'learnomy_cron_jobs', function ( array $jobs ) {
$jobs['my_addon_nightly_sync'] = 'daily'; // Any registered cron schedule: hourly, twicedaily, daily, weekly.
return $jobs;
} );
add_action( 'my_addon_nightly_sync', 'my_addon_run_sync' );
To stop it, for example when your add-on is deactivated, call \Learnomy\Cron::unschedule( 'my_addon_nightly_sync' ). If your job writes rows that pile up (a log, a sync history), prune them in the same job.