84% comment-roles

Code Review | Comment Roles

WordPress plugin Comment Roles scored84%from 54 tests.

About plugin

  • Plugin page: comment-roles
  • Plugin version: 0.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.3
  • WordPress version: 6.3.1
  • First release: Sep 11, 2015
  • Latest release: Sep 14, 2015
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: kendalltristan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /754 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Comment Roles
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.45 ▼0.30
Dashboard /wp-admin3.32 ▲0.0142.80 ▼4.59
Posts /wp-admin/edit.php3.37 ▲0.0145.34 ▲2.17
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.61 ▼3.57
Media Library /wp-admin/upload.php3.24 ▲0.0136.81 ▼5.37

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Comment Roles
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.33 ▼0.981.97 ▲0.3043.58 ▼3.32
Dashboard /wp-admin2,200 ▲155.80 ▼0.0896.87 ▼23.0437.68 ▼6.76
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0139.90 ▲4.7833.35 ▲0.04
Add New Post /wp-admin/post-new.php1,534 ▲2023.11 ▲5.26660.25 ▼43.6849.90 ▼8.16
Media Library /wp-admin/upload.php1,385 ▼04.18 ▲0.07103.55 ▼0.9048.23 ▲3.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/comment-roles/comment-roles.php:49

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === comment-roles === )
You can take inspiration from this readme.txt

comment-roles/comment-roles.php 92% from 13 tests

The main file in "Comment Roles" v. 0.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 281 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin51 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1223634
PO File11117

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin