Skip to content

Enhancement/9942 siwg woocommerce registration - #13233

Open
zutigrm wants to merge 21 commits into
developfrom
enhancement/9942-siwg-woocommerce-registration
Open

Enhancement/9942 siwg woocommerce registration#13233
zutigrm wants to merge 21 commits into
developfrom
enhancement/9942-siwg-woocommerce-registration

Conversation

@zutigrm

@zutigrm zutigrm commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Related issue(s):

Relevant technical choices

  • The Implementation Brief states that WooCommerce registration should always assign the customer role and treat WooCommerce as the sole account-creation authority when active, regardless of WordPress's own "Anyone can register" setting. This directly contradicts the issue's own Acceptance Criteria, which explicitly require:
    • checking both WordPress and WooCommerce settings,
    • using WordPress's default role whenever "Anyone can register" is enabled - even if WooCommerce is also enabled - and
    • falling back to WooCommerce's customer role only when WordPress registration is closed but WooCommerce's own setting is open.
  • So the PR diverges a bit from IB and follows the AC

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 This comment is automatically updated by CI workflows. Each section is managed independently.

📚 Storybook for d18c9eb:

📦 Build files for d18c9eb:

🎭 Playwright reports for d18c9eb:

@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 3.25 MB

ℹ️ View Unchanged
Filename Size Change
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css 124 B 0 B
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/index.js 42.9 kB 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.css 307 B 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/contribute-with-google/index.js 6.01 kB 0 B
dist/assets/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js 5.21 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/index.js 6.02 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js 5.21 kB 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.css 84 B 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/sign-in-with-google/index.js 18.5 kB 0 B
dist/assets/css/googlesitekit-admin-css-********************.min.css 74 kB 0 B
dist/assets/css/googlesitekit-adminbar-css-********************.min.css 12.7 kB 0 B
dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 851 B 0 B
dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 9.09 kB 0 B
dist/assets/js/46-********************.js 3.84 kB 0 B
dist/assets/js/65-********************.js 1.03 kB 0 B
dist/assets/js/187-********************.js 101 kB 0 B
dist/assets/js/308-********************.js 3 kB 0 B
dist/assets/js/315-********************.js 3.08 kB 0 B
dist/assets/js/397-********************.js 477 kB 0 B
dist/assets/js/403-********************.js 2.26 kB 0 B
dist/assets/js/509-********************.js 970 B 0 B
dist/assets/js/658-********************.js 52.7 kB 0 B
dist/assets/js/917-********************.js 2.41 kB 0 B
dist/assets/js/analytics-advanced-tracking-********************.js 404 B 0 B
dist/assets/js/googlesitekit-activation-********************.js 27.1 kB 0 B
dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 65.9 kB 0 B
dist/assets/js/googlesitekit-admin-pointers-tracking-********************.js 5.37 kB 0 B
dist/assets/js/googlesitekit-adminbar-********************.js 41.4 kB 0 B
dist/assets/js/googlesitekit-api-********************.js 8.04 kB 0 B
dist/assets/js/googlesitekit-block-tracking-********************.js 5.56 kB 0 B
dist/assets/js/googlesitekit-components-********************.js 6.28 kB 0 B
dist/assets/js/googlesitekit-consent-mode-********************.js 26 kB 0 B
dist/assets/js/googlesitekit-data-********************.js 1.83 kB 0 B
dist/assets/js/googlesitekit-datastore-forms-********************.js 7.21 kB 0 B
dist/assets/js/googlesitekit-datastore-location-********************.js 1.6 kB 0 B
dist/assets/js/googlesitekit-datastore-pdf-********************.js 1.2 kB 0 B
dist/assets/js/googlesitekit-datastore-site-********************.js 19.1 kB +37 B (+0.19%)
dist/assets/js/googlesitekit-datastore-ui-********************.js 7.37 kB 0 B
dist/assets/js/googlesitekit-datastore-user-********************.js 23.7 kB 0 B
dist/assets/js/googlesitekit-entity-dashboard-********************.js 79.4 kB 0 B
dist/assets/js/googlesitekit-events-provider-contact-form-7-********************.js 2.35 kB 0 B
dist/assets/js/googlesitekit-events-provider-easy-digital-downloads-********************.js 1.12 kB 0 B
dist/assets/js/googlesitekit-events-provider-mailchimp-********************.js 2.34 kB 0 B
dist/assets/js/googlesitekit-events-provider-ninja-forms-********************.js 2.3 kB 0 B
dist/assets/js/googlesitekit-events-provider-optin-monster-********************.js 2.22 kB 0 B
dist/assets/js/googlesitekit-events-provider-popup-maker-********************.js 2.44 kB 0 B
dist/assets/js/googlesitekit-events-provider-woocommerce-********************.js 1.08 kB 0 B
dist/assets/js/googlesitekit-events-provider-wpforms-********************.js 2.44 kB 0 B
dist/assets/js/googlesitekit-i18n-********************.js 4.43 kB 0 B
dist/assets/js/googlesitekit-key-metrics-setup-********************.js 59.5 kB 0 B
dist/assets/js/googlesitekit-main-dashboard-********************.js 209 kB 0 B
dist/assets/js/googlesitekit-metric-selection-********************.js 64.7 kB 0 B
dist/assets/js/googlesitekit-modules-********************.js 28 kB 0 B
dist/assets/js/googlesitekit-modules-ads-********************.js 49.8 kB +27 B (+0.05%)
dist/assets/js/googlesitekit-modules-adsense-********************.js 160 kB 0 B
dist/assets/js/googlesitekit-modules-analytics-4-********************.js 280 kB 0 B
dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 25.3 kB 0 B
dist/assets/js/googlesitekit-modules-reader-revenue-manager-********************.js 68.7 kB 0 B
dist/assets/js/googlesitekit-modules-search-console-********************.js 75.4 kB 0 B
dist/assets/js/googlesitekit-modules-sign-in-with-google-********************.js 35.3 kB +146 B (+0.41%)
dist/assets/js/googlesitekit-modules-tagmanager-********************.js 32.1 kB 0 B
dist/assets/js/googlesitekit-notifications-********************.js 85 kB 0 B
dist/assets/js/googlesitekit-polyfills-********************.js 228 B 0 B
dist/assets/js/googlesitekit-settings-********************.js 168 kB 0 B
dist/assets/js/googlesitekit-splash-********************.js 90.5 kB 0 B
dist/assets/js/googlesitekit-user-input-********************.js 56.9 kB 0 B
dist/assets/js/googlesitekit-vendor-********************.js 314 kB 0 B
dist/assets/js/googlesitekit-vendor-lazy-pdf-********************.js 21.7 kB 0 B
dist/assets/js/googlesitekit-widgets-********************.js 179 kB 0 B
dist/assets/js/googlesitekit-wp-dashboard-********************.js 69.2 kB 0 B
dist/assets/js/runtime-********************.js 1.94 kB 0 B
dist/assets/js/sign-in-with-google-********************.js 1.14 kB 0 B

