• Resolved Dave

    (@go3asy)


    Hi, I have been using this for some time now and have spoken in the past when you first released the plugin. I made some changes to the plugin to meet our needs so dont want to update and am just wondering if you ever got to the bottom of the issue witht he finder not always loading when going to the page?

    Sometimes it fails to load for me and requires a page refresh.

    Will categories be in the pro version also? Cheers

    https://www.ads-software.com/plugins/wp-store-locator/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    What is your url? Does it also happen when you use the default wp theme?

    A category filter will be available in the pro version.

    Thread Starter Dave

    (@go3asy)

    Yeah seems to always happen tested on another site as well https://nhsforthvalley.com/health-services/local-service-finder/

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Do you happen to be logged in when that happens? Which browser do you use, or does it happen in different browsers?

    Thread Starter Dave

    (@go3asy)

    It happens in all browsers wether logged in I not. All it loads is the top grey bar text and search box. Doesn’t load the drop downs for sorting results or the map etc. doesn’t happen every time and a page refresh fixes it. Not a cache issue as happend before we added caching.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    I can’t replicate it at all, whatever browser I try it always works fine on the first load.

    I did notice a warning in Firebug “You have included the Google Maps API multiple times on this page. This may cause unexpected errors.”

    If I check the source it is added twice. Can you maybe remove this one from the source in the locator page, it is not from the store locator plugin. It’s unlikely but maybe that somehow breaks it for you on the first load.

    <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>

    You are testing this from your office? If so, does it happen for you on other locations as well?

    Do you have Firebug ( https://getfirebug.com/ ) installed? If not, could you maybe add it to Firefox. Then press F12, open the console tab and see if there are any errors/warnings after the page loaded but the store locator is broken. If so, can you please share them with me.

    Thread Starter Dave

    (@go3asy)

    It happens at home as well. Doesnt always do it if you go off the page say 10 times and back on 5 times it wont load and require a refresh. So I remove that line from a file in the plugin?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Not from the store locator plugin, the maps script loaded by wp store locator should stay. But somewhere in your theme ( most likely in the functions.php ) or through another plugin a second map script is added, that is the one you should remove.

    The quickest way to find where it’s coming from is to download the theme/plugin files and run a search through them looking for “maps.google.com”

    Thread Starter Dave

    (@go3asy)

    Yeah I have searched every file and I cant find it, doing my head in.

    Thread Starter Dave

    (@go3asy)

    Found it now it was park of a shortcode. I will leave it for a while and see how it gets on once taken out

    Thread Starter Dave

    (@go3asy)

    Still getting the problem although I cant replicate it in firefox but google chrome its constantly happening. Only 1 instance of oft he google maps api loading.

    Thread Starter Dave

    (@go3asy)

    Ok I have put the script back in I removed as its still happening.

    Just got a reply from the other person who was testing it and they are also using chrome not IE which I originally thought so it could just be a problem with chrome.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Can you hit F12 in Chrome, that should show the dev tools. Then go the console and check if there are any errors or warnings there when it doesn’t load. You do need to reload the page after activating the dev tools before the console shows anything.

    Thread Starter Dave

    (@go3asy)

    Just the same “You have included the Google Maps API multiple times on this page. This may cause unexpected errors.”

    (removing this doesn’t fix the issue)

    Checked this on an instance the finder didn’t load.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Doesn’t load the drop downs for sorting results or the map etc

    I missed the map not loading part the first time I read it. The map has an event listener attached to it that inits the map once the page has finished loading.

    google.maps.event.addDomListener( window, "load", initializeGmap );

    One situation I’m aware of that breaks it is Ajax navigation. You aren’t using it, so that can’t be it. But it does look like the “window” sometimes doesn’t finish loading and that would result in no map or dropdowns.

    There is one way to test it and that is to make the initializeGmap write something to the debug console.

    If you add this inside the initializeGmap function ( which is at the top of the /js/wpsl-gmap.js file ) then we can see if it even reach that part of the script in either Firebug or the debugger in Chrome.

    console.log( "loaded" );

    If it doesn’t say it and the map is missing, then we know what the problem is.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Or even easier just change this

    if ( $( "#wpsl-gmap" ).length ) {
        google.maps.event.addDomListener( window, "load", initializeGmap );
    }

    Into this and test it again ( code is at the bottom of the wpsl-gmap.js file ).

    if ( $( "#wpsl-gmap" ).length ) {
        initializeGmap();
    }

    The whole Google Maps even listener is a bit pointless since it’s already wrapped inside a jQuery( document ).ready( function( $ )

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Finder doesnt always load and required refresh’ is closed to new replies.