68% bad-tournament

Code Review | Bad Tournament

WordPress plugin Bad Tournament scored68%from 54 tests.

About plugin

  • Plugin page: bad-tournament
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9.7
  • WordPress version: 6.3.1
  • First release: Jan 9, 2018
  • Latest release: Jun 26, 2023
  • Number of updates: 16
  • Update frequency: every 124.7 days
  • Top authors: loloirie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,311 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.85ms] Passed 4 tests

This is a short check of server-side resources used by Bad Tournament
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.27 ▼2.34
Dashboard /wp-admin3.34 ▼0.0146.67 ▼17.83
Posts /wp-admin/edit.php3.39 ▲0.0347.36 ▲1.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.41 ▲0.72
Media Library /wp-admin/upload.php3.26 ▲0.0334.67 ▲0.06
Table /wp-admin/admin.php?page=bad_tournament&admin_view=table3.32127.18
Matches /wp-admin/admin.php?page=bad_tournament&admin_view=matches3.2032.56
Players /wp-admin/admin.php?page=bad_tournament&admin_view=players3.2029.25
Options /wp-admin/admin.php?page=bad_tournament&admin_view=export3.2030.70
Bad Tournament /wp-admin/admin.php?page=bad_tournament3.2026.45
Clubs /wp-admin/admin.php?page=bad_tournament&admin_view=clubs3.2027.83

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 54 new files
Database: 5 new tables, 8 new options
New tables
wp_bvg_players_tournament
wp_bvg_matches
wp_bvg_clubs
wp_bvg_players_double
wp_bvg_players
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
bad_tournament_installed
widget_recent-comments
theysaidso_admin_options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Bad Tournament: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲10413.54 ▼0.831.81 ▲0.0638.75 ▼0.87
Dashboard /wp-admin2,259 ▲674.87 ▼0.1198.92 ▼12.9183.06 ▲44.86
Posts /wp-admin/edit.php2,145 ▲561.98 ▼0.0139.23 ▲3.1634.24 ▼0.02
Add New Post /wp-admin/post-new.php1,634 ▲10118.32 ▼4.57690.95 ▲13.4846.35 ▼10.49
Media Library /wp-admin/upload.php1,441 ▲504.21 ▼0.0798.11 ▲1.0372.33 ▲29.12
Table /wp-admin/admin.php?page=bad_tournament&admin_view=table7881.536.8818.18
Matches /wp-admin/admin.php?page=bad_tournament&admin_view=matches7241.536.6916.80
Players /wp-admin/admin.php?page=bad_tournament&admin_view=players7241.357.0520.44
Options /wp-admin/admin.php?page=bad_tournament&admin_view=export8491.9432.6325.61
Bad Tournament /wp-admin/admin.php?page=bad_tournament7241.147.2016.24
Clubs /wp-admin/admin.php?page=bad_tournament&admin_view=clubs7241.146.2615.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_bvg_players_double
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bad_tournament&admin_view=clubs
    • > Warning in wp-content/plugins/bad-tournament/admin/index.php+11
    require_once(wp-content/plugins/bad-tournament/admin/badt_functions.php): failed to open stream: No such file or directory
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bad_tournament&admin_view=clubs
    • > Compile error in wp-content/plugins/bad-tournament/admin/index.php+11
    require_once(): Failed opening required 'wp-content/plugins/bad-tournament/admin/badt_functions.php' (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/admin.php?page=bad_tournament&admin_view=export
    • > Warning in wp-content/plugins/bad-tournament/bad-tournament.php+155
    include(wp-content/plugins/bad-tournament/admin/index-export.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=bad_tournament&admin_view=export
    • > Warning in wp-content/plugins/bad-tournament/bad-tournament.php+155
    include(): Failed opening 'wp-content/plugins/bad-tournament/admin/index-export.php' for inclusion (include_path='.:/usr/share/php')
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bad_tournament
    • > Notice in wp-content/plugins/bad-tournament/bad-tournament.php+154
    Undefined index: admin_view

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 fix the following
  • 120× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: html_ajax in wp-content/plugins/bad-tournament/admin/action/player-info.php on line 11
    • > PHP Notice
      Undefined index: match_id in wp-content/plugins/bad-tournament/admin/action/change-player-match.php on line 9
    • > PHP Notice
      Undefined variable: html in wp-content/plugins/bad-tournament/admin/index_html/header.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bad-tournament/admin/action/tournament-select.php:258
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bad-tournament/admin/index_html/player-config.php on line 10
    • > PHP Notice
      Undefined variable: all_players in wp-content/plugins/bad-tournament/admin/index_html/player-config.php on line 34
    • > PHP Notice
      Trying to get property 'localization' of non-object in wp-content/plugins/bad-tournament/shortcodes/sc_html/tournament-summary.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bad-tournament/admin/index_html/player-config.php on line 100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_atts() in wp-content/plugins/bad-tournament/shortcodes/shortcode-matches.php:13
    • > PHP Notice
      Undefined index: pl_id in wp-content/plugins/bad-tournament/admin/action/player-edit-field.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: tournament, table tennis, tennis, club, shortcode...

bad-tournament/bad-tournament.php Passed 13 tests

The main PHP script in "Bad Tournament" version 1.4 is automatically included on every request by WordPress
51 characters long description:
Badminton / Tennis / Table tennis Tournament Plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected7,288 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,0087023,872
JavaScript33023672,375
CSS35823739
PO File1140163302

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions1565.22%
▷ Anonymous functions834.78%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/background_spinner_ldo.png52.23KB34.27KB▼ 34.39%
icons/bad-tournament-warning-icon.png1.12KB1.44KB0.00%
icons/bad-tournament-ok-icon.png1.32KB1.49KB0.00%
icons/bad-tournament-close-icon.png0.89KB0.77KB▼ 14.04%
icons/bad-tournament-plus-icon.png0.74KB0.74KB0.00%