88% threat-scan-plugin

Code Review | Threat Scan Plugin

WordPress plugin Threat Scan Plugin scored 88% from 54 tests.

About plugin

  • Plugin page: threat-scan-plugin
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7.1
  • WordPress version: 5.8.1
  • First release: Apr 9, 2010
  • Latest release: Apr 25, 2021
  • Number of updates: 12
  • Update frequency: every 336.2 days
  • Top authors: kpgraham (91.67%)willjenkins (16.67%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active / 23,209 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼142.35ms] Passed 4 tests

A check of server-side resources used by Threat Scan Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1831.38 ▲9.24
Dashboard /wp-admin3.13 ▲0.0846.45 ▲2.34
Posts /wp-admin/edit.php3.18 ▲0.0739.69 ▼3.94
Add New Post /wp-admin/post-new.php5.49 ▲0.0694.14 ▼560.53
Media Library /wp-admin/upload.php3.07 ▲0.0630.61 ▼7.26
Threat Scan /wp-admin/options-general.php?page=threatscan3.0226.32

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Threat Scan Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.91 ▲0.047.45 ▼1.6048.42 ▲3.72
Dashboard /wp-admin2,972 ▲415.86 ▼0.09133.32 ▼10.32103.89 ▼2.44
Posts /wp-admin/edit.php2,744 ▲52.68 ▲0.0161.99 ▼7.6487.77 ▼2.13
Add New Post /wp-admin/post-new.php1,675 ▲17719.14 ▲0.31368.86 ▼8.81112.28 ▲8.66
Media Library /wp-admin/upload.php1,812 ▲25.05 ▲0.04156.67 ▲8.74116.10 ▼2.00
Threat Scan /wp-admin/options-general.php?page=threatscan1,0992.0957.4466.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=threatscan
    • > Notice in wp-content/plugins/threat-scan-plugin/threat-scan.php+24
    Undefined index: kpg_threat_opt

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/threat-scan-plugin/threat-scan.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: hacked, virus, scan, threats, malicious code

threat-scan-plugin/threat-scan.php 92% from 13 tests

The principal PHP file in "Threat Scan Plugin" v. 1.3 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 ("threat-scan-plugin.php" instead of "threat-scan.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected369 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14538369

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin