normalize_ua( $user_agent ); if ( '' === $ua ) { return false; } return false !== stristr( $ua, 'googlebot' ); } /** * Checks if IP is from Google, 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, '(^|\.)(googlebot\.com|google\.com)' ); } }