84% wp-comment-policy-checkbox

Code Review | WP Comment Policy Checkbox

WordPress plugin WP Comment Policy Checkbox scored 84% from 54 tests.

About plugin

  • Plugin page: wp-comment-policy...
  • Plugin version: 0.4.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 3, 2018
  • Latest release: Dec 5, 2022
  • Number of updates: 38
  • Update frequency: every 46.5 days
  • Top authors: fcojgodoy (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

7,000+ active / 46,996 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.57ms] Passed 4 tests

An overview of server-side resources used by WP Comment Policy Checkbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.93 ▼0.41
Dashboard /wp-admin3.36 ▲0.0646.75 ▼4.14
Posts /wp-admin/edit.php3.41 ▲0.0542.99 ▼0.72
Add New Post /wp-admin/post-new.php5.94 ▲0.0580.65 ▼13.02
Media Library /wp-admin/upload.php3.28 ▲0.0535.86 ▲1.26

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WP Comment Policy Checkbox
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6813.14 ▼1.175.45 ▲3.3545.18 ▼7.32
Dashboard /wp-admin2,206 ▲184.84 ▼0.20110.80 ▲8.6242.75 ▼1.72
Posts /wp-admin/edit.php2,089 ▲32.05 ▲0.0834.48 ▼0.9134.27 ▼0.47
Add New Post /wp-admin/post-new.php1,542 ▲2818.70 ▼4.92589.46 ▼102.4950.38 ▼5.03
Media Library /wp-admin/upload.php1,388 ▼34.20 ▲0.0294.12 ▼11.8640.07 ▼8.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-comment-policy-checkbox/includes/wp-comment-policy-checkbox-admin.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-comment-policy-checkbox/includes/wp-comment-policy-checkbox-data-exporter.php:85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-comment-policy-checkbox/includes/wp-comment-policy-checkbox-data-eraser.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-comment-policy-checkbox/admin/wp-comment-policy-checkbox-admin.php:21

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: You can take inspiration from this readme.txt

wp-comment-policy-checkbox/wp-comment-policy-checkbox.php 92% from 13 tests

"WP Comment Policy Checkbox" version 0.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 169 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected612 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5163105404
SVG100127
PO File2161681

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png39.66KB18.55KB▼ 53.23%
assets/screenshot-3.png5.07KB2.39KB▼ 52.80%
assets/screenshot-2.png27.61KB13.28KB▼ 51.91%
assets/icon-128x128.png2.68KB2.11KB▼ 21.40%