Updates

UpdateService::run() performs safe WordPress updates: it creates a database backup first, updates core and plugins according to the site template's auto-update policy, runs a healthcheck, and restores the backup if the healthcheck fails.

Flow

flowchart LR Start[RunUpdateJob] --> Backup[Backup DB] Backup --> Core[Update core] Core --> Plugins[Update plugins] Plugins --> Health[Run healthcheck] Health --> OK{status ok?} OK -->|Yes| Done[Record completed] OK -->|No| Restore[Restore DB backup] Restore --> Fail[Record failed]

Template policy

Update behavior is driven by the site's template auto_update_policy_json:

If no template or no policy, defaults apply (e.g. minor-only core).

Key file

app/Services/Updates/UpdateService.php

Scheduling

wphoster:run-updates --staging-first runs daily at 01:00. Staging-first means staging sites are updated before production when both share a template/pairing.