Support » Plugin: WP Google Maps » [Plugin: WP Google Maps] Patch: HTTPS Support

  • I noticed a small problem with your plugins when a page with a map was loaded via HTTPS in that Google complained the page had insecure items, asking whether to load them or not. Looking at your code I noticed this happens because the JavaScript is loaded directly from “…” at wpGoogleMaps.php lines 213, 315 and 615. I attempted then manually loading it from, and it worked, so I figured a simple fix would to do the same thing Google itself does when loading Google Analytics, by changing those three lines from:

    <script type="text/javascript" src=""></script>


    <script type="text/javascript">
    	var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
    	document.write(unescape("%3Cscript src='" + gmapsJsHost + "' type='text/javascript'%3E%3C/script%3E"));

    I tested this on 5.01 and it works perfectly: no more complaints from Google Chrome when loading the page from the HTTPS version!

    I hope this helps. It’d be nice to have this added to the official plugin!

    PS.: Naturally, an even simpler version would be:

    <script type="text/javascript">document.write(unescape("%3Cscript src='" + document.location.protocol + "//' type='text/javascript'%3E%3C/script%3E"));</script>

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


    Thank you so much for this Alexander! I will implement this in v5.02 – MUCH appreciated!

    Kind regards

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP Google Maps] Patch: HTTPS Support’ is closed to new replies.