74% nospamnx

Code Review | NoSpamNX

WordPress plugin NoSpamNX scored 74% from 54 tests.

About plugin

  • Plugin page: nospamnx
  • Plugin version: 5.2.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 5.9.2
  • First release: Mar 27, 2009
  • Latest release: Jan 27, 2022
  • Number of updates: 222
  • Update frequency: every 21.5 days
  • Top authors: kubi23 (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

10,000+ active / 318,721 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼290.15ms] Passed 4 tests

Analyzing server-side resources used by NoSpamNX
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2055.76 ▲8.32
Dashboard /wp-admin3.55 ▲0.1439.65 ▲6.09
Posts /wp-admin/edit.php3.77 ▲0.1339.29 ▲3.46
Add New Post /wp-admin/post-new.php7.01 ▲0.0495.46 ▼1,173.53
Media Library /wp-admin/upload.php3.43 ▲0.1327.34 ▲3.39
NoSpamNX /wp-admin/options-general.php?page=nospamnx3.3924.28

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 3 new options
New WordPress options
nospamnx-blacklist
nospamnx
nospamnx-blacklist-global

Browser metrics Passed 4 tests

An overview of browser requirements for NoSpamNX
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,778 ▲2315.84 ▲0.195.65 ▼0.382.05 ▼0.12
Dashboard /wp-admin2,903 ▲456.16 ▼0.03117.34 ▼17.75151.62 ▼10.59
Posts /wp-admin/edit.php2,693 ▲53.22 ▼0.0263.23 ▼1.90142.86 ▼4.32
Add New Post /wp-admin/post-new.php1,761 ▲7121.48 ▲0.81448.03 ▲6.75155.02 ▼8.30
Media Library /wp-admin/upload.php1,703 ▲55.44 ▼0.06148.60 ▲2.13188.58 ▼2.04
NoSpamNX /wp-admin/options-general.php?page=nospamnx1,2552.6356.64124.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-includes/class-wp-hook.php+307
    call_user_func_array() expects parameter 1 to be a valid callback, function 'uninstall' not found or invalid function name
  • This plugin does not fully uninstall, leaving 3 options in the database
    • nospamnx
    • nospamnx-blacklist
    • nospamnx-blacklist-global

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nospamnx/nospamnx.php:55

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === nospamnx === )
  • Tags: Please delete some tags, you are using 22 tag instead of maximum 10
You can take inspiration from this readme.txt

nospamnx/nospamnx.php Passed 13 tests

The primary PHP file in "NoSpamNX" version 5.2.11 is used by WordPress to initiate all plugin functionality
105 characters long description:
To protect your blog from automated spambots, this plugin adds invisible formfields to your comment form.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,494 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PO File98552,142988
PHP16031506

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity112.00
▷ Minimum class complexity112.00
▷ Maximum class complexity112.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods28
▷ Static methods310.71%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin