Skip to content

Fix WordPress exclusion regex bypassing WooCommerce checkout URLs#18

Merged
luke-owen-crowdhandler merged 2 commits into
mainfrom
maintenance/woo-ignore-finesse
Mar 18, 2026
Merged

Fix WordPress exclusion regex bypassing WooCommerce checkout URLs#18
luke-owen-crowdhandler merged 2 commits into
mainfrom
maintenance/woo-ignore-finesse

Conversation

@luke-owen-crowdhandler
Copy link
Copy Markdown
Contributor

The wc_order query parameter on checkout order-received pages was matching the WordPress exclusion regex, causing the worker to skip CrowdHandler entirely for checkout confirmation pages.

Added (?!order) negative lookahead so wc_order_* keys no longer trigger the bypass while all other wp-/wc- exclusions still work.

The wc_order query parameter on checkout order-received pages was
matching the WordPress exclusion regex, causing the worker to skip
CrowdHandler entirely for checkout confirmation pages.

Added (?!order) negative lookahead so wc_order_* keys no longer
trigger the bypass while all other wp-*/wc-* exclusions still work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the WordPress URL/query exclusion logic used by the Cloudflare Worker so WooCommerce “order-received” / checkout confirmation traffic isn’t accidentally bypassing CrowdHandler due to wc_order* query args matching the WordPress exclusion regex.

Changes:

  • Updated the wordpressExclusions regex to add an order negative lookahead after wp-*/wc-* style prefixes.
  • Regenerated the built dist/ artifacts to include the updated regex.

Reviewed changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated 1 comment.

File Description
helpers/misc.js Adjusts the WordPress exclusion regex intended to stop wc_order* from triggering bypass.
dist/index.js Compiled worker output reflecting the updated exclusion regex.
dist/index.js.map Updated source map reflecting rebuilt output.
dist/README.md Updates the build timestamp for the generated dist/ assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread helpers/misc.js Outdated
],
//regex for matching wordpress urls and query strings
wordpressExclusions: /(w[cp][-_](?![-_]).*|xmlrpc\.php|readme\.html|license\.txt|trackback|feed(?:\/.*)?|comments\/feed(?:\/.*)?)(\?.*)?/,
wordpressExclusions: /(w[cp][-_](?![-_])(?!order).*|xmlrpc\.php|readme\.html|license\.txt|trackback|feed(?:\/.*)?|comments\/feed(?:\/.*)?)(\?.*)?/,
(?!order) was too broad — would also prevent bypassing legitimate
WooCommerce admin paths like wc-orders. Narrowing to (?!order_)
targets only the wc_order_ key prefix used in checkout URLs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@luke-owen-crowdhandler luke-owen-crowdhandler merged commit f0c6bb7 into main Mar 18, 2026
@luke-owen-crowdhandler luke-owen-crowdhandler deleted the maintenance/woo-ignore-finesse branch March 18, 2026 16:51
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.

2 participants