Store Locator Plus® for WordPress Forums Store Locator Plus Map cannot Locate address

Tagged: ,

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #58437
    andrew.k.winter
    Participant

    The address search feature works fine on my staging site, but doesn’t on the live site even though the settings are the same.

    The whole listing of locations displays upon first load, but when I enter an address in “Find locations” it gives me the result: “Could not locate this address. Please try a different location.”

    I obtained the Google Browser Key for SLP a while ago which has been working since I launched the website last year. Since the Google changes and this issue, I checked to make sure the Geocoder API is enabled. I haven’t set any restrictions, so I left the SLP Google Geocoding Key field blank. It doesn’t work either way if I create a new key to enter in that field.

    I actually didn’t have it linked to a billing account before so I created one. Still the issue remains. I appreciate your help resolving this!

    Attachments:
    You must be logged in to view attached files.
    #58445
    Cici
    Keymaster

    I just went to this site: Is this the correct url ?

    https://barreamped.com/take-a-class/

    It looks like you may have an old version of geocoder  and/or have not correctly set up the key. The error message on that page indicates you may not be using the referrer correctly ( To use the Maps JavaScript API client side services, you will need to create a separate API key which can be secured with an HTTP referrers restriction)

    The error on that public site:

    Failed to set referrer policy: The value ” is not one of ‘no-referrer’, ‘no-referrer-when-downgrade’, ‘origin’, ‘origin-when-cross-origin’, ‘same-origin’, ‘strict-origin’, ‘strict-origin-when-cross-origin’, or ‘unsafe-url’. The referrer policy has been left unchanged. index

    Here is an article and instructions written by the developer and in docs site.  Unfortunately Google instructions stink and a lot of people are misled by Google on how to use  the  referrer info.

     

    #58446
    Cici
    Keymaster

     

    More info on setting up the browser key without restrictions

    See info on what not to do

    If you did not set any referrer restrictions then is it possible you are using an outdated version of the Maps Javascrit API on the live site ?

    https://developers.google.com/maps/documentation/javascript/v2tov3

    According to Google transition team  and support, you would most likely need a new key to go from version 2 to version 3. Be sure to read the article and contact Google support with questions on what you need to do, always make sure you have a backup of your site..

    #58455
    andrew.k.winter
    Participant

    https://barreamped.com/take-a-class/ is correct.

    I have both Geocoding Key and Browser Key inserted in their fields. Neither of them are restricted. Both are new keys and version 3.

    I ran the test by changing the Center Map in settings and both the map and geocoding work.

    Still, the map cannot locate an address on the site page... :-/

    I wonder if it has anything to do with SSL since it works fine on the staging site but not on the live site?

    Do you still see that “set referrer policy” error?

    Thanks!

    #58465
    Cici
    Keymaster

    If you do not have any referrer restrictions you do not need to be obtaining a unique geocoding KEY. I can see your geocoding key when I inspect and search in that site so I am guessing that may be one of the issues.

    Yes The error is the same , you can see it if you just use the browser tool to inspecyt and look under the console tab at the bottom when it opens up

    Failed to set referrer policy: The value ” is not one of ‘no-referrer’, ‘no-referrer-when-downgrade’, ‘origin’, ‘origin-when-cross-origin’, ‘same-origin’, ‘strict-origin’, ‘strict-origin-when-cross-origin’, or ‘unsafe-url’. The referrer policy has been left unchange

    The other error that I see now when using the “search for a specific zip code; using browser console inspector is a 404 error.

    I am discussing this with the developer.

     

    #58470
    Cici
    Keymaster

    Drew can you try something for us on the site url that isnt working?  Goto Settings/MAP and map domain and set it to something else, save, then set it back to United States or whatever you had before

     

    And report back what it says.

    #58471
    Cici
    Keymaster

    Drew you mentioned SSl…did you recently migrate site to Https?  Is there a difference between the staging site SSL and the actual live site?

     

    #58478
    andrew.k.winter
    Participant

    Cici, thanks for looking into this.

    I went to Settings/Map and did what you suggested.

    No change, but I can see several errors, I see this one twice

    Failed to load resource: the server responded with a status of 404 (Not Found)

    One relates to the theme… /js/maps/swiper.jquery.js.map — could this be a conflict with scripts in the SLP plugin?

    The other relates to the geocode after using the search …/wp-json/store-locator-plus/v2/geocode/…/us/37209

    I took out the geocoding key and see this Log:

    Google JavaScript API geocoder failed with status ERROR results undefined

    The staging site is an exact clone sharing the database and SSL of the live site. The migration to SSL wasn’t recent (Feb 2018).

    #58479
    Cici
    Keymaster

    Hey Andrew, We are tryint o track down the bug,

     

    On the site that you already have and returning errors, Do you see the map domain list?  If you cannot see screenshot see where the map domain dropdown menu is under Documentation about how to select map domains 

     

    Attachments:
    You must be logged in to view attached files.
    #58495
    Cici
    Keymaster

    Andrew,

     

    I am at a loss but have the developer trying to figure this out. It is a lot of different errors I am seeing reported by customers but they are all related to geocoder, so I do nto know if Google changed something on us yet again or what is going on. We had a customer who fixed  his API key restrictions and it wirked and now the problem is back.

     

    Long story short, can you send , via the contact us any WP debug logs you might have if you have tried that, and/or send a temporary log-in via Support for your staging site so our developer can look at it?

    Ugh so frustrating I know.

     

    #58513
    Lance Cleveland
    Keymaster

    Andrew —

    Did you port this site over properly?

    How is the /portal/ being set in the site_url for your configuration on the live site?

    SLP uses the WordPress call to get the REST URL, and that call reads the value of the site_url option in your WP database.

    Your live site is here:
    https://barreamped.com/

    But the code thinks your REST listener is here:
    https://barreamped.com/portal/wp-json/

    If you can help us understand the porting process from staging to live we might be able to come up with a solution in the code.   However it looks like the port did not change all references in the WordPress database properly.

    Is there is a reason you have left the site_url set to the /portal/ subdirectory?

    #58515
    andrew.k.winter
    Participant

    Hi Lance,

    I gave the site its own directory to keep clear of clutter and organized in the root directory so its WordPress address is https://barreamped.com/portal/ while its Site URL is https://barreamped.com/

    The staging site is within /portal/ba-staging2/ which is a clone of the live site created via the WP Staging plugin.

    Let me know if you need anymore information! Thanks.

    #58550
    Cici
    Keymaster

    Hi Andrew,

    For some reason Lance is having a problem with being able to  reply to this post.

    One question/observation….can you edit and save  pages  or posts WP ?  If not SLP will not work. Per lance, WP 5.0 changed and is riddled with REST API and JavaScript errors and  invalid JSON responses..   SLP as well as core WordPress features rely heavily on the REST API.  He will be writing about this, I cannot address it, since it is out of my skill set.

    You mentioned yin first post , i.e Google API you did not have any restrictions no referrers . so the news article and latest video may not effect you.

    Browser Key

    This should have a single restriction turned on — the referer restriction. The value of that restriction should contain your website URL. Using a wildcard like https://*.storelocatorplus.com/ is usually a good idea as many web servers allow the non-www (https://storelocatorplus.com/) and WWW address (https://www.storelocatorplus.com) to be used.

    additional info about how the SLP geocoding requests , how the IP restrictions work for geocoding etc.

    https://www.storelocatorplus.com/api-keys-with-referer-restrictions-cannot-be-used/

    If you could send any additional questions and info to the email support so Lance can answer the more technical questiosn on the subdirectory urls etc that would be appreciated.

    #58712
    Lance Cleveland
    Keymaster

    Looks like you have a WordPress subdirectory install.

    If you have WP installed in a subdir AND are using permalinks (any setting other than “plain”) you MUST have the correct wp-json rewrite rule in your Apache or nginx config.

    Most of the Codex examples predate the REST API and do not properly account for it when permalinks are enabled.

    https://www.storelocatorplus.com/wordpress-subdirectory-installs-and-the-rest-api/

    #58727
    andrew.k.winter
    Participant

    I do have a WordPress subdirectory install and using pretty permalinks.

    I believe by Apache you mean htaccess? I’m not familiar with nginx config.

    Will this rule work if I add it to the .htaccess file of the root directory?

    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-json/(.*) /wordpress/index.php?rest_route=/$1 [L]
    #58735
    Cici
    Keymaster

    Hi Andrew.

    We do not run Apache so cannot test on it, but yes with Apache it is htaccess

    Lances recent article on the issue, or the more complex article for the tech savvy people such as yourself.

    (Best to test your fix on a staging or test site.)

    http://lance.bio/2019/02/12/nginx-installing-wordpress-in-a-subdirectory/

    When Lance has some available time I will ask him what his thoughts are.

     

     

     

     

     

    #58742
    andrew.k.winter
    Participant

    Looks like after the latest plugin update it is working again! Thank you!

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘Map cannot Locate address’ is closed to new replies.