-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
webdesign29 edited this page Jun 13, 2026
·
2 revisions
bext-wp is a small, dependency-free, namespaced (Bext\WP) plugin with a custom autoloader.
bext-wp.php (normal plugin) or mu-loader.php → bext-wp/bext-wp.php (must-use)
│
▼
Plugin::instance()->boot()
│ builds Env, then registers modules
├── always: Settings, Admin, Health (so the UI always exists)
└── gated: Cache, Cron, SDK (Env::is_enabled)
Each module exposes register() and is expected to no-op when not behind bext and fail
open on any bext call.
| File | Responsibility |
|---|---|
bext-wp.php |
Plugin header, constants, autoloader, boot, deactivation cleanup |
mu-loader.php |
must-use stub that requires the package from its subdirectory |
uninstall.php |
removes all bext_wp_* options (multisite-aware) |
src/Plugin.php |
singleton orchestrator; boots modules |
src/Env.php |
config resolution (constant > setting > default) + loopback/cloud transport |
src/Settings.php |
wp-admin Settings page (option bext_wp_settings) |
src/Cache.php |
purge-on-change + personalization-safe headers + manual purge |
src/Cron.php |
Action Scheduler taming + queue stats |
src/Health.php |
config checks + PHP-warning capture |
src/Admin.php |
dashboard + admin-bar pill |
src/SDK.php |
wp_mail + job bridge |
src/Network.php |
multisite network-admin settings + cross-site dashboard/purge (loads only on multisite) |
cli/Commands.php |
wp bext … |
bin/deploy-fleet.sh |
copy-per-site installer |
Env is the one place that knows how to talk to bext:
-
Config —
mode(),is_enabled(),app_id(),purge_on_save_enabled(),anon_cache_control(),sdk_email_enabled(),sdk_jobs_enabled(), cloud getters — each layered constant > setting > default. -
Detection —
is_behind_bext()(param / header / sticky flag / mode). -
Transport —
endpoint_base()(loopback127.0.0.1:80vs cloud URL) +transport_headers()(Host, andAuthorization: Bearerin cloud mode), used bypurge_proxy(),sdk_request(),bext_get().
| Option | Autoload | Purpose |
|---|---|---|
bext_wp_settings |
yes | the Settings page values |
bext_wp_detected |
yes | sticky "we've seen a bext signal" flag (auto mode) |
bext_wp_purge_log |
no | recent purges (dashboard) |
bext_wp_recent_warnings |
no | captured PHP warnings (dashboard) |
Transient bext_wp_test_result holds the last Test connection outcome (60 s).
-
BEXT_SERVERFastCGI param → detection. -
POST /__bext/cache/purge-proxy→fastcgi_cache.invalidate_paths/prefix(the real eviction). -
BEXT_PURGE_TOKENenv → opt-in bearer auth for remote (cloud) purges. -
/__bext/sdk/*(email/queue),/__bext/health→ SDK + dashboard.
PHP 7.4+ (no 8.0-only syntax). Multisite-aware (per-blog options; subdirectory full-purge scoped to the blog path). Works with or without WooCommerce / Action Scheduler.
bext-wp · GPL-2.0-or-later · Sponsored by webdesign29 & Inklura · bext.dev
Getting started
Features
Reference
Operations