osompress / genesis-simple-share

Plugin: Genesis Simple Share
36 stars 16 forks source link

Facebook buttons all showing zero count #77

Closed nickcernis closed 8 years ago

nickcernis commented 8 years ago

Facebook dropped support for their public share count REST API.

Requests now return, “REST API is deprecated for versions v2.1 and higher (12)”: https://api.facebook.com/method/links.getStats?urls=http://example.com/&format=json

https___api_facebook_com_method_links_getstats_urls_http___example_com__format_json

All Facebook buttons on Rainmaker and WP sites now show a count of zero: http://www.copyblogger.com/email-marketing-defined/

email_marketing_defined_in_60_seconds__animated_video__-_copyblogger_-

I found that counts are still available via the Graph API, seemingly without authentication:

https___graph_facebook_com__id_http___example_com

This is the same endpoint Automattic are using in Jetpack at the moment: https://github.com/Automattic/jetpack/blob/5302991caad01efd2b91977b711c525fd65191f7/modules/sharedaddy/sharing.js#L36

They were already using the graph API, but are updating their plugin to reference the new object structure: https://github.com/Automattic/jetpack/pull/4879

Authentication appears to be required only if you specify an API version:

Suggest we either use the new Graph API endpoint while it's available (preferred) or drop the Facebook count.

Further info

Thanks to @eugenoprea for the heads-up on this and for digging up some industry chatter:

NicktheGeek commented 8 years ago

Test Scenario:

Test Verification:

katyfb13 commented 8 years ago

@NicktheGeek so where is this to be tested?

NicktheGeek commented 8 years ago

We can verify it in dev02 using the issue for Rainmaker, that will be enough to verify it for release on this plugin. Assuming we can do that we can push the plugin update Monday.

katyfb13 commented 8 years ago

This was confirmed in dev02. If you need me to upload a revised plugin to a wp install, please let me know.

screen shot 2016-08-19 at 11 44 53 am

Sounds like this is production ready pending possible plugin testing.

billerickson commented 8 years ago

You might want to check on this for higher traffic sites.

I recently updated EA Share Count since SharedCount.com shut down, and found that sometimes the unauthenticated API requests worked (like on my local environment, or from a browser), but in production they didn't work (e.g., on billerickson.net).

I think if you don't provide an API key they use some other means of identifying you, like an IP address, and still limit the number of queries.

I had to create a long-lived Facebook Access Token for the counts to work again.

NicktheGeek commented 8 years ago

@billerickson Thanks, we'll get some info when we run the update on copyblogger.com.

We've got a different service that handles twitter share there, but we may need something like that for FB share.

It's great how these social services are crippling features that people use that drive traffic for their service. It's like FB saw the death spiral of Twitter and though, "man, that's pretty sweet. I need to get me a piece of that action."

billerickson commented 8 years ago

What probably helps you is you're doing it via Javascript, so it's tied to the visitor's IP. We do it server-side so it's tied to our IP.

Yeah, it's definitely annoying how difficult the social services make this. But I'm not surprised Facebook is moving to requiring access tokens. It's the first step in them charging for access to the API, like they charge businesses who want to share their Facebook posts with people already following those businesses.

guidedmathadventures commented 8 years ago

I am trying to fix this problem on my wp site and have tried to follow the comments here. Will this plugin be fixed so facebook shares no longer show zero, or is there a way I can fix it myself. Thanks for your help!

nickcernis commented 8 years ago

@guidedmathadventures Thanks for checking in! Yes, you'll see a plugin update next week to fix the Facebook counts. :-) Sorry for the inconvenience in the meantime.

NicktheGeek commented 8 years ago

Anyone wishing to test this fix can download the develop branch from this git repo and replace their plugin with the provided file.

The update should go out Monday unless something comes up.

billerickson commented 8 years ago

Here's the direct link to the download: https://github.com/copyblogger/genesis-simple-share/archive/develop.zip

bgardner commented 8 years ago

I just pushed the plugin up on No Sidebar, and it appears to be showing the FB counts:

http://nosidebar.com/things-minimalists-dont-do/