= 2 ) { $cur = (int) $hist[ count( $hist ) - 1 ]; $prev = array_slice( $hist, 0, -1 ); $ref = $prev ? (int) max( $prev ) : $cur; // Recent high (capped 12-scan window). $drop = $ref - $cur; $thr = isset( $settings['score_drop_threshold'] ) ? (int) $settings['score_drop_threshold'] : 5; if ( $drop >= $thr ) { $alerts[] = array( 'sev' => 'high', 'msg' => sprintf( /* translators: 1: points below high, 2: current score */ __( 'GEO score is %1$d points below its recent high (currently %2$d).', 'aicitare' ), $drop, $cur ), ); } } // Key AI crawlers blocked. $bots = AICitare_Data::get_bots(); $blocked = array(); foreach ( self::MAJOR_BOTS as $b ) { if ( empty( $bots[ $b ] ) ) { $blocked[] = $b; } } if ( $blocked ) { $alerts[] = array( 'sev' => 'med', 'msg' => sprintf( /* translators: 1: count, 2: comma-separated bot names */ _n( '%1$d key AI crawler is blocked: %2$s', '%1$d key AI crawlers are blocked: %2$s', count( $blocked ), 'aicitare' ), count( $blocked ), implode( ', ', $blocked ) ), ); } return $alerts; } public function admin_notices() { $screen = get_current_screen(); if ( ! $screen || 'toplevel_page_' . AICITARE_SLUG !== $screen->id ) { return; } foreach ( self::current() as $a ) { $class = 'high' === $a['sev'] ? 'notice-error' : 'notice-warning'; printf( '

AICitare: %s

', esc_attr( $class ), esc_html( $a['msg'] ) ); } } }