WordPress.org

Ready to get started?Download WordPress

Forums

Add Twitter, Facebook Like, Google plus one Social share
[resolved] Plugin embeds HTTP content on HTT (2 posts)

  1. Ian Dunn
    Member
    Posted 2 years ago #

    The plugin is always loading the Facebook/Twitter/etc scripts over HTTP, even when the current page is using HTTPS. This causes mixed content warnings in browsers.

    Instead of doing this:

    wp_enqueue_script('twitter_facebook_share_twitter', 'http://platform.twitter.com/widgets.js','','',$option['jsload']);
    
    <iframe src="http://www.facebook.com/plugins/like.php?href=' . urlencode($post_link) . '&layout=box_count&show_faces=false&action=like&font=verdana&colorscheme=light" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:60px;" allowTransparency="true"></iframe>
    
    <div class="buttons"><script src="http://www.stumbleupon.com/hostedbadge.php?s=5&r='.$post_link.'"></script></div>';
    
    etc

    You should be doing this:

    wp_enqueue_script('twitter_facebook_share_twitter', 'http'. ( is_ssl() ? 's' : '' ) .'://platform.twitter.com/widgets.js','','',$option['jsload']);
    
    <iframe src="http'. ( is_ssl() ? 's' : '' ) .'://www.facebook.com/plugins/like.php?href=' . urlencode($post_link) . '&layout=box_count&show_faces=false&action=like&font=verdana&colorscheme=light" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:60px;" allowTransparency="true"></iframe>
    
    <div class="buttons"><script src="http'. ( is_ssl() ? 's' : '' ) .'://www.stumbleupon.com/hostedbadge.php?s=5&r='.$post_link.'"></script></div>';

    I've modified the plugin to work with my site, but that means I can't upgrade it anymore. Could you please fix the URLs in a future release of the plugin?

    http://wordpress.org/extend/plugins/twitter-facebook-google-plusone-share/

  2. BeingMaverick
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for sharing the code. I have included it in the next release. It really helps when user comes up with something likes this..Brilliant.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic