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 Ticket

Tagged: 

  • Author
    Posts
  • #519035

    Dave
    Full Member
    Post count: 205

    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,
    Dave

    #519036

    Dave
    Full Member
    Post count: 205
    This reply has been marked as private.
    #519064

    Alex Rollin
    Moderator
    Post count: 27815

    Please 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.

    #519181

    Dave
    Full Member
    Post count: 205
    This reply has been marked as private.
    #519255

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    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

    #519291

    Dave
    Full Member
    Post count: 205

    Thanks 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,
    Dave

    #519293

    Dave
    Full Member
    Post count: 205

    Hi 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.70

    But 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.js

    I’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,
    Dave

    #519305

    Alex Rollin
    Moderator
    Post count: 27815

    The developers will take a look

    #519314

    Dave
    Full Member
    Post count: 205

    Thanks 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,
    Dave

    #519527

    Dave
    Full Member
    Post count: 205

    Hi 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,
    Dave

    #519544

    Dave
    Full Member
    Post count: 205

    Just 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,
    Dave

    #519575

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi 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

    #519577

    Dave
    Full Member
    Post count: 205

    Great thank you. Much appreciated.

    Dave

    #519706

    Kiran
    Moderator
    Post count: 7069

    Hi Dave,

    We have updated some changes please check and let us know.

    Regards,
    Kiran

    #519720

    Dave
    Full Member
    Post count: 205

    All 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-519293

    Thanks,
    Dave

Viewing 15 posts - 1 through 15 (of 22 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount