- February 8, 2019 at 8:02 AM #58659
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?
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
WordPress General Limit:128M
WordPress Admin Limit:256M
PHP Peak RAM:64 MB
PHP Post Max Size:32M
W.February 8, 2019 at 2:51 PM #58667
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)
And more specifically if you use the Browser tools and inspect the Network:
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
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/>; rel=”https://api.w.org/”
Content-Type: text/html; charset=UTF-8February 8, 2019 at 2:53 PM #58668
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.February 8, 2019 at 4:56 PM #58673
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 versionFebruary 9, 2019 at 5:19 AM #58678
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.
February 9, 2019 at 7:02 AM #58680
- This reply was modified 5 months, 1 week ago by William.
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?
W.February 9, 2019 at 3:43 PM #58683
I am having this same problem at rightatschool.com/program-finder. Please advise.February 9, 2019 at 5:23 PM #58684
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.
Did you migrate your site from http to https? Is your cert valid in Googles eyes? I am still seeing the error:
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.February 9, 2019 at 5:30 PM #58685
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..February 10, 2019 at 4:55 AM #58697
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?
W.February 11, 2019 at 8:06 AM #58699
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.February 11, 2019 at 1:05 PM #58703
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
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.February 11, 2019 at 1:22 PM #58705
Thanks Cici. 🙂
Yes, WP is installed in /cms
I will look into that and report back.
W.February 11, 2019 at 10:56 PM #58709
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.
February 13, 2019 at 7:15 AM #58740
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.February 13, 2019 at 3:39 PM #58748
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 linkFebruary 14, 2019 at 11:33 AM #58752
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. 🙂
W.February 15, 2019 at 4:41 PM #58766
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
The topic ‘"Could not locate this address" error but blank search shows locations’ is closed to new replies.