0, 'structure' => 0, 'crawl' => 0, 'authority' => 0, 'freshness' => 0 ); foreach ( $pages as $p ) { $ls = AICitare_Scanner::live_sub( $p, $fixed ); foreach ( $subs as $k => $v ) { $subs[ $k ] += $ls[ $k ]; } } $n = max( 1, count( $pages ) ); foreach ( $subs as $k => $v ) { $subs[ $k ] = (int) round( $v / $n ); } // Open issues + top priorities. $open = array(); foreach ( $pages as $p ) { foreach ( $p['issues'] as $is ) { if ( empty( $fixed[ $is['id'] ] ) ) { $open[] = array( 'i' => $is, 'p' => $p ); } } } usort( $open, function ( $a, $b ) { return $b['i']['gain'] - $a['i']['gain']; } ); $top = array_slice( $open, 0, 5 ); // Citation summary. $cits = AICitare_Visibility::get_citations(); $total = 0; foreach ( $cits as $r ) { foreach ( $r['e'] as $v ) { if ( null !== $v ) { $total++; } } } $color = function ( $v ) { return $v >= 80 ? '#16a34a' : ( $v >= 60 ? '#d97706' : '#dc2626' ); }; $site_c = $color( $site ); ob_start(); ?>

AICitare report

·

Overall GEO score
/ 100

Score breakdown

$v ) : ?>

Snapshot

Pages tracked
Open issues
AI citations

Top priority actions

  1. +

All issues resolved — nice work.

Generated by AICitare ·

last_error = ''; $capture = function ( $wp_error ) { if ( is_wp_error( $wp_error ) ) { $this->last_error = $wp_error->get_error_message(); } }; add_action( 'wp_mail_failed', $capture ); $ct = function () { return 'text/html'; }; add_filter( 'wp_mail_content_type', $ct ); $ok = wp_mail( $to, $subject, self::build_html() ); remove_filter( 'wp_mail_content_type', $ct ); remove_action( 'wp_mail_failed', $capture ); AICitare_Log::add( 'report', $ok ? ( 'Report emailed to ' . $to ) : ( 'Report send failed (' . $to . ')' . ( $this->last_error ? ' — ' . $this->last_error : '' ) ) ); return $ok; } public function send_scheduled() { $settings = AICitare_Data::get_settings(); if ( ! empty( $settings['reports_enabled'] ) ) { $this->send(); } } }