Athenian Geotracking
Overview
Product overview
Athenian Geotracking is the live field-visibility layer for Athenian Unÿa and other Athenian service-platform deployments. It receives technician GPS updates through a WordPress REST API, stores each technician's most recent operational location in a dedicated database table, and displays recent technician activity on a Google Maps-powered admin screen inside WordPress.
The plugin is designed for service businesses where dispatchers, coordinators, and operations teams need a current view of who is active, where technicians are located, and when each person last checked in. Rather than forcing teams to coordinate through texts, phone calls, screenshots, or disconnected fleet tools, Athenian Geotracking brings technician location awareness directly into the same WordPress admin environment used to manage service operations.
At its current implementation stage, the plugin provides the core infrastructure for live technician visibility: location ingestion, latest-location storage, admin settings, a technician map screen, and a secured admin retrieval endpoint. It is also a strong foundation for future dispatch automation, customer ETA tools, route intelligence, technician availability scoring, historical tracking, and mobile field-service integrations.
---
Use cases
- Site locations
- Geographic context
- Map administration
- Location-aware experiences
Developer
Developer starting point
This baseline documents location storage and mapping code. It does not claim an external geocoder response, consent flow, or production location capture has been exercised.
Admin Workflow
1. Install and Activate
When the plugin is activated, it creates the custom tracking table used to store technician location records.
2. Configure Google Maps
An administrator adds a Google Maps JavaScript API key on the plugin settings screen.
3. Connect a Field Client
A technician-facing mobile app, browser workflow, or companion tracking service sends location updates to the plugin's REST endpoint.
4. Monitor the Technician Map
Operations staff open the Technician Map inside the WordPress admin. The map loads recent technician data and refreshes automatically.
5. Use Visibility for Dispatch Decisions
Dispatchers can use the live map as an operational reference when assigning services, checking availability, reviewing field coverage, or coordinating support.
---
Customer / Technician Workflow
The current plugin does not include a bundled customer-facing or technician-facing frontend interface. It is designed to receive technician location updates from an external field client.
A typical technician workflow would be:
- Technician logs into a mobile app or technician dashboard.
- The client obtains permission to access device location.
- The client periodically posts GPS coordinates, speed, heading, and status to the REST endpoint.
- Athenian Geotracking updates the technician's latest location record.
- Admin users see the technician's current field presence on the map.
This separation keeps the WordPress plugin focused on ingestion, storage, and admin visibility while allowing the technician experience to be implemented in a mobile app, Unÿa technician dashboard, or other field client.
---
Technical Architecture
Plugin Bootstrap
Primary file:
athenian-geotracking.phpThe plugin defines core constants:
ATHENIAN_GEO_VERSIONATHENIAN_GEO_FILEATHENIAN_GEO_DIRATHENIAN_GEO_URL
It initializes a namespaced autoloader and boots the main plugin orchestrator on plugins_loaded.
Main Orchestrator
Primary class:
Athenian\Geo\Core\PluginResponsibilities:
- Instantiate REST API handler
- Instantiate admin map handler
- Instantiate settings handler
- Register REST routes on
rest_api_init - Boot admin screens and settings
REST API Layer
Primary class:
Athenian\Geo\Core\Rest_ApiNamespace:
athenian-geo/v1Routes:
| Method | Route | Purpose | Permission | |---|---|---|---| | POST | /technician-location | Receive technician location updates | Current implementation uses open development callback | | GET | /technicians | Return recent technician location records | manage_options |
The REST layer validates required fields, normalizes optional heading/speed values, stores updates through the locations table class, and returns normalized JSON responses.
Database Layer
Primary class:
Athenian\Geo\Core\Locations_TableResponsibilities:
- Resolve custom table name
- Create the table on activation
- Upsert latest technician location
- Retrieve recent technician locations with optional status filtering
Admin Map Layer
Primary class:
Athenian\Geo\Admin\Admin_MapResponsibilities:
- Register the Technician Map admin page
- Enqueue Google Maps when configured
- Enqueue admin CSS and JavaScript
- Localize REST URL, nonce, default filters, and map defaults
- Render the map container and missing-key notice
Settings Layer
Primary class:
Athenian\Geo\Admin\SettingsResponsibilities:
- Register the Google Maps API key option
- Add the settings section and field
- Render the settings page under WordPress Settings
Autoloader
Primary class:
Athenian\Geo\Includes\AutoloaderThe autoloader maps the Athenian\Geo\ namespace to the plugin's local core, admin, and includes-style directories. The implementation uses lowercased relative paths and underscore-based filenames for the currently loaded class files.
---
Data Model
Custom Table
Table name:
{$wpdb->prefix}ath_geo_locationsTable Columns
| Column | Type | Purpose | |---|---:|---| | id | bigint unsigned | Auto-incrementing row ID | | technician_id | bigint unsigned | Technician post ID, intended to reference a Unÿa technician record | | lat | double | Latest latitude | | lng | double | Latest longitude | | heading | float NULL | Optional movement heading | | speed | float NULL | Optional movement speed | | status | varchar(32) | Technician state such as available, busy, or offline | | updated_at | datetime | Last update timestamp |
Indexes
| Index | Purpose | |---|---| | Primary key on id | Unique row identity | | Key on technician_id | Faster technician-specific updates/lookups | | Key on updated_at | Recent activity filtering |
Configuration Option
| Option | Purpose | |---|---| | ath_geo_google_maps_api_key | Stores the Google Maps JavaScript API key used by the admin map |
---
REST API Details
Update Technician Location
POST /wp-json/athenian-geo/v1/technician-locationExample payload:
{
"technician_id": 123,
"lat": 36.1627,
"lng": -86.7816,
"heading": 180,
"speed": 22.4,
"status": "available"
}Example response:
{
"success": true,
"technician_id": 123,
"lat": 36.1627,
"lng": -86.7816,
"status": "available",
"updated_at": "2026-07-01 10:30:00"
}Required fields:
technician_idlatlng
Optional fields:
headingspeedstatus
Default status:
availableList Recent Technician Locations
GET /wp-json/athenian-geo/v1/technicians?minutes_recent=30&status=availableExample response:
[
{
"technician_id": 123,
"name": "Technician Name",
"lat": 36.1627,
"lng": -86.7816,
"heading": 180,
"speed": 22.4,
"status": "available",
"updated_at": "2026-07-01 10:30:00"
}
]The endpoint resolves each technician_id with get_post() and uses the post title as the displayed technician name when available.
---
WordPress Hooks and Integration Points
Hooks Used
| Hook | Purpose | |---|---| | plugins_loaded | Boot the main plugin orchestrator | | rest_api_init | Register geotracking REST routes | | admin_menu | Add admin map/settings menu entries | | admin_enqueue_scripts | Load map CSS/JS only on the map screen | | admin_init | Register settings fields/options | | register_activation_hook | Create the geotracking custom table |
External Services
| Service | Purpose | |---|---| | Google Maps JavaScript API | Admin map rendering | | WordPress REST API | Field-client ingestion and admin retrieval |
Athenian Platform Touchpoints
Athenian Geotracking is built to support the Athenian Unÿa service stack. The current implementation assumes technician IDs can be resolved as WordPress posts, which aligns with a Unÿa-style technician data model. It is most naturally paired with:
- Athenian Unÿa service booking
- Technician dashboards or mobile apps
- Dispatch/admin workflows
- Service order assignment tools
- Customer ETA and notification systems
- Future route optimization or availability logic
---
Security and Permissions Notes
The current implementation includes two permission paths:
GET /techniciansis restricted to users withmanage_options.POST /technician-locationcurrently uses__return_trueas its permission callback, with an inline development note indicating no authentication is required.
A can_update_location() method exists and checks for logged-in users with the read capability, but it is not currently assigned to the update route.
Before production deployment, the update endpoint should be hardened. Recommended production approaches include:
- Require authenticated technician users.
- Validate that the authenticated user is allowed to update the submitted
technician_id. - Use application passwords, JWT, OAuth, or a signed request token for mobile clients.
- Add nonce verification for browser-based technician dashboards.
- Add rate limiting or request throttling.
- Validate coordinate ranges.
- Sanitize and constrain accepted status values.
- Log rejected requests for operational review.
This plugin has the right architectural separation for production security, but the location-ingestion permission callback should be treated as a development-mode implementation until hardened.
---
Implementation Observations
Duplicate File Naming Patterns
The ZIP includes both hyphenated and underscored versions of some class files:
admin/admin-map.php
admin/admin_map.php
core/locations-table.php
core/locations_table.phpThe autoloader currently resolves the loaded class names to underscore-style files such as:
admin/admin_map.php
core/locations_table.phpThe duplicate files appear to be legacy or compatibility copies. They should be reviewed and consolidated to reduce maintenance ambiguity.
Upsert Behavior
Locations_Table::upsert_location() attempts an update first and inserts if the update reports false or 0 affected rows. Because $wpdb->update() can return 0 when a matching row exists but the values did not change, repeated identical updates could potentially create duplicate technician rows unless the database table has a unique technician constraint.
Recommended improvement:
- Add a unique key on
technician_idif the table is intended to store one latest row per technician. - Change insert fallback logic to only insert when no existing technician row exists.
- Consider using explicit select-then-update/insert logic or SQL
ON DUPLICATE KEY UPDATEwith a unique key.
Coordinate Validation
Current validation checks that technician ID, latitude, and longitude are present, but it treats falsy numeric values as invalid. That means valid coordinates such as 0 could fail validation. While this may not matter for the intended U.S. service footprint, a production-grade global implementation should use range-aware validation:
- Latitude between
-90and90 - Longitude between
-180and180 - Technician ID greater than
0
Admin UX
The admin interface is intentionally lightweight. It provides the map container and missing-key warning, while the JavaScript handles map initialization, marker rendering, and refresh behavior. This keeps the first version simple while leaving room for richer filters, technician panels, route overlays, and assignment actions.
---
Technical Strengths
- Clean separation between bootstrap, REST API, database table, settings, and map UI.
- Uses a dedicated custom table instead of overloading post meta for high-frequency location state.
- Provides a simple REST contract that can be consumed by mobile apps or field clients.
- Limits the admin retrieval endpoint to administrators.
- Loads Google Maps only when the admin map page is active.
- Provides a warning when Google Maps is not configured.
- Uses recent/status filters to keep the admin map focused on operationally relevant technicians.
- Provides a strong foundation for Unÿa dispatch, technician, and field-service workflows.
---
Example Implementation Scenario
A mobile nail service operation uses Athenian Unÿa to manage bookings and technician assignments. Technicians check in through a mobile dashboard that sends location updates every few minutes while they are active. A dispatcher opens the Technician Map in WordPress and sees available technicians near upcoming appointment locations. Instead of texting the team for updates, the dispatcher can make assignment decisions with live field context already visible in the admin workflow.
---
Install
- Reviewed source folder: athenian-geotracking
- Plugin version reviewed: 0.1.1
- Local source inventory: 18 files (temporary, test, and Git metadata excluded).
- GitHub baseline: https://github.com/Athenian-Brands/athenian-geotracking at baseline/devdocs-0.1.1-20261006c / 9cba7e1bc359c9bb14c9c1b674a9c0d0b53e6edb.
- WordPress and the configured map/geocoder environment.
- Location providers, consent, accuracy, and external geocoding require separate verification.
Configuration
- Executive Summary — see the linked technical reference excerpt.
- Marketing Positioning — see the linked technical reference excerpt.
- The Operational Problem — see the linked technical reference excerpt.
- Core Value Proposition — see the linked technical reference excerpt.
- Key Features — see the linked technical reference excerpt.
- Admin Workflow — see the linked technical reference excerpt.
- Customer / Technician Workflow — see the linked technical reference excerpt.
- Technical Architecture — see the linked technical reference excerpt.
- Data Model — see the linked technical reference excerpt.
- REST API Details — see the linked technical reference excerpt.
- Admin Map Behavior — see the linked technical reference excerpt.
- WordPress Hooks and Integration Points — see the linked technical reference excerpt.
- Security and Permissions Notes — see the linked technical reference excerpt.
- Implementation Observations — see the linked technical reference excerpt.
Usage
- Shortcodes detected in local PHP source: 0
- Static action/filter hooks detected in local PHP source: 8
- REST route registrations detected in local PHP source: 2
Shortcodes
- No static add_shortcode registrations were detected by the baseline scanner.
REST Endpoints
- /technician-location — core/rest_api.php
- /technicians — core/rest_api.php
Hooks
- admin_enqueue_scripts — admin/admin-map.php
- admin_enqueue_scripts — admin/admin_map.php
- admin_init — admin/settings.php
- admin_menu — admin/admin-map.php
- admin_menu — admin/admin_map.php
- admin_menu — admin/settings.php
- plugins_loaded — athenian-geotracking.php
- rest_api_init — core/plugin.php
Data Model
- Data Model — described in the local technical reference.
- WordPress Hooks and Integration Points — described in the local technical reference.
API Reference
- Local source digest: 364ef5165f95475c130a5c873fd12167427127149d43409451c6bc5220c9cdb2
- Repository URL: https://github.com/Athenian-Brands/athenian-geotracking
- Repository reference: baseline/devdocs-0.1.1-20261006c
- Repository commit: 9cba7e1bc359c9bb14c9c1b674a9c0d0b53e6edb
Source files include: .gitignore, admin/admin-map.php, admin/admin_map.php, admin/settings.php, assets/css/admin-tech-map.css, assets/js/admin-tech-map.js, athenian-geotracking-icon.png, athenian-geotracking.php, athenian-geotracking.zip, core/locations-table.php, core/locations_table.php, core/plugin.php, core/rest_api.php, docs/athenian-geotracking-marketing-document.md, docs/athenian-platform-marketing.md, docs/athenian-platform-technical.md, docs/technical-marketing.md, includes/class-autoloader.php
Troubleshooting
- This baseline documents location storage and mapping code. It does not claim an external geocoder response, consent flow, or production location capture has been exercised.
- Confirm the deployed plugin version, active dependencies, and current repository tree before using implementation details as a release contract.
Treat payment, carrier, vendor, shipment, inventory, account, credential, tax, AI, and external-provider behavior as integration-dependent until exercised in the target environment.
FAQ
What is this page intended to establish?
A versioned, product-linked starting point for iterative developer documentation. It combines the local implementation reference with a detected-code inventory and a committed GitHub baseline.
Is the linked repository baseline verified?
Yes. The repository URL, ref, and commit recorded on this page were verified from the clean GitHub baseline prepared for this documentation pass. That does not by itself prove fleet deployment parity.
What remains for release-grade documentation?
Reconcile the recorded source baseline with the deployed plugin version, then exercise the relevant authenticated, store, provider, payment, tax, carrier, or generated-artifact paths in the target environment.