78% captcha-for-comments-form

Code Review | Comments Form Captcha

WordPress plugin Comments Form Captcha scored78%from 54 tests.

About plugin

  • Plugin page: captcha-for-comme...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 24, 2020
  • Latest release: Jan 24, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: milankyada (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /431 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.03MB] [CPU: ▼5.37ms] Passed 4 tests

An overview of server-side resources used by Comments Form Captcha
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.91 ▼4.37
Dashboard /wp-admin3.33 ▲0.0348.16 ▼5.20
Posts /wp-admin/edit.php3.38 ▲0.0346.47 ▼5.49
Add New Post /wp-admin/post-new.php5.93 ▲0.0596.16 ▼6.40
Media Library /wp-admin/upload.php3.26 ▲0.0337.83 ▲3.69
Comments Form Captcha /wp-admin/options-general.php?page=for-captcha-setting3.2024.50

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Comments Form Captcha
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8913.94 ▼0.2118.93 ▲17.1339.78 ▼7.17
Dashboard /wp-admin2,207 ▲165.85 ▼0.0598.25 ▼1.8538.13 ▼3.31
Posts /wp-admin/edit.php2,090 ▼22.00 ▲0.0340.61 ▲0.8835.18 ▼1.50
Add New Post /wp-admin/post-new.php1,536 ▲2223.25 ▲5.82600.38 ▼46.2852.55 ▲0.92
Media Library /wp-admin/upload.php1,392 ▲14.19 ▼0.0798.50 ▼6.1442.04 ▼7.61
Comments Form Captcha /wp-admin/options-general.php?page=for-captcha-setting8222.0728.9934.48

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=for-captcha-setting
    • > Notice in wp-content/plugins/captcha-for-comments-form/init.php+73
    Trying to access array offset on value of type bool

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/captcha-for-comments-form/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: spam, comments, captcha, googlerecaptcha

captcha-for-comments-form/init.php 92% from 13 tests

This is the main PHP file of "Comments Form Captcha" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("captcha-for-comments-form.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin155 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3267131
JavaScript13024

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.00
▷ Minimum class complexity6.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods12
▷ Static methods18.33%
▷ Public methods975.00%
▷ Protected methods18.33%
▷ Private methods216.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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