Skip to content

feat: plan 032 — M9 release hardening for WordPress.org: free zip, lifecycle, light-only admin, test targets - #39

Merged
jack9x merged 44 commits into
developfrom
jack/feature/032-m9-release
Nov 11, 2026
Merged

jack9x merged 44 commits into
developfrom
jack/feature/032-m9-release

Conversation

@jack9x

@jack9x jack9x commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR gets YayMatik ready to submit to WordPress.org:

  • Free zip: no license client or updater; admin-shell's license code is removed and its remaining uses are guarded at build time.
  • Lifecycle: WordPress, PHP and WooCommerce versions checked at runtime; clean deactivation and uninstall.
  • Admin: light only, with a Create button in the header on Overview and the editor.
  • Code quality: queries use %i for table names, product lists are bounded, the Tailwind reset no longer reaches WordPress's menu and bar.
  • Readme and a translation template.
  • Tests: every check and e2e journey runs on two wp-env sites: the latest versions, and the minimum (WordPress 6.9, PHP 7.4, WooCommerce 11.0).

Base: develop 5000114. No schema change. One commit per checkpoint, plus fix: commits from review. Built in three runs: CP0–CP7, CP8a–CP9, CP10–CP12.

Checkpoints

  • CP0 Docs, API freeze, review skill (5838e43)
    • Roadmap statuses.
    • Hooks and actions are experimental until Extension API v1; @internal on Step, Module and DataItem.
    • .claude/docs/context-wporg-release-checklist.md and /wp-review.
  • CP1 Test targets (856c522, fix ba62f7f)
    • --wp-env-min site (dev/wp-env-min/).
    • Every check-* takes local, --wp-env or --wp-env-min and refuses staging.
    • ./run.sh check-all prints one PASS/FAIL/SKIP table.
    • ./run.sh probe-mysql --staging makes read-only MySQL 8 checks: erase REGEXP, GET_LOCK, the user meta key collation.
  • CP2 Header, light only (be92a92, fix 326ef09)
    • ThemeProvider and ThemeToggle are gone; <html> is always yay-light.
    • CreateWorkflowButton (in shared/create/) is in the header on Overview and the editor. The editor saves before it creates, so a failed save leaves no new workflow behind.
  • CP3 Lifecycle (d6d4269, fix e79cfa3)
    • Requirements::met() runs on plugins_loaded, before the autoloader. On failure: one notice on the Plugins screen, nothing else loads.
    • The deactivation hook loads no class, and works network-wide.
    • uninstall.php → Uninstaller always removes jobs and transients. Tables, options and meta go only with YAYMATIK_REMOVE_ALL_DATA; coupons stay. Each site of a network is cleaned.
    • Uninstalling a duplicate copy leaves the active copy's data alone.
  • CP4 Header fields, I18n, release build (ebc598b, fix ab2c412)
    • Plugin header (Requires at least 6.9, Requires PHP 7.4, Requires Plugins, WC requires / tested, License).
    • I18n.php removed.
    • YayMatikMenuAdapter; portable sed -i.bak.
  • CP5 UI (02cd472)
    • Kit strings translatable; describe box and examples disabled (D9).
    • Runs empty state without the docs link (D10); run detail and runs section polish (D20).
    • Core logos as inline SVG data: URIs.
    • Tailwind preflight scoped to :where(#yaymatik, body > :not(#wpwrap)).
  • CP6 Settings check, journeys (f20f235, fix 16e6c54)
    • check-settings: ranges, all-or-nothing save, one 400 per field, each Health check fix. The site keeps its daily job times.
    • Seed adds a "Classic checkout" page.
    • New e2e: settings save, Health check fix, classic checkout order, unsubscribe stops the next email.
  • CP7 readme, release gate (4373e0f): readme.txt; the ordered release gate in ops-release.md.
  • Whole-plan review (d031e35, 47debcc).
  • CP8a Build (ca35c23, fixes 423e552, e9c1575, d12c4f2)
    • The free build removes admin-shell's src/License, as YayBulkOrder's approved lite build does. dev/scripts/lib/free-admin-shell.php then adds class_exists guards to the scoped copy, and ABSPATH guards to every admin-shell file in both editions.
    • The patch step fails the build when admin-shell changes under it.
    • Also: composer.json ships, the unused YayMatikProLicenseAdapter is deleted, react/jsx-runtime is external, exception messages are escaped, the ABSPATH guard is in 5 more files, and AdminShell::boot() runs once.
  • CP8b %i (3b6d48f, fix a1a6f11)
    • Every query is prepared where it runs, with tables and columns as %i.
    • IN lists use Schema::in(), which returns '' for an empty list so the query fails loudly.
  • CP8c Bounded product queries (56b32f9, fixes 592ec50, 6db0145)
    • Cross-sell / upsell suggestions: read in chunks of 12, up to 36, with caches primed.
    • Newest products: queried with catalog visibility and stock status.
    • Review products: only catalog-visible products.
    • Cart items: capped at 50 lines with an "and N more items" line.
  • CP8d (b856879)
    • The app's text, border and focus rules are scoped like the preflight. Admin menu and bar computed styles are unchanged with the app's CSS on or off.
    • Clean-site run on --wp-env-min: activation printed nothing, and every screen plus one order through a workflow left no debug.log.
  • CP9 Translation file, docs (7964845): pnpm makepot; languages/yaymatik.pot, also rebuilt into each release zip. Roadmap statuses.
  • CP10 Fixes from the browser check (dc31f27, fix 5cf3ab6)
    • The header Create button also shows on the template preview.
    • Health check "Check again" stays busy for at least 600 ms, then a toast says "No problems found." or "Found N problem(s)."
    • Preview and Send test of an email with a cross-sell or upsell grid use the newest paid order with the most grids (among the last 20). With none, the grid shows the store's newest products, minus the order's own, and the header says "Sample products: no recent order has cross-sells". The has_cross_sells / has_upsells fields keep the order's real value.
    • The seed gives its products cross-sells and upsells.
  • CP11 UI polish (5f164b3)
    • Workflows list: the title-row Browse templates / Create workflow show only when there are workflows; an empty list shows the empty state's pair alone.
    • Opening a step's panel moves the canvas only on the axis where the step is hidden: a step under the panel slides sideways without jumping up or down. A step hidden on both axes is centred, as before.
    • The list's title row keeps its height when the buttons are hidden (CP12, e8a3cea).
  • CP12 Release build, translator comments (e8a3cea)
    • The release build no longer runs phpcbf on the build folder, where it rewrote the patched admin-shell files. It lints the source with pnpm lint:php first and stops on an error.
    • Every JS string with placeholders keeps its translator comment in the minified build; strings shared by two call sites have one comment. wp i18n make-pot on the zip prints no warnings.
    • The coupon step's card template joins its two values with WordPress's own translated list separator, so make-pot no longer reads %discount_type% / %expiry_days% as unordered %d / %e. The card text is unchanged.
  • CP13 Deploy lint
    • ./run.sh deploy lints PHP in the checkout, then builds in its clean worktree with the lint skipped (YAYMATIK_SKIP_LINT=1): the worktree has no lint tools. ./run.sh release still lints and stops when the tools are missing.

Tests

  • pnpm lint, pnpm test (Vitest), pnpm lint:php, pnpm test:php (PHPUnit), pnpm build.
  • ./run.sh check-all --wp-env and --wp-env-min: storage, runs, late module, carts, lifecycle, win-back, catalog, settings, plugin lifecycle.
  • ./run.sh probe-mysql --staging.
  • pnpm e2e, three runs in a row.
  • /wp-review on the free zip (Plugin Check included).

WordPress.org review notes

Short answers for the review thread (U3):

  • Guest email capture without a nonce (includes/Workflow/Core/Cart/EmailCapture.php, wc_ajax_yaymatik_capture_email)
    • Checkout pages are often cached, so a nonce in the page would be stale for most guests.
    • The handler checks the request's origin instead (Sec-Fetch-Site, Origin, Referer against the store's own URL; RequestOrigin), sanitizes its two fields and rate-limits by session, IP and site.
    • The reply is always the same {"success":true}, so it never says whether an address is known.
    • Capture is off unless the store owner turns on cart tracking, and guest capture has its own switch.
  • Hook-name warnings
    • yaymatik_modules, yaymatik_resendable_emails and yaymatik_change_role_allow_all are prefixed. Plugin Check flags them only because they are passed as class constants (self::HOOK, self::FILTER, self::ALLOW_ALL_FILTER).
    • woocommerce_add_to_cart_validation (includes/Engine/FEPages/RestoreCart.php) is WooCommerce's own filter. The restore-cart link applies it before it adds each saved line, exactly as WooCommerce's add-to-cart form does, so other plugins can refuse a product.
  • Admin menu package (vendor-prefixed/)
    • YayCommerce's shared admin-menu package, scoped. The free build leaves out its license client and updater (src/License).
    • Its other files still name those classes on paths that run only for paid YayCommerce plugins. The build adds a class_exists check to each (dev/scripts/lib/free-admin-shell.php, in the public repo), so the free plugin never loads license code and never fails when another YayCommerce plugin is installed.
    • The same step adds defined( 'ABSPATH' ) || exit; to each of its files.
  • UnescapedDBParameter / InterpolatedNotPrepared warnings (28)
    • These are in RunStore, CartStore, RunStepStore, TriggerClaimStore, WorkflowStore and CustomerStats.
    • Each query goes through $wpdb->prepare() where it runs. Table and column names are %i; values are %d / %s.
    • What the checker flags is a SQL fragment that holds only placeholders, built from fixed text:
      • Schema::in() makes the %d,%d,… list for an IN (…), one placeholder per value passed.
      • $filter and $about are fixed WHERE parts with placeholders for the values passed with them.
      • $busy, $columns and $set are lists of placeholders or fixed column names.
    • No value from a request or the database is ever written into the SQL text.
  • Bundled libraries: listed with versions in readme.txt. React, ReactDOM and the JSX runtime are not bundled: the app uses WordPress's own react, react-dom and react-jsx-runtime scripts.

