83% tournament-bracket-generator

Code Review | Tournament Bracket Generator

WordPress plugin Tournament Bracket Generator scored 83% from 54 tests.

About plugin

  • Plugin page: tournament-bracke...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-4.7.1
  • WordPress version: 6.3.1
  • First release: Jan 18, 2017
  • Latest release: Jan 18, 2017
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: blakelong (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 9,694 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.03MB] [CPU: ▼1.02ms] Passed 4 tests

A check of server-side resources used by Tournament Bracket Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0351.97 ▲5.82
Dashboard /wp-admin3.34 ▲0.0353.27 ▼0.24
Posts /wp-admin/edit.php3.39 ▲0.0354.75 ▲1.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0395.00 ▼4.17
Media Library /wp-admin/upload.php3.26 ▲0.0336.63 ▼1.34
Tournament Bracket Generator /wp-admin/themes.php?page=tournament-bracket-settings3.2343.38

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 8 new options
New WordPress options
tournament-bracket-save
can_compress_scripts
db_upgraded
tournament-bracket-options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Tournament Bracket Generator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲7613.60 ▲0.476.76 ▲4.7248.26 ▲3.35
Dashboard /wp-admin2,210 ▲44.85 ▼0.01104.61 ▼5.6641.39 ▲3.07
Posts /wp-admin/edit.php2,093 ▲12.05 ▲0.0647.51 ▲6.6036.08 ▲0.54
Add New Post /wp-admin/post-new.php1,533 ▲1923.53 ▲5.79655.97 ▲36.1949.36 ▼1.93
Media Library /wp-admin/upload.php1,389 ▼24.16 ▼0.0598.39 ▼1.9943.26 ▼0.72
Tournament Bracket Generator /wp-admin/themes.php?page=tournament-bracket-settings8781.7125.2426.32

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tournament-bracket-generator/class.tournamentbracket-layout.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tournament-bracket-generator/tournamentbracketgen.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/tournament-bracket-generator/class.tournamentbracket.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tournament-bracket-generator/class.tournamentbracket-admin.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

tournament-bracket-generator/tournamentbracketgen.php 85% from 13 tests

"Tournament Bracket Generator" version 1.0.0'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:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tournament-bracket-generator.php" instead of "tournamentbracketgen.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected1,152 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP55024483
JavaScript2190351
CSS205318

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity27.00
▷ Minimum class complexity6.00
▷ Maximum class complexity53.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods30
▷ Static methods516.67%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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