WordPress.org

Make WordPress Core

Opened 14 months ago

Last modified 7 months ago

#47417 new enhancement

Do we need a 48 size of favicon in wp_site_icon function?

Reported by: idpokute Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Customize Keywords: 2nd-opinion needs-patch
Focuses: Cc:

Description

Hello guys,

Google announced that they would display favicon in search result.
Here is its guide line; https://support.google.com/webmasters/answer/9290858,

Especially, following sentence makes me open this ticket.
"Your favicon should be a multiple of 48px square, for example: 48x48px, 96x96px, 144x144px and so on"

Currently, WP makes 32x32, 192x192, 180, 270 sizes by wp_site_icon() in /wp-includes/general-template.php
Do you think we need to add 48 size?

Attachments (2)

47417.patch (1.4 KB) - added by dkarfa 14 months ago.
Add support for 48, 96 and 144
47417.2.patch (1.5 KB) - added by dkarfa 14 months ago.
Update patch keep 32 size and also update WP_Site_Icon class

Download all attachments as: .zip

Change History (11)

#1 @idpokute
14 months ago

  • Component changed from General to Bootstrap/Load

@dkarfa
14 months ago

Add support for 48, 96 and 144

#2 @swissspidy
14 months ago

@dkarfa Why removing the 32x32 version? That should be left as-is. Also, WP_Site_Icon would need updating too. But I'd probably just wait until a decision has been made here :-)

#3 @swissspidy
14 months ago

  • Component changed from Bootstrap/Load to Customize

#4 @dkarfa
14 months ago

Your favicon should be a multiple of 48px square, for example: 48x48px, 96x96px, 144x144px and so on. - Referring this https://support.google.com/webmasters/answer/9290858

That why I remove the 32x32 version.

One question, by default it will be 32x32 or 48x48 to check before serving the default favicon URL favicon.ico

#5 @idpokute
14 months ago

I'm a bit curious how Goggle made the number 48, because many people including me use multiple of 16px in general. Also Chrome display 16px favicon in browser tab.

They might use 48px favicon in search result.

@dkarfa
14 months ago

Update patch keep 32 size and also update WP_Site_Icon class

#6 @dkarfa
14 months ago

Thanks, @swissspidy updated the code.

#7 follow-up: @dlh
7 months ago

  • Keywords 2nd-opinion needs-patch added
  • Version 5.2.1 deleted

The 192x192 icon is already a multiple of 48. Is it common for sites to be unable to provide a site icon of that size? I don't know one way or the other.

Regarding 47417.2.patch: Google lists 48px, 96px, and 144px as example sizes that meet their criteria, but it isn't clear to me that they also expect sites to add link tags for each of those sizes. Is it necessary to generate each of them?

Even if it's decided that the 192x192 icon is sufficient, it might not hurt to add a note to the docs for that size to indicate that it's used for Google search results as well as App icon for Android/Chrome so that the size isn't removed so long as it's used by Google for that purpose.

#8 @dlh
7 months ago

  • Milestone changed from Awaiting Review to Future Release

#9 in reply to: ↑ 7 @dlh
7 months ago

I had forgotten that the description for the site icon control includes: "Site Icons should be square and at least 512 × 512 pixels."

The 192x192 icon is already a multiple of 48. Is it common for sites to be unable to provide a site icon of that size? I don't know one way or the other.

So, whether or not it's common, perhaps it's not a use case that core intends to support right now, since uploading a 512x512 site icon as recommended should generate a 192x192 version.

Note: See TracTickets for help on using tickets.