MilliBase: The PHP Array That Becomes a WordPress Admin, API Schema, and Config Layer

A declarative settings framework that turns one source of truth into a React interface, REST validation, encrypted storage, and a pre-WordPress config file.

8 min read • View on GitHub • More from MilliPress

A single PHP array sits at the center of a desk, with four outputs fanning outward into a database box, a REST gate, a React admin panel, and a file drawer. The scene explains how one settings definition can compile into multiple layers of a WordPress system.
MilliBase treats configuration like a compiled artifact, not a form.
Key Takeaways

The settings page disappears

Most WordPress settings tools start with a form. MilliBase starts with a schema. That difference changes the job: instead of stitching together HTML, save handlers, REST endpoints, and React state, you define the settings once and let the framework derive the rest.

That is the real promise here. MilliBase is not a nicer settings page library. It is a compiler for WordPress admin state.

A sealed envelope marked with an encrypted key prefix passes through a locked chamber, while plain keys move through an ordinary bin path. A config file path and a constant override line sit in the background as routing controls.
Keys with the `enc_` prefix take a different path, which makes encryption a convention instead of a separate system.

One schema, four outputs

The core machinery lives in `Schema.php`. According to the repository structure, it turns one PHP config array into database defaults, REST schema, and a client-safe config payload for the React app. In other words, one source of truth feeds both the server and the interface.

MilliBase resolves settings by precedence, then exposes the result through the same schema to both REST and React.

That means the frontend is not inventing its own rules. `SettingsApp.jsx` and `FieldRenderer.jsx` simply render what the schema already knows. The React side stays in sync because it is downstream of the same contract.

LayerWhat it providesWhy it matters
DefaultsBaseline values from the schemaAlways available, even before anything is saved
DatabasePersisted WordPress optionsHolds normal runtime state
Config filePhysical PHP config that can be included earlyMakes settings readable before full WordPress boot
ConstantsHard overrides from codeGives deploy-time control and highest precedence
`enc_` fieldsEncrypted storage pathProtects sensitive values without special per-field plumbing

Why `Manager.php` waits on purpose

`Manager.php` uses deferred initialization so the framework can respect WordPress timing and translation rules. That is a small detail with a large effect: the settings object can exist early for programmatic use, while the admin page and translated UI strings wait until WordPress is ready.

We’re happy to share that MilliCache has finally launched. Alongside the release, we introduced a flexible rule system that powers cache behavior. This system is also available as a standalone open-source package called MilliRules.

That quote is about MilliCache, not MilliBase, but it fits the same design culture. The team seems interested in splitting a system into reusable pieces instead of forcing everything into one monolith.

Settings.php is where the real policy lives

If `Schema.php` defines the shape, `Settings.php` defines the rules of motion. It supports dot-notation access like `general.enabled`, and it resolves values through a clear priority stack: constants first, then the config file, then the database, then defaults.

That ordering matters because it gives developers a predictable override model. A deployed constant can win without rewriting the database, while the database still remains the normal persistence layer for runtime changes.

QuestionTraditional settings pageMilliBase
Where does truth live?Scattered across forms, options, and custom codeOne schema drives everything
How are values resolved?Usually ad hocA fixed precedence chain
How is sensitive data handled?Often manual or inconsistentKeys prefixed with `enc_` are encrypted by convention
Can it work before WordPress is fully loaded?Usually noYes, through the config file path

The config file is the hidden killer feature

The standout move is `ConfigFile.php`. Instead of treating settings as something WordPress must fetch from the database every time, MilliBase can write a physical PHP file and read it before the rest of WordPress is available. That is a systems-level escape hatch, not a cosmetic optimization.

The repo analysis also notes `opcache_invalidate`, which is the right finishing touch. If PHP caches the file, the update path still needs to stay honest. This is what makes the feature feel intentional rather than clever for its own sake.

$settings = $manager->settings();
$value = $settings->get('general.enabled');

if ($settings->standalone()) {
    // Constants and config file values can still resolve here.
}

Why the frontend feels native

The React admin is not bolted on. It is generated from the same schema that powers server validation and persistence. That is why the UI can feel native to WordPress without becoming a separate application with its own drift and edge cases.

The useful trade-off is obvious: less hand-built UI code, but more commitment to a declarative model. If you want arbitrary admin behavior, this is restrictive. If you want consistent plugin settings with less glue, that restriction is the point.

Where MilliBase fits in the WordPress ecosystem

Compared with a traditional hand-rolled settings page, MilliBase asks you to think in schemas, precedence, and generated interfaces. Compared with a generic React admin dashboard, it gives you tighter integration with WordPress storage, REST validation, and boot timing.

ApproachStrengthCost
Manual WordPress settingsMaximum freedomLots of glue code and drift
Plain React adminModern UI controlYou still build storage and validation
MilliBaseSingle declarative source of truthMore opinionated, less ad hoc flexibility