79% challonge

Code Review | Challonge

WordPress plugin Challonge scored 79% from 54 tests.

About plugin

  • Plugin page: challonge
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9
  • WordPress version: 6.3.1
  • First release: Nov 5, 2013
  • Latest release: Sep 2, 2017
  • Number of updates: 18
  • Update frequency: every 77.7 days
  • Top authors: zavaboy (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active / 17,108 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.13ms] Passed 4 tests

Server-side resources used by Challonge
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.80 ▼7.40
Dashboard /wp-admin3.31 ▲0.0041.90 ▼8.91
Posts /wp-admin/edit.php3.36 ▲0.0043.11 ▼5.43
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.79 ▼6.76
Media Library /wp-admin/upload.php3.23 ▲0.0034.07 ▼1.65

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Challonge
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.48 ▲0.331.98 ▲0.2043.60 ▼5.39
Dashboard /wp-admin2,209 ▲215.86 ▲0.9597.84 ▼21.5238.63 ▼10.51
Posts /wp-admin/edit.php2,089 ▼32.17 ▲0.1736.45 ▼0.0735.44 ▲0.58
Add New Post /wp-admin/post-new.php1,520 ▼1323.18 ▲0.22653.28 ▼12.4460.49 ▲9.36
Media Library /wp-admin/upload.php1,385 ▼34.14 ▼0.1098.85 ▼12.7441.22 ▼7.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Incomplete uninstall procedure, leaving 35 files (1.49MB) in the plugin directory
    • (new file) challonge-admin.js
    • (new file) challonge-admin.min.js
    • (new file) challonge.min.js
    • (new file) challonge.css
    • (new file) challonge-mce-button.js
    • (new file) challonge-admin.css
    • (new file) challonge.js
    • (new file) cacert.pem
    • (new file) challonge.php
    • (new file) challonge.png
    • ...
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 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)
Even though no errors were found, this is by no means an exhaustive test

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

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (It's easy to embed a tournament bracket with the shortcode. The widgets make singing up to a tournament and reporting scores easy.), #2 (If no "url" attribute is set in your shortcode, a tournament listing will be displayed.), #3 (Signing up to a tournament is easy.), #4 (Reporting your score is also easy.), #5 (Control things like how player names are defined and how scoring works in the settings page.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

challonge/challonge.php 92% from 13 tests

The main file in "Challonge" v. 1.1.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
Everything looks great! No dangerous files found in this plugin16,122 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript91,0601,22012,351
PHP112374202,831
CSS2179521
PO File1160238419

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity64.38
▷ Minimum class complexity17.00
▷ Maximum class complexity152.00
Average method complexity7.04
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods84
▷ Static methods44.76%
▷ Public methods8196.43%
▷ Protected methods00.00%
▷ Private methods33.57%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants9
▷ Global constants111.11%
▷ Class constants888.89%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.32MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png16.49KB8.69KB▼ 47.27%
screenshot-3.png36.92KB20.04KB▼ 45.70%
screenshot-1.png160.05KB49.66KB▼ 68.97%
screenshot-4.png25.48KB12.19KB▼ 52.17%
screenshot-5.png89.10KB36.71KB▼ 58.80%