Google Maps plugin issue – not sure what I'm doing wrong

Hello All,

I've installed and made active network wide your Google Maps plugin. I'm not sure what i'm doing wrong, but after applying the Google API in the plug in settings, get this dialogue on the page:

http://focalpointministries.net/events/2017/02/2017-iron-sharpens-iron-mens-conference-orlando-park-il/

Can you lend a hand please. This site is now live and the problem started happing last night.

Thank you in advance,

Adrian

  • Rupok
    • Support Ninja

    Hi Adrian,

    So sorry for the inconvenience. I went to your site and could see the issue in action. However, on your site, the map is loading fine for a second, and on the next second, it’s showing that warning. If your API key was wrong, then it should not load the map on the first place, I’m not sure though.

    However, just to make sure your current API key has any issue or not, can you please create another API Key, insert it in Google Maps plugin options and check if the issue stays.

    If the issue stays, just to make sure no other plugin is causing this, can you please do a plugin conflict test? To know more about plugin conflict test, you can check this guide: http://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    If the issue stays after trying all these, please let us know. We will be glad to investigate further.

    Have a nice day. Cheers!

    Rupok

  • Adrian
    • The Incredible Code Injector

    Hey Rupok,

    Thanks for your response. Just to you have a heads up. I’ve already done a plugin conflict check. I’ll try the new API, however, unsure if that will help any. Do you have any suggestions on how to set up the API?

    Thank you.

    Adrian

  • Adrian
    • The Incredible Code Injector

    Update: just did a plugin in check to no evail. the plug in loads, but then it kicks out the map. unsure what’s going on when it was working fine a few days ago.

    I’m opening up support access for your help on this matter… thank you.

    Thank you.

    Adrian

  • Kasia Swiderska
    • Support nomad

    Hello Adrian,

    I tried to replicate issue on my multi site but I could not. I even tried my API key that I know that will work on every domain, but on your site it didn’t worked.

    If we can exclude plugin conflict I would like you to enable debug log in your WordPress. To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

    define('WP_DEBUG', true);

    In order to enable the error logging to a file on the server you need to add yet one more similar line:

    define( 'WP_DEBUG_LOG', true );

    In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.

    Depending on whether you want your errors to be only logged or also displayed on the screen you should also have this line there, immediately after the line mentioned above:

    define( 'WP_DEBUG_DISPLAY', false );

    The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it. I would need then to see content of the debug.log file – so please upload it to service like a dropbox and paste link to it here.

    kind regards,

    Kasia

  • Kasia Swiderska
    • Support nomad

    Hello Adrian,

    Unfortunately there is only one small notice coming from maps plugin and that doesn’t point us to right direction.

    I’m pinging plugin developer to get his opinion on what could be cause of this issue and I will show him debug log – maybe there is something he as developer will see that I don’t.

    As soon I’ll get feedback I’ll report back to you.

    kind regards,

    Kasia

  • Kasia Swiderska
    • Support nomad

    Hello Adrian,

    I got feedback from developer. There is problem with probably with your theme, around 1012 line

    there is code

    <script type='text/javascript' src='http://focalpointministries.net/wp-content/themes/Extra/includes/builder/scripts/frontend-builder-scripts.js?ver=2.0.26'></script>
    <script type='text/javascript' src='//maps.googleapis.com/maps/api/js'></script>

    this part is to blame: <script type='text/javascript' src='//maps.googleapis.com/maps/api/js'></script>

    our plugin request includes the API key, this one doesn’t. However, this one gets executed first, so when our map loader sees we already have google maps API loaded on the page, it just drops (so we don’t re-include the API, that can lead to problems) and uses whatever the page already has.

    You have to check your theme for adding google maps and remove that line. Look in the functions.php file. Let me know if you will find anything.

    kind regards,

    Kasia

  • Adrian
    • The Incredible Code Injector

    Hello Kasia,

    I understand in principal. I’m using a child them and am sure I can add it in PHP as I use your google maps plugin on all my sites using this theme. However, how would I go about checking and fixing the issue. When it comes to writing PHP I’m a newb.. :0|

    Please advice,

    Thank You,

    Adrian

  • Nithin
    • Support Wizard

    Hi Adrian,

    However, how would I go about checking and fixing the issue.

    To have a better idea about this, could you please enable support access, so that we could give a closer look, on how the mentioned scripts gets loaded in your child theme.

    You can grant access from WPMU DEV > Support > Support Access > Grant Access, or check this manual: http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Please let us know once you enable access, so that we could get this sorted. Have a nice day. :slight_smile:

    Kind Regards,

    Nithin

  • Rupok
    • Support Ninja

    Hi Adrian,

    Thanks for granting Support Access. I found that you are using the Extra Child Theme, but unfortunately I didn’t get the Theme Editor option in your dashboard. Did you disable it intentionally? It’s a good approach, but for checking your current Google Maps issue, I need to check your theme code to find out from where that Map API is being called.

    So, can you please enable Theme editor on your site again so we can try to fix this for you? Or Can you please send me a message with your FTP access credentials through our secure contact form here: https://premium.wpmudev.org/contact/

    Subject: “Attn: Rupok”

    – FTP Username

    – FTP Password

    – FTP Host

    – Link back to this thread for reference

    – Any other relevant URLs

    Select “I have a different question” for your topic. This and the subject line ensure that it gets assigned to me.

    We will jump in as soon as you confirm and will try to fix this for you.

    Have a nice day. Cheers!

    Rupok

  • Kasia Swiderska
    • Support nomad

    Hello Adrian,

    I downloaded your theme and looked for the code for adding maps and the I saw that code has option to add API key. And then I found that not only in your theme has place to add API key but also to disable adding maps script to your site.

    And both options are not working. Please contact theme developer and tell them about the issue – maybe they have updated theme with this fixed? if not ask them to provide right function to deregister their script in child theme so our plugin will take over on map displaying.

    kind regards,

    Kasia

  • Adrian
    • The Incredible Code Injector

    Kasia,

    I’ve asked the theme developer your question and got this in regards to my ask:

    “Where are google map API key settings where I can input Google map API key?

    As of June 22, 2016 Google Maps V3 no longer support keyless access.”

    Can you provide an answer for them?

    Thank You,

    Adrian

  • Kasia Swiderska
    • Support nomad

    Hello Adrian,

    I'm sorry for delay here – our system prevents threads from bumping and every time you posted your thread was pushed lower in our queue.

    I'm bit confused with your question here

    I've asked the theme developer your question and got this in regards to my ask:

    "Where are google map API key settings where I can input Google map API key?

    As of June 22, 2016 Google Maps V3 no longer support keyless access."

    Can you provide an answer for them?

    They don't know their theme has option for that? Its in Extra -> Theme Options

    You added there API keys but they are not added in output code and that causes this error with map display.

    Also I tried second option to disable adding that script and it also wasn't working.

    That would need to be fixed on their side.

    kind regards,

    Kasia

  • Adrian
    • The Incredible Code Injector

    This is what they’ve said…

    That is quite strange. They have a plugin and it is not only made for theme Divi OR theme Extra.

    Adrian this is support team here.

    What if someone using some other theme OR for example using twenty seventeen wp theme?

    We have Google Map Api key and it is intended to work with our Map modules. And it is working well.

    Adrian Do you have this Setting:

    Settings -> Google Maps -> Options -> Google Maps API Key

    See this article:

    https://premium.wpmudev.org/forums/topic/google-maps-plugin-api#post-1127364

    Other users who are using wpmu are also facing this issue. And i hope all of them are not using theme Extra OR theme Divi.

    See this article from wpmudev forum.

    https://premium.wpmudev.org/forums/topic/google-maps-plugin-api

    Thanks

    I’m at a loss, I don’t know what to do. Thoughts?

    Adrian

  • Rupok
    • Support Ninja

    Hi Adrian,

    Can you please temporarily deactivate our Google Maps plugin and then set Google Maps API in your theme settings and use your theme’s map module and check if map is being shown perfectly or not?

    If it shows perfectly, then please confirm. I’ll ping our developer regarding this after you confirm.

    If it still doesn’t show, then our plugin is not disabling your theme functionality and something else is causing this. We will investigate further after you confirm.

    I’m looking forward to hearing from you and resolving this issue as soon as possible.

    Have a nice day. Cheers!

    Rupok

  • Adrian
    • The Incredible Code Injector

    Kasia,

    I am granting access now. You should be able to view the maps section there. Please look at:

    http://focalpointministries.net/events/2017/02/orland-park-il/

    There the theme’s map module is on the page and your plug in and both maps are showing..

    Here:

    http://focalpointministries.net/events/2017/03/beloit-wi/

    Only your plugin is active on the page and it’s not working?

    Unsure what do do.

    Thank you for working on this issue.

    Adrian

  • Patrick
    • Support Monkey

    Hi there Adrian

    I hope you don’t mind me jumping in here.

    Inspecting any page on your site does show this error in the console:

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

    So indeed, having both your theme and the plugin calling the map API is causing issues.

    I logged into your site to do some testing and confirm that by including the API key in your theme only, both maps appear correctly on http://focalpointministries.net/events/2017/02/orland-park-il/

    …and the plugin-generated map does not appear on http://focalpointministries.net/events/2017/03/beloit-wi/

    I did try to dequeue the script that calls the maps API in your parent theme by adding a custom function to your child-theme. But I believe that also dequeued the call from our plugin, and resulted in no maps showing at all, darn it.

    So I’m going to ask our second-level support wiz-kids if they can come in to lend their expertise on this issue.

  • Patrick
    • Support Monkey

    Hey there Adrian

    Well, I tried the alternate code (in the child-theme, yes) to dequeue the map API from your theme, but that didn’t work. Also tried swapping the API keys for the theme and the plugin, using the same key for both, and removing the key from each one in turn. None of that worked I’m afraid.

    I also tried using the alternate map shortcode for the plugin-generated maps – agm_map – but no change with that either.

    I’ve filed a report on this on Thursday and chatted a bit with one of our 2nd-line support peeps on Friday. I’ll try to get him to take another look at this issue today.

    Hang in there; we’ll figure something out. :wink:

    However, there is something you could do as a temporary stopgap measure, so you can at least have a map display on your event pages while we figure this out. We know that when you have a map generated by your theme and one generated by the plugin on the same page, they both show fine. You could simply do that in the meantime, and hide the theme-generated map with CSS, like so:

    .single-incsub_event .et_pb_map_container {display:none;}

  • Patrick
    • Support Monkey

    Hi again Adrian

    I hope you’re well today!

    Yikes, this has been going on for awhile now. :slight_frown:

    I just read through this whole thread again and, while I hate to be the one to hafta pass the buck, it would appear that the issue is with the theme, and the fact that we have been unable to dequeue the call to the maps API in that theme. Even their built-in function to do so does not appear to be working correctly.

    That call is being triggered first, and our plugin sees that and does not call the API a second time to prevent errors. So the result is that when a map from our plugin is shown alone on a page, it does not display as the correct API key is not being called. Does that make sense?

    That being said, I just bumped the question to our devs & 2nd-level support wiz-kids for their assistance. Please do keep support access open.

    Thanks!

  • Patrick
    • Support Monkey

    Hi again Adrian

    I hope you’re having a great day!

    I just took the liberty of downloading your theme & child-theme using the FTP creds you had previously provided to Kasia Swiderska

    I installed both on a test network and activated the child-theme on a subsite with Events+. I then added the same Google API key to the child-theme options panel that I already had in the WPMU DEV Google Maps plugin.

    I then added maps generated by both the child-theme and the plugin to a few events on that subsite. All maps are displaying correctly:

    Theme-generated map only: http://events2.pcwriter.net/events/2017/03/new-event/

    Plugin-generated map only: http://events2.pcwriter.net/events/2017/03/free-event/

    Maps generated by both the theme and the plugin: http://events2.pcwriter.net/events/2017/03/sample-event/

    This has me now convinced that there is indeed something else on your install that is conflicting.

    Oddly enough, I had previously tried using the API key on your site for both the plugin and the theme, but it did work. Can you please test that again by generating a new API key at Google, and enter that in both the plugin and your theme on your site?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.