Support » Plugin: Pinterest "Pin It" Button » Please fix Pinterest "Pin It" syntax in public-display-functions.php

  • Resolved manovotny


    In the public-display-functions.php file, you are correctly adding a HTTP / HTTPS check on line 23, like so…

    wp_enqueue_script( 'pinterest-assets', 'http' . ( is_ssl() ? 's' : '' ) . '://', null, '', true );

    Please add the same kind of check to the button image on line 101, which currently looks like this…

    $btn_img_url = '//';

    …and it should look like this…

    $btn_img_url = 'http' . ( is_ssl() ? 's' : '' ) . '://';

    …so it does not automatically assume which protocol to use.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Phil Derksen


    It’s pretty common practice to use “protocol-less” URLs for static files like JS/images/CSS, as long as the source serves them up both ways, as in the case of CDNs.

    <script src="//"></script>

    Pinterest serves up that button image this way, and their embed code also outputs it this way.

    Also, once I make the minimum requirement of WP 3.5, wp_enqueue_script won’t even have that check.

    Phil Derksen : :

    Yes it is common practice, but that does not mean it is the best practice.

    If you use this protocol-less technique for a Pin It button in your posts, and people use MailChimp or FeedBurner to receive posts via email, email clients see the “//” and begin to search attached network drives.

    On small networks, like at home, it is less of a big deal. The email clients will search the networked drives, not find them, and the assets will not load. You lose the functionality, but the email will at least still load.

    On large networks, like major businesses and corporations, the email clients will search for forever. Most email clients do more than just give up, the flat out crash.

    This users to unsubscribe and view to drop and that is just not cool. It negatively reflects on the people / sites who use plugins like this and it is not even their fault.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Please fix Pinterest "Pin It" syntax in public-display-functions.php’ is closed to new replies.