Skip to content

GH#738: fix: simple checkout form follow-up fixes#739

Merged
superdav42 merged 1 commit intomainfrom
feature/738-simple-checkout-followup-fixes
Apr 2, 2026
Merged

GH#738: fix: simple checkout form follow-up fixes#739
superdav42 merged 1 commit intomainfrom
feature/738-simple-checkout-followup-fixes

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

@superdav42 superdav42 commented Apr 2, 2026

Summary

  • Skip JS password validation rules when auto_generate_password is enabled on the checkout form — the server-side logic already handles this but at render time the flag is not in the request, so detect it from form settings instead.
  • Register wu_dmtable on $wpdb early in WP_Ultimo::init() to prevent PHP notices about undefined property when domain mapping code runs before Domain_Mapping::startup().
  • Add the same wu_dmtable fallback in Domain::get_by_domain() for non-sunrise plugin load paths.
  • Add simple template entry (Email Only icon) to the checkout form template list.

Files Changed

  • inc/checkout/class-checkout.php — JS validation fix for auto-generated passwords
  • inc/class-wp-ultimo.php — early wu_dmtable registration
  • inc/models/class-domain.phpwu_dmtable fallback in get_by_domain()
  • inc/admin-pages/class-checkout-form-list-admin-page.php — add simple template entry

Runtime Testing

Risk level: Low — these are follow-up fixes to PR #737 (already merged). Changes are: a JS validation guard (no new logic path, only skips rules when flag is set), two `` property guards (defensive fallbacks, no new queries), and a template list entry (UI-only addition). Self-assessed.

Closes #738


aidevops.sh v3.5.611 plugin for OpenCode v1.3.0 with claude-sonnet-4-6 spent 2m on this as a headless worker.

Summary by CodeRabbit

  • New Features

    • Added "Simple (Email Only)" checkout form template option
  • Bug Fixes

    • Fixed password validation handling when auto-generate password is configured in checkout forms
    • Improved domain mapping table initialization to prevent reference errors

- Skip JS password validation rules when auto_generate_password is
  enabled on the checkout form (class-checkout.php). The server-side
  logic already handles this via request_or_session(), but at render
  time the flag is not in the request, so detect it from form settings.

- Register wu_dmtable on $wpdb early in WP_Ultimo::init() to prevent
  PHP notices about undefined property when domain mapping code runs
  before Domain_Mapping::startup() (class-wp-ultimo.php).

- Add the same wu_dmtable fallback in Domain::get_by_domain() for
  non-sunrise plugin load paths (class-domain.php).

- Add 'simple' template entry (Email Only icon) to the checkout form
  template list (class-checkout-form-list-admin-page.php).

Closes #738
@superdav42
Copy link
Copy Markdown
Collaborator Author

Completion Summary

This summary was written by the worker at PR creation time for the deterministic merge pass.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79614786-7042-439c-adfb-bc9cb2c1005b

📥 Commits

Reviewing files that changed from the base of the PR and between 26168ed and 3ded7e6.

📒 Files selected for processing (4)
  • inc/admin-pages/class-checkout-form-list-admin-page.php
  • inc/checkout/class-checkout.php
  • inc/class-wp-ultimo.php
  • inc/models/class-domain.php

📝 Walkthrough

Walkthrough

This PR commits four uncommitted fixes from the simple checkout form follow-up. Changes include adding a "simple" template option to the checkout form admin UI, skipping password validation rules when auto-generation is enabled, initializing domain-mapping table globals early in plugin startup, and providing fallback initialization for domain lookups.

Changes

Cohort / File(s) Summary
Checkout Form Template UI
inc/admin-pages/class-checkout-form-list-admin-page.php
Added "Simple (Email Only)" template option with corresponding dashicon to the checkout form template selector in the admin modal.
Checkout Password Validation
inc/checkout/class-checkout.php
Modified get_js_validation_rules() to detect auto_generate_password enabled on password fields and clear the corresponding client-side validation rule strings (password, password_conf, valid_password) to prevent validator from requiring fields not rendered at runtime.
Domain Mapping Table Initialization
inc/class-wp-ultimo.php, inc/models/class-domain.php
Added early initialization of $wpdb->wu_dmtable global property in WP_Ultimo::init() and fallback check in Domain::get_by_domain() to prevent undefined property notices when domain mapping code runs before Domain_Mapping::startup().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • #737: Introduces the simple checkout form template feature and related password auto-generation logic that these fixes address.
  • #218: Also modifies WP_Ultimo::init() for early multisite-related initialization.
  • #346: Modifies domain-mapping table initialization and domain lookup functionality similarly affected by these changes.

Poem

🐰 A simple form template hops into place,
With passwords that auto-generate with grace,
Early table setup prevents notices grim,
Domain lookups dance, not wrecked by a whim,
Four fixes committed—the follow-up's complete! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the PR as fix-related follow-ups to issue #738 and accurately describes the changeset containing four coordinated fixes.
Linked Issues check ✅ Passed All four files mentioned in issue #738 are present with appropriate changes: JS validation skip, wpdb registration, domain fallback, and template list addition.
Out of Scope Changes check ✅ Passed All changes directly align with the four specific follow-up fixes outlined in issue #738; no unrelated modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/738-simple-checkout-followup-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Performance Test Results

Performance test results for 3e7588b are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 40 37.78 MB 825.50 ms (+42.00 ms / +5% ) 152.00 ms (+4.00 ms / +3% ) 1073.50 ms (+97.50 ms / +9% ) 1980.00 ms 1900.45 ms 85.40 ms
1 56 49.02 MB 945.00 ms 143.00 ms 1087.50 ms 2074.00 ms 1996.50 ms 76.75 ms

@superdav42 superdav42 merged commit 6ded15a into main Apr 2, 2026
11 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Completion Summary


Merged via PR #739 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).

aidevops.sh v3.5.611 spent 4m on this as a headless bash routine.

superdav42 added a commit that referenced this pull request Apr 3, 2026
…password

- Signup_Field_Password_Test: 6 new tests covering auto_generate_password
  defaults, get_fields toggle, to_fields_array hidden flag emission,
  v-show guards on strength meter and confirm field
- Checkout_Form_Test: 11 new tests covering simple template validation,
  use_template() structure, field presence, auto-generate flags on
  username/password/site_title/site_url, filterable hook, and save path

All 17 tests pass against the implementation already in main (PRs #737, #739, #742).

Closes #746
superdav42 added a commit that referenced this pull request Apr 3, 2026
…erated credentials (#747)

* chore: add t524 simple checkout form feature to backlog (re-implement PR #740)

* test(checkout): add unit tests for simple template and auto-generate password

- Signup_Field_Password_Test: 6 new tests covering auto_generate_password
  defaults, get_fields toggle, to_fields_array hidden flag emission,
  v-show guards on strength meter and confirm field
- Checkout_Form_Test: 11 new tests covering simple template validation,
  use_template() structure, field presence, auto-generate flags on
  username/password/site_title/site_url, filterable hook, and save path

All 17 tests pass against the implementation already in main (PRs #737, #739, #742).

Closes #746
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.

chore: commit and PR uncommitted fixes from simple checkout form follow-up

1 participant