-
Notifications
You must be signed in to change notification settings - Fork 33
Fix: Allow domain override in canonical URLs #3525
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
Conversation
📝 WalkthroughWalkthroughThe changes refactor canonical URL handling in the class by introducing a filter for domain overrides, ensuring canonical URLs are consistently normalized and sanitized when retrieved or stored, and internationalizing a fallback string. The logic now allows for dynamic domain replacement and aligns canonical URLs with the configured Site ID or a filtered domain. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ParselyClass
Client->>ParselyClass: set_canonical_url(post, url)
ParselyClass->>ParselyClass: get_canonical_url(url)
ParselyClass->>ParselyClass: sanitize_url(url)
ParselyClass->>ParselyClass: update_post_meta(post, canonical_url)
Client->>ParselyClass: get_canonical_url_from_post(post)
ParselyClass->>ParselyClass: get_post_meta(post)
ParselyClass->>ParselyClass: get_canonical_url(meta_url)
ParselyClass-->>Client: canonical_url
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes detected. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.15)Note: Using configuration file /phpstan.neon. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)`**/*.{html,php}`: "Perform a detailed review of the provided code with followin...
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
🧠 Learnings (2)📓 Common learningssrc/class-parsely.php (2)🧬 Code Graph Analysis (1)src/class-parsely.php (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (7)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
|
…e-in-canonical-urls" (7905106)
Description
With this PR, we're making the domain overridable in canonical URLs. This is possible through the
wp_parsely_canonical_url_domainfilter. For example:This is useful for sites that have a mismatching Site ID and URL, as it will make some features operational that would otherwise break.
Motivation and context
Fixes #3523.
How has this been tested?
Locally, using manual and automated testing. Some integration tests have been written and will be made available in a future PR, as they are still being cleaned up.
Summary by CodeRabbit
New Features
Improvements