$data Payload from PGM_Ai_Visibility_Collector. * * @return void */ public function render( array $data ): void { $trendline = is_array( $data['trendline'] ?? null ) ? $data['trendline'] : array(); $standings = is_array( $data['standings'] ?? null ) ? $data['standings'] : array(); $last_run_at = isset( $data['last_run_at'] ) && $data['last_run_at'] ? esc_html( (string) $data['last_run_at'] ) : esc_html__( 'Never', 'peptide-geo-monitor' ); $mtd_cost = isset( $data['mtd_cost_usd'] ) ? (float) $data['mtd_cost_usd'] : 0.0; $cap = isset( $data['monthly_cap_usd'] ) ? (float) $data['monthly_cap_usd'] : PGM_DEFAULT_MONTHLY_BUDGET_USD; $this->render_proxy_note(); $this->render_meta_bar( $last_run_at, $mtd_cost, $cap ); $this->render_trendline( $trendline ); $this->render_standings( $standings ); } /** * {@inheritDoc} */ public function get_title(): string { return __( 'AI Visibility', 'peptide-geo-monitor' ); } /** * Render the proxy-metric disclaimer note. * * @return void */ private function render_proxy_note(): void { echo '
'; echo '' . esc_html__( 'Note:', 'peptide-geo-monitor' ) . ' '; echo esc_html__( 'Scores are measured via API probes — a directional proxy, not the consumer ChatGPT/Gemini apps (different retrieval, personalisation, and system prompts).', 'peptide-geo-monitor' ); echo '
' . esc_html__( 'No probe runs recorded yet. Click "Run now" to collect the first data point.', 'peptide-geo-monitor' ) . '
' . esc_html__( 'No standings data yet.', 'peptide-geo-monitor' ) . '
| ' . esc_html__( 'Peptide', 'peptide-geo-monitor' ) . ' | '; echo '' . esc_html__( 'Cited?', 'peptide-geo-monitor' ) . ' | '; echo '' . esc_html__( 'Our Position', 'peptide-geo-monitor' ) . ' | '; echo '' . esc_html__( 'Top Competing Domains', 'peptide-geo-monitor' ) . ' | '; echo '
|---|---|---|---|
| ' . esc_html( (string) $row['label'] ) . ' | '; echo '' . $cited_icon . ' | '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- only emoji echo '' . esc_html( $position ) . ' | '; echo '' . wp_kses_post( $domains ) . ' | '; echo '