module Pluginscan # Responsible for calling out to an API to see if any advisories # have been published about this plugin class VulnerabilityScanner class Error < StandardError; end def initialize(advisories_api = WPVulnDB::API.new, response_handler = WPVulnDB::APIResponseHandler.new) @advisories_api = advisories_api @response_handler = response_handler end def scan(plugin_slug) response = @advisories_api.get_plugin_advisories(plugin_slug) @response_handler.call(response, plugin_slug) end end end