Support » Plugin: Event Organiser » [Plugin: Event Organiser] "This page has insecure content" – Loading Google Maps

  • Resolved Ian Anderson Gray

    (@baritoneuk)


    Would it be possible to update the javascript file to load Google Maps with the same protocol as the page whether that be HTTPS or HTTP? I’ve got a site that uses HTTPS when you’re logged in and HTTP when you’re not. When I am logged in I get a “This page has insecure content” in Chrome.

    In the frontend.js could the Google Maps js file be loaded with “//” instead of “http://”. That way it will load the appropriate version (i.e. http or https) for the site:

    script.src="//maps.googleapis.com/maps/api/js?sensor=false&callback=eo_load_map";

    Thanks!

    http://wordpress.org/extend/plugins/event-organiser/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Ian Anderson Gray

    (@baritoneuk)

    OK, I am talking a load of rubbish. That would only be if the Google Maps file was hosted locally. I really must revise my coding knowledge!

    It looks like I’ll just have to change it to use https. In that case, could there be an option in EO to choose whether to load Google Maps using https or http?

    Thanks!

    I’ll look into adding https: when it’s being used (i.e. using is_ssl).

    Does changing line 41 of includes/event-organiser-register.php

    to

    wp_register_script( 'eo_GoogleMap', (is_ssl() ? 'https:// :'http://').'maps.googleapis.com/maps/api/js?sensor=true');

    work

    Thread Starter Ian Anderson Gray

    (@baritoneuk)

    Thanks, Stephen- it would be great if this could be added. Your code works really well (although you missed out an ‘ after the first https)

    wp_register_script( 'eo_GoogleMap', (is_ssl() ? 'https://' :'http://').'maps.googleapis.com/maps/api/js?sensor=true');

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Event Organiser] "This page has insecure content" – Loading Google Maps’ is closed to new replies.