compressed-size-action

@tofumatt tofumatt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few comment tweaks and questions, but overall this seems good-to-go after the few issues mentioned are resolved/answered 👍🏻

Comment on lines +1008 to +1009
* `false` both when WooCommerce is inactive and when it is active but its
* own account-creation settings are closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `false` both when WooCommerce is inactive and when it is active but its
* own account-creation settings are closed.
* `false` when:
* - WooCommerce is inactive
* - when WooCommerce is active but account-creation in WooCommerce
* is disabled.

breakpoint,
} ) {
return createInterpolateElement( message, {
a: showLink ? <Link key="link" href={ settingsURL } /> : <span />,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key prop isn't needed here, from what I can see.

Suggested change
a: showLink ? <Link key="link" href={ settingsURL } /> : <span />,
a: showLink ? <Link href={ settingsURL } /> : <span />,

Comment on lines +63 to +70
br:
breakpoint !== BREAKPOINT_SMALL ? (
<br />
) : (
// eslint-disable-next-line react/jsx-no-useless-fragment
<Fragment />
),
} );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was here before, but why not add a className to this <br /> tag and hide it with CSS instead on small screens? This is sort of odd, and will cause the internal markup of the text to change on screen size changes as well. A pure-CSS implementation would be better.

Comment on lines 46 to +51
const anyoneCanRegister = useSelect( ( select ) =>
select( CORE_SITE ).getAnyoneCanRegister()
);
const anyoneCanRegisterWooCommerce = useSelect( ( select ) =>
select( CORE_SITE ).getAnyoneCanRegisterWooCommerce()
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this would make sense to build as a single, consolidated selector. Especially if we want to expand on the value later and not have to manage each setting.

/**
* Checks if the registration is open.
*
* Checked here in the base class, rather than only in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's redundant phrasing here 🙂

Suggested change
* Checked here in the base class, rather than only in
* Checked here rather than in

Comment on lines +417 to +421
* that public static method on the subclass triggers a fatal
* "Cannot make non static method ... static" error, even though private
* methods aren't supposed to participate in override compatibility
* checks. PHP 8.1+ correctly excludes private methods from that check,
* but the plugin's floor is PHP 7.4.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* that public static method on the subclass triggers a fatal
* "Cannot make non static method ... static" error, even though private
* methods aren't supposed to participate in override compatibility
* checks. PHP 8.1+ correctly excludes private methods from that check,
* but the plugin's floor is PHP 7.4.
* that public static method on the subclass triggers a fatal
* error, even though private methods aren't supposed to
* participate in override compatibility checks.

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.

Update Sign in with Google logic regarding account creation to use WooCommerce Allow customers to create an account setting

2 participants