StatsPlugin code factoring
This commit is contained in:
@@ -65,22 +65,21 @@ class StatsPlugin < Plugin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def total_plugins(file=PLUGINS_FULL_FILE, xml=PLUGINS_VULNS_FILE)
|
def total_plugins(file=PLUGINS_FULL_FILE, xml=PLUGINS_VULNS_FILE)
|
||||||
options = {}
|
total('plugins', file, xml)
|
||||||
options[:only_vulnerable_ones] = false
|
|
||||||
options[:file] = file
|
|
||||||
options[:vulns_file] = xml
|
|
||||||
options[:base_url] = "http://localhost"
|
|
||||||
options[:type] = "plugins"
|
|
||||||
WpEnumerator.generate_items(options).count
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def total_themes(file=THEMES_FULL_FILE, xml=THEMES_VULNS_FILE)
|
def total_themes(file=THEMES_FULL_FILE, xml=THEMES_VULNS_FILE)
|
||||||
options = {}
|
total('themes', file, xml)
|
||||||
options[:only_vulnerable_ones] = false
|
end
|
||||||
options[:file] = file
|
|
||||||
options[:vulns_file] = xml
|
def total(type, file, xml)
|
||||||
options[:base_url] = "http://localhost"
|
options = {
|
||||||
options[:type] = "themes"
|
type: type,
|
||||||
|
file: file,
|
||||||
|
vulns_file: xml,
|
||||||
|
base_url: 'http://localhost',
|
||||||
|
only_vulnerable_ones: false
|
||||||
|
}
|
||||||
WpEnumerator.generate_items(options).count
|
WpEnumerator.generate_items(options).count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user