Integrate Customer Reviews for WooCommerce anonymity: show "Anonymous" in review notifications#130
Open
ZebaAfiaShama wants to merge 1 commit into
Open
Conversation
When a customer submits a product review anonymously via the "Customer Reviews for WooCommerce" (CusRev) plugin, the review is stored with comment_author set to CusRev's "Anonymous" label while the verified buyer's WordPress user id and email stay attached to the comment. WooReviews::add() took the user-id branch and used the account display name (often the email prefix, e.g. "X123" for X123@gmail.com), so the notification leaked the identity the customer asked to hide — and the retained email also resolved to their gravatar. Detect anonymous reviews (CusRev's "Anonymous" author label when CusRev is active, or an empty comment_author) and surface a neutral "Anonymous" label, dropping the email so no name, email prefix or gravatar is shown. Both the label and the detection are filterable (nx_woo_review_anonymous_label, nx_is_anonymous_review). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Integrates NotificationX with the Customer Reviews for WooCommerce (CusRev) plugin's anonymity feature. When a customer submits a product review anonymously, the social-proof notification now shows "Anonymous" instead of leaking the account display name / email prefix (e.g. "X123" for
X123@gmail.com).The problem
When a customer picks Anonymous as their Display name on CusRev's review (reminder/aggregated) form, CusRev stores the review with
comment_author = "Anonymous"while the verified buyer's WordPressuser_idand email stay attached to the comment.WooReviews::add()checkeduser_idfirst and used the accountdisplay_name(often the email prefix), ignoring thecomment_author. So the notification displayed the customer's identity — exactly what they asked to hide. The retained email also resolved to their gravatar.The fix
In
includes/Extensions/WooCommerce/WOOReviews.php, after building the review data, detect anonymous reviews and surface a neutral label:comment_authorequals CusRev's "Anonymous" label (localized string or English fallback) while CusRev is active (Ivole/CR_Reviews), orcomment_authoris empty (guest reviews / imports — matches CusRev's own Google-feed heuristic).is_anonymous.nx_woo_review_anonymous_label,nx_is_anonymous_review.Testing
Verified end-to-end in a WordPress + WooCommerce 10.9.1 + Customer Reviews for WooCommerce 5.113.0 sandbox:
CR_Endpoint::create_review) → stored ascomment_author="Anonymous",user_idset, email retained.No behavior change for non-CusRev or non-anonymous reviews.