68% advanced-comment-control

Code Review | Advanced Comment Control

WordPress plugin Advanced Comment Control scored68%from 54 tests.

About plugin

  • Plugin page: advanced-comment-...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 6.3.1
  • First release: Sep 30, 2014
  • Latest release: May 23, 2016
  • Number of updates: 6
  • Update frequency: every 100.5 days
  • Top authors: layotte (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,787 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.72MB] [CPU: ▼49.73ms] Passed 4 tests

A check of server-side resources used by Advanced Comment Control
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.27 ▼1.206.06 ▼33.73
Dashboard /wp-admin2.29 ▼1.026.18 ▼44.80
Posts /wp-admin/edit.php2.29 ▼1.076.01 ▼40.35
Add New Post /wp-admin/post-new.php2.29 ▼3.606.85 ▼80.05
Media Library /wp-admin/upload.php2.29 ▼0.946.90 ▼26.24
Advanced Controls /wp-admin/edit-comments.php?page=advanced_comment_control_settings2.346.46
All Comments /wp-admin/edit-comments.php2.347.04

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Comment Control
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.72 ▲0.371.73 ▲0.1243.74 ▼0.00
Dashboard /wp-admin2,215 ▲385.59 ▼0.0684.44 ▼18.7739.78 ▼4.46
Posts /wp-admin/edit.php2,117 ▲172.02 ▲0.0334.86 ▼6.4432.39 ▼7.29
Add New Post /wp-admin/post-new.php1,541 ▲1323.18 ▼0.17702.74 ▲46.7150.95 ▼7.74
Media Library /wp-admin/upload.php1,417 ▲234.29 ▲0.1295.29 ▼21.1240.79 ▼5.50
Advanced Controls /wp-admin/edit-comments.php?page=advanced_comment_control_settings1,2062.2126.4129.43
All Comments /wp-admin/edit-comments.php1,8242.2735.3632.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/advanced-comment-control/class.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; AdvancedCommentControl has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-comments.php
    • > Deprecated in wp-content/plugins/advanced-comment-control/class.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; AdvancedCommentControl has a deprecated constructor

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/advanced-comment-control/advanced-comment-control.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-comment-control/functions.php:98

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: comments, pings, spam, security, advanced...

advanced-comment-control/advanced-comment-control.php Passed 13 tests

"Advanced Comment Control" version 1.2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
91 characters long description:
This plugin allows you to manage who can comment and when they can comment on your content.

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 plugin875 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP3321139672
PO File14754122
JavaScript27250
CSS23031

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity105.00
▷ Minimum class complexity105.00
▷ Maximum class complexity105.00
Average method complexity10.45
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.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 were not PNG files found in your plugin