Releases: ephpm/wordpress-worker
Release list
v0.1.2 — Elementor idempotent-lifecycle
What
Ships muplugins/elementor-idempotent-lifecycle.php — a drop-in mu-plugin that fixes the Cannot redeclare class Elementor\Element_Column fatal that hits every request from N ≥ 2 under this adapter's per-request init re-fire.
Root cause
Elementor's Elements_Manager::require_files() (elements.php:461) uses require (not require_once) for column/section/repeater. Fires from Plugin::init() on the init action; under FPM init fires once per process (correct), but this adapter's per-request replay re-runs it → redeclaration fatal.
Fix shape
remove_action('init', [Plugin::instance(), 'init'], 0) after boot. All other Elementor hooks (REST, admin, editor, widget-render) stay intact.
Reproduction verified
- Elementor 4.1.4 + WP 7.0 +
ephpm/ephpm:v0.4.2-php8.4 - Without mu-plugin: every request kills a worker (
Cannot redeclare Element_Columnin log; ePHPm recycles + retries) - With mu-plugin: 5 consecutive requests, one worker, zero crashes
Drop-in
cp vendor/ephpm/wordpress-worker/muplugins/elementor-idempotent-lifecycle.php wp-content/mu-plugins/Same drop-in pattern as v0.1.1's woocommerce-session-per-request.php. See README for the rationale.
Full changelog
- fix: Elementor idempotent-lifecycle mu-plugin (redeclaration fatal) (#4)
v0.1.1 - per-request lifecycle actions (WooCommerce cart fix)
Fixed
- WooCommerce add-to-cart (and any plugin hooking per-request work onto
init/wp_loaded) now works in worker mode. The resident worker re-firesinitandwp_loadedfor every request (andshutdownafter the response), with boot-timedid_actioncounters zeroed so plugins observe FPM-identical hook counts from the first request. Previously these actions fired only once at boot, so WooCommerce'swp_loaded-registered add-to-cart handler never executed:?add-to-cart=returned a plain 200 page, set no session cookie, and carts stayed empty. Measured cost: ~2ms per request.
Added
- WooCommerce end-to-end regression suite (
e2e/): add-to-cart redirect +wp_woocommerce_session_*cookie + Store API cart contents + two-user cart isolation. Fails 1/5 on v0.1.0, passes 5/5 on this release. muplugins/woocommerce-session-per-request.php- optional drop-in that rebinds WooCommerce's session singleton to each request's cookies (WC holds boot-time cookie state the adapter cannot reach generically; see README).- README "Lifecycle contract" section: what fires once vs per request, and the observable differences from php-fpm.
Reported with a precise root cause and reproduction by the ePHPm-lab WordPress v5 benchmark - the regression test in this release is the reporter's specification, implemented.