protected function canBeScanned($url)
    {
        if (!is_url($url) || in_array($url, $this->alreadyScanned) ||
            (!$this->getConfig('externalLinks') && is_external_url($url, $this->hostname))) {
            return false;
        }

        foreach ((array)$this->getConfig('excludeLinks') as $pattern) {
            if (preg_match($pattern, $url)) {
                return false;
            }
        }

        return true;
    }