MRR and analytics
OSubscribe ships a full subscription analytics layer powered by OSub_Analytics and OSub_Metrics_Aggregator. Live numbers come from the subscription and charge tables; rolled-up daily metrics live in wp_osub_metrics_daily.
Live MRR
OSub_Analytics::current_mrr() sums normalized recurring amounts across all subscriptions where status IN ('active','trial','past_due','pending_cancel'). Normalization converts each subscription's interval into a monthly equivalent:
day- amount * (30 / interval_count)week- amount (30 / (interval_count 7))month- amount / interval_countyear- amount / (interval_count * 12)
ARR
OSub_Analytics::arr() is current_mrr() * 12.
Active subscribers
active_subscribers() counts subscriptions in active, trial, past_due, or pending_cancel.
Churn rate
churn_rate($days) (default 30) is the count of cancellations in the window divided by the active count, expressed as a percentage.
Dunning recovery rate
dunning_recovery_rate($days) is the percentage of dunning runs in the window that ended in recovered.
Daily roll-ups
The osub/cron/metrics_recompute job (daily) writes a row to wp_osub_metrics_daily per metric per day. The columns include MRR, active count, new subs, churned subs, expansions, contractions, dunning recovered. The Reports page renders these as time series.
Cohort retention
OSub_Cohorts computes month-over-month retention curves per signup cohort. The Reports page renders a cohort heatmap.
LTV and tenure
Average LTV is computed across all subscriptions where cancelled_at IS NOT NULL, summing successful charges over the lifetime. Average tenure is cancelled_at - started_at over the same set.
Reconciliation
osub/cron/reconcile (daily) walks recent gateway events and reconciles drift between local and gateway-side state - useful for catching webhook misfires.

