array( 'operator' => 'OpenAI', 'type' => 'training' ), 'OAI-SearchBot' => array( 'operator' => 'OpenAI', 'type' => 'search' ), 'ChatGPT-User' => array( 'operator' => 'OpenAI', 'type' => 'agent' ), 'ClaudeBot' => array( 'operator' => 'Anthropic', 'type' => 'training' ), 'Claude-SearchBot' => array( 'operator' => 'Anthropic', 'type' => 'search' ), 'Claude-User' => array( 'operator' => 'Anthropic', 'type' => 'agent' ), 'PerplexityBot' => array( 'operator' => 'Perplexity', 'type' => 'search' ), 'Perplexity-User' => array( 'operator' => 'Perplexity', 'type' => 'agent' ), 'Google-Extended' => array( 'operator' => 'Google', 'type' => 'training' ), 'Applebot-Extended' => array( 'operator' => 'Apple', 'type' => 'training' ), 'Meta-ExternalAgent' => array( 'operator' => 'Meta', 'type' => 'training' ), 'Meta-ExternalFetcher' => array( 'operator' => 'Meta', 'type' => 'agent' ), 'Amazonbot' => array( 'operator' => 'Amazon', 'type' => 'search' ), 'Bytespider' => array( 'operator' => 'ByteDance', 'type' => 'training' ), 'CCBot' => array( 'operator' => 'Common Crawl', 'type' => 'training' ), 'MistralAI-User' => array( 'operator' => 'Mistral', 'type' => 'agent' ), 'DuckAssistBot' => array( 'operator' => 'DuckDuckGo', 'type' => 'search' ), 'cohere-ai' => array( 'operator' => 'Cohere', 'type' => 'training' ), ); /** * Filter the list of known AI bots. * * @param array $bots Bots keyed by user-agent token. */ return apply_filters( 'agentaisle_bots', $bots ); } /** * Match a user agent string to a known bot. * * @param string $user_agent User agent. * @return string|null Bot token or null. */ public static function match( $user_agent ) { if ( '' === $user_agent ) { return null; } foreach ( array_keys( self::all() ) as $token ) { if ( false !== stripos( $user_agent, $token ) ) { return $token; } } return null; } /** * Human label for a bot type. * * @param string $type Type key. * @return string */ public static function type_label( $type ) { $labels = array( 'training' => __( 'Training', 'agentaisle' ), 'search' => __( 'AI search', 'agentaisle' ), 'agent' => __( 'User agent', 'agentaisle' ), ); return $labels[ $type ] ?? $type; } }