refactor(cost): split 550-line cost tracker into tracker + reporter
Extract read-only reporting queries (get_cost_summary, get_daily_costs, get_recent_calls, ajax_get_cost_data) into Peptide_News_Cost_Reporter (224 lines). Core tracker retains logging, budget enforcement, pricing, table creation, and pruning (276 lines). Backward-compatible proxies preserved on Peptide_News_Cost_Tracker. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -353,7 +353,8 @@ if ( ! function_exists( 'add_settings_field' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Cost tracker provides calculate_cost(), budget checks used by tests.
|
||||
// Cost subsystem: reporter must load before tracker (tracker proxies to reporter).
|
||||
require_once PEPTIDE_NEWS_PLUGIN_DIR . 'includes/class-peptide-news-cost-reporter.php';
|
||||
require_once PEPTIDE_NEWS_PLUGIN_DIR . 'includes/class-peptide-news-cost-tracker.php';
|
||||
|
||||
// Stub WP_REST_Request for REST API tests.
|
||||
|
||||
Reference in New Issue
Block a user