Store Locator Plus® for WordPress Forums Store Locator Plus "Could not locate this address" error but blank search shows locations

Tagged: 

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #58659
    William
    Participant

    I have a Store Locator Plus running on a site which has been working fine. I noticed yesterday that the search wasn’t working for any location (address or post code) and just gave a message “Could not locate this address. Please try a different location.”

    However, if you leave address or post code blank and just hit “FIND LOCATIONS”, it lists all locations within the miles limit set on the page for the centre of the map. Increasing the mileage limit also works, and shows more locations, from the centre of the map.

    I’ve checked the Google keys and all seems fine – I assume these are correct otherwise an empty address/post code search wouldn’t work either.

    I have Map Domain set correctly (UK – maps.google.co.uk)

    I have seen a few posts on similar subject but can’t see a resolution. Can anyone advise what the problem may be?

    Web site

    Wordpress: Version 5.0.3
    Store Locator Plus® Version: 5.0.3
    Store Locator Plus : Extended Data Manager Version: 4.7.0
    Store Locator Plus Pro Pack: Version 4.4.04 – Deactivated (as not required)
    This Info Cached:1549567595
    Network Active: No
    PHP Version:7.1.26
    MySQL Version:5.5.61
    PHP Limit:256M
    WordPress General Limit:128M
    WordPress Admin Limit:256M
    PHP Peak RAM:64 MB
    PHP Post Max Size:32M

    Thanks.

    W.

    #58667
    Cici
    Keymaster

    If ProPack is not active it will not show up in your Plugin environment , ditto with Extended Manager, (If this is an exact screenshot of your current plugin environment)

    You have a json error.  And the regions search is US  (not UK or GR)

    Use any Browser  dev tool and inspect your site you will see under Console this error

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

    https://www.samonline.co.uk/cms/wp-json/store-locator-plus/v2/geocode/25bd3c841c43281ca01a8068f9e1c658/us/London

     

    And more specifically if you use the Browser tools and inspect the Network:

    1. Request URL:
    2. Request Method:
      GET
    3. Status Code:

      404 Not Found
    4. Remote Address:
      5.159.228.49:443
    5. Referrer Policy:
      no-referrer-when-downgrade

    Please read the Developers article about your referrer and  restrictions

    your site is not able to freely communicate back and forth between WordPress, , Google etc.

    Your REST API  is blocked for some reason

    HTTP/1.1 404 Not Found

    Date: Fri, 08 Feb 2019 19:37:02 GMT

    Server: Apache/2.4.37 (cPanel) OpenSSL/1.0.2q mod_bwlimited/1.4

    X-Powered-By: PHP/7.1.26

    Expires: Wed, 11 Jan 1984 05:00:00 GMT

    Cache-Control: no-cache, must-revalidate, max-age=0

    Link: <https://www.samonline.co.uk/wp-json/&gt;; rel=”https://api.w.org/&#8221;

    Vary: Accept-Encoding,User-Agent

    Content-Encoding: gzip

    Content-Length: 12770

    Connection: close

    Content-Type: text/html; charset=UTF-8

     

    #58668
    Cici
    Keymaster

    P.S. when you do inspect and go to the link for the error shown in the browser window you will see this

     

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

    We may have a fix for the domain issue returning US even if you put in UK,

    if you want to test the pre release version 5.0.4 we can send that to you via email, but it should only be tested on a dev or staging site if you have one.

    It may not fix your 404 error but it should fix the map domain issue. You can send request to contact us for pre release version

     

    #58678
    William
    Participant

    Hi Cici,

    Thank you very much for your quick replies. They are great appreciated. 🙂

    >If ProPack is not active it will not show up in your Plugin environment , ditto with Extended Manager, (If this is an exact screenshot of your current plugin environment)

    You are correct – I added the ProPack line myself just for information, even though it didn’t appear in the Plugin Environment information.

    I will investigate your feedback and respond.

    Regards,

    W.

     

    • This reply was modified 5 years, 9 months ago by William.
    #58680
    William
    Participant

    Hi Cici,

    I have been struggling with this.

    Here’s what I have done … I have created a new Google Browser API Key (the one I was using was set-up for unrelated embedded maps) and have kept it unrestricted, in the meantime. I have not (yet) set up a Geocoding Key so I have added the same key into the Geocoding Key field in SLP.

    When I look in console.cloud.google.com I can see the traffic from tests fine, with 200 response codes. However, location search results is still exactly same as initially posted.

    admin-ajax.php is not blocked.

    >Use any Browser  dev tool and inspect your site you will see under Console this error

    When I check in Chrome Console, I don’t see the errors you mention .. can you check if they are still there?

    Thanks,

    W.

    #58683
    Lee
    Participant

    I am having this same problem at rightatschool.com/program-finder. Please advise.

    #58684
    Cici
    Keymaster

    @Willliam

    If you have no referrer you only need the one key. The browser key.  Do not add the browser Google Maps API key in both fields.  If you do restrict follow the directions that Lance provided in his articles.  This one also has a video to explain it.

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

    Did you migrate your site from http to https?   Is your cert valid in Googles eyes?  I am still seeing the error:

      1. Request Method:
        GET
      2. Status Code:

        404 Not Found
      3. Remote Address:
        5.159.228.49:443
      4. Referrer Policy:
        no-referrer-when-downgrade
    1. Response Headersview source

    Secondly, as far as what we are seeing that the domain is poiting to US even if you have selected the map domain UK. There is a pacth being tested. We can provide you the pre-release via email if you have a staging site, a clone or dev or test site.

    Make sure you always have site back-ups.

    #58685
    Cici
    Keymaster

    @ Lee

    Please refer to the posting guidelines. It might be possible you have the exact same issue , configuration, referreres, API keys, add-ons, other  plugins, WP version, map domain (he is UK map)  etc as William, but most likely your back end isn’t exactly the same.

    I realize  the message returning  is the same exact message but It is basically saying   cant talk to Google and they are not talking to us so no location is found..

    If you could , please start a new post. following the guidelines  and provide a screenshot of your WPSLP  plugin environment.

    #58697
    William
    Participant

    Cici,

    Thanks again for your support.

    >If you have no referrer you only need the one key. The browser key.  Do not add the browser Google Maps API key in both fields.  If you do restrict follow the directions that Lance provided in his articles.  This one also has a video to explain it.

    OK, thanks. I have now removed the Google Geocoding Key under SLP -> General. That field is now blank.

    >Did you migrate your site from http to https?

    Yes, I did, two weeks ago. This could be the problem, as I don’t know if the SLP search worked correctely after the change from http to https.

    >Is your cert valid in Googles eyes?

    I assumed so as Chrome shows the cert as valid, but I don’t know for certain … it is an AutoSSL cert (from comodo.com via  Cpanel), also used widely on 100+ sites and I’ve never had a problem with any Google feature before. Is there another way I check if Google views the cert as valid?

    >Secondly, as far as what we are seeing that the domain is poiting to US even if you have selected the map domain UK. There is a pacth being tested. We can provide you the pre-release via email if you have a staging site, a clone or dev or test site.

    I don’t have a staging site or clone and would have to set this up. Is there a US / UK setting somewhere I can first try and change under SLP 5.0.3?

    Regards,

    W.

    #58699
    William
    Participant

    Update :  Just for information, I installed and tested another store location plugin today and, using the same Google API key, it works perfectly.

    This would appear to rule out any https or Google API issues on the site.

    #58703
    Cici
    Keymaster

    Ok, that is good info.  The  US vs UK domain region is a bug in SLP that is being addressed, that was the only reason I was asking for info regarding if you had one so you could test the Pre release to see if that fixes the issue.

    But I am now thinking, you may have the same issue we are seeing with some others who have been using SLP  from back in the day before the WP REST API was used.   As of SLP version 5.0 SLP now uses the WP REST API to communicate with the Google geocoder.

    , after visiting your site again , when looking at the error message I see  the blocked url  with the word after the .com as /cms/wp json ? Do you have WP installed in a subdirectory folder, i.e

    https://www.samonline.co.uk/cms/wp-json/store-locator-plus/

    If so then the web server configuration, regardless of which web server you choose, is NOT correctly re-routing requests to the URL that WordPress is “listening” on.

    SLP is going to use the address WordPress tells it…

     

    So if you installed in  /cms and set your “WordPress Address” to https://yourdomain.com/cms/    it is going to talk to yourdomaind.com/cms/wp-json/

    If WordPress is not responding to REST requests there then you must add a rule to your web config to say “hey, re-route all requests coming in at /cms/wp-json/  to /wp-json instead.

    #58705
    William
    Participant

    Thanks Cici. 🙂

    Yes, WP is installed in /cms

    I will look into that and report back.

    W.

    #58709
    Lance Cleveland
    Keymaster

    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/

    #58740
    William
    Participant

    Thanks again Cici and Lance. I appreciate your investigations and solution. 🙂

    I completely understand the issue but, as I’m running Apache, I would have to get someone with more knowledge to look into what rewrites are required for it. However, I have one concern … if we do set-up a rewrite for wp-json on this site, is it possible that we could then cause an issue with another plug-in which uses wp-json currently?

    W.

    #58748
    Cici
    Keymaster

    Others have used the route rule with Apache and no issues reported. My search also showed the resolution in WP stack exchange. The REST API configuration appears to have been n issue for a while on some sites .It is not an issue with SLP — it is an issue with WordPress and web server configuration.  And not users fault because WordPress had not updated their own documentation when they started using the REST API so sites were being set-up the old way with the old subdirectory instructions as Lance mentioned.

    If you have concerns, You might want to do some research to see if it is an issue for some of your other plugins.  If your configuration is corrected and if other plugins are not using a hacked configuration they should be ok.

    You can post the question in the WP Stackexchange

    FYI link

    https://wordpress.stackexchange.com/questions/306033/rewrite-rest-route-link-to-wp-json-without-changing-default-permalink-stru

     

     

    #58752
    William
    Participant

    Hi,

    I set up an Apache RewriteRule and it didn’t work. However, I just updated to SLP 5.0.4 and it’s now working again. 🙂

    Many thanks.

    W.

    #58766
    Cici
    Keymaster

    @Lee

    You do not have the same issue, your site is not working correctly because you have errors regarding your google MAPS API keys.

    To obtain support you must start a new Post and provide your plugin environment  per the posting guidelines. This support post will be closed since William is reporting issue resolved

     

     

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘"Could not locate this address" error but blank search shows locations’ is closed to new replies.