Automattic / Automattic/WP-Job-Manager
[discussion] GeoLocation Providers, Handling, and Debugging
- Dominant language
- PHP
- Stars
- 899
- Forks
- 369
- Avg merge
- 11h 37m
- Merged PRs (30d)
- 12
Description
Wanted to get the discussion regarding geolocation organized into a single issue so they can be addressed, and so I can try and help with some PRs to enhance the current geolocation handling.
Few things I think will be most important:
- Additional geolocation providers (@jom you mentioned you may have already started on this?)
- Debug Logging
- Handling to queue geolocation on listings missing geolocation data
My thoughts regarding debug could be handled a few different ways
1. Add button in Settings to test geolocation api, and show errors
_This would make it easy to get around how geolocation is handled now, where it's not done immediately (to prevent delay for user on frontend)_
2. Add button in new writepanel in admin area, to trigger geolocation on single listing (and show success or error message)
_Similar to above, but this would also allow admins to see specific error on listings (if there is one), while also providing the ability to "test" geolocation (would probably just have to add something in docs to point users to using this for debugging)_
3. Output errors from geolocation directly into error log
Personally I think the error log method/handling should be added either way (and can be maybe enabled via a filter or setting), and I like the ability to do it from admin area, but would this cause confusion as to geolocation is still generated when a listing is saved?
Maybe we could have a new writepanel that shows some information about the geolocation data (if geolocation is enabled), showing like a green status if listing has geolocation data, with a few details from it. Could then possibly have a button to "Force Regenerate" which could show error/success since concern of delay for admin is not big issue compared to user on frontend.
I think debugging is probably going to be one of the most required handlings here, mainly because I see a ton of clients having issues with geolocation not being generated (almost always due to key restrictions). Because there isn't any way to view any of this (natively) or know what the "issue" is, most users assume it's the plugin and not something with their API key or restrictions on it.
Maybe we could add another tab to settings area specifically for GeoLocation, to define the provider to use, have debug information, and even the button to trigger updating all listings that have not been set.
@jom @gkaragia @renatho thoughts, suggestions, concerns, opinions?
For reference, here's some "slow geocode" i came up with a few years ago for a clients (probably no use, but just in case):
https://gist.github.com/tripflex/a13cf9ece1d6cec01c16e3bf8be08721
Related:
https://github.com/Automattic/WP-Job-Manager/issues/1753
https://github.com/Automattic/WP-Job-Manager/issues/2097
https://github.com/Automattic/WP-Job-Manager/issues/1966
https://github.com/Automattic/WP-Job-Manager/issues/1069
Contributor guide
Research direction
No implementation files, tests, or entry points are named. Start by reviewing the related issues and the existing geolocation handling, then clarify which provider, debugging, queueing, and admin workflows are in scope. Done criteria are not defined and would need agreement before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100