90% delete-old-comments

Code Review | Delete Old Comments

WordPress plugin Delete Old Comments scored90%from 54 tests.

About plugin

  • Plugin page: delete-old-comments
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.1
  • WordPress version: 6.3.1
  • First release: Apr 19, 2019
  • Latest release: Apr 23, 2019
  • Number of updates: 3
  • Update frequency: every 4.3 days
  • Top authors: carlosmoreirapt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /892 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Server-side resources used by Delete Old Comments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1240.24 ▼1.10
Dashboard /wp-admin3.43 ▲0.1344.96 ▲0.37
Posts /wp-admin/edit.php3.55 ▲0.1945.73 ▼0.18
Add New Post /wp-admin/post-new.php6.01 ▲0.1379.58 ▼9.61
Media Library /wp-admin/upload.php3.36 ▲0.1336.50 ▲2.80

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Delete Old Comments
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.061.68 ▲0.0143.86 ▼1.45
Dashboard /wp-admin2,198 ▲185.52 ▼0.1183.95 ▼6.7037.54 ▼6.72
Posts /wp-admin/edit.php2,097 ▼31.99 ▼0.0432.67 ▼2.0635.64 ▼2.95
Add New Post /wp-admin/post-new.php1,526 ▼023.30 ▼0.15663.54 ▼27.3549.89 ▼14.02
Media Library /wp-admin/upload.php1,400 ▼04.31 ▲0.08109.96 ▲7.6248.29 ▲4.32

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need 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 Passed 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 Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: gdpr, cleanup, comments, maintanance

delete-old-comments/delete-old-comments.php Passed 13 tests

The principal PHP file in "Delete Old Comments" v. 1.0.0 is loaded by WordPress automatically on each request
125 characters long description:
Delete from database old comments automatically. The plugin will add options to the discussion settings page to control this.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin672 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11168294664
Markdown1607
JSON1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.33
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods40
▷ Static methods37.50%
▷ Public methods3690.00%
▷ Protected methods00.00%
▷ Private methods410.00%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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