Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.78k stars 894 forks source link

Social media previews: display an alert if the image format is not allowed #21210

Open enricobattocchi opened 8 months ago

enricobattocchi commented 8 months ago

The social media previews are correctly warning you to use the correct image format when selecting an image for FB or Twitter, but the image is displayed nonetheless. ~This happens also if you use an unsupported image format for the featured image, but in that case you don't get any alert so users might be confused. In alternative,~ we might keep displaying the image but turn on the alert even when the image is coming from outside (as a featured image or a content image)

igorschoester commented 7 months ago

I'm having doubts if this is the best UX to offer. It is a valid image and could potentially be frustrating to a user if the user can still select such image in the media library. And even then, it is a valid image according to the browser. Are we sure socials are stopping these image types?

That said, I tried to follow the Facebook path of this in the code, regarding the editor:

The warnings seem to also end up in the ImageSelect. Where we have some logic whether to display them or not: only if there is a selected image.

So actually, the user selects an image, but we disregard it. So we will need to invent a "trying to select" thing to make sure it does not end up in the form. This is not at all how we are currently dealing with this. Making this a very non-trivial change. Once this is tackled, X/Twitter would look the same. And then we have the settings, which I didn't look into yet.

pls78 commented 7 months ago