Skip to content

summary card for fallback images - #49

Merged
pfefferle merged 2 commits into
mainfrom
twitter-card-fallback
Sep 18, 2026
Merged

pfefferle merged 2 commits into
mainfrom
twitter-card-fallback

Conversation

@pfefferle

Copy link
Copy Markdown
Owner

Follow up to #46. Posts without own images got a summary_large_image card with the site icon, which looks a bit odd. The card is now summary again if og:image only holds the fallback images (site icon, logo, header).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread tests/phpunit/tests/class-test-opengraph.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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() and opengraph_fallback_image() both produce the same URL array, so this returns summary even though the post has its own image and should get summary_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

@pfefferle
pfefferle merged commit ec2ef98 into main Sep 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants