Forum Replies Created
-
AuthorPosts
-
November 8, 2016 at 12:39 pm in reply to: 'google is not defined' console error and site hangup upon loading any events pg #1189312
Keri
ParticipantAndras,
I think I may have found the issue, albeit unconventionally!
I was doing some digging in the TEC PRO code and I found where the Google Maps API script is generated and loaded in Ajax_Maps.php and I noticed these lines in the handle() function:
$http = is_ssl() ? 'https' : 'http'; $url = apply_filters( 'tribe_events_pro_google_maps_api', $http . '://maps.google.com/maps/api/js' ); wp_register_script( 'tribe-gmaps', $url, array( 'tribe-events-pro' ) );It looks like the script is being loaded based on the security protocol of the site where the plugin is being operated (my site is run with no SSL cert as of now: HTTP). However, after doing a bit of research, I found that Google recommends loading the Maps JavaScript API over HTTPS regardless, in accordance with their current security efforts. So, I tried modifying the code like so:
$http = 'https'; /*is_ssl() ? 'https' : 'http';*/After applying this change, the error has disappeared, I’m assuming since the script is being loaded securely.
Additionally, the article I provided above also states that if you NEED to load the script through HTTP for whatever reason, it says to use the URL ‘http://maps.googleapis.com/’ instead of the default one found in the code. I also tried this and found that it still throws the error, but loads the page successfully anyway. Interesting.
So, it seems that there wasn’t any plugin/theme conflicts after all. Let me know if this is a valid fix or not 🙂
Thanks for the help!November 7, 2016 at 10:03 am in reply to: 'google is not defined' console error and site hangup upon loading any events pg #1188710Keri
ParticipantHi Andras,
I am still working on pinpointing the cause of this error. I did some conflict testing today and results varied. I don’t have the time to lay everything out right now; I just wanted to reply to this thread to keep it from closing. I will get back to you soon. Bear with me!
Thanks.
November 3, 2016 at 7:01 am in reply to: 'google is not defined' console error and site hangup upon loading any events pg #1186948Keri
ParticipantAndras,
Thanks for the quick response.
I went through the conflict testing process you provided me and as soon as I reverted to the default theme, deactivated all non-tribes plugins, and cleared my browser cache, the problem was resolved. Then, I reactivated each plugin one-by-one and reactivated my original theme and the issue seemed to have been resolved initially; no console errors.However, after about 15-20 minutes, the issue arose again; got the same console error and site hangup. I had done nothing except refresh the page! So, I went through the conflict testing process once more and even after completing the three steps under ‘Test if there is a conflict’, the issue was still present this time. I also tried to deactivate and re-activate the Events Calendar plugins and tried again, to no avail; still the same error.
There has to be some back-end script that is enqueuing and loading the Google Maps script in maybe a deprecated fashion? That would be my only guess. What else can I do? 🙁
Thanks.
-
This reply was modified 9 years, 6 months ago by
Keri.
-
This reply was modified 9 years, 6 months ago by
-
AuthorPosts
