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:
core_minor_only— If true,wp core update --minor; otherwise full core update.allow_plugins— List of plugin slugs allowed to auto-update. Only those are updated.
If no template or no policy, defaults apply (e.g. minor-only core).
Key file
app/Services/Updates/UpdateService.php
run(Site)— Create UpdateRun (running), backup DB, updateCore + updatePlugins, healthcheck; on failure restore DB and set run status failed.updateCore(Site)— wp core update (--minor if policy says so)updatePlugins(Site)— wp plugin update for allowed slugs only
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.