admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'ait-airce-admin' ), ] ); // If Pro is present, load the license / experiments admin JS. if ( defined( 'AIT_AIRCE_PRO_URL' ) && defined( 'AIT_AIRCE_PRO_VERSION' ) ) { wp_enqueue_script( 'ait-airce-pro-admin', AIT_AIRCE_PRO_URL . 'assets/js/pro-admin.js', [ 'jquery' ], AIT_AIRCE_PRO_VERSION, true ); wp_localize_script( 'ait-airce-pro-admin', 'AIT_AIRCE_PRO_ADMIN', [ 'ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'ait-airce-pro-admin' ), ] ); } } public function render_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } echo '
'; echo '

' . esc_html__( 'AI Related Content Engine 2', 'ait-ai-related-posts' ) . '

'; echo '

' . esc_html__( 'Semantic related content powered by embeddings (no categories/tags required).', 'ait-ai-related-posts' ) . '

'; echo '
'; self::display_dashboard_usage(); self::display_dashboard_quick_actions(); echo '
'; echo '
'; } public static function display_dashboard_usage() { // Lite: show index size and cache stats. $stats = [ 'indexed' => 0, 'cached' => 0, ]; if ( class_exists( 'AIT_AIRCE_DB' ) && function_exists( 'AIT_AIRCE' ) ) { try { $db = new AIT_AIRCE_DB(); $stats['indexed'] = (int) $db->count_indexed_items(); } catch ( Exception $e ) {} } $cache_stats = get_option( 'ait_airce_cache_stats', [] ); if ( is_array( $cache_stats ) && isset( $cache_stats['entries'] ) ) { $stats['cached'] = (int) $cache_stats['entries']; } ?>