78% disable-wp-comments

Code Review | Disable WP Comments

WordPress plugin Disable WP Comments scored78%from 54 tests.

About plugin

  • Plugin page: disable-wp-comments
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Dec 12, 2019
  • Latest release: Aug 21, 2023
  • Number of updates: 18
  • Update frequency: every 74.8 days
  • Top authors: qsheeraz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,323 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.10MB] [CPU: ▼3.45ms] Passed 4 tests

Analyzing server-side resources used by Disable WP Comments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.95 ▲0.80
Dashboard /wp-admin3.40 ▲0.1044.83 ▼3.58
Posts /wp-admin/edit.php3.51 ▲0.1646.08 ▼0.77
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.05 ▼10.25
Media Library /wp-admin/upload.php3.32 ▲0.0935.91 ▲1.60

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Disable WP Comments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲12713.42 ▼1.308.03 ▲6.2842.09 ▲3.46
Dashboard /wp-admin2,211 ▲345.48 ▼0.1787.89 ▼0.0039.63 ▼5.76
Posts /wp-admin/edit.php2,116 ▲162.00 ▼0.0238.48 ▼11.9337.18 ▼0.18
Add New Post /wp-admin/post-new.php1,540 ▲1423.66 ▲0.17665.55 ▼26.3147.18 ▼5.28
Media Library /wp-admin/upload.php1,419 ▲164.19 ▲0.0596.82 ▼14.4345.63 ▼1.94

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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 output text when accessed directly:
    • > /wp-content/plugins/disable-wp-comments/public/partials/disable-wp-comments-public-display.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/disable-wp-comments/admin/partials/disable-wp-comments-admin-display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/disable-wp-comments/admin/partials/disable-wp-comments-admin-plugins.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/disable-wp-comments/admin/partials/disable-wp-comments-admin-right-area.php:39

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (screenshot-1.jpg), #2 (screenshot-2.jpg)
The official readme.txt might help

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

The main file in "Disable WP Comments" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
82 characters long description:
A simple pluign to Disable/Hide or to Close WordPress native comments. And more...

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
Everything looks great! No dangerous files found in this plugin845 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14182647494
CSS24214341
JavaScript345410

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.71
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods3286.49%
▷ Protected methods00.00%
▷ Private methods513.51%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected