3PO

June 27th, 2012. Tagged: performance, yslow

Say hello to the 3PO extension for YSlow. It checks your site for integration with popular 3rd parties, such as Facebook, Twitter widgets, Google Analytics and so on.

3PO (3rd party optimization) extension currently has 5 checks: two of them generic to all 3rd parties and three specific to Facebook plugins. I'm looking forward to adding more checks and more specific to a particular provider's best practices.

The extension is currently available as a bookmarklet, but since YSlow is a platform available on many platforms, it can be built as a Firefox or Chrome extension, command line tool, etc.

Install

Click this link to test, or drag to your bookmarks to install

YSlow +3PO

And the code is available in my YSlow fork on Github.

Checks

Here's a the list of checks along with some explanation.

Load 3rd party JS asyncrhonously

Category: Common

Use the JavaScript snippets that load the JS files asynchronously in order to speed up the user experience. Most providers offer you an asynchronous version of the script you're including on your page. If they don't, let them know and meanwhile do it yourself

If you don't include the script asynchronously, you create a SPOF (Single Point of Failure) and your site effectively goes down when the 3rd party goes down. See for yourself.

Load the 3rd party JS only once

Category: Common

Loading the 3rd party JS files more than once per page is not necessary and slows down the user experience. Sometimes people copy-paste snippets multiple times on the page, e.g. when you have one widget per blog post in a blog post listing. The script only needs to load once and serve multiple widgets.

Define XML namespace

Category: Facebook

If you use tags like <fb:like> you need to define an XML namespace to make the plugin work in old IE versions. Same for any tag that has :

Add an #fb-root element

Category: Facebook

The Facebook JS SDK needs an element with id="fb-root". So add this to your page, before you include the Facebook JS SDK

<div id="fb-root">

Include OG (Open Graph) meta tags

Category: Facebook

Open graph tags let you better describe your content. To learn more, see the documentation. And run the tool to validate your page.

Tell your friends about this post: Facebook, Twitter, Google+

45 Responses

  1. Patrick Kettner

    Hey Stoyan,
    That js file is trying to load

    http://localhost/~stoyanstefanov/yslow

  2. oops, thanks, fixed :)

  3. [...] 3PO is a handy bookmarklet from Stoyan Stefanov that checks pages for integration with common third-party content, such as analytics and social sharing buttons. True to its claim, it was easy to install by just dragging it to my bookmarks. When I visit a page, one click launches the tool, and it generates a nice little report that not only assigns a letter grade to the page but also gives tips on how to fix issues that it identifies. [...]

  4. Stoyan, it appears that the check for DIV#fb-root returns a false negative. http://wholemedicine.net/ DOES contain this element but 3PO claims it doesn’t.

  5. [...] 3PO is a handy bookmarklet from Stoyan Stefanov that checks pages for integration with common third-party content, such as analytics and social sharing buttons. True to its claim, it was easy to install by just dragging it to my bookmarks. When I visit a page, one click launches the tool, and it generates a nice little report that not only assigns a letter grade to the page but also gives tips on how to fix issues that it identifies. [...]

  6. Bart is right. It returns a false negative for my website also. But awesome work, Stoyan! Thanks for making it available.

  7. I added a to my page, but it still throws an error and tells me that it didn’t find a . Also I never included that “Like” button or anything related to FB. The only thing that could be Facebook are the “AddThis” buttons.

  8. Edit: this page doesn’t have a but the tool says it does.

  9. How Can this new ruleset be added to YSlow commandline?

  10. [...] Stoyan Article : http://www.phpied.com/3po/ [...]

  11. [...] qui potete installare il bookmarklet di YSlow + 3PO, l'autore garantisce la compatibilità con Chrome e Firefox, io l'ho testato sul secondo e va molto [...]

  12. [...] SPOF-O-Matic, 3PO for YSlow [...]

  13. [...] SPOF-O-Matic, 3PO for YSlow [...]

  14. [...] SPOF-O-Matic, 3PO for YSlow [...]

  15. [...] http://www.phpied.com/3po/ [...]

  16. [...] in a web application. The most notable ones being webpagetest.org, SPOF-O-Matic chrome plugin and YSlow 3PO extension. At eBay we wanted to detect SPOF at a very early stage, during the development cycle [...]

  17. [...] SPOF-O-Matic, 3PO for YSlow [...]

  18. [...] in a web application, most notably webpagetest.org, the Chrome plugin SPOF-O-Matic, and the YSlow 3PO [...]

  19. [...] SPOF-O-Matic, 3PO for YSlow [...]

  20. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  21. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  22. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  23. [...] SPOF-O-Matic, 3PO for YSlow [...]

  24. I really like your blog.. very nice colors & theme. Did you make this website yourself or did
    you hire someone to do it for you? Plz answer back as I’m looking to create my own blog and would like to know where u got this from. kudos

  25. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  26. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  27. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  28. I have fun with, cause I found just what I was having a look for. You have ended my four day long hunt! God Bless you man. Have a nice day. Bye

  29. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  30. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  31. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  32. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  33. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  34. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  35. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  36. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  37. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  38. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  39. I’ve read several excellent stuff here. Definitely worth bookmarking for revisiting. I surprise how much attempt you put to create this type of wonderful informative site.

  40. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  41. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  42. [...] also recommend the YSlow extension 3PO, which checks your site for integration with popular third-party scripts like Twitter, Facebook, [...]

  43. It was stressful paying on two homes, but moving out of the house worked
    out best for us. Mike Mc – Dougall has lived and worked in Las Vegas for
    20 years, and business interests have made it mandatory that he
    drive on the Las Vegas Strip at least once a week for
    those 20 years. The real estate market has been known to be the best kind of investment someone can initiate, compared to other forms of
    investments which are highly risky such as currency exchange and stock
    trading, real estate or the housing market tends to deliver
    better revenues at a much steady pace.

    Feel free to surf to my page: henderson commercial real estate

  44. […] SPOF-O-Matic, 3PO for YSlow […]

  45. […] do load. There’s no reason why these scripts need to load synchronously—you should always load them asynchronously. If the third party doesn’t provide an asynchronous version, demand it. Also consider replacing […]

Leave a Reply