jaredatch / Shared-Counts

WordPress plugin that leverages SharedCount.com API to quickly retrieve, cache, and display various social sharing counts.
GNU General Public License v2.0
47 stars 16 forks source link

Facebook count isn't showing on the metabox #117

Closed dhanendran closed 2 years ago

dhanendran commented 3 years ago

Plugin version

1.3.0

Current Behaviour

Facebook count is always 0 in metabox

Expected Behaviour

In metabox, Facebook count should show the count from FB

Possible Solution

We need to pass the fields=engagement query param to https://graph.facebook.com/. At the moment plugin is passing only the id and token, with this param FB is returning the same id which we passed. When I add the fields=engagement to the URL, I'm getting reaction_count, share_count, comment_count.

Steps to Reproduce (for bugs)

https://graph.facebook.com/?id=https%3A%2F%2Fbreakingdefense.com%2F2021%2F04%2Fwhy-putin-threatens-ukraine%2F&access_token={FB_TOKEN}

https://graph.facebook.com/?id=https%3A%2F%2Fbreakingdefense.com%2F2021%2F04%2Fwhy-putin-threatens-ukraine%2F&access_token={FB_TOKEN}&fields=engagement

Screenshots (if appropriate)

Current behaviour Screenshot 2021-06-08 at 6 47 08 PM Expected behaviour Screenshot 2021-06-08 at 6 47 02 PM

billerickson commented 2 years ago

This was fixed here and will be in the next release (1.4.0)