Google Maps Conflict
This topic contains 21 replies, has 4 voices, and was last updated by Kiran 5 years ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: snippet
-
AuthorPosts
-
November 28, 2019 at 4:18 pm #519035
Hi guys,
I’m having a conflict with another plugin with it’s google maps. Seems to be loading twice – once from their plugin, and once from yours.
I saw in a previous post that Kiran had written this script for someone else…
function _my_add_gmaps_api_args($args){
$args .= “&libraries=places,geometry”;
return $args;
}
add_filter(‘geodir_googlemap_script_extra’,’_my_add_gmaps_api_args’);// Disable GeoDirectoiry Google Maps on CM Maps Routes pages
function geodirectory_fix_google_map_conflict( $gd_map = ” ) {
global $wp, $wp_query;
if ( !is_admin() && !empty( $wp_query ) && $wp_query->is_main_query() && ( !empty( $wp->query_vars[‘post_type’] ) || !empty( $wp->query_vars[‘cmmrm_dashboard_page’] ) ) ) {
$post_type = !empty( $wp->query_vars[‘post_type’] ) ? $wp->query_vars[‘post_type’] : ”;
$cmmrm_dashboard_page = !empty( $wp->query_vars[‘cmmrm_dashboard_page’] ) ? $wp->query_vars[‘cmmrm_dashboard_page’] : ”;if ( ( is_single() || is_archive() ) && ( $post_type == ‘cmmrm_route’ || $cmmrm_dashboard_page == ‘edit’ ) ) {
$gd_map = ‘none’;
}
}
return $gd_map;
}
add_filter( ‘geodir_map_name’, ‘geodirectory_fix_google_map_conflict’, 10, 1 );Is there any way you could adapt the script for me please? I just need it for one page which is whatsonhub.co.uk/notification-settings. There’s nothing from GeoDirectory on that page so happy to disable it. Can you help?
Thanks,
DaveNovember 28, 2019 at 4:19 pm #519036This reply has been marked as private.November 28, 2019 at 8:45 pm #519064Please try removing the key from the other plugin. GD will serve other plugins with the key if necessary (and the plugin is using WP best practices for loading Google maps).
If we need to check, please share a link to the page of the other plugin where you add the key.
November 29, 2019 at 9:51 am #519181This reply has been marked as private.November 29, 2019 at 11:48 pm #519255Hello,
have you already put in a ticket with the plugin author? You could point out that we also make this other plugin that uses the same methods as GeoDirectory to serve a key for other plugins and themes: https://wordpress.org/plugins/api-key-for-google-maps/
The site is going 500 on the front page. Please try a conflict test and disable non-GD plugins.
https://wpgeodirectory.com/docs-v2/faq/troubleshooting/#conflict-test
November 30, 2019 at 12:42 pm #519291Thanks Alex.
The 500 seems to happen very rarely now. It’s very hard to pinpoint but it looks like something is conflicting with my membership plugin or this Smart Notifications plugin.
I’ve tried the wordpress debug, console etc etc, but very hard to determine. And both of those plugins I really need. Any suggestions on finding and resolving it will be really appreciated.
As for maps, I can suggest it, but they’re not so responsive. Which is why when I saw the script I sent you on first message, I was hoping easiest thing to do would be to disable it for that page. It just needs adapting by Kiran that’s all.
Thanks,
DaveNovember 30, 2019 at 2:14 pm #519293Hi Alex, just following up on that 500 error…
The following error only appears in the console when I have my membership plugin active…
Error: No select2/compat/dropdownCss
at j (select2.min.js:69)
at n (select2.min.js:131)
at select2.min.js:48
at D.apply (select2.min.js:1413)
at new e (select2.min.js:1515)
at new e (select2.min.js:1536)
at HTMLSelectElement.<anonymous> (select2.min.js:1739)
at Function.each (jquery.js?ver=1.12.4-wp:2)
at a.fn.init.each (jquery.js?ver=1.12.4-wp:2)
at a.fn.init.a.fn.select2 (select2.min.js:1737)It says it relates to this file mainly:
https://whatsonhub.co.uk/wp-content/plugins/geodirectory/assets/js/geodir-select2.min.js?ver=2.0.0.70But when I mouse over the select2.min.js references it gives me:
https://whatsonhub.co.uk/wp-content/plugins/indeed-membership-pro/assets/js/select2.min.jsI’m no developer so I don’t understand how the 2 different plugins are conflicting.
I’m not 100% sure if this is the error that’s causing the slow downs / 500 errors but it only seems to happen when the membership plugin is activated.
Can you help point me in a direction to get this resolved please?
Thanks,
DaveNovember 30, 2019 at 6:53 pm #519305The developers will take a look
November 30, 2019 at 9:18 pm #519314Thanks Alex.
Since my last message, the site has developed a major slow down every time I try and load the home page.
My hosting providers spotted the following error which is coming from the GD Events Plugin:
=========================================
SELECT wp_posts.*, wp_geodir_gd_event_detail.*, wp_geodir_event_schedule.* FROM wp_posts
INNER JOIN wp_geodir_gd_event_detail ON (wp_geodir_gd_event_detail.post_id = wp_posts.ID) LEFT JOIN wp_geodir_event_schedule ON wp_geodir_event_schedule.event_id = wp_posts.ID LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1 AND ( wp_posts.post_status = ‘publish’ ) AND wp_posts.post_type = ‘gd_event’ AND 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (61,63,66,330,331,335,336,339,340,345,353,364,365,380,381,390,391,412,428,434,457,460,473,482,489,505,519,520,583,613,681,695,761,910,1783,1848,1850,2029,2032,2036,2040,2049,2596)
)
GROUP BY wp_geodir_event_schedule.schedule_id
ORDER BY (( 29 * 0 ) + (wp_geodir_gd_event_detail.rating_count * wp_geodir_gd_event_detail.overall_rating )) / ( 29 + wp_geodir_gd_event_detail.rating_count ) DESC, wp_geodir_event_schedule.start_date ASC, wp_geodir_event_schedule.start_time ASC
LIMIT 0, 4
=========================================After this, I turned off the Events plugin to test it, and when I do the site runs super fast.
Weird thing is, even though Events plugin is turned off, all events still show and work fine. Is this normal?
You can test it yourself. If you take a look at whatsonhub.co.uk you’ll see how it get stuck on loading. Just turn events off and you’ll see the difference.
There’s no caching plugin active right now either.
Thanks,
DaveDecember 2, 2019 at 2:31 pm #519527Hi guys,
Any news on this at all? Sorry to rush but my homepage just won’t load until it’s fixed.
Specifically it’s only part loading the widgets and no listing images are showing. The location switcher will not work either.
When I turn off the Events plugin, it works and loads everything just fine with the exception of the events calendar.
I’d really appreciate your urgent help.
Thanks,
DaveDecember 2, 2019 at 3:07 pm #519544Just another note on this…
The individual location pages are working just fine e.g. https://whatsonhub.co.uk/city/united-kingdom/edinburgh/
It’s whatsonhub.co.uk and whatsonhub.co.uk/city which have the loading problem even through they run on the same template and widgets.
Thanks,
DaveDecember 2, 2019 at 6:19 pm #519575Hi David,
I am just about to finish for the day, i have flagged this for another dev to look at when he comes online, if its not solved when i come online tomorrow i will look into it more.
Thanks,
Stiofan
December 2, 2019 at 6:36 pm #519577Great thank you. Much appreciated.
Dave
December 3, 2019 at 10:11 am #519706Hi Dave,
We have updated some changes please check and let us know.
Regards,
KiranDecember 3, 2019 at 12:29 pm #519720All seems to be working great now thanks. Do you know what caused the problem so I can try to avoid anything in future?
Also, did you manage to take a look at the early post regarding a select2 error:
https://wpgeodirectory.com/support/topic/google-maps-conflict/#post-519293Thanks,
Dave -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket