78% another-comments-cleaner

Code Review | Another Comments Cleaner

WordPress plugin Another Comments Cleaner scored78%from 54 tests.

About plugin

  • Plugin page: another-comments-...
  • Plugin version: 0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Dec 10, 2016
  • Latest release: Dec 12, 2016
  • Number of updates: 5
  • Update frequency: every 31.6 days
  • Top authors: cnhk_systems (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /876 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 gracefully, with no errors

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

Analyzing server-side resources used by Another Comments Cleaner
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0046.18 ▲5.94
Dashboard /wp-admin3.32 ▲0.0154.44 ▲1.92
Posts /wp-admin/edit.php3.37 ▲0.0151.02 ▼3.40
Add New Post /wp-admin/post-new.php5.90 ▲0.01103.33 ▼6.31
Media Library /wp-admin/upload.php3.24 ▲0.0136.23 ▼2.18
All Comments /wp-admin/edit-comments.php3.2642.79
Cleaner /wp-admin/edit-comments.php?page=ancc3.2837.89

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Another Comments Cleaner
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.34 ▲0.111.82 ▼0.0943.72 ▼0.49
Dashboard /wp-admin2,212 ▲385.62 ▲0.0291.22 ▲3.9838.85 ▼7.86
Posts /wp-admin/edit.php2,117 ▲171.95 ▼0.0034.41 ▼10.6534.09 ▼1.05
Add New Post /wp-admin/post-new.php1,541 ▲1323.14 ▼0.02590.20 ▼38.4748.96 ▼12.10
Media Library /wp-admin/upload.php1,417 ▲204.18 ▲0.0399.54 ▼9.8542.36 ▼6.39
All Comments /wp-admin/edit-comments.php1,8252.2638.7138.44
Cleaner /wp-admin/edit-comments.php?page=ancc1,1021.7033.4531.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-comments.php?page=ancc
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/another-comments-cleaner/comments-cleaner.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: clean database, spam delete, comments, spam, comments delete

another-comments-cleaner/comments-cleaner.php 92% from 13 tests

The main file in "Another Comments Cleaner" v. 0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("another-comments-cleaner.php" instead of "comments-cleaner.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected606 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP44067431
JavaScript11118163
Markdown1709
CSS1003

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity78.00
▷ Minimum class complexity78.00
▷ Maximum class complexity78.00
Average method complexity5.81
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16.25%
▷ Public methods1381.25%
▷ Protected methods00.00%
▷ Private methods318.75%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected