84% ninjascanner

Code Review | NinjaScanner - Virus & Malware scan

WordPress plugin NinjaScanner - Virus & Malware scan scored84%from 54 tests.

About plugin

  • Plugin page: ninjascanner
  • Plugin version: 3.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 9, 2017
  • Latest release: Jul 24, 2023
  • Number of updates: 156
  • Update frequency: every 13.2 days
  • Top authors: nintechnet (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

30,000+ active /538,644 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.26ms] Passed 4 tests

Server-side resources used by NinjaScanner - Virus & Malware scan
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0437.61 ▼2.20
Dashboard /wp-admin3.33 ▲0.0345.27 ▼4.12
Posts /wp-admin/edit.php3.38 ▲0.0345.87 ▼1.94
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.16 ▼4.77
Media Library /wp-admin/upload.php3.25 ▲0.0335.49 ▲4.25

Server storage [IO: ▲0.84MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
It is recommended to fix the following issues
  • Illegal file modification detected: 10 files (1.90KB) outside of "wp-content/plugins/ninjascanner/" and "wp-content/uploads/"
    • (new file) wp-content/ninjascanner/nscan651f0df465f5e6.82952898/index.html
    • (new file) wp-content/ninjascanner/nscan651f0df465f5e6.82952898/cache/.htaccess
    • (new file) wp-content/ninjascanner/local/index.html
    • (new file) wp-content/ninjascanner/.htaccess
    • (new file) wp-content/ninjascanner/nscan651f0df465f5e6.82952898/.htaccess
    • (new file) wp-content/ninjascanner/nscan651f0df465f5e6.82952898/cache/index.html
    • (new file) wp-content/ninjascanner/local/.htaccess
    • (new file) wp-content/ninjascanner/index.html
    • (new file) wp-content/ninjascanner/nscan651f0df465f5e6.82952898/quarantine/.htaccess
    • (new file) wp-content/ninjascanner/nscan651f0df465f5e6.82952898/quarantine/index.html
Filesystem: 64 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
nscan_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by NinjaScanner - Virus & Malware scan
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲8813.58 ▼0.971.76 ▲0.2039.07 ▼10.81
Dashboard /wp-admin2,229 ▲415.84 ▲0.84100.70 ▼6.2938.79 ▼5.95
Posts /wp-admin/edit.php2,112 ▲232.02 ▼0.0140.53 ▲0.3035.02 ▼0.30
Add New Post /wp-admin/post-new.php1,543 ▲1018.38 ▼5.00599.37 ▼48.0256.07 ▲8.85
Media Library /wp-admin/upload.php1,411 ▲234.21 ▼0.0795.61 ▼2.8843.40 ▲0.49

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 33× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/ninjascanner/lib/vendor/diff/Diff/Renderer/Abstract.php
    • > /wp-content/plugins/ninjascanner/lib/scan.php
    • > /wp-content/plugins/ninjascanner/lib/file_compare.php
    • > /wp-content/plugins/ninjascanner/lib/tab_log.php
    • > /wp-content/plugins/ninjascanner/lib/install.php
    • > /wp-content/plugins/ninjascanner/lib/utils.php
    • > /wp-content/plugins/ninjascanner/lib/tab_premium.php
    • > /wp-content/plugins/ninjascanner/lib/vendor/diff/Diff/Renderer/Html/SideBySide.php
    • > /wp-content/plugins/ninjascanner/lib/vendor/diff/Diff/SequenceMatcher.php
    • > /wp-content/plugins/ninjascanner/uninstall.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: virus, malware, security, protection, scanner

ninjascanner/index.php 92% from 13 tests

The principal PHP file in "NinjaScanner - Virus & Malware scan" v. 3.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ninjascanner.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected11,089 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,7462,9038,298
PO File18481,3382,131
JavaScript27291396
CSS22823263
HTML1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity24.00
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods40
▷ Static methods00.00%
▷ Public methods2767.50%
▷ Protected methods12.50%
▷ Private methods1230.00%
Functions121
▷ Named functions121100.00%
▷ Anonymous functions00.00%
Constants46
▷ Global constants46100.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
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/rate.png0.54KB0.49KB▼ 10.07%
static/logo_ns_40.png2.68KB1.95KB▼ 27.25%
static/logo_ns_100.png18.18KB4.33KB▼ 76.19%
static/integration.png7.53KB3.91KB▼ 48.01%