WordPress.org

Support

Support » Plugins and Hacks » Add Twitter, Facebook Like, Google plus one Social share » [Resolved] [Plugin: Add Twitter, Facebook Like, Google plus one Social share] Plugin embeds HTTP content on HTT

[Resolved] [Plugin: Add Twitter, Facebook Like, Google plus one Social share] Plugin embeds HTTP content on HTT

  • 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/

Viewing 1 replies (of 1 total)
  • Plugin Author BeingMaverick

    @beingmaverick

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Add Twitter, Facebook Like, Google plus one Social share] Plugin embeds HTTP content on HTT’ is closed to new replies.
Skip to toolbar