summary card for fallback images - #49
Merged
Merged
Conversation
Merged
There was a problem hiding this comment.
🟡 Changes recommended
Logo and multi-image header fallback paths lack regression coverage.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates Twitter card selection so fallback-only images use summary cards.
Changes:
- Detects fallback images before selecting
summary_large_image. - Adds a site-icon fallback regression test.
File summaries
| File | Description |
|---|---|
opengraph.php |
Adjusts Twitter card selection for fallback images. |
tests/phpunit/tests/class-test-opengraph.php |
Adds fallback-image card tests. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🔵 Needs a closer look
The fallback comparison misclassifies posts whose featured image is also configured as the custom logo.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
opengraph.php:680
- This comparison loses provenance: when a post's featured attachment is also configured as the custom logo,
opengraph_default_image()andopengraph_fallback_image()both produce the same URL array, so this returnssummaryeven though the post has its own image and should getsummary_large_image. The card decision needs to distinguish post-sourced images from fallback-sourced images rather than comparing only the final URLs.
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
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.
Follow up to #46. Posts without own images got a
summary_large_imagecard with the site icon, which looks a bit odd. The card is nowsummaryagain ifog:imageonly holds the fallback images (site icon, logo, header).