[Read This Fine Material] from Joshua Hoblitt

fixing the WordPress Twitter Badge Widget v1.75 plugin to work with HTTPS


The excellent WordPress Twitter Badge Widget Plugin I use on this blog fetches a .js from twitter via HTTP. Ironically, twitter redirects the request to be via HTTPS but initial request is enough to break the browsers title bar “lock icon”.

Fortunately, the required fix is trivial:

$ git diff
diff --git a/twitterbadgescript.js b/twitterbadgescript.js
index 8209441..99d3d31 100644
--- a/twitterbadgescript.js
+++ b/twitterbadgescript.js
@@ -61,7 +61,7 @@ function TBW_ProcessWidgets(jTB)
     var twitterWidgets = document.createElement('script');
     twitterWidgets.type = 'text/javascript';
     twitterWidgets.async = true;
-    twitterWidgets.src = 'https://platform.twitter.com/widgets.js';
+    twitterWidgets.src = 'https://platform.twitter.com/widgets.js';
   })();//Run on DOM ready

I’ve posted the widget + my trivial via fix here: https://github.com/jhoblitt/twitter-badge-widget.

Leave a Reply