84% disable-comments-on-attachments

Code Review | Disable Comments on Media Attachments

WordPress plugin Disable Comments on Media Attachments scored84%from 54 tests.

About plugin

  • Plugin page: disable-comments-...
  • Plugin version: 0.2.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.0-6.0
  • WordPress version: 6.3.1
  • First release: Oct 5, 2016
  • Latest release: Jun 2, 2022
  • Number of updates: 18
  • Update frequency: every 115.3 days
  • Top authors: Asif2BD (94.44%)priyomukul (11.11%)

Code review

54 tests

User reviews

2 reviews

Install metrics

800+ active /5,670 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.80ms] Passed 4 tests

Analyzing server-side resources used by Disable Comments on Media Attachments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1337.02 ▼4.79
Dashboard /wp-admin4.35 ▲1.0550.11 ▲2.72
Posts /wp-admin/edit.php3.53 ▲0.1844.45 ▼3.20
Add New Post /wp-admin/post-new.php6.00 ▲0.1281.50 ▼9.93
Media Library /wp-admin/upload.php3.34 ▲0.1237.09 ▲4.66

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Disable Comments on Media Attachments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14913.56 ▼1.031.63 ▼0.1851.77 ▲8.19
Dashboard /wp-admin2,298 ▲1075.87 ▲0.9998.97 ▼9.4741.76 ▼0.66
Posts /wp-admin/edit.php2,111 ▲222.02 ▲0.0139.52 ▲4.4134.96 ▼0.65
Add New Post /wp-admin/post-new.php1,553 ▲3923.48 ▲5.65662.60 ▲51.8957.83 ▲0.97
Media Library /wp-admin/upload.php1,408 ▲174.20 ▲0.02107.09 ▲10.0446.77 ▲3.65

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      include_once(ABSPATHWPINC/feed.php): failed to open stream: No such file or directory in wp-content/plugins/disable-comments-on-attachments/wpdev-dashboard-widget.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disable-comments-on-attachments/wpdev-dashboard-widget.php:52
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-comments-on-attachments/wpdev-dashboard-widget.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/disable-comments-on-attachments/disable-comments-on-attachments.php:15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-comments-on-attachments/wpdev-dashboard-widget.php on line 5
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/feed.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/disable-comments-on-attachments/wpdev-dashboard-widget.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: disable attachment comments, comments, disable comments, attachments comment, disable media comments...

disable-comments-on-attachments/disable-comments-on-attachments.php Passed 13 tests

This is the main PHP file of "Disable Comments on Media Attachments" version 0.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
43 characters long description:
Disable Comments on Media Attachments Pages

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 detected642 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP353303642

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity109.00
▷ Minimum class complexity109.00
▷ Maximum class complexity109.00
Average method complexity5.15
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods13.85%
▷ Public methods2076.92%
▷ Protected methods415.38%
▷ Private methods27.69%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin