=== HiRizzi Geolocation ===
Plugin Name:  HiRizzi Geolocation
Version:      0.1.4
Author:       HiRizzi
Author URI:   https://hirizzi.com
Plugin URI:   https://hirizzi.com/free-downloads/
License:      GPL v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Requires WP:  5.3
Tested up to: 6.7
Requires PHP: 7.4

== Description ==

GPS proximity search for WordPress membership and directory sites. Members consent to share their location, then see other nearby members sorted by distance — as a list or on a Google Map. Requires your own Google Maps API key (Maps JavaScript API + Geocoding API).

= A note on privacy and safety =

This plugin was built with proximity-based membership sites (including dating platforms) in mind, where exact location exposure is a genuine safety concern, not just a style preference. Two things are true by design, not by admin configuration:

* **Distance shown to other members is always rounded** (e.g. "~3 mi", or "< 1 mi" for anything closer than one unit — never "0").
* **Map markers for other members always use a coarsened (snapped) position**, regardless of whether the site stores exact or snapped coordinates internally.

Coordinate snapping at the storage level is also on by default and configurable in Settings — this is a stronger mitigation than display-only rounding, since the underlying data itself is imprecise.

**Be aware:** rounding and snapping reduce casual exposure and make proximity-based location guessing meaningfully harder, but they do not fully eliminate the risk of a determined attacker using multiple accounts at different points to triangulate someone's approximate location (a known category of risk on any proximity-based platform, historically demonstrated against several major dating apps). If your use case has serious safety stakes, consider offering city/area-level matching instead of precise GPS, and treat this plugin's mitigations as a meaningful reduction in risk, not a guarantee.

= Core Features =

* Consent-gated location sharing — the browser's own permission prompt plus explicit admin-configurable consent copy before it's triggered, never captured silently
* Member-controlled withdrawal — a logged-in member can stop sharing and permanently delete all location and consent metadata stored by the plugin
* Radius search using the Haversine formula, with a configurable default and max radius
* Reverse geocoding (city name) via Google's Geocoding API, cached to reduce billing calls
* `[hirizzi_nearby_members]` list and `[hirizzi_nearby_map]` Google Map, both showing only rounded distances and coarse positions for other members
* No new database tables — location data is stored as standard WordPress user meta

== Installation ==

1. Upload and activate the plugin.
2. Get a Google Maps API key with the Maps JavaScript API and Geocoding API enabled, and **restrict it by HTTP referrer** in the Google Cloud Console before going live.
3. Enter the key and configure your defaults under Settings → HiRizzi Geolocation.
4. Add `[hirizzi_share_location]`, `[hirizzi_nearby_members]`, and/or `[hirizzi_nearby_map]` to pages on your site.

== Frequently Asked Questions ==

= Can other members see my exact location? =
No. Only rounded distance figures and, on the map, a coarsened marker position are ever shown for other members. Your own position (used to center the map and calculate distances) is naturally visible to yourself.

= Does this fully prevent someone from figuring out my location? =
No plugin can make that guarantee. Rounding and coordinate snapping meaningfully raise the difficulty, but a sufficiently motivated attacker using multiple accounts could still narrow down an approximate area over time. Please read the privacy note in the plugin description before deploying this on a site with real safety stakes.

= Does this cost money to run? =
Google's Maps JavaScript API and Geocoding API both have free monthly usage tiers, beyond which Google charges per the Google Cloud Platform's current Maps Platform pricing. Reverse-geocode results are cached to reduce repeated calls for the same area, but you should review Google's current pricing and set a budget alert in Google Cloud Console.

= Does location searching scale to a large member base? =
The radius search in this version queries every member who has shared a location and computes distance for each — fine for small-to-medium sites, but a future version should add an indexed bounding-box pre-filter before the Haversine calculation for sites with a very large number of location-sharing members.

== Changelog ==

= 0.1.4 =
* Added a review-request banner at the top of the settings page.

= 0.1.3 =
* Added a direct link to Google Cloud Console (not just the API Library) next to the API key field.
* Added a collapsible step-by-step setup guide on the settings page, covering project creation, enabling both APIs, generating a key, and restricting it correctly — including the two real gotchas people hit in practice: project names can't contain a period, and the "API restrictions" step defaults to every API currently enabled on the project rather than just the two this plugin needs.
* Added a warning against ever sharing an API key via email, chat, or a support ticket, with guidance to regenerate the key if that ever happens.

= 0.1.2 =
* Added a direct link to the Google Cloud Console API Library on the settings page, next to the API key field.

= 0.1.1 =
* Added a member-facing “Stop Sharing / Delete My Location” control that removes coordinates, city, update timestamp, and consent timestamp.
* Added a nonce-protected, authenticated AJAX deletion endpoint.
* Fixed a runtime fatal error in list and map radius clamping caused by a missing `$` on `$max_radius`.

= 0.1.0 =
* Initial release: consent-gated location sharing, Haversine radius search, reverse geocoding with caching, nearby-members list and map shortcodes. Rounded distances and snapped marker positions for other members are enforced unconditionally at the output layer, independent of the storage-precision setting.
