Sha256: 08dc0081b44ccc9db87f654857b96f59be96abc56695d32cc19b4d41778680b2

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

require_relative 'theme_version/style'
require_relative 'theme_version/woo_framework_meta_generator'

module WPScan
  module Finders
    module ThemeVersion
      # Theme Version Finder
      class Base
        include CMSScanner::Finders::UniqueFinder

        # @param [ WPScan::Theme ] theme
        def initialize(theme)
          finders <<
            ThemeVersion::Style.new(theme) <<
            ThemeVersion::WooFrameworkMetaGenerator.new(theme)

          load_specific_finders(theme)
        end

        # Load the finders associated with the theme
        #
        # @param [ WPScan::Theme ] theme
        def load_specific_finders(theme)
          module_name = theme.classify_name.to_sym

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

          mod = Finders::ThemeVersion.const_get(module_name)

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

            next unless c.is_a?(Class)

            finders << c.new(theme)
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wpscan-3.0.8 app/finders/theme_version.rb
wpscan-3.0.7 app/finders/theme_version.rb
wpscan-3.0.6 app/finders/theme_version.rb
wpscan-3.0.5 app/finders/theme_version.rb
wpscan-3.0.4 app/finders/theme_version.rb
wpscan-3.0.3 app/finders/theme_version.rb
wpscan-3.0.2 app/finders/theme_version.rb
wpscan-3.0.1 app/finders/theme_version.rb
wpscan-3.0 app/finders/theme_version.rb