Repository navigation
Apply excluded user roles to WooCommerce events (1.2.3) - #30
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The excluded-roles setting removed the tracking script but left server-side AddToCart, InitiateCheckout and Purchase events running, so an excluded administrator's cart and checkout were still captured. post_event() now skips them with no blocked report and nothing held. It judges only the user's own request: a replay of events held earlier and a request that is not the buyer's (staff completing an order, a gateway webhook) are unaffected. A skipped Purchase is not recorded as delivered, so such a request can send it later. That limit is accepted and stated on the settings page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…trix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The excluded-roles setting removed the tracking script for a selected role, but server-side WooCommerce events ignored it. An excluded administrator's AddToCart, InitiateCheckout and Purchase were still captured from their own signed-in requests.
What changes
post_event()skips an event from an excluded user's own request: no event, no blocked report, nothing held, and the skip is written to the debug log.Exclude Tracking for User Roles, and the settings page and FAQ state both limits below.Accepted limits
Upgrade note
Sites that exclude roles may see lower event counts, because those users' WooCommerce events stop.
Verification
Full run on 4ecfab8 (later commits touch only the report and OpenSpec files):
excluded-rolespecThe scenario matrix has a new section,
ROLE-01toROLE-10. OpenSpec changefix-woo-excluded-rolesis archived in this branch.🤖 Generated with Claude Code