Class: WPScan::DB::WpItem

Inherits:
Object
  • Object
show all
Defined in:
lib/wpscan/db/wp_item.rb

Overview

WpItem - super DB class for Plugin, Theme and Version

Direct Known Subclasses

Plugin, Theme, Version

Class Method Summary collapse

Class Method Details

.metadataJSON

Returns:

  • (JSON)


15
16
17
# File 'lib/wpscan/db/wp_item.rb', line 15

def self.
  @metadata ||= read_json_file()
end

.metadata_at(identifier) ⇒ Hash

Returns The JSON data from the metadata associated to the identifier.

Parameters:

  • identifier (String)

    The plugin/theme slug or version number

Returns:

  • (Hash)

    The JSON data from the metadata associated to the identifier



10
11
12
# File 'lib/wpscan/db/wp_item.rb', line 10

def self.(identifier)
  [identifier] || {}
end

.metadata_fileString

Returns:

  • (String)


20
21
22
# File 'lib/wpscan/db/wp_item.rb', line 20

def self.
  @metadata_file ||= DB_DIR.join('metadata.json').to_s
end