-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add identifier to JSON-LD metadata #3007
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request primarily involve the addition of a CSS class attribute to the JSON-LD script tags outputted by the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🧰 Additional context used📓 Path-based instructions (3)tests/Integration/UI/MetadataRendererTest.php (1)Pattern
tests/Integration/Endpoints/RestMetadataTest.php (1)Pattern
tests/e2e/specs/front-end-metadata.spec.ts (1)Pattern
🔇 Additional comments (3)tests/e2e/specs/front-end-metadata.spec.ts (1)
The test assertions have been properly updated to verify the presence of the new Also applies to: 70-70, 85-85, 110-110, 129-129, 148-148 tests/Integration/UI/MetadataRendererTest.php (1)
The assertion has been properly updated to verify the presence of the new tests/Integration/Endpoints/RestMetadataTest.php (1)
The expected output has been properly updated to include the new Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great idea, thank you!
I'm approving it as it looks good. My only suggestion is that we could use id
instead of class, since it should be unique. But just a nitpick, class
works just fine for this purpose as well, so feel free to do it either way :)
@vaurdan, just for context, I did consider an ID when I thought of this PR, and then I looked on how Yoast and Rank Math do it. Both of them identify their JSON-LD with |
Description
There are many plugins that generate JSON-LD. When our plugin's metadata is output as JSON-LD, it's often hard to distinguish if there are several other JSON-LD blocks in the page's source. This can be a hindrance when troubleshooting.
This PR adds a
class="wp-parsely-metadata"
identifier to our JSON-LD's<script>
tag, so our own metadata can easily be spotted when trying to troubleshoot.Motivation and context
Make troubleshooting easier.
How has this been tested?
Existing tests modified to pass.
Summary by CodeRabbit
New Features
Bug Fixes