Skip to content
Corex

AdvancedSettingsService

Corex\Config\Settings\AdvancedSettingsService · class · Config layer

The Advanced settings section (spec 068 T203): a truthful system-diagnostics read-out and the danger-zone actions, each gated behind an exact typed confirmation so a destructive reset can never fire by accident (fail-closed). It composes from already-gathered real facts and never performs the reset itself — the caller runs the concrete reset only after {@see confirms()} returns true. WordPress-free, so it is unit-testable.

A real system-diagnostics report from gathered facts — never fabricated values.

The danger-zone actions. Each names exactly what it reverses and the phrase the operator must type to run it — a reset never touches unrelated owner content (FR-141).

confirms(string $typed, string $expected): bool

Section titled “confirms(string $typed, string $expected): bool”

Fail-closed confirmation: the destructive action proceeds only when the typed phrase exactly matches the expected phrase (case-sensitive, whitespace-trimmed). An empty expected phrase or any mismatch denies the action.