Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Tweet count parameters from Tweet button #2747

Closed
niallkennedy opened this issue Sep 23, 2015 · 13 comments
Closed

Remove Tweet count parameters from Tweet button #2747

niallkennedy opened this issue Sep 23, 2015 · 13 comments
Assignees
Labels
[Feature] Sharing Post sharing, sharing buttons [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Milestone

Comments

@niallkennedy
Copy link
Contributor

Twitter announced a new design for the Tweet button and plans to drop Tweet count. This issue tracks an announced change not yet reflected in live code.

The new Tweet button dimensions for Sharedaddy smart buttons will be similar to an existing button configured with the count=none display option. The count and counturl query parameters in the iframe will have no effect once the new design is live.

The cdn.api.twitter.com/1/urls/count.json endpoint used by Twitter's widgets JavaScript will no longer function as part of this change, causing WPCOMSharing.update_twitter_count to never update.

@kraftbj kraftbj added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Sharing Post sharing, sharing buttons labels Sep 23, 2015
@kraftbj kraftbj added this to the 3.8 milestone Sep 23, 2015
@kraftbj
Copy link
Contributor

kraftbj commented Sep 23, 2015

Thanks @niallkennedy!

Per original post, "next month" so something we can account for in 3.8 hopefully and start setting user expectations in support documentation.

cc @aduth / IO

@bobbingwide
Copy link
Contributor

This problem is happening already.
I am getting "waiting for cdn.api.twitter.com"
This appears to be preventing other jQuery from running.
For example the jQuery for my nivo slider.

I also see Failed to load resource: the server responded with a status of 404 (Not Found)
https://widgets.wp.com/languages/notifications/en_US.json

I assume this is related.

Workaround

  • Disable Sharing to Twitter
  • Or use Button style Official
  • Hiding the Twitter icon behind the More link doesn't work
  • Choosing Text only doesn't work either

@jeherve
Copy link
Member

jeherve commented Sep 24, 2015

@jeherve
Copy link
Member

jeherve commented Sep 24, 2015

I also see Failed to load resource: the server responded with a status of 404 (Not Found)
https://widgets.wp.com/languages/notifications/en_US.json

That's a different issue. It will be fixed in 3.7.1. See #2698 for more details

@bobbingwide
Copy link
Contributor

Hi Jeremy, I like the alternative workaround and thanks for the info on the widgets issue

@paulschreiber
Copy link
Contributor

I'm seeing this problem as well (on WordPress VIP). Just deployed the filter workaround.

@kraftbj
Copy link
Contributor

kraftbj commented Oct 1, 2015

@niallkennedy - Do y'all have a firm date for killing the API?

@aduth
Copy link
Contributor

aduth commented Oct 1, 2015

It's not obvious to me that the problems noted in this thread are related to the original issue. I'd expect that once the API is removed, it would still return a response promptly (even a 404) and not hang. From what I can tell, the logic that exists currently in Jetpack and WordPress.com will continue to work as expected even after the API is dropped, though we should certainly do our due diligence to remove the unnecessary requests and button query parameters.

@paulschreiber, can you provide more detail about the problem you were observing?

@paulschreiber
Copy link
Contributor

Here's the JS in question:

jQuery.each([ https_url, http_url ], function( i, urlVariant ) {
    requests.twitter.push({
        dataType: 'jsonp',
        data: { url: urlVariant },
        url: 'https://cdn.api.twitter.com/1/urls/count.json';,
        success: jQuery.proxy( WPCOMSharing.update_twitter_count, null, urlVariant )
    });
} );

It tries to load:
https://cdn.api.twitter.com/1/urls/count.json?callback=jQuery11130011356212897226214_1443649675853&xhr=1&url=http%3A%2F%2Ffivethirtyeight.com%2Fdatalab%2Fsteelers-cowboys-romo-roethlisberger%2F

This URL only loads only intermittently. It likely depends on which CDN POP you hit.

When it didn't load cleanly, the browser would hang (presumably until the 300sec TCP timeout), which would block the loading of other scripts/execution of other activities.

Twitter is removing this API endpoint. As this endpoint was never officially supported, unlike a regular API removal, it might not behave nicely (i.e. 404, 403 error). In this case, it's failing to load entirely, as cdn.api.twitter.com is not a hostname they intended the public to use and may be going away. The cdn.api.twitter.com timeouts may also be entirely unrelated to the API deprecation, but since that's not a supported endpoint, Twitter's probably not going to fix it for you.

Jetpack should remove this code ASAP before you get flooded with complaints.

@aduth
Copy link
Contributor

aduth commented Oct 1, 2015

See #2787 for removal of share count requests.

@jeherve jeherve closed this as completed Oct 7, 2015
@kraftbj
Copy link
Contributor

kraftbj commented Oct 7, 2015

Reopening b/c #2787 only removed the counts from unofficial buttons. Still need to remove the counturl param (at least) from the official button to fully clean up.

@kraftbj kraftbj reopened this Oct 7, 2015
@dereksmart dereksmart modified the milestones: 3.8.1, 3.8 Nov 3, 2015
@zinigor zinigor self-assigned this Nov 6, 2015
zinigor added a commit that referenced this issue Nov 9, 2015
@dereksmart
Copy link
Member

done in #2979

@niallkennedy
Copy link
Contributor Author

The Tweet button's new visual design is now deployed. The new design removes the share count component. Sites with an older version of Sharedaddy code using the official buttons may see what appears to be extra padding due to the previous iframe dimensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Sharing Post sharing, sharing buttons [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

8 participants