78% disable-comments

Code Review | Disable Comments - Remove Comments & Stop Spam [Multi-Site Support]

WordPress plugin Disable Comments - Remove Comments & Stop Spam [Multi-Site Support] scored78%from 54 tests.

About plugin

  • Plugin page: disable-comments
  • Plugin version: 2.4.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: May 27, 2011
  • Latest release: Aug 30, 2023
  • Number of updates: 179
  • Update frequency: every 25.0 days
  • Top authors: solarissmoke (76.54%)wpdevteam (13.41%)Asif2BD (11.17%)

Code review

54 tests

User reviews

269 reviews

Install metrics

1,000,000+ active /23,091,842 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
Install script ran successfully

Server metrics [RAM: ▲0.35MB] [CPU: ▼3.60ms] Passed 4 tests

Analyzing server-side resources used by Disable Comments - Remove Comments & Stop Spam [Multi-Site Support]
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3546.41 ▲3.16
Dashboard /wp-admin3.70 ▲0.3652.57 ▼15.21
Posts /wp-admin/edit.php3.76 ▲0.4055.50 ▲1.91
Add New Post /wp-admin/post-new.php6.22 ▲0.3494.70 ▼4.26
Media Library /wp-admin/upload.php3.56 ▲0.3441.16 ▲4.76
Disable Comments /wp-admin/options-general.php?page=disable_comments_settings3.6137.65
Delete Comments /wp-admin/tools.php?page=disable_comments_tools3.4333.16

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
disable_comments_options
theysaidso_admin_options
disable_comment_version
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Disable Comments - Remove Comments & Stop Spam [Multi-Site Support]
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.25 ▲0.111.89 ▼0.0045.82 ▼0.27
Dashboard /wp-admin2,208 ▲315.64 ▲0.0582.27 ▼17.3180.49 ▲34.75
Posts /wp-admin/edit.php2,110 ▲101.96 ▼0.1937.12 ▲1.8733.09 ▼6.69
Add New Post /wp-admin/post-new.php1,534 ▲823.87 ▲0.82648.74 ▼42.6551.46 ▲2.51
Media Library /wp-admin/upload.php1,410 ▲164.30 ▼0.0096.83 ▼4.5345.30 ▼0.85
Disable Comments /wp-admin/options-general.php?page=disable_comments_settings1,5772.5748.83108.55
Delete Comments /wp-admin/tools.php?page=disable_comments_tools1,6022.5643.7258.51

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
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • disable_comment_version
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/disable-comments/views/partials/_footer.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/disable-comments/views/partials/_disable.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/disable-comments/views/partials/_delete.php:3
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/disable-comments/views/partials/_sites.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/disable-comments/views/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/disable-comments/views/partials/_sites.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/disable-comments/views/partials/_sidebar.php:3
    • > PHP Warning
      Use of undefined constant DC_PLUGIN_VIEWS_PATH - assumed 'DC_PLUGIN_VIEWS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-comments/views/partials/_footer.php on line 6
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/disable-comments/views/partials/_sites.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/disable-comments/views/partials/_menu.php:3
    • > PHP Warning
      include(): Failed opening 'DC_PLUGIN_VIEWS_PATHpartials/_menu.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/disable-comments/views/partials/_footer.php on line 6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can look at the official readme.txt

disable-comments/disable-comments.php 92% from 13 tests

The main PHP script in "Disable Comments - Remove Comments & Stop Spam [Multi-Site Support]" version 2.4.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin3,591 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP122064562,348
JavaScript52771781,141
CSS53198
SVG1004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity134.00
▷ Minimum class complexity24.00
▷ Maximum class complexity261.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods92
▷ Static methods22.17%
▷ Public methods7682.61%
▷ Protected methods44.35%
▷ Private methods1213.04%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.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
6 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/finalize-thumb.png20.93KB11.42KB▼ 45.44%
assets/img/icon-logo-small.png0.92KB1.33KB0.00%
assets/img/company-thumb.png57.25KB28.95KB▼ 49.44%
assets/img/check.png0.15KB0.24KB0.00%
assets/img/logo.png8.78KB4.94KB▼ 43.68%