89% comments-leaderboard

Code Review | Comments Leaderboard

WordPress plugin Comments Leaderboard scored89%from 54 tests.

About plugin

  • Plugin page: comments-leaderboard
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8
  • WordPress version: 6.3.1
  • First release: Aug 6, 2015
  • Latest release: May 3, 2017
  • Number of updates: 28
  • Update frequency: every 23.8 days
  • Top authors: alexmangini (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,875 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.04MB] [CPU: ▼6.07ms] Passed 4 tests

A check of server-side resources used by Comments Leaderboard
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.0447.42 ▲1.41
Dashboard /wp-admin3.61 ▲0.0452.60 ▼2.76
Posts /wp-admin/edit.php3.72 ▲0.0449.15 ▼6.32
Add New Post /wp-admin/post-new.php6.19 ▲0.0483.80 ▼12.08
Media Library /wp-admin/upload.php3.53 ▲0.0436.87 ▼3.11

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Comments Leaderboard
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.30 ▼0.092.07 ▲0.2239.76 ▼6.45
Dashboard /wp-admin2,195 ▲245.66 ▲0.0588.64 ▼17.5640.71 ▼6.33
Posts /wp-admin/edit.php2,100 ▲212.04 ▲0.0536.38 ▼2.5232.58 ▼5.37
Add New Post /wp-admin/post-new.php1,550 ▲523.80 ▲0.63601.18 ▼90.8051.02 ▼1.94
Media Library /wp-admin/upload.php1,403 ▼04.22 ▼0.03104.40 ▼3.0743.11 ▼0.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_comments_leaderboard

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
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org 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 ( === comments-leaderboard === )
The official readme.txt is a good inspiration

comments-leaderboard/comments-leaderboard.php 92% from 13 tests

"Comments Leaderboard" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)

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
No dangerous file extensions were detected285 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP18466148
CSS123679
PO File19940
JavaScript13018

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/medal.png0.92KB1.46KB0.00%