84% comment-gatekeeper

Code Review | Comment Gatekeeper

WordPress plugin Comment Gatekeeper scored84%from 54 tests.

About plugin

  • Plugin page: comment-gatekeeper
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.3-3.8
  • WordPress version: 6.3.1
  • First release: Dec 4, 2013
  • Latest release: Jan 31, 2014
  • Number of updates: 18
  • Update frequency: every 3.3 days
  • Top authors: StuartSequeira (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,670 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.37ms] Passed 4 tests

An overview of server-side resources used by Comment Gatekeeper
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0344.04 ▲4.40
Dashboard /wp-admin3.34 ▲0.0452.17 ▲0.62
Posts /wp-admin/edit.php3.39 ▲0.0347.18 ▼4.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.41 ▼27.71
Media Library /wp-admin/upload.php3.26 ▲0.0339.78 ▲1.96

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Comment Gatekeeper
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7913.39 ▼0.914.77 ▲2.3846.42 ▲5.61
Dashboard /wp-admin2,224 ▲215.80 ▲0.9398.61 ▼7.4740.21 ▼7.96
Posts /wp-admin/edit.php2,100 ▲32.00 ▼0.0138.74 ▲4.0333.93 ▼2.11
Add New Post /wp-admin/post-new.php1,545 ▲1423.20 ▲0.07681.63 ▲5.7158.86 ▲5.22
Media Library /wp-admin/upload.php1,400 ▲34.21 ▼0.0798.10 ▼24.5646.17 ▼2.91

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/comment-gatekeeper/comment-gatekeeper.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/comment-gatekeeper/includes/settings.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/comment-gatekeeper/includes/comment-form.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: comments, spam

comment-gatekeeper/comment-gatekeeper.php Passed 13 tests

The primary PHP file in "Comment Gatekeeper" version 1.1.1 is used by WordPress to initiate all plugin functionality
78 characters long description:
Insert a question and answer field to your comment form to block spam comments

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin175 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP416690175

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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 are no PNG files in this plugin