83% disable-comments-for-post-types

Code Review | Disable Comments for Post Types

WordPress plugin Disable Comments for Post Types scored83%from 54 tests.

About plugin

  • Plugin page: disable-comments-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9.2
  • WordPress version: 6.3.1
  • First release: Aug 10, 2014
  • Latest release: Aug 10, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: tormorten (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,424 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Disable Comments for Post Types
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.52 ▲0.97
Dashboard /wp-admin3.32 ▲0.0152.97 ▲3.53
Posts /wp-admin/edit.php3.37 ▲0.0148.46 ▲0.03
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.88 ▼14.62
Media Library /wp-admin/upload.php3.24 ▲0.0141.75 ▲1.99

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Disable Comments for Post Types
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.10 ▼0.252.04 ▲0.4143.02 ▲2.54
Dashboard /wp-admin2,198 ▲275.56 ▲0.0287.81 ▼11.7138.77 ▼4.16
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0035.16 ▼10.0634.65 ▼5.24
Add New Post /wp-admin/post-new.php1,526 ▼023.14 ▼0.33677.81 ▼56.0257.34 ▼15.71
Media Library /wp-admin/upload.php1,403 ▲94.12 ▼0.13110.26 ▲6.4350.34 ▲3.26

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/disable-comments-for-post-types/disable-comments-post-type.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: post type, comments, disable

disable-comments-for-post-types/disable-comments-post-type.php 69% from 13 tests

"Disable Comments for Post Types" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("disable-comments-for-post-types.php" instead of "disable-comments-post-type.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages/")
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages/")

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
Good job! No executable or dangerous file extensions detected35 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1314635

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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