90% comment-form-csrf-protection

Code Review | Comment Form CSRF Protection

WordPress plugin Comment Form CSRF Protection scored90%from 54 tests.

About plugin

  • Plugin page: comment-form-csrf...
  • Plugin version: 1.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Feb 21, 2019
  • Latest release: Jul 23, 2023
  • Number of updates: 11
  • Update frequency: every 146.6 days
  • Top authors: ayeshrajans (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /5,737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼10.28ms] Passed 4 tests

An overview of server-side resources used by Comment Form CSRF Protection
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0045.71 ▼5.88
Dashboard /wp-admin3.31 ▲0.0167.72 ▲15.92
Posts /wp-admin/edit.php3.36 ▲0.0051.52 ▼13.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.40 ▼18.81
Media Library /wp-admin/upload.php3.23 ▲0.0039.38 ▼3.37

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Comment Form CSRF Protection
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.021.99 ▼0.3053.38 ▲0.68
Dashboard /wp-admin2,198 ▲215.50 ▼0.3295.75 ▼27.9540.82 ▼7.15
Posts /wp-admin/edit.php2,103 ▼21.94 ▼0.0541.75 ▼7.5838.01 ▼2.08
Add New Post /wp-admin/post-new.php1,526 ▼023.68 ▲0.27678.89 ▼76.1659.56 ▼2.81
Media Library /wp-admin/upload.php1,397 ▼34.19 ▼0.05103.16 ▼25.1144.06 ▼16.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed: The official readme.txt might help

comment-form-csrf-protection/comment-form-csrf-protection.php Passed 13 tests

The main PHP script in "Comment Form CSRF Protection" version 1.4 is automatically included on every request by WordPress
111 characters long description:
WordPress's default comment forms are not protected against Cross-Site Request Forgery. This plugin fixes that.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin61 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP181938
JSON10023

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin