Class: WPScan::Finders::PluginVersion::Base

Inherits:
Object
  • Object
show all
Includes:
CMSScanner::Finders::UniqueFinder
Defined in:
app/finders/plugin_version.rb

Overview

Plugin Version Finder

Instance Method Summary collapse

Constructor Details

#initialize(plugin) ⇒ Base

Returns a new instance of Base.

Parameters:



18
19
20
21
22
# File 'app/finders/plugin_version.rb', line 18

def initialize(plugin)
  finders << PluginVersion::Readme.new(plugin)

  load_specific_finders(plugin)
end

Instance Method Details

#load_specific_finders(plugin) ⇒ Object

Load the finders associated with the plugin

Parameters:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/finders/plugin_version.rb', line 27

def load_specific_finders(plugin)
  module_name = plugin.classify_name.to_sym

  return unless Finders::PluginVersion.constants.include?(module_name)

  mod = Finders::PluginVersion.const_get(module_name)

  mod.constants.each do |constant|
    c = mod.const_get(constant)

    next unless c.is_a?(Class)

    finders << c.new(plugin)
  end
end