Repository navigation
Remove nofollow from product permalink buttons - #66743
Conversation
Testing GuidelinesHi , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughProduct button rendering now omits ChangesProduct button link attributes
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/woocommerce/tests/php/includes/wc-template-functions-test.php`:
- Around line 29-31: Update the output-buffer cleanup block to use a while loop
that repeatedly calls ob_end_clean() while ob_get_level() remains greater than
$buffer_level, ensuring every nested buffer created after the recorded level is
unwound.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: a2e0799d-9c8a-40cb-8ab1-670e477fda02
📒 Files selected for processing (7)
plugins/woocommerce/changelog/fix-product-link-nofollowplugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/button/block.tsxplugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/button/test/block.test.tsxplugins/woocommerce/includes/wc-template-functions.phpplugins/woocommerce/src/Blocks/BlockTypes/ProductButton.phpplugins/woocommerce/tests/php/includes/wc-template-functions-test.phpplugins/woocommerce/tests/php/src/Blocks/BlockTypes/ProductButton.php
kmanijak
left a comment
There was a problem hiding this comment.
Thanks for this contribution! This is well scoped PR which I appreciate!
I verified the changes in three scenarios:
- ✅ classic product grid (shortcode)
- ✅ All Products block (client-side rendered product button)
- ✅ Product Collection
All work as expected.
I left one minor comment about the test file and the setup but otherwise this looks good!
|
Thanks for the review. I simplified the test mocks in 46524ec and reran the targeted JS test:
It passes locally. |
kmanijak
left a comment
There was a problem hiding this comment.
Thanks for your contribution and thanks for addressing my feedback, this looks good! 👍
Submission Review Guidelines:
Changes proposed in this Pull Request:
Product detail links currently receive
rel="nofollow"even when they only navigate to the product permalink. This removesnofollowfrom those links across the client-rendered Product Button, server-rendered blocks, and classic loop templates, while retaining it for cart, direct add-to-cart, and external product links.Closes #43097.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
rel="nofollow"attribute.nofollow.nofollow; the external link should also retainnoopener noreferrer.Testing that has already taken place:
wp-env: 10 passed, 18 assertions.Milestone
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment
Created manually.
Release Communication
Select if this PR needs a generated summary for release notes:
When to use each?
Feature Highlight: New features, UI changes, or improvements merchants will notice.
Developer Advisory: Breaking changes, deprecations, or changes that affect themes/plugins/extensions.
An AI will analyze your PR and post a draft comment for you to review and edit.