-
AuthorPosts
-
July 15, 2019 at 11:42 pm #1118983
As you know, we have used Enfold and Google maps for a very long time now and I normally, I can resolve issues between them pretty easily, though this time is managing to give me some issues. The hard part is the site is live now and has a ton of traffic, so trying to resolve it on the fly.
We use a common directory plugin called GeoDirectory. It integrates with Enfold pretty nicely for the most part. While both pull from the Google Maps API, we have managed to avoid issues by making sure are matched keys. That has worked pretty reliably until a major client’s site upgrade this past weekend. We upgraded them on a development staging site, taking the opportunity to upgrade many components like Enfold and various plugins. Both had previously had the same Google Maps API keys and it worked without issues. But, with thes upgrades, though, it started throwing the typical API key not valid issue. I went back and grabbed fresh keys and installed to both Enfold and GeoDirectory, and while both took, when looking at the source of the rendered page, the Enfold one is not displaying the entered key.
Has anyone seen this issue before? Any bright ideas at resolutions?
Site details:
WP 5.2.2
Enfold 4.5.7 running under a child theme
GeoDirectory 1.xJuly 16, 2019 at 6:05 am #1119049This reply has been marked as private.July 16, 2019 at 6:19 pm #1119228Hi Jason E ,
Best regards,
VictoriaJuly 16, 2019 at 7:55 pm #1119276Yes, billing is all setup, and it works on other sites. This is the first case where Enfold is not passing through the api key variable, as I showed in the screenshot. The plugin is loading it first and then Enfold, which is not putting in the key correctly. Disabling the plugin does not change anything.
July 17, 2019 at 4:08 am #1119362Hi,
Thank you for sharing the details.
I checked your site and in the console, I found the below error
You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
So I removed the API key from the theme options and check the site again but the same error popped again. There may be more than one plugin trying to add the API key.
Have you tried to contact the plugin author? Let us know what he has to say about this?
You should remove the API key and save the theme settings to completely remove it. Try adding your new API key now if you still get any error please deactivate all plugins and try the below steps.
To find which plugin is causing the conflict please follow these steps:
1. Go to your plugins page > Deactivate all active Plugins
2. Update WordPress and Enfold to the latest version if you have not.
3. Make sure all the plugins are updated.
4. If the problem does not persist when plugins are turned off, activate one plugin at a time and refresh until you find the plugin in conflict.We await the results of your plugin compatibility test.
Thanks for your cooperation :)
Best regards,
VinayJuly 17, 2019 at 7:32 am #1119425This reply has been marked as private.July 17, 2019 at 11:21 am #1119520Hi Jason E,
Did you get it working for you now? What does the reply above mean?
Best regards,
VictoriaJuly 17, 2019 at 3:24 pm #1119606I removed my reply, because my response was with a lot of frustration. It would not allow me to delete the response entirely, or I would have. I should have left a different message, I apologize.
I posted in my previous responses some of the very answers Vinnay was requesting. I said at the beginning of the thread I am used to doing this and had done the normal troubleshooting. The problem did not occur on older versions of Enfold. I cannot pin down exactly what version it changed, but will try to do some more investigating today to get detailed answers.
I will work to compose a better response later this morning.
In the mean time, can you ask if there is a function to remove the GoogleMaps API call from the normal Enfold page load?
July 18, 2019 at 11:38 am #1119881Hi,
We are very sorry for the inconvenience.
You can prevent the theme from loading the API script by using the following filter.
function avf_load_google_map_api_prohibited_mod( $no_load ) { return true; } add_filter( 'avf_load_google_map_api_prohibited', 'avf_load_google_map_api_prohibited_mod', 10, 1 );
Make sure that the API key is added in the plugin’s panel. Let us know if that helps fix the duplicate API issue.
You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
Best regards,
IsmaelJuly 24, 2019 at 6:44 am #1121396This reply has been marked as private.July 25, 2019 at 9:51 am #1121857Hi,
Thank you for the update.
I added the following snippet to completely remove the map API from the theme, but the same error occurs.
You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
function ava_deregister_google_map_api(){ wp_deregister_script('avia-google-maps-api'); wp_dequeue_script('avia-google-maps-api'); remove_action( 'init', array( 'av_google_maps', 'handler_wp_register_scripts' ), 20 ); } add_action( 'after_setup_theme' , 'ava_deregister_google_map_api' );
I think the issue is between the Events Calendar Pro and the Geodirectory plugin. They both have their own Google Map API key field. (see private field)
Best regards,
IsmaelJuly 25, 2019 at 4:54 pm #1121946Hi Ismael,
Here is what is odd. I completely disabled all plugins the other night. Every last one except Classic Editor, but that line of code still was in there.
<script type=’text/javascript’ src=’//maps.googleapis.com/maps/api/js?’></script>
I am going to continue to search for the cause of this, but I have a bigger question… How are these plugins supposed to work together at this point? They used to without issue, but not now. If someone needs the functionality of these plugins, it seems like a no-win scenario. I have to believe there is a viable solution to this, because there is no way we are the only ones utilizing multiple plugins with Google Maps API calls. I love the Google Maps integration for Enfold, but I also need the integration to show location maps for GeoDirectory and Events Calendar Pro. These are not small-audience plugins, they are widely used ones, like Enfold. The problem is that each developer involved just says to disable the other ones. As usual, Google is absolutely no help.
July 26, 2019 at 3:19 am #1122027Hey!
Thank you for using Enfold.I don’t really think this will help but have you tried disabling the “avia_maps_key_for_plugins” filter? Comment out this line or remove it completely.
add_filter( ‘script_loader_src’, ‘avia_maps_key_for_plugins’, 10, 2 );
That script is surely not coming from the theme because we have deactivated it completely using the filter above. We deregister the script and dequeue it. We actually disabled the function that loads any script related to google map.
If you deactivated the plugins and still see the map API script in the frontend, then it must have been added in the header directly or via WP hook. If you can provide the FTP details in the private field, we’ll try to trace where it’s coming from.
Regards,
IsmaelJuly 26, 2019 at 3:35 am #1122030I would much rather you see things are they are before me making changes, so I have included access for you.
It would be awesome to find a solution, because Enfold, Events Calendar Pro, GeoDirectory and Gravity Forms are the most important tools across any site I build. With all of them, almost anything is possible. Enfold and css have always been the thing that brings everything together.
Thank you for all of the help and insight,
-jasonJuly 29, 2019 at 4:50 am #1122616Hi,
Thank you for the update.
In the private field is a list of loaded scripts and as you may notice, the theme is no longer loading any scripts related to Google maps (avia_google_maps_front_script, avia_google_maps_api_script) because we disabled it. But there are two scripts that is probably loading the same map API. One is from the Geodirectory plugin with the script handle “geodir-google-maps” and the other script is called “google-maps”, which is nonspecific, so we’re not really sure where it’s coming from.
34 => ‘geodir-google-maps’,
43 => ‘google-maps’,Events Calendar Pro, GeoDirectory and Gravity Forms are the most important tools across any site I build.
This is no longer an issue with the theme but rather a conflict between two or more plugins. Unfortunately, this is beyond the scope of support. Please contact the plugin authors for additional help.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.