normalize_ua( $user_agent ); if ( '' === $ua ) { return false; } return (bool) preg_match( '/Bingbot|MSNBot|MSNBot-Media|AdIdxBot|BingPreview/i', $ua ); } /** * Checks if IP is from Bing, based on DNS verification. * * @param string $ip The IP address to check. * * @return bool */ public function is_ip( string $ip ): bool { return $this->verify_dns( $ip, '(^|\.)(msn\.com|msnbot\.msn\.com|bing\.com)' ); } }