84% close-comments-on-media-attachment

Code Review | Close Comments on Media Attachment Pages

WordPress plugin Close Comments on Media Attachment Pages scored84%from 54 tests.

About plugin

  • Plugin page: close-comments-on...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 15, 2016
  • Latest release: Mar 15, 2016
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: janmejai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /945 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.19ms] Passed 4 tests

Analyzing server-side resources used by Close Comments on Media Attachment Pages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.21 ▼4.82
Dashboard /wp-admin3.31 ▲0.0148.93 ▼3.01
Posts /wp-admin/edit.php3.36 ▲0.0045.65 ▲0.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.58 ▼5.04
Media Library /wp-admin/upload.php3.23 ▲0.0033.16 ▲0.10

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Close Comments on Media Attachment Pages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼0.981.94 ▲0.1140.34 ▼4.21
Dashboard /wp-admin2,209 ▲184.83 ▼1.21107.41 ▲1.1541.20 ▼6.21
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0740.69 ▲6.5234.42 ▼0.46
Add New Post /wp-admin/post-new.php1,544 ▲218.32 ▲0.01608.69 ▲1.8955.48 ▼2.12
Media Library /wp-admin/upload.php1,388 ▼04.14 ▼0.1497.79 ▼6.0242.05 ▼0.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/close-comments-on-media-attachment/close-comments-on-media-attachments.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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:
  • Donate link: Please fix this invalid URI: "www.wpcub.com"
The official readme.txt might help

close-comments-on-media-attachment/close-comments-on-media-attachments.php 92% from 13 tests

The main PHP file in "Close Comments on Media Attachment Pages" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("close-comments-on-media-attachment.php" instead of "close-comments-on-media-attachments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected9 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11109

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin