79% one-click-close-comments

Code Review | One Click Close Comments

WordPress plugin One Click Close Comments scored79%from 54 tests.

About plugin

  • Plugin page: one-click-close-c...
  • Plugin version: 2.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Jun 12, 2009
  • Latest release: Apr 2, 2021
  • Number of updates: 22
  • Update frequency: every 196.7 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

10,000+ active /154,634 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.84ms] Passed 4 tests

Server-side resources used by One Click Close Comments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.31 ▼2.64
Dashboard /wp-admin3.34 ▲0.0345.39 ▼3.04
Posts /wp-admin/edit.php3.40 ▲0.0444.51 ▼0.32
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.85 ▼5.37
Media Library /wp-admin/upload.php3.26 ▲0.0335.73 ▲2.55

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for One Click Close Comments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.63 ▲0.361.78 ▼0.1148.04 ▲5.29
Dashboard /wp-admin2,198 ▲215.57 ▼0.0585.29 ▼5.4138.57 ▼0.67
Posts /wp-admin/edit.php2,115 ▲152.01 ▲0.0336.61 ▼1.4937.03 ▼4.32
Add New Post /wp-admin/post-new.php1,526 ▼922.99 ▲4.92618.76 ▼19.5752.60 ▼10.78
Media Library /wp-admin/upload.php1,403 ▼04.24 ▲0.04103.33 ▲4.0343.04 ▼2.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% 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 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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/one-click-close-comments/tests/bootstrap.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/one-click-close-comments/tests/bootstrap.php on line 17
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/one-click-close-comments/tests/bootstrap.php on line 17

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: commenting status, comments, close comments, admin, discussion...

one-click-close-comments/one-click-close-comments.php Passed 13 tests

"One Click Close Comments" version 2.7.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
102 characters long description:
Conveniently close or open comments for a post or page with one click from the admin listing of posts.

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
Everything looks great! No dangerous files found in this plugin637 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP4137199349
Markdown3430200
JavaScript10129
CSS11024
Bourne Shell16221
XML10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity12.50
▷ Minimum class complexity7.00
▷ Maximum class complexity18.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods42
▷ Static methods1433.33%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin