From 8b18204a697d5255823d4fca197fb30aa3f19bd1 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Fri, 22 Mar 2019 06:56:10 +0000 Subject: [PATCH] Updates memory_profiler dep, revert changes to memory allocated commit (increased retained memory too much) --- bin/wpscan-memprof | 4 +--- lib/wpscan/db/dynamic_finders/plugin.rb | 11 +---------- wpscan.gemspec | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/bin/wpscan-memprof b/bin/wpscan-memprof index 7bcce447..2397ce7e 100755 --- a/bin/wpscan-memprof +++ b/bin/wpscan-memprof @@ -18,6 +18,4 @@ report = MemoryProfiler.report(top: 15) do end end -# scale_bytes option not yet supported in the latest stable -# See https://github.com/SamSaffron/memory_profiler/issues/68 -report.pretty_print($stdout, scale_bytes: true, detailed_report: true, to_file: 'memprof.report') +report.pretty_print(scale_bytes: true, to_file: 'memprof.report') diff --git a/lib/wpscan/db/dynamic_finders/plugin.rb b/lib/wpscan/db/dynamic_finders/plugin.rb index 7500f7c2..a839c00f 100644 --- a/lib/wpscan/db/dynamic_finders/plugin.rb +++ b/lib/wpscan/db/dynamic_finders/plugin.rb @@ -64,22 +64,13 @@ module WPScan # What about slugs such as js_composer which will be done as JsComposer, just like js-composer constant_name = classify_slug(slug) - # version_finder_module.constants.include? could be used here - # however, it increases the memory allocated doing so. - unless version_finder_modules.include?(constant_name) + unless version_finder_module.constants.include?(constant_name) version_finder_module.const_set(constant_name, Module.new) - - version_finder_modules << constant_name end version_finder_module.const_get(constant_name) end - # @return [ Array ] - def self.version_finder_modules - @version_finder_modules ||= version_finder_module.constants - end - def self.create_versions_finders versions_finders_configs.each do |slug, finders| mod = maybe_create_module(slug) diff --git a/wpscan.gemspec b/wpscan.gemspec index 505edec3..a4cc4cfa 100644 --- a/wpscan.gemspec +++ b/wpscan.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'bundler', '>= 1.6' s.add_development_dependency 'coveralls', '~> 0.8.0' - s.add_development_dependency 'memory_profiler', '~> 0.9.12' + s.add_development_dependency 'memory_profiler', '~> 0.9.13' s.add_development_dependency 'rake', '~> 12.3' s.add_development_dependency 'rspec', '~> 3.8.0' s.add_development_dependency 'rspec-its', '~> 1.2.0'