84% comment-author-role-badge

Code Review | Comment Author Role Badge

WordPress plugin Comment Author Role Badge scored84%from 54 tests.

About plugin

  • Plugin page: comment-author-ro...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 6.3.1
  • First release: Jan 4, 2017
  • Latest release: Aug 11, 2021
  • Number of updates: 8
  • Update frequency: every 209.7 days
  • Top authors: Sparanoid (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Comment Author Role Badge
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.20 ▼3.73
Dashboard /wp-admin3.32 ▲0.0250.96 ▼3.22
Posts /wp-admin/edit.php3.37 ▲0.0150.42 ▲0.09
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.07 ▼9.60
Media Library /wp-admin/upload.php3.24 ▲0.0133.78 ▼3.14

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Comment Author Role Badge
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.43 ▲0.131.59 ▼0.2739.81 ▼3.20
Dashboard /wp-admin2,203 ▲154.88 ▼0.96110.46 ▲6.0339.45 ▼4.85
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0540.42 ▲1.9535.80 ▲3.05
Add New Post /wp-admin/post-new.php1,528 ▼522.98 ▼0.29642.30 ▼46.9051.32 ▼3.38
Media Library /wp-admin/upload.php1,388 ▼04.24 ▲0.0796.00 ▼28.0642.02 ▼8.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/comment-author-role-badge/comment-author-role-badge.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
7 plugin tags: badges, comment, badge, author, comments...

comment-author-role-badge/comment-author-role-badge.php Passed 13 tests

"Comment Author Role Badge" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
76 characters long description:
Displays a user badge next to the comment author name based on author's role

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected75 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1113140
CSS14535

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin