ERRORS: You have included the Google Maps API multiple times on this page.

Home Forums Calendar Products Events Calendar PRO ERRORS: You have included the Google Maps API multiple times on this page.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1163154
    hprata
    Participant

    Anyway to have the events cal pro use the themes map API instead of its own? I get this error and it would be nice if the events pro plugin checked if the theme has maps load before attempting to load its own.

    ERORR
    You have included the Google Maps API multiple times on this page. This may cause unexpected errors.

    #1163641
    Cliff
    Member

    Hi. This isn’t something we typically support, but if you provide me a .zip of your theme, I may be able to look into it quickly for you.

    #1163710
    hprata
    Participant

    How do I send the files privately?

    #1163734
    Cliff
    Member

    Ah, I didn’t notice before that you posted this in the Pre-Sales Forum (a public forum that does not allow Private Replies).

    I’ve moved this thread to the PRO forum. You should be able to see the Private Reply option now. 🙂

    #1163737
    hprata
    Participant

    This reply is private.

    #1164197
    Cliff
    Member

    Thanks. I looked through the parent theme (not the child theme) and found several things:

    1)

    It uses wp_enqueue_script for both:

    • optimizer_map, which loads this file: /wp-content/themes/optimizer_pro/assets/js/map-styles.js
    • and optimizer_googlemaps, which loads this file: https://maps.googleapis.com/maps/api/js?key=AIzaSyC……NqOg (I obfuscated it)

    2)

    Notice on that 2nd one, it has a hard-coded Google Maps API key. Yikes!

    I’d suggest you report this to the theme author, as it may be against Google Maps’ terms and/or they may not realize their API key is being used by everyone who runs their theme.

    3)

    It might be advisable in this situation to dequeue the duplicate scripts. I came up with this code snippet but did not test it (since I never activated the Optimizer Pro theme or the child theme you sent me):

    https://gist.github.com/cliffordp/ca3baf77c9be8b72f37db10c7c91783b

    Please let me know how it goes for you.

    #1173274
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘ERRORS: You have included the Google Maps API multiple times on this page.’ is closed to new replies.