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

AJAX Endpoint #19

Closed
benjaminpick opened this issue Jul 15, 2015 · 5 comments
Closed

AJAX Endpoint #19

benjaminpick opened this issue Jul 15, 2015 · 5 comments

Comments

@benjaminpick
Copy link
Member

admin-ajax.php?action=geoip_detect2_get_info_from_current_ip&locales=fr,en

should return the JSON data.

@benjaminpick
Copy link
Member Author

Difficulty: everybody could potentially use the service (not allowed for paid file), and we cannot avoid it with nonces when the goal is to get cached pages customized. So:

  1. this must be opt-in
  2. add a secret parameter
  3. check the referer.

@alaninteractive
Copy link

Sounds great. I'm using http://freegeoip.net/ as a workaround, but it seems a little flakey. Thanks

@benjaminpick
Copy link
Member Author

benjaminpick commented Sep 29, 2015

I have started the work on the ajax branch, see #46. TODO:

  • Filling in empty attributes so that the JSON structure is always the same (unit tests)
  • Errors should always be JSON
  • Make shortcodes work with caching via JS by enqueuing a JS-File and replace placeholder in the HTML (as global option? as shortcode param?) (LATER)

@alaninteractive
Copy link

Woop! Thanks Benjamin

@benjaminpick
Copy link
Member Author

Basic support released in 2.11.0 - Further work in #60

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

No branches or pull requests

2 participants