78% nerdtools-bad-bots-spam-defender

Code Review | NerdTools Bad Bots Spam Defender

WordPress plugin NerdTools Bad Bots Spam Defender scored78%from 54 tests.

About plugin

  • Plugin page: nerdtools-bad-bot...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.0
  • WordPress version: 6.3.1
  • First release: Jul 22, 2014
  • Latest release: Jul 28, 2014
  • Number of updates: 5
  • Update frequency: every 5.8 days
  • Top authors: ko159 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /968 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.05ms] Passed 4 tests

Analyzing server-side resources used by NerdTools Bad Bots Spam Defender
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.81 ▲1.48
Dashboard /wp-admin3.32 ▼0.0243.55 ▼15.52
Posts /wp-admin/edit.php3.37 ▲0.0248.43 ▼3.94
Add New Post /wp-admin/post-new.php5.90 ▲0.0282.41 ▼10.22
Media Library /wp-admin/upload.php3.24 ▲0.0235.43 ▲1.69

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by NerdTools Bad Bots Spam Defender
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6713.74 ▼0.611.65 ▼0.0742.06 ▲1.41
Dashboard /wp-admin2,219 ▲314.84 ▼1.06116.25 ▲14.0540.19 ▼5.74
Posts /wp-admin/edit.php2,105 ▲162.04 ▲0.0338.92 ▼1.7535.92 ▼0.21
Add New Post /wp-admin/post-new.php1,545 ▲1623.34 ▲4.80589.93 ▼28.3550.42 ▼9.67
Media Library /wp-admin/upload.php1,401 ▲164.26 ▲0.10101.21 ▲0.9146.76 ▲5.94
NT BB Spam Defender /wp-admin/nerdtools_bad_bots_spam_defender.php260.440.0614.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/nerdtools-bad-bots-spam-defender/nerdtools_bad_bots_spam_defender.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/nerdtools_bad_bots_spam_defender.php
    • > Network (severe)
    wp-admin/nerdtools_bad_bots_spam_defender.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Coming shortly)
You can look at the official readme.txt

nerdtools-bad-bots-spam-defender/nerdtools_bad_bots_spam_defender.php 85% from 13 tests

The primary PHP file in "NerdTools Bad Bots Spam Defender" version 1.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nerdtools-bad-bots-spam-defender.php" instead of "nerdtools_bad_bots_spam_defender.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
Success! There were no dangerous files found in this plugin61 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP192161

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions5
▷ Named functions5100.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
There were not PNG files found in your plugin