What it does
Download Analytics, in practice.
Listens to the core ambikly_download_served action and inserts a row into its own ambikly_download_log table for every file served: order, customer and product ids, file name, byte count, a SHA-256 hash of the IP salted with AUTH_SALT, a truncated user agent and a site-local timestamp. GET /ambikly-pro/v1/download-analytics, readable by anyone with the view-store capability, returns the top 100 files by download count with unique customers, plus a per-day series for the requested date range, defaulting to the last 30 days. A daily WP-Cron job deletes rows older than the retention setting, and uninstalling clears the schedule.