Class: WPScan::Plugin

Inherits:
WpItem
  • Object
show all
Defined in:
app/models/plugin.rb

Overview

WordPress Plugin

Constant Summary

Constants inherited from WpItem

WpItem::CHANGELOGS, WpItem::READMES

Instance Attribute Summary

Attributes inherited from WpItem

#blog, #detection_opts, #slug, #uri, #version_detection_opts

Instance Method Summary collapse

Methods inherited from WpItem

#==, #changelog_url, #classify, #directory_listing?, #error_log?, #last_updated, #latest_version, #outdated?, #popular?, #readme_url, #to_s, #url, #vulnerabilities, #vulnerable_to?

Methods included from Vulnerable

#vulnerable?

Constructor Details

#initialize(slug, blog, opts = {}) ⇒ Plugin

See WpItem



5
6
7
8
9
# File 'app/models/plugin.rb', line 5

def initialize(slug, blog, opts = {})
  super(slug, blog, opts)

  @uri = Addressable::URI.parse(blog.url("wp-content/plugins/#{slug}/"))
end

Instance Method Details

#db_dataJSON

Returns:

  • (JSON)


12
13
14
# File 'app/models/plugin.rb', line 12

def db_data
  DB::Plugin.db_data(slug)
end

#version(opts = {}) ⇒ WPScan::Version, false

Parameters:

  • opts (Hash) (defaults to: {})

Returns:

  • (WPScan::Version, false)


19
20
21
22
23
# File 'app/models/plugin.rb', line 19

def version(opts = {})
  @version = Finders::PluginVersion::Base.find(self, version_detection_opts.merge(opts)) if @version.nil?

  @version
end