78% comment-section-manager

Code Review | Comment Section Manager

WordPress plugin Comment Section Manager scored78%from 54 tests.

About plugin

  • Plugin page: comment-section-m...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3
  • WordPress version: 6.3.1
  • First release: Dec 11, 2015
  • Latest release: Nov 13, 2016
  • Number of updates: 16
  • Update frequency: every 22.6 days
  • Top authors: hirenwadhiya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,595 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.09ms] Passed 4 tests

This is a short check of server-side resources used by Comment Section Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0243.74 ▼0.80
Dashboard /wp-admin3.37 ▲0.0351.81 ▼3.90
Posts /wp-admin/edit.php3.42 ▲0.0351.48 ▲2.94
Add New Post /wp-admin/post-new.php5.95 ▲0.0286.09 ▼14.34
Media Library /wp-admin/upload.php3.30 ▲0.0338.18 ▲2.70
Categories /wp-admin/admin.php?page=comment_remover_categories3.2434.83
Pages /wp-admin/admin.php?page=comment_remover_pages3.2633.97
All Pages Setting /wp-admin/admin.php?page=comment_remover_plugin3.2431.51

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Comment Section Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.26 ▼0.391.78 ▼0.0343.08 ▲2.78
Dashboard /wp-admin2,225 ▲455.55 ▼0.1085.57 ▼1.5439.50 ▼4.39
Posts /wp-admin/edit.php2,136 ▲332.00 ▼0.0236.37 ▼5.9634.71 ▲1.13
Add New Post /wp-admin/post-new.php1,552 ▲1623.15 ▲0.04674.68 ▲35.5349.61 ▼6.34
Media Library /wp-admin/upload.php1,433 ▲364.21 ▼0.0698.47 ▼5.4641.06 ▼4.60
Categories /wp-admin/admin.php?page=comment_remover_categories8632.0024.1929.23
Pages /wp-admin/admin.php?page=comment_remover_pages8662.0323.0628.40
All Pages Setting /wp-admin/admin.php?page=comment_remover_plugin8572.0327.3029.59

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=comment_remover_categories
    • > Notice in wp-content/plugins/comment-section-manager/comment-section-manager.php+207
    Undefined offset: 1
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=comment_remover_pages
    • > Notice in wp-content/plugins/comment-section-manager/comment-section-manager.php+133
    Undefined offset: 2
    • > GET request to /wp-admin/admin.php?page=comment_remover_plugin
    • > Notice in wp-content/plugins/comment-section-manager/comment-section-manager.php+61
    Undefined index: comment
    • > GET request to /wp-admin/admin.php?page=comment_remover_plugin
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=comment_remover_plugin
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/comment-section-manager/comment-section-manager.php:16

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === comment-section-manager === )
The official readme.txt is a good inspiration

comment-section-manager/comment-section-manager.php Passed 13 tests

The primary PHP file in "Comment Section Manager" version 1.0 is used by WordPress to initiate all plugin functionality
82 characters long description:
This plugin will allow you to enable and disable comments from pages and category.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin206 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1228200
CSS1236

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues 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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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