Athenian Data Intelligence
Overview
Product overview
Plugin Name: Athenian Data Intelligence (ADI) Primary File: athenian-data-intelligence.php Text Domain: athenian-data-intelligence Author: Scott Mays | Athenian Brands Requires WordPress: 6.2+ Requires PHP: 8.1+ Declared Plugin Header Version: 0.1.0 Runtime Constant Version: 0.2.0
Athenian Data Intelligence is the canonical analytics, metrics registry, rollup, dashboard, and observability layer for the Athenian Platform. It captures operational events from WooCommerce, AI workflows, OpenAI usage, credits systems, payout ledgers, and marketplace-style activity, then normalizes that activity into durable daily rollups that can power dashboards, APIs, internal tools, and future decision-support features.
---
Use cases
- Executive dashboards
- Operational reporting
- Marketplace analytics
- AI-assisted intelligence
Developer
Fleet parity boundary
The reviewed local source baseline is ADI 0.2.9, but the active Athenian Spa deployment reports version 0.1.0 and main-file SHA-256 c59a36193c12a6ef781cfc29fc85b1ed1ec387efd947d3e72a6cbe240924fa92. Treat the local repository commit as a source baseline, not as the deployed runtime identity, until a normalized tree comparison is completed.
Developer starting point
This baseline documents Data Intelligence collection and dashboard architecture. It does not claim historical completeness, AI-provider success, or production reporting correctness.
Technical Architecture
File Structure
athenian-data-intelligence.php
assets/
admin.css
admin.js
vendor/chart.umd.min.js
dashboards/
ai.json
credits.json
customers.json
executive.json
financial.json
marketplace.json
openai.json
operations.json
platform.json
swap-shop.json
vendors.json
docs/
adi-marketing-document.md
includes/
Autoload.php
Plugin.php
API/
GraphQL.php
REST.php
Admin/
Admin.php
Core/
Alerts.php
Collector.php
DB.php
OpenAIReports.php
Registry.php
Rollups.php
AI/
Pricing.php
Capture/
APCAI.php
Credits.php
OpenAI.php
OwlPay.php
WooCommerce.phpBoot Flow
The main plugin file defines constants, loads includes/Autoload.php, and starts \Athenian\ADI\Plugin::instance().
Plugin::boot() initializes:
- Registry
- Database upgrade checks
- Collector
- Rollups
- OpenAI report sync
- WooCommerce capture
- OpenAI HTTP capture
- APC AI capture
- Credits capture
- OwlPay capture
- REST routes
- WPGraphQL routes, when available
- Admin UI, when in the WordPress admin
Database Tables
ADI creates three custom tables.
#### wp_adi_events
Stores raw event records.
Important columns:
idtsevent_keysite_idactor_idobject_typeobject_iddim_vendor_iddim_customer_idamountcurrencymeta
Indexes support event/time queries, object references, vendor dimensions, and customer dimensions.
#### wp_adi_rollups_daily
Stores daily metric rollups.
Important columns:
daymetric_keysite_iddim_vendor_iddim_product_iddim_customer_idvalue_sumvalue_countvalue_minvalue_maxextra
The table includes a unique key across day, metric, site, vendor, product, and customer dimensions.
#### wp_adi_alert_runs
Stores alert evaluation history.
Important columns:
ran_atalert_keystatusmessagemeta
---
Credits and Payout Integration
Credits Capture
ADI listens to credit-related hooks:
cpm_credit_transaction_recordedcpm_credit_balance_changedath_credits_deductedath_credits_added
It classifies credit events into purchases, spend, refunds/reversals, cashouts, and AI-related spend.
OwlPay Capture
ADI listens to OwlPay ledger hooks:
ath_owlpay/ledger/entry_createdath_owlpay/ledger/entry_updated
It records payout entries and classifies them as held or released based on availability timing. When a previously held entry becomes available, ADI records a release metric.
---
Developer Integration Guide
Record a Custom ADI Event
do_action('ath_adi_event', 'custom.metric.key', [
'amount' => 1,
'meta' => [
'source' => 'my-plugin',
'note' => 'Custom event payload',
],
'dims' => [
'vendor_id' => 123,
'customer_id' => 456,
],
'ctx' => [
'object_type' => 'custom_object',
'object_id' => 789,
],
]);Register Custom Metrics or Dashboards
add_action('ath_adi_register', function ($registry_class) {
$registry_class::register_metric([
'key' => 'my.metric.total',
'label' => 'My Metric',
'type' => 'count',
'unit' => '',
'dimensions' => ['site', 'vendor', 'customer'],
'source' => 'my-plugin',
'description' => 'A custom metric emitted by my plugin.',
]);
$registry_class::register_dashboard('my-dashboard', [
'id' => 'my-dashboard',
'label' => 'My Dashboard',
'kpis' => [
['metric' => 'my.metric.total', 'label' => 'My Metric'],
],
'charts' => [
[
'metric' => 'my.metric.total',
'label' => 'My Metric Trend',
'type' => 'line',
'description' => 'Custom metric over time.',
],
],
]);
});Provide Order Cost Data
add_filter('ath_adi_order_cost_total', function ($cost, $order) {
// Return a numeric cost total to enable ADI margin reporting.
return $cost;
}, 10, 2);Control OpenAI Host Detection
add_filter('ath_adi_is_openai_host', function ($is_openai, $host, $url) {
if ($host === 'my-openai-proxy.example.com') {
return true;
}
return $is_openai;
}, 10, 3);Disable HTTP Count or Usage Rollups When APC AI Handles Counts
add_filter('ath_adi_openai_http_counts_enabled', '__return_false');
add_filter('ath_adi_openai_http_usage_enabled', '__return_false');Control Rollup Eligibility
add_filter('ath_adi_should_rollup_metric', function ($should, $metric_key, $event_row) {
if ($metric_key === 'custom.lifecycle.event') {
return false;
}
return $should;
}, 10, 3);---
Security and Permissions
ADI uses WordPress capabilities to protect analytics access:
- Dashboard REST access requires
manage_woocommerceormanage_options. - Admin settings require
manage_woocommerceormanage_options. - OpenAI credential configuration is restricted to
manage_optionsusers. - Admin settings submissions use WordPress nonces.
- REST dashboard requests use a localized REST nonce.
- OpenAI URLs are redacted before storage to avoid persisting sensitive query parameters.
- Internal OpenAI report requests use
X-ATH-ADI-Internalso they are not counted as regular OpenAI app usage.
---
Notable Implementation Details
- The plugin header lists version
0.1.0, whileATH_ADI_VERSIONis set to0.2.0; this should be normalized before packaging a formal release. - Rollup cron registration exists through the
ath_adi_cron_rollupshook, but activation currently schedules OpenAI report cron rather than explicitly scheduling rollup cron in the inspected code. - Alerts include an evaluator class and settings UI, but the inspected boot sequence does not show a scheduled alert runner calling
Alerts::evaluate()automatically. - Some dashboard areas are forward-looking and become more valuable when upstream plugins emit the associated metrics, especially marketplace, vendor, platform, and Swap Shop metrics.
- OpenAI cost estimation depends on configured pricing JSON or filter-provided pricing tables.
- OpenAI report sync requires appropriate OpenAI Admin/organization credentials and, for Codex workspace analytics, a valid workspace ID and analytics key.
- The REST summary endpoint is deterministic and not currently an AI-generated narrative.
---
Install
- Reviewed source folder: athenian-data-intelligence
- Plugin version reviewed: 0.2.9
- Local source inventory: 39 files (temporary, test, and Git metadata excluded).
- GitHub baseline: https://github.com/Athenian-Brands/athenian-data-intelligence at baseline/devdocs-0.2.9-20261006c / 879d1161948113710ed1a6acd10d325ca7dd4912.
- WordPress and the configured data sources.
- Historical backfills, external AI requests, analytics freshness, and business-reporting correctness require separate verification.
- Athenian Spa fleet observation: active deployed version 0.1.0.
- Athenian Spa deployed main-file SHA-256: c59a36193c12a6ef781cfc29fc85b1ed1ec387efd947d3e72a6cbe240924fa92
- Local source baseline remains version 0.2.9; full deployed/source parity is not asserted.
Configuration
- Plugin Identity — see the linked technical reference excerpt.
- Executive Summary — see the linked technical reference excerpt.
- Marketing Positioning — see the linked technical reference excerpt.
- Key Value Propositions — see the linked technical reference excerpt.
- Primary Use Cases — see the linked technical reference excerpt.
- Feature Overview — see the linked technical reference excerpt.
- Technical Architecture — see the linked technical reference excerpt.
- Metric Families — see the linked technical reference excerpt.
- WooCommerce Capture Behavior — see the linked technical reference excerpt.
- AI Capture Behavior — see the linked technical reference excerpt.
- Credits and Payout Integration — see the linked technical reference excerpt.
- Admin User Experience — see the linked technical reference excerpt.
- Developer Integration Guide — see the linked technical reference excerpt.
- Security and Permissions — see the linked technical reference excerpt.
Usage
- Shortcodes detected in local PHP source: 0
- Static action/filter hooks detected in local PHP source: 29
- REST route registrations detected in local PHP source: 1
Shortcodes
- No static add_shortcode registrations were detected by the baseline scanner.
REST Endpoints
- adi/v1 — includes/API/REST.php
Hooks
- admin_enqueue_scripts — includes/Admin/Admin.php
- admin_menu — includes/Admin/Admin.php
- admin_post_ath_adi_save_settings — includes/Admin/Admin.php
- admin_post_ath_adi_sync_openai_reports — includes/Admin/Admin.php
- apc_ai/usage_cost_usd — includes/Core/Capture/APCAI.php
- apk/event — includes/Core/Collector.php
- apk_event — includes/Core/Collector.php
- ath_adi_cron_rollups — includes/Core/Rollups.php
- ath_adi_event — includes/Core/Collector.php
- ath_ai/event — includes/Core/Capture/APCAI.php
- ath_credits_added — includes/Core/Capture/Credits.php
- ath_credits_deducted — includes/Core/Capture/Credits.php
- ath_owlpay/ledger/entry_created — includes/Core/Capture/OwlPay.php
- ath_owlpay/ledger/entry_updated — includes/Core/Capture/OwlPay.php
- cpm_credit_balance_changed — includes/Core/Capture/Credits.php
- cpm_credit_transaction_recorded — includes/Core/Capture/Credits.php
- graphql_register_types — includes/API/GraphQL.php
- http_api_debug — includes/Core/Capture/OpenAI.php
- init — includes/Core/DB.php
- init — includes/Core/OpenAIReports.php
- init — includes/Core/Registry.php
- plugins_loaded — includes/Plugin.php
- pre_http_request — includes/Core/Capture/OpenAI.php
- rest_api_init — includes/API/REST.php
- woocommerce_order_refunded — includes/Core/Collector.php
- woocommerce_order_status_completed — includes/Core/Capture/WooCommerce.php
- woocommerce_order_status_completed — includes/Core/Collector.php
- woocommerce_order_status_processing — includes/Core/Collector.php
- woocommerce_refund_created — includes/Core/Capture/WooCommerce.php
Data Model
- Credits and Payout Integration — described in the local technical reference.
- Developer Integration Guide — described in the local technical reference.
Athenian Spa fallback cost boundary: use the
ath_adi_order_cost_totalfilter first, then read_apic_cost_total; no rows were present for that metadata key during the 2026-10-07 inspection.
API Reference
- Local source digest: 0e5f8a254dc8531090a32a8b49c17d2ea49c4a93c7e37d5d6e550d9ef6e11ec0
- Repository URL: https://github.com/Athenian-Brands/athenian-data-intelligence
- Repository reference: baseline/devdocs-0.2.9-20261006c
- Repository commit: 879d1161948113710ed1a6acd10d325ca7dd4912
Source files include: assets/admin-v2.css, assets/admin.css, assets/admin.js, athenian-data-intelligence-icon.png, athenian-data-intelligence.php, dashboards/ai.json, dashboards/credits.json, dashboards/curriculum-ai.json, dashboards/customers.json, dashboards/executive.json, dashboards/financial.json, dashboards/marketplace.json, dashboards/openai.json, dashboards/operations.json, dashboards/platform.json, dashboards/swap-shop.json, dashboards/vendors.json, docs/adi-marketing-document.md, docs/athenian-platform-marketing.md, docs/athenian-platform-technical.md, docs/curriculum-builder-ai-usage.md, docs/technical-marketing.md, includes/API/GraphQL.php, includes/API/REST.php, includes/Admin/Admin.php, includes/Autoload.php, includes/Core/AI/Pricing.php, includes/Core/Alerts.php, …
Troubleshooting
This baseline documents Data Intelligence collection and dashboard architecture. It does not claim historical completeness, AI-provider success, or production reporting correctness.
- 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.
- Before upgrading the live 0.1.0 deployment from the local 0.2.9 baseline, reconcile the deployed tree and verify the APIC cost fallback contract.
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.
Why does the deployed version differ from the source baseline?
The current fleet observation found ADI 0.1.0 active on Athenian Spa while the local/GitHub documentation baseline is 0.2.9. This is a parity gap requiring a backed-up source/tree review before promotion.