10% ninja-spam-protection

Code Review | Ninja Spam Protection

WordPress plugin Ninja Spam Protection scored10%from 54 tests.

About plugin

  • Plugin page: ninja-spam-protec...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.9.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2022
  • Latest release: Mar 4, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: randomoutputs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /242 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/ninja-spam-protection/ninja-spam-protection.php+69
    Undefined variable: ninja_spam_protection_requested_uri

Server metrics [RAM: ▼1.94MB] [CPU: ▼61.01ms] Passed 4 tests

A check of server-side resources used by Ninja Spam Protection
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.78 ▼42.26
Dashboard /wp-admin2.08 ▼1.266.04 ▼60.20
Posts /wp-admin/edit.php2.08 ▼1.286.19 ▼45.13
Add New Post /wp-admin/post-new.php2.08 ▼3.816.50 ▼96.44
Media Library /wp-admin/upload.php2.08 ▼1.156.31 ▼34.57

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ninja Spam Protection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5914.21 ▼0.171.85 ▲0.1443.78 ▼1.10
Dashboard /wp-admin2,198 ▲275.62 ▼0.0597.17 ▼3.8941.26 ▼4.16
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0038.03 ▲1.6035.64 ▲0.65
Add New Post /wp-admin/post-new.php1,533 ▲523.14 ▼0.08685.47 ▲8.8853.63 ▼5.58
Media Library /wp-admin/upload.php1,394 ▼64.24 ▲0.0899.52 ▼24.4343.63 ▼6.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/ninja-spam-protection/ninja-spam-protection.php+69
    Undefined variable: ninja_spam_protection_requested_uri
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

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 Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: spam, comments, gdpr, stop spam, security...

ninja-spam-protection/ninja-spam-protection.php Passed 13 tests

This is the main PHP file of "Ninja Spam Protection" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
107 characters long description:
The ultimate solution to prevent spam comments on the default commenting system for WordPress in WordPress.

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
No dangerous file extensions were detected59 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP110959

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected