Core, plugins and theme go into Test Mode.
There are three possible modes for each module.
- no change ✅
- test mode 🚧
- disabled 🚫
The admin bar shows the current WordPress environment and each module's mode with a status emoji.
WP Environment: setsWP_ENVIRONMENT_TYPEtostagingin test mode, orlocalwhen disabled.Disallow robots: setsblog_publicto0in both test mode and disabled mode.Cron events: stops cron requests in both test mode and disabled mode.Action Scheduler: stops queue and asynchronous request processing in both test mode and disabled mode.Mail: redirects all outgoing mail to the site admin in test mode. Disabled mode uses FluentSMTP simulation when available, or blocks mail at the WordPress level otherwise.Outbound HTTP requests: allows only same-site and explicitly approved requests in test mode, or disables all HTTP requests entirely.MakeCommerce payment gateway: uses the sandbox in test mode, or disables its payment and shipping methods entirely.
Airplane Mode: disables external assets, avatars, or embeds.- Debug WordPress how-to
Implement
Module
interface.
add_filter(
'plugins_loaded',
static function () {
add_filter(
'szepeviktor/test-mode/modules',
static function (array $modules): array {
$modules[] = \My\TestMode\Module::class;
return $modules;
},
10,
1
);
},
10, // Before 11!
0
);RELEASE_TAG="$(git tag --sort=version:refname | tail -n 1)" vendor/bin/consistent-versions check