89% comment-validation-computy

Code Review | comment validation

WordPress plugin comment validation scored89%from 54 tests.

About plugin

  • Plugin page: comment-validatio...
  • Plugin version: 1.6.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Feb 10, 2016
  • Latest release: Aug 18, 2023
  • Number of updates: 18
  • Update frequency: every 152.6 days
  • Top authors: calliko (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,328 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by comment validation
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0134.76 ▼7.22
Dashboard /wp-admin3.31 ▲0.0146.79 ▼3.26
Posts /wp-admin/edit.php3.36 ▲0.0148.36 ▼4.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.94 ▼6.80
Media Library /wp-admin/upload.php3.24 ▲0.0134.70 ▼0.65
Comment validation computy /wp-admin/options-general.php?page=cv-plugin-options3.2031.23

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for comment validation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲7413.22 ▼1.142.14 ▲0.3146.97 ▼1.45
Dashboard /wp-admin2,212 ▲214.87 ▼0.9899.41 ▲2.1239.08 ▼5.18
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0239.49 ▲4.3235.31 ▲4.51
Add New Post /wp-admin/post-new.php1,519 ▼1717.81 ▼5.37681.57 ▲8.3254.81 ▲5.59
Media Library /wp-admin/upload.php1,394 ▲34.23 ▲0.0494.26 ▼10.3040.73 ▼7.59
Comment validation computy /wp-admin/options-general.php?page=cv-plugin-options8612.1323.6425.95

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (This is a highlighted code.)
You can take inspiration from this readme.txt

comment-validation-computy/comment-validation.php 92% from 13 tests

"comment validation" version 1.6.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("comment-validation-computy.php" instead of "comment-validation.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
Success! There were no dangerous files found in this plugin183 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP21413105
JavaScript21731
CSS21028
SVG10119

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/1.png7.01KB7.28KB0.00%
screenshot-1.png7.01KB7.28KB0.00%