Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip code search not returning results for certain zip codes #739

Open
lsterling03 opened this issue Mar 31, 2016 · 17 comments
Open

Zip code search not returning results for certain zip codes #739

lsterling03 opened this issue Mar 31, 2016 · 17 comments

Comments

@lsterling03
Copy link

Using the search widget with zip code, and it works for most of our locations. But there are four locations that do not show up in the results even if I type in their exact zip code. I've confirmed that their location info is correctly entered in the post. Those locations properly appear on the map and mashup map.

I don't see any errors in the console. I turned on debugging and no errors there either. I've deactivated all plugins and tried it with Twenty Ten. The problem remains.

I tried changing the zip code on one of the problem locations to a zip code that I know works. When I do that, it shows up in search results. When I changed it back to its real zip code, it no longer shows up in search results. I've, of course, made sure the radius was large enough.

I'm not sure what else to tell you. Can you think of a reason why this would happen, or what else I can do to troubleshoot?

@lsterling03
Copy link
Author

In case it matters, these are the zip codes that don't work:

25177
22801
20109
20151

@cyberhobo
Copy link
Owner

I saved a post with address "2503 Maccorkle Ave, St Albans, WV 25177", and a search for 25177 finds it. Which map provider are you using?

@lsterling03
Copy link
Author

I'm using Google V3 without an API key. I just tried it with Leaflet and
OpenLayers and I still get the same problem. The locations are properly
plotted on the map with each provider -- but still get a "no results found"
from the zip code search.

This is strange!

On Thu, Mar 31, 2016 at 10:53 AM, Dylan Kuhn [email protected]
wrote:

I saved a post with address "2503 Maccorkle Ave, St Albans, WV 25177", and
a search for 25177 finds it. Which map provider are you using?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#739 (comment)

@cyberhobo
Copy link
Owner

Can you add a post with the same address I used and see if that is found?

On Thu, Mar 31, 2016 at 7:58 AM, lsterling03 [email protected]
wrote:

I'm using Google V3 without an API key. I just tried it with Leaflet and
OpenLayers and I still get the same problem. The locations are properly
plotted on the map with each provider -- but still get a "no results found"
from the zip code search.

This is strange!

On Thu, Mar 31, 2016 at 10:53 AM, Dylan Kuhn [email protected]
wrote:

I saved a post with address "2503 Maccorkle Ave, St Albans, WV 25177",
and
a search for 25177 finds it. Which map provider are you using?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
<
#739 (comment)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#739 (comment)

@lsterling03
Copy link
Author

Unfortunately, that address didn't work either. So strange that it only
happens to certain zip codes. Others still work just fine.

It seems clear now that the problem is on my end, but frustrating that I
can't find a culprit even with the default theme and no plugins activated.
If you have any ideas on another test I can try, I'd welcome any advice.

Thanks!

On Thu, Mar 31, 2016 at 11:05 AM, Dylan Kuhn [email protected]
wrote:

Can you add a post with the same address I used and see if that is found?

On Thu, Mar 31, 2016 at 7:58 AM, lsterling03 [email protected]
wrote:

I'm using Google V3 without an API key. I just tried it with Leaflet and
OpenLayers and I still get the same problem. The locations are properly
plotted on the map with each provider -- but still get a "no results
found"
from the zip code search.

This is strange!

On Thu, Mar 31, 2016 at 10:53 AM, Dylan Kuhn [email protected]
wrote:

I saved a post with address "2503 Maccorkle Ave, St Albans, WV 25177",
and
a search for 25177 finds it. Which map provider are you using?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
<

#739 (comment)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
<
#739 (comment)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#739 (comment)

@lsterling03
Copy link
Author

Just to add to this....

If I type in the city name "St Albans" or "St Albans, VA" into the search field, the location does show up. It just doesn't show up if I type in the zip code "25177". I went line-by-line in the database to see if there was any difference in the way the working and non-working locations were saved, and they are all formatted the same.

Stumped.

@cyberhobo
Copy link
Owner

That should result in a geocode request like this:

https://maps.google.com/maps/api/geocode/json?address=25177&language=en

Which returns St Albans for me. The only twist I can see is if your site language is not set to English perhaps?

@lsterling03
Copy link
Author

The site is set to English. I'm still trying to figure this out. I took a clone of the entire site and put it on another server, and everything works fine. So then I tried cloning that clone and moving it back to the live server... but the zips still will won't work there. The site is hosted on Rackspace cloud. I spent an hour on the phone with their tech support and they couldn't find anything wrong or anything different between the working and non-working server technology. Can you think of anything that would possibly be incompatible with Rackspace cloud sites?

One thing I did notice in the database is that the postal code field was not always filled in correctly for each location. Sometimes there were just 4 seemingly random numbers. But there wasn't any consistency in the mistakes -- meaning, some of the broken zips had correct postal code fields. And some of the working zips had incorrect postal code fields. But in case that was the problem, I manually edited the postal code field in the database for all locations and that field didn't have any effect either way.

Have you ever heard of any problems with your plugin on Rackspace?

On Apr 13, 2016, at 10:34 PM, Dylan Kuhn [email protected] wrote:

That should result in a geocode request like this:

https://maps.google.com/maps/api/geocode/json?address=25177&language=en

Which returns St Albans for me. The only twist I can see is if your site language is not set to English perhaps?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@cyberhobo
Copy link
Owner

No, I don't know of any Rackspace-specific issues. You could use this small plugin to see what results the URL above gives you on the Rackspace server.

@lsterling03
Copy link
Author

Thanks for that plugin -- interesting results. I put in this URL:
https://maps.google.com/maps/api/geocode/json?address=25177&language=en and
the Hostgator (cloned) site returned the correct results as expected.

The Rackspace site returned this:

{"headers":{"content-type":"application/json; charset=UTF-8","date":"Thu,
14 Apr 2016 14:03:48 GMT","pragma":"no-cache","expires":"Fri, 01 Jan 1990
00:00:00 GMT","cache-control":"no-cache,
must-revalidate","access-control-allow-origin":"*","content-encoding":"gzip","server":"mafe","content-length":"224","x-xss-protection":"1;
mode=block","x-frame-options":"SAMEORIGIN","alternate-protocol":"443:quic","alt-svc":"quic=":443";
ma=2592000; v="32,31,30,29,28,27,26,25""},"body":"{\n "error_message"
: "You have exceeded your daily request quota for this API. We recommend
registering for a key at the Google Developers Console: https://
console.developers.google.com/apis/credentials?project=_",\n
"results" : [],\n "status" :
"OVER_QUERY_LIMIT"\n}\n","response":{"code":200,"message":"OK"},"cookies":[],"filename":null}

So it seems Rackspace requires you to use an API key. But that doesn't make
sense either, because I tried that URL but with one of the working zip
codes (
https://maps.google.com/maps/api/geocode/json?address=23220&language=en)
and I got the same API error warning. But that 23220 zip code DOES work on
the Rackspace site.

Crazy. I'll sign up for an API and see if that changes anything.

On Wed, Apr 13, 2016 at 11:35 PM, Lindsay Sterling [email protected]
wrote:

Thank you. I'll give that a try.

On Apr 13, 2016, at 11:13 PM, Dylan Kuhn [email protected] wrote:

No, I don't know of any Rackspace-specific issues. You could use this
small plugin https://github.com/cyberhobo/wp-remote-request-test to see
what results the URL above gives you on the Rackspace server.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#739 (comment)

@lsterling03
Copy link
Author

I signed up for a standard API and entered it into the Geo Mashup settings. The zips still don't work with the API.

@cyberhobo
Copy link
Owner

I was never able to get those geocoding requests to work with an API key,
so currently Geo Mashup doesn't attempt to use one. If you can give me an
example URL with a key that works for you, maybe I can get that working
again.

On Thu, Apr 14, 2016 at 7:19 AM, lsterling03 [email protected]
wrote:

I signed up for a standard API and I still got the same "exceeded quota"
error on Rackspace, for both working and non-working zip codes.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#739 (comment)

@lsterling03
Copy link
Author

Here's request with my API key:
https://maps.google.com/maps/api/geocode/json?address=22801&language=en&key=AIzaSyB0xMv0CFMrAROQKn3n7xAS96FpCkSq_n0

And here's a test page on Rackspace, stripped down with only 2 locations,
one working and one not. Harrisonburg (22801) doesn't work. Richmond
(23220) works. No plugins are activated except for GeoMashup.

http://www.landsaver.net.php56-29.ord1-1.websitetestlink.com/warehouse-locations/

Type in 22801 into the zip code search in the sidebar and you won't get any
results, even though that's the zip code of the Harrisonburg location. But
if you type in a different zip code that's near that location (22802), then
you will see the result. Type in the word "Harrisonburg" and you will get
the result. Just not with 22801.

On Thu, Apr 14, 2016 at 11:05 AM, Dylan Kuhn [email protected]
wrote:

I was never able to get those geocoding requests to work with an API key,
so currently Geo Mashup doesn't attempt to use one. If you can give me an
example URL with a key that works for you, maybe I can get that working
again.

On Thu, Apr 14, 2016 at 7:19 AM, lsterling03 [email protected]
wrote:

I signed up for a standard API and I still got the same "exceeded quota"
error on Rackspace, for both working and non-working zip codes.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
<
#739 (comment)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#739 (comment)

@cyberhobo
Copy link
Owner

I'm hoping that #752 will solve this.

@TheJester12
Copy link

I'm actually experiencing this on a recent install. Zip codes 55123 and 56085 aren't working:

https://yettioutdoors.com/dealers/

I tried a direct API call with my key and it does return results:

https://maps.google.com/maps/api/geocode/json?address=56085&language=en&key=mykey

Any thoughts? What else should I check?

@cyberhobo
Copy link
Owner

@TheJester12, do you know if that is also a rackspace server? Have you tried using the remote request plugin to see if the results are the same on the server?

@cyberhobo
Copy link
Owner

cyberhobo commented Aug 27, 2017

The other thing that might be of interest could be added to your search results template after the No Results Found message:

       <p><?php _e( 'No results found.', 'GeoMashup' ); ?></p>

        <?php if ( GeoMashupDB::$geocode_error ) : ?>
            <--
            <?php echo GeoMashupDB::$geocode_error->get_error_code(); ?>
            <?php echo GeoMashupDB::$geocode_error->get_error_message(); ?>
            -->
        <?php endif; ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants