Switching Environments #
To set the environment programmatically:
update_option('dmsi_aapi_environment', 'development');
To set the environment using environment.php, place a file at the plugin root (wp-content/plugins/dmsi-advanced-api/environment.php) with content such as:
<?php
return [
'environment' => 'development',
'jwt_access_ttl' => 7200,
];
Values in environment.php override the corresponding database options at runtime.
Environment Behavior Differences #
| Behavior | production | staging | development |
|---|---|---|---|
| HTTPS enforced | Yes — HTTP returns 403 | Yes | No — HTTP allowed |
| Debug logging | No | Optional | Yes |
X-DMSI-Environment header | production | staging | development |
Sandbox vs. Environment #
Sandbox is a mode, not an environment. Sandbox mode can be enabled in any environment (production, staging, or development). When sandbox is enabled, requests made with the sandbox key are processed against isolated sandbox database tables (dmsi_aapi_sandbox_*) and do not affect live data. Rate limits do not apply to sandbox requests.
To enable sandbox mode:
update_option('dmsi_aapi_sandbox_enabled', 1);
Or use the admin UI: navigate to the DDLS Developer admin shell and open the Sandbox page.