Open before submission

  • This repo, YayCommerce/YayAutomation, goes public (Pro modules included); its default branch develop holds the zip's code (B1).
  • By hand: each of the 8 workflows once on staging, one email in a real inbox, the free zip uploaded and smoke-tested on a clean site (U1).
  • Readme validator (R1).

…ation and the real user_collides(), late-module temp file readable and ignored
… workflow on a failed save; e2e waits for the dialog to close
…notices, targeted option cache deletes, RCs of the minimums accepted
…ee zip (LegacyBridge needs it), Pro adapter out through .distignore, sed failures stop the build
…empty state and run detail polish, inline core logos, scoped preflight
…d, e2e for settings, health fix, classic checkout and unsubscribe
…ck runs, daily job times restored, unsubscribe test with a control shopper, classic checkout waits for the order review
… the active copy's data, only SVG data URIs as logos, no dead WooCommerce guard, readme on waiting runs after a reinstall
…guarded, checked), composer.json shipped, jsx-runtime external, escaped exceptions, ABSPATH guards
…eState, stricter guard check (aliases, dependent classes, guard must name a License class), ABSPATH guards in the Pro zip too
…uses means no orders, refunds_sql() back, upsert test, tidy
…ckorders kept, one catalog rule, order lines primed, overflow counts items
…ke the preflight; WordPress's menu and bar untouched
…ed, stricter guard and ABSPATH checks, pot slug and step order, tidy
…ain feedback, preview picks an order with a product grid or shows sample products, seed cross-sells
…never the order's own, the order with the most grids, every sample grid named, one order load each, Check again safe after leaving the page
…e build, translator comments kept in the minified build, steady list title row, schedule names plan 032
…r, so make-pot has no placeholder warning; pot rebuilt
…tion (public at submission, Pro included, default branch develop)
@jack9x
jack9x merged commit 9b31ca7 into develop Nov 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant