Class: WPScan::Model::Plugin
Overview
WordPress Plugin
Constant Summary
Constants inherited from WpItem
Instance Attribute Summary
Attributes inherited from WpItem
#blog, #detection_opts, #path_from_blog, #slug, #uri, #version_detection_opts
Instance Method Summary collapse
- #db_data ⇒ JSON
-
#initialize(slug, blog, opts = {}) ⇒ Plugin
constructor
See WpItem.
- #potential_readme_filenames ⇒ Array<String>
- #version(opts = {}) ⇒ Model::Version, false
Methods inherited from WpItem
#==, #classify, #directory_listing?, #error_log?, #head_and_get, #last_updated, #latest_version, #outdated?, #popular?, #readme_url, #to_s, #url, #vulnerabilities, #vulnerable_to?
Methods included from Vulnerable
Constructor Details
#initialize(slug, blog, opts = {}) ⇒ Plugin
See WpItem
8 9 10 11 12 13 14 15 16 |
# File 'app/models/plugin.rb', line 8 def initialize(slug, blog, opts = {}) super(slug, blog, opts) # To be used by #head_and_get # If custom wp-content, it will be replaced by blog#url @path_from_blog = "wp-content/plugins/#{slug}/" @uri = Addressable::URI.parse(blog.url(path_from_blog)) end |
Instance Method Details
#db_data ⇒ JSON
19 20 21 |
# File 'app/models/plugin.rb', line 19 def db_data @db_data ||= DB::Plugin.db_data(slug) end |
#potential_readme_filenames ⇒ Array<String>
33 34 35 |
# File 'app/models/plugin.rb', line 33 def potential_readme_filenames @potential_readme_filenames ||= [*(DB::DynamicFinders::Plugin.df_data.dig(slug, 'Readme', 'path') || super)] end |
#version(opts = {}) ⇒ Model::Version, false
26 27 28 29 30 |
# File 'app/models/plugin.rb', line 26 def version(opts = {}) @version = Finders::PluginVersion::Base.find(self, version_detection_opts.merge(opts)) if @version.nil? @version end |