68% disable-post-comments

Code Review | Disable Post Comments

WordPress plugin Disable Post Comments scored68%from 54 tests.

About plugin

  • Plugin page: disable-post-comm...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2020
  • Latest release: May 25, 2023
  • Number of updates: 14
  • Update frequency: every 87.4 days
  • Top authors: sumitsingh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /639 total downloads

Benchmarks

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

Analyzing server-side resources used by Disable Post Comments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.6418.18 ▼26.65
Dashboard /wp-admin2.86 ▼0.4419.36 ▼28.36
Posts /wp-admin/edit.php2.86 ▼0.4917.86 ▼26.41
Add New Post /wp-admin/post-new.php2.86 ▼3.0218.50 ▼68.18
Media Library /wp-admin/upload.php2.86 ▼0.3616.38 ▼18.64
Delete Comments /wp-admin/tools.php?page=disable_comments_tools2.8719.35
Disable Comments /wp-admin/options-general.php?page=disable_comments_settings2.8719.45

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
disable_post_comments_options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Disable Post Comments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲4914.85 ▲0.641.62 ▼0.6543.30 ▼0.20
Dashboard /wp-admin2,223 ▲355.77 ▲0.8899.40 ▼17.2540.29 ▼9.25
Posts /wp-admin/edit.php2,108 ▲192.00 ▼0.0436.54 ▼5.3133.32 ▼1.19
Add New Post /wp-admin/post-new.php1,546 ▲3223.51 ▲6.13661.17 ▼27.8864.32 ▲13.93
Media Library /wp-admin/upload.php1,411 ▲234.18 ▼0.07100.39 ▼8.5146.71 ▲0.47
Delete Comments /wp-admin/tools.php?page=disable_comments_tools8481.7029.8836.12
Disable Comments /wp-admin/options-general.php?page=disable_comments_settings8451.8626.6925.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/disable-post-comments/disable-post-comments.php+119
    Undefined index: disabled_post_types
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • 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
These server-side errors were triggered
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=disable_comments_settings
    • > Notice in wp-content/plugins/disable-post-comments/includes/dpc-settings-page.php+63
    Undefined index: disabled_post_types
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=disable_comments_settings
    • > Notice in wp-content/plugins/disable-post-comments/includes/dpc-settings-page.php+58
    Undefined index: remove_everywhere
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=disable_comments_settings
    • > Warning in wp-content/plugins/disable-post-comments/includes/dpc-settings-page.php+63
    in_array() expects parameter 2 to be array, null given

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=disable_comments_settings
    • > Network (severe)
    wp-content/plugins/disable-post-comments/css/dpc_style.css?ver=1.0.3 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed: Please take inspiration from this readme.txt

disable-post-comments/disable-post-comments.php Passed 13 tests

The main PHP script in "Disable Post Comments" version 1.0.3 is automatically included on every request by WordPress
137 characters long description:
This plugin allows administrators can disable wordpress all post type comments on their site and also can be disabled specific post type.

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
No dangerous file extensions were detected1,820 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PO File102542991,190
PHP59090534
CSS13077
JavaScript21119

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity72.00
▷ Minimum class complexity72.00
▷ Maximum class complexity72.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods37
▷ Static methods12.70%
▷ Public methods2875.68%
▷ Protected methods00.00%
▷ Private methods924.32%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin