Docs · Cron & scheduled tasks

Cron & scheduled tasks

FortPass has a single entry point: run_cron($con) in functions.php. Each task has its own throttle so calling run_cron() more often than needed is harmless — only tasks whose interval has elapsed actually do work.

How it gets triggered

Tasks

TaskIntervalWhat it does
Monthly reportsDay 1 of each monthmonthly_dispatch_reports() sends the security summary email to every eligible user.
Breach digestEvery 24hbreach_digest_dispatch() — HIBP fetch → email to users with breach_alerts_basic or breach_alerts_realtime.
Emergency processingEvery runMarks requests with elapsed wait as granted, sends email + encrypted recovery code.
CleanupEvery 5 min (throttled)cron_cleanup_expired() — reset tokens, login codes, expired emergency invites, PIN attempts, sessions, scan history, cancelled subs, expired trials.
Translation workerEvery 60scron_process_translations() drains the translation queue. See i18n & auto-translation.
New language detectionOn startupcron_detect_new_languages() compares installed langs vs translated_languages_seen setting.
Translation orphan sweepDailyRemoves translation rows whose source object no longer exists.

Cleanup details

The cleanup pass touches several tables on a 5-minute throttle:

Forcing a task to run

Each task's last-run timestamp lives in settings with key cron_*_last_run. Setting it to 0 manually forces the next execution:

UPDATE settings SET setting_value='0' WHERE setting_name='cron_monthly_last_run';

The next run_cron() call will fire the monthly dispatch, regardless of the calendar.

Performance

Each task short-circuits if its interval hasn't elapsed (single SELECT per task). A typical run_cron() call with all timers fresh does < 10 queries and returns in < 5 ms. Cron-on-visit overhead is negligible.

FortPass · © 2026 Medel Platforms · medel.es