10% bang-vulnerability-scanner

Code Review | Bang Vulnerability Scanner

WordPress plugin Bang Vulnerability Scanner scored10%from 54 tests.

About plugin

  • Plugin page: bang-vulnerabilit...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Apr 18, 2018
  • Latest release: Apr 19, 2018
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: marcus.downing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /946 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php+40
    Undefined variable: wp_version

Server metrics [RAM: ▲0.12MB] [CPU: ▼5.28ms] 75% from 4 tests

A check of server-side resources used by Bang Vulnerability Scanner
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 713.93ms on /wp-admin/tools.php?page=bang-vulnerability-scanner)
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1339.18 ▲1.11
Dashboard /wp-admin3.44 ▲0.0944.87 ▼18.17
Posts /wp-admin/edit.php3.55 ▲0.2045.76 ▼3.75
Add New Post /wp-admin/post-new.php6.02 ▲0.13100.45 ▲6.35
Media Library /wp-admin/upload.php3.36 ▲0.1335.82 ▼0.30
Vulnerability Scanner /wp-admin/tools.php?page=bang-vulnerability-scanner3.44713.93

Server storage [IO: ▲0.37MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Bang Vulnerability Scanner: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.09 ▼0.261.70 ▲0.0245.57 ▲1.88
Dashboard /wp-admin2,202 ▲315.59 ▼0.0682.15 ▼10.1240.99 ▼1.44
Posts /wp-admin/edit.php2,104 ▲11.99 ▲0.0436.24 ▲1.7235.57 ▲1.68
Add New Post /wp-admin/post-new.php1,529 ▲123.69 ▲0.75636.86 ▼78.7556.68 ▼3.89
Media Library /wp-admin/upload.php1,398 ▼24.26 ▲0.1297.98 ▼17.7543.35 ▼5.17
Vulnerability Scanner /wp-admin/tools.php?page=bang-vulnerability-scanner9941.9922.4132.33

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 23× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      include_once(ABSPATHWPINC/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 45
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 38
    • > PHP Warning
      include_once(ABSPATHWPINC/class-http.php): failed to open stream: No such file or directory in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 42
    • > PHP Notice
      Undefined variable: wp_version in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 40
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 45
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 45
    • > PHP Warning
      Use of undefined constant HOUR_IN_SECONDS - assumed 'HOUR_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/bang-vulnerability-scanner/includes/vuln-admin.php:3
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/class-http.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 42
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/version.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/bang-vulnerability-scanner/bang-vulnerability-scanner.php on line 38

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: scanner, vulnerabilities, security

bang-vulnerability-scanner/bang-vulnerability-scanner.php Passed 13 tests

The main PHP file in "Bang Vulnerability Scanner" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
108 characters long description:
Checks the plugins, themes and WordPress for known vulnerabilities, using WPScan Vulnerability Database API.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin726 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9158118725
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity20.71
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity6.04
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods30
▷ Static methods13.33%
▷ Public methods2790.00%
▷ Protected methods00.00%
▷ Private methods310.00%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.33MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png113.44KB82.21KB▼ 27.53%
assets/screenshot-1.png146.00KB52.68KB▼ 63.92%
assets/icon-256x256.png56.04KB36.64KB▼ 34.63%
assets/icon-128x128.png19.51KB12.87KB▼ 34.05%
images/bang-black-v.png3.58KB0.72KB▼ 79.87%