Skip to content
Corex

OperationsMode

Corex\Config\Operations\OperationsMode · class · Config layer

Pure model for the CoreX Operations Mode (spec 065). The operations mode is a real, operator-declared state (persisted by {@see OperationsModeStore}) — distinct from wp_get_environment_type(), which is the default when no mode has been declared. This model owns the truthful metadata for each mode: label, tone, description, the warnings the mode implies, whether changing to it needs confirmation (production, maintenance and coming soon do), and whether it changes public behaviour (maintenance and coming soon do). WordPress-free, so it is unit-testable. It NEVER changes site behaviour itself — the boundary does, safely and reversibly. Coming soon (spec 101) is the fifth mode. Spec 063 named it and spec 065 shipped without it; what each of the two closed modes does to a visitor is {@see MaintenanceGuard} and {@see ComingSoonGuard}, and they are deliberately not the same thing.

The selectable modes, in display order.

Normalise an arbitrary value to a real mode; unknown values fall back to production (the safe default that changes no behaviour), never to an invented mode.

Changing to production, maintenance or coming soon requires an explicit confirmation step.

Maintenance and coming soon change public behaviour: a 503 notice in one, the coming-soon page and a redirect to it in the other.

The mode-specific warnings an operator should see. Real, advisory guidance — not a fabricated status.

The warnings that say something {@see describe()}‘s detail does not: what the mode leaves exposed, or what the operator still has to do. Shown under the current mode, where a warning that restates the detail is the same sentence twice.