Guide

First run

Activation sets a flag rather than doing work immediately, then the setup wizard connects the site and records client details. This page describes what happens and what you control.

What activation does

WordPress redirects immediately after register_activation_hook fires, so Mantle cannot run its real setup there. Instead the activation hook records two options and lets the next request act on them.

  1. Activation hook runs

    mantle_activation() adds mantle_activated, records the activating user in mantle_activation_user_id, and sets mantle_flush_rewrite_rules.

  2. Next request, on init

    Bootstrap checks mantle_activated at priority 99, fires the mantle_activated action, then deletes both options so this runs once.

  3. Conditional redirect

    If the request is in the admin, is not a multi-activation (activate-multi is absent), and the current user is the activating user, Mantle redirects to the setup wizard.

  4. Migrations

    At init priority 100, Mantle compares the stored version setting against MANTLE_PLUGIN_VERSION and runs migrations if it is behind.

The wizard lives at:

Setup wizard URL bash
/wp-admin/admin.php?page=mantle&view=setup

Complete setup

The wizard is a React view backed by its own REST namespace, separate from ordinary settings:

RouteMethodsPurpose
/mantle/v1/setupGET, POSTRead and write the setup payload
/mantle/v1/setup/<setting_key>GET, POSTRead and write a single setup key
/mantle/v1/pinPOSTBegin PIN-based verification
/mantle/v1/pin/<pin>POSTSubmit a four-digit PIN
/mantle/v1/connectorGETStart the connection flow
/mantle/v1/connector/callbackGETOAuth callback

Setup data is stored separately from the main settings option and is read through Mantle\Model\Setup, which supports dot notation for nested keys such as authentication.steps.pin.status.

Enable modules

Three modules — client_info, dashboard, and welcome — are type core and are always enabled; is_enabled() returns true for them unconditionally and they cannot be switched off. The other thirteen are functional and default to whatever is recorded in the mantle_modules option.

Request GET /wp-json/mantle/v1/modules
HeadersKey: value
Accept application/jsonX-WP-Nonce REPLACE_WITH_REST_NONCE
Response 200 OK
BodyJSON
[
  { "slug": "client_info", "name": "Client Info", "active": true, "type": "core" },
  { "slug": "monitoring", "name": "Monitoring", "active": false, "type": "functional" }
]

The response shape is the mantle_modules option: each entry carries slug, name, active, and type. Toggle a module by posting to /mantle/v1/modules/<module_id>.

Enabling a module takes effect on the next request: Module_Loader::update_module_status() writes the option, clears its in-memory module list, and re-fires mantle_register_module.

Verify

Confirm the schema is intact bash
wp mantle settings audit
Option: mantle
Schema keys: 102
Saved keys: 102
Missing schema keys: 0
Orphaned saved keys: 0

Success: Settings audit passed. Saved keys match the registered schema.
Success
Ready to configure

Mantle is installed, setup is complete, and the settings option matches the registered schema. Continue with the module guides or the reference section.

102 schema keys

Next steps

Was this helpful?