[wp-meta] [Making WordPress.org] #5826: Twitter card not working for some plugin pages

Making WordPress.org noreply at wordpress.org
Thu Jul 15 14:14:41 UTC 2021


#5826: Twitter card not working for some plugin pages
------------------------------+--------------------
 Reporter:  pedromendonca     |      Owner:  (none)
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:
Component:  Plugin Directory  |   Keywords:
------------------------------+--------------------
 Some plugins have **banner and icon**, some have just **icon** or
 **banner**, some have **none**.

 To start, the current Twitter card type for sharing a plugin page is
 always `"summary_large_image"`, which is far from ideal for all the cases
 described above.

 These different situations might require different approaches on
 `social_meta_data()`.
 https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
 /wp-content/themes/pub/wporg-plugins/functions.php?#L321

 = Currently

 For the Twitter card type, all plugins use `"summary_large_image"`.

 For the image itself, here is the current logic on `social_meta_data()`:
 - If **2x banner** exist: Use it only for `twitter:image`
 - If **1x banner** exist: Use it only for `og:image`

 = Enhancement

 The cart type should depend on the available images and image ratio:
 - If banner (**2x** or **1x**) exist: Set Twitter card type to
 `"summary_large_image"`
 - If banner don't exist: Fallback to Twitter card type `"summary"` to
 print a small square image (plugin icon or WordPress logo)

 For the image itself, probably it will be ok to include the **1x banner**
 for Twitter if there is no **2x banner**, and also probably it will be
 better to include the **2x banner** for Facebook in the first place.
 So I suggest the same logic for both Twitter and Facebook:
 - If **banner** exist: Use it for `twitter:image` and `og:image` (**2x**
 with fallback to **1x**)
 - If only **icon** exist: Use it for `twitter:image` and `og:image`
 (**2x** with fallback to **1x**)
 - If **none** exist: Fallback to WordPress square logo for `twitter:image`
 and `og:image`

 == Twitter cards documentation

 Here is the current documentation for Twitter cards specs:
 https://developer.twitter.com/en/docs/twitter-for-
 websites/cards/overview/summary
 https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview
 /summary-card-with-large-image

 Twitter card validator:
 https://cards-dev.twitter.com/validator

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5826>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list