denchev / simple-wordpress-ogimage

1 stars 2 forks source link

Facebook required all og:image tags #3

Open Yuribtr opened 7 years ago

Yuribtr commented 7 years ago

Hi! I made small changes in your plugin to support FB requirements. https://github.com/Yuribtr/simple-wordpress-ogimage/pull/1/commits/febb27d9d109555a4b4e3b962142188dcca812bd This needed for passing tests at https://developers.facebook.com/tools/debug/sharing It is also increase chances for image to be loaded by FB. More info about FB bug here: https://developers.facebook.com/bugs/1626463061012181/ Could you please to review my changes and implement them in your package?

denchev commented 7 years ago

Thanks for the suggested changes.

The reason I haven't put other OG tags is because I'd like the plugin to be image oriented only. There are bunch of other solutions that deal with OG tags.

Are you saying that without the other tags Facebook is less likely to pick up the image from the og:image tag? Also you have set some static values for the image width and height which will not always be the case. I think Wordpress is saving the image width/height so they can be added (if the image is either the default or the feature image).

Regards

Yuribtr commented 7 years ago

As my WP site was suffered from this problem, I read many articles re image processing by FB. Unfortunately I didn't found 100% working solution. Some peoples reported that og:image, og:image:width, og:image:height, og:image:url should be always stated (in exact such order). FB Debug tool says that there should be additional tags (og:url, og:title, og:description). As I newbie in writing WP plugins, I decided to add them all. Now my solution works almost on 100%.

For me it is unclear how to easily take image dimensions inside plugin without "headache". If you do this - it will be great! Also you may add settings "Add OpenGraph url, title, description". Many thanks for your work.