Skip to content

Releases: ephpm/wordpress-worker

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.