map bubble issue

This topic contains 16 replies, has 5 voices, and was last updated by  Nicolas Antoine 4 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #522908

    Victor Cardona
    Full Member
    Post count: 177

    Hi,

    I am having a recurring maps issue that I thought was resolved. This issue keeps coming back when I return to the map on the front page of my site after leaving the site for a while. When clicking on one of the map icons it results in an error message and the map bubbles don’t load.

    My site is at http://www.hearabouthere.com

    Any help would be appreciated.
    Thanks
    Victor

    #522909

    Victor Cardona
    Full Member
    Post count: 177
    This reply has been marked as private.
    #522912

    Kor
    Moderator
    Post count: 16516

    Hi Victor,

    Thanks for your post. I’ve clicked a few map markers and I’m able to open the map bubbles without issues. Could you be more specific? How do you replicate it? Maybe you should try clearing your browser cache?

    #523155

    Kiran
    Moderator
    Post count: 7069

    Hi Victor,

    I checked with different browser with clearing cache each time. It worked fine for me (see attachment).

    If you see issue again try following PHP snippet.

    
    
    /**
     * Validate map bubble nonce using referer.
     */
    function gd_snippet_fix_map_bubble_issue( $errors ) {
    	if ( is_wp_error( $errors ) && ! empty( $_REQUEST['_wpnonce'] ) &&  ! empty( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '/wp-json/geodir/' ) !== false && strpos( $_SERVER['REQUEST_URI'], '/markers/' ) !== false && is_wp_error( $errors ) && $errors->get_error_code() == 'rest_cookie_invalid_nonce' ) {
    		$parse_referer = wp_parse_url( wp_get_referer() ); // Http referer
    		$parse_home = wp_parse_url( home_url( '/' ) ); // Home url
    
    		if ( ! empty( $parse_referer['host'] ) && ! empty( $parse_home['host'] ) && strtolower( $parse_referer['host'] ) == strtolower( $parse_home['host'] ) ) {
    			return true;
    		}
    	}
    	return $errors;
    }
    add_filter( 'rest_authentication_errors', 'gd_snippet_fix_map_bubble_issue', 99999, 1 );

    Check here about how to use PHP snippet. https://wpgeodirectory.com/docs-v2/faq/customizing/#snippets

    Regards,
    Kiran

    #523439

    Victor Cardona
    Full Member
    Post count: 177

    Hi Kor and Kiran,

    Thanks for your messages.

    I just tried this on ios safari and chrome desktop and received an error, and white box pops up with a spinning arrow.

    A screenshot of the box with arrow on ios and a screenshot on chrome desktop are attached.

    I note that if I reload the page then the map bubble loads correctly. I have only seen this on the front page map not the location page map.

    I note your comment about the php snippet. Would you suggest I use this to address this issue? I don’t need to customize this other than to get the map bubble to load.

    Any help appreciated.
    thanks
    Victor

    #523447

    Kor
    Moderator
    Post count: 16516
    This reply has been marked as private.
    #523490

    Kiran
    Moderator
    Post count: 7069

    Hi Victor,

    Map bubble worked fine for me as well in Safari, Chrome & Firefox. If you add PHP snippet then it will prevent cache issue with map bubble.

    Let us know.

    Regards,
    Kiran

    #523697

    Victor Cardona
    Full Member
    Post count: 177

    Hi Kiran,

    I am continuing to have this issue when I first go to the front page and click on a map element both on ios and chrome on my pc. If I reload the browser page after the error then it works fine.

    Perhaps I should try the PHP snippet that you provided?

    I wonder if there is something different about the map or my site that is different than the way others are using it. I tried refreshing the browser cache and even the cache at my webhost, siteground, but this issue keeps reappearing.

    Any help or advice appreciated.
    Thanks
    Victor

    #523699

    Kiran
    Moderator
    Post count: 7069

    Hi Victor,

    This error occurs when it fails to validate security nonce. I have tried many times in different browsers but can’t replicate issue. One of my team member also tried and it worked working fine for him also.

    It looks like something cache related things that creating issue at your side.

    Please try adding PHP snippet and let us know how it goes.

    Best Regards,
    Kiran

    #523706

    Victor Cardona
    Full Member
    Post count: 177

    Thanks, Kiran.

    I have tried on other devices and get the same issue when I access the map on the first load. On the bright side it appears it isn’t happening to others…

    I haven’t enabled the supercacher on siteground either. Maybe that would help?

    I will try the PHP snippet.

    Best regards,
    Victor

    #523713

    Kor
    Moderator
    Post count: 16516

    Hi Victor,

    Thanks for your reply. Yes, please test the PHP code snippet and if the issue persists, kindly record a screencast using this free tool https://screencast-o-matic.com/ and share it here for our reference.

    #523762

    ukvape
    Expired Member
    Post count: 72

    We have the same issue, only happens on mobile though. (Sorry for hijacking but it may help us both)

    Will test the PHP code shortly

    #523785

    Kor
    Moderator
    Post count: 16516

    Hi ukvape,

    Thanks for your post. Kindly open a new ticket and we’ll check your GD setup.

    #523852

    Victor Cardona
    Full Member
    Post count: 177

    Hi Kiran,

    The PHP snippet appears to have fixed the problem. Thanks for the help.
    Best regards,
    Victor

    #523855

    Kiran
    Moderator
    Post count: 7069

    Thanks for letting us know.

    Kiran

Viewing 15 posts - 1 through 15 (of 17 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