Skip to content

Releases: ephpm/wordpress-worker

v0.1.2 — Elementor idempotent-lifecycle

Choose a tag to compare

@luthermonson luthermonson released this 11 Jul 22:56
7b08bbe

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_Column in 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)

Choose a tag to compare

@luthermonson luthermonson released this 10 Jul 13:40
0331ff6

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-fires init and wp_loaded for every request (and shutdown after the response), with boot-time did_action counters zeroed so plugins observe FPM-identical hook counts from the first request. Previously these actions fired only once at boot, so WooCommerce's wp_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.