78% disable-comments-on-post-categories

Code Review | Disable Comments on Post Categories

WordPress plugin Disable Comments on Post Categories scored78%from 54 tests.

About plugin

  • Plugin page: disable-comments-...
  • Plugin version: 0.91
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.0
  • WordPress version: 6.3.1
  • First release: Sep 16, 2014
  • Latest release: Sep 25, 2014
  • Number of updates: 15
  • Update frequency: every 0.7 days
  • Top authors: a.ankit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,551 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.97ms] Passed 4 tests

Analyzing server-side resources used by Disable Comments on Post Categories
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.97 ▼7.00
Dashboard /wp-admin3.32 ▲0.0148.46 ▼3.18
Posts /wp-admin/edit.php3.37 ▲0.0149.81 ▼0.34
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.42 ▼13.37
Media Library /wp-admin/upload.php3.24 ▲0.0142.39 ▲4.32
Disable Comments Post Categories /wp-admin/options-general.php?page=disable_categories_comments3.2336.71

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Disable Comments on Post Categories
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.23 ▼0.151.82 ▼0.4142.87 ▲2.25
Dashboard /wp-admin2,196 ▲195.62 ▲0.0987.43 ▼16.1941.71 ▼3.78
Posts /wp-admin/edit.php2,104 ▲12.02 ▲0.0634.74 ▼6.1037.32 ▼0.00
Add New Post /wp-admin/post-new.php1,529 ▲123.62 ▲0.41655.71 ▼5.4254.58 ▲0.27
Media Library /wp-admin/upload.php1,404 ▲14.19 ▼0.0399.36 ▼9.5441.19 ▼3.33
Disable Comments Post Categories /wp-admin/options-general.php?page=disable_categories_comments8391.9923.8545.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=disable_categories_comments
    • > Notice in wp-content/plugins/disable-comments-on-post-categories/settings-page.php+24
    Undefined index: tab

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/disable-comments-on-post-categories/settings-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disable-comments-on-post-categories/disable-comments-categories.php:15

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Settings-Screen)
The official readme.txt is a good inspiration

disable-comments-on-post-categories/disable-comments-categories.php 92% from 13 tests

"Disable Comments on Post Categories" version 0.91'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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("disable-comments-on-post-categories.php" instead of "disable-comments-categories.php")

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
Success! There were no dangerous files found in this plugin212 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP317125196
CSS10016

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png24.21KB15.79KB▼ 34.80%