Skip to content

feat: add simple checkout form template with auto-generated credentials#737

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

feat: add simple checkout form template with auto-generated credentials#737
superdav42 merged 1 commit intomainfrom
feature/simple-checkout

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

@superdav42 superdav42 commented Apr 2, 2026

Summary

  • Adds a new simple checkout form template preset that requires only an email address from the customer
  • Username is derived from the email, password is generated server-side via wp_generate_password(), site title from username, and site URL from site title — all via existing auto-generate mechanisms
  • Adds auto_generate_password toggle to the Password signup field; when enabled, no password field is rendered and validation rules are skipped

Changes

  • Signup_Field_Password: add auto_generate_password toggle; emits a hidden flag when enabled so no password field is rendered; hides strength meter and confirm field via v-show
  • Checkout: generate password via wp_generate_password(16) when the auto-generate flag is present; skip password/password_conf/valid_password validation rules
  • Checkout_Form model: add 'simple' to template enum, use_template(), and save() step_types; add get_simple_template() private method with wu_checkout_form_simple_template filter
  • API schemas (checkout-form-create.php + checkout-form-update.php): add 'simple' to template enum

Testing

  • Create a checkout form, select "simple" template — verify only email field is shown
  • Complete checkout — verify username/password/site-title/site-URL are auto-generated
  • Verify auto-generated password is emailed to customer post-signup

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

Summary by CodeRabbit

  • New Features
    • Added "simple" checkout form template with minimal, pre-configured field setup
    • Introduced password auto-generation capability for customer signup during checkout
    • Password input fields now conditionally hide when auto-generation is enabled
    • Updated checkout form schema to support the new template mode

Introduces a new 'simple' checkout form preset that requires only an
email address from the customer. Username is derived from the email,
password is generated server-side, site title from username, and site
URL from site title — all via existing auto-generate mechanisms.

Changes:
- Signup_Field_Password: add auto_generate_password toggle; emits a
  hidden flag when enabled so no password field is rendered
- Checkout: generate password via wp_generate_password() when the flag
  is present; skip password/password_conf/valid_password validation rules
- Checkout_Form model: add 'simple' to template enum, use_template(),
  and save() step_types; add get_simple_template() private method
- API schemas (create + update): add 'simple' to template enum
@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: 8c453f69-a60c-4e44-a386-86fe740da29d

📥 Commits

Reviewing files that changed from the base of the PR and between 4f03b8c and 90ca0ff.

📒 Files selected for processing (5)
  • inc/apis/schemas/checkout-form-create.php
  • inc/apis/schemas/checkout-form-update.php
  • inc/checkout/class-checkout.php
  • inc/checkout/signup-fields/class-signup-field-password.php
  • inc/models/class-checkout-form.php

📝 Walkthrough

Walkthrough

The changes introduce a new "simple" checkout template option and an auto-generate password feature for customer signup. Schema definitions are updated to permit the "simple" template value, backend logic conditionally handles password auto-generation with modified validation rules, and signup field UI toggles password visibility when auto-generation is enabled.

Changes

Cohort / File(s) Summary
API Schema Updates
inc/apis/schemas/checkout-form-create.php, inc/apis/schemas/checkout-form-update.php
Added 'simple' to the template field's enum values and updated field descriptions to document this new template mode option.
Password Auto-Generation Logic
inc/checkout/class-checkout.php, inc/checkout/signup-fields/class-signup-field-password.php
Implemented auto-generate password flow: resolves password from request/session, replaces with generated password when auto_generate_password is enabled; conditionally disables password field validation rules and hides password input controls via UI toggle.
Template System Extension
inc/models/class-checkout-form.php
Expanded template validation to include 'simple' mode; added get_simple_template() method defining minimal single-step checkout with auto-generated username/password/site fields; updated template loading and persistence to handle the new template type.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A simple form appears with password spun,
No typing needed, auto-generation's fun!
New templates bloom where checkouts grow lean,
Where fields are hidden and toggles convene,
A nimble solution, swift and serene! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a 'simple' checkout form template and auto-generated credentials support, which are the primary features introduced across all modified files.
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/simple-checkout

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 168b8b8 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 (-1 / -3% ) 37.73 MB 842.50 ms (+18.00 ms / +2% ) 166.00 ms 1033.00 ms (+24.00 ms / +2% ) 2000.00 ms (+56.00 ms / +3% ) 1908.00 ms (+46.40 ms / +2% ) 87.30 ms
1 56 49.02 MB 932.00 ms 150.00 ms (+4.00 ms / +3% ) 1079.50 ms 2068.00 ms 1989.25 ms 80.95 ms (+1.85 ms / +2% )

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

Completed via PR #737, merged to main.

Merged by deterministic merge pass (pulse-wrapper.sh). No worker summary was available — the worker either crashed before writing one or this PR predates the merge summary convention.

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.

1 participant