handleRequest(); } add_action( 'admin_init', 'contai_handle_billing_topup_submission' ); function contai_billing_page() { if ( contai_render_connection_required_notice() ) { return; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display-only section navigation parameter. $section = sanitize_key( wp_unslash( $_GET['section'] ?? 'overview' ) ); $valid_sections = array( 'overview', 'billing-history' ); if ( ! in_array( $section, $valid_sections, true ) ) { $section = 'overview'; } $service = new ContaiBillingService(); $layout = new ContaiBillingLayout( $section ); $layout->render_header(); switch ( $section ) { case 'billing-history': $panel = new ContaiBillingHistoryPanel( $service ); $layout->render_page_title( __( 'Billing History', '1platform-content-ai' ), __( 'View your transaction history and payment details', '1platform-content-ai' ), 'dashicons-list-view' ); $panel->render(); break; case 'overview': default: $panel = new ContaiBillingOverviewPanel( $service ); $layout->render_page_title( __( 'Billing Overview', '1platform-content-ai' ), __( 'Manage your credit balance and subscription', '1platform-content-ai' ), 'dashicons-chart-area' ); $panel->render(); } $layout->render_footer(); }