10% bracketpress

Code Review | BracketPress

WordPress plugin BracketPress scored 10% from 54 tests.

About plugin

  • Plugin page: bracketpress
  • Plugin version: 1.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.1.1
  • WordPress version: 5.8.1
  • First release: Feb 12, 2013
  • Latest release: Mar 14, 2015
  • Number of updates: 28
  • Update frequency: every 27.1 days
  • Top authors: ntemple (75%)scotthack (28.57%)

Code review

54 tests

User reviews

17 reviews

Install metrics

80+ active / 10,357 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/bracketpress/bracketpress.php+31
    constant(): Couldn't find constant BRACKETPRESS_DEBUG

Server metrics [RAM: ▼1.65MB] [CPU: ▼186.60ms] Passed 4 tests

Analyzing server-side resources used by BracketPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.98 ▼0.855.29 ▼29.82
Dashboard /wp-admin2.00 ▼1.056.30 ▼37.42
Posts /wp-admin/edit.php2.00 ▼1.105.63 ▼36.55
Add New Post /wp-admin/post-new.php2.00 ▼3.435.44 ▼642.60
Media Library /wp-admin/upload.php2.00 ▼1.005.44 ▼28.41
Team Data /wp-admin/edit.php?post_type=brackets&page=bracketpress_teams2.015.83
Add Ons /wp-admin/edit.php?post_type=brackets&page=bracketpress_addons2.015.66
Settings & Scoring /wp-admin/edit.php?post_type=brackets&page=bracketpress2.016.21
Add New /wp-admin/post-new.php?post_type=brackets2.006.10
Brackets /wp-admin/edit.php?post_type=brackets2.0110.19

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 31 new files
Database: 3 new tables, 10 new options
New tables
wp_bracketpress_match
wp_bracketpress_team
wp_bracketpress_location
New WordPress options
bracketpress_regionname_4
widget_mynewwidget
bracketpress_region_2
bracketpress_regionname_1
bracketpress_region_4
bracketpress_regionname_2
bracketpress_options
bracketpress_region_3
bracketpress_region_1
bracketpress_regionname_3

Browser metrics Passed 4 tests

A check of browser resources used by BracketPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,757 ▲18515.90 ▲0.147.81 ▲0.0151.94 ▼0.50
Dashboard /wp-admin3,042 ▲1116.00 ▲0.02138.35 ▼3.49114.72 ▲0.41
Posts /wp-admin/edit.php2,789 ▲502.72 ▲0.0162.12 ▲1.0492.03 ▼3.73
Add New Post /wp-admin/post-new.php1,532 ▼8318.55 ▼3.36361.51 ▲93.02112.12 ▲3.68
Media Library /wp-admin/upload.php1,860 ▲535.03 ▼0.02142.55 ▼17.54117.08 ▼11.79
Team Data /wp-admin/edit.php?post_type=brackets&page=bracketpress_teams9,2992.0959.4771.12
Add Ons /wp-admin/edit.php?post_type=brackets&page=bracketpress_addons1,0982.1053.7262.12
Settings & Scoring /wp-admin/edit.php?post_type=brackets&page=bracketpress1,3132.0852.9980.94
Add New /wp-admin/post-new.php?post_type=brackets3,3259.06204.51153.20
Brackets /wp-admin/edit.php?post_type=brackets2,4432.7161.8482.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/bracketpress/bracketpress.php+31
    constant(): Couldn't find constant BRACKETPRESS_DEBUG
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_bracketpress_match
    • wp_bracketpress_location
    • wp_bracketpress_team
  • Zombie WordPress options were found after uninstall: 10 options
    • bracketpress_region_2
    • bracketpress_region_1
    • bracketpress_regionname_4
    • bracketpress_region_4
    • bracketpress_regionname_1
    • bracketpress_regionname_2
    • bracketpress_regionname_3
    • bracketpress_options
    • bracketpress_region_3
    • widget_mynewwidget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=brackets
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/bracketpress/bracketpress.php+31
    constant(): Couldn't find constant BRACKETPRESS_DEBUG
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=brackets
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/bracketpress/lib/bracketpress-widgets.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; MyNewWidget has a deprecated constructor
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress_teams
    • > Notice in wp-content/plugins/bracketpress/templates/teams.php+37
    Undefined index: changeposition
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress_teams
    • > Notice in wp-content/plugins/bracketpress/templates/teams.php+189
    Undefined variable: rowcount
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: date_brackets_close
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Warning in wp-content/plugins/bracketpress/includes/admin/settings.php+132
    Use of undefined constant size - assumed 'size' (this will throw an Error in a future version of PHP)
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Warning in wp-content/plugins/bracketpress/includes/admin/settings.php+132
    Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: time_brackets_close
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: points_first_round
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: points_second_round
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: points_third_round
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: points_fourth_round
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: points_fifth_round
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: points_sixth_round
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: template
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: edit_title
    • > GET request to /wp-admin/edit.php?post_type=brackets&page=bracketpress
    • > Notice in wp-content/plugins/bracketpress/includes/admin/settings.php+80
    Undefined index: show_bracketpress_logo

SRP 0% 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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/bracketpress/templates/addons.php
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bracketpress/templates/bracket_edit.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bracketpress/lib/bracketpress-widgets.php:3
    • > PHP Warning
      Use of undefined constant BRACKETPRESS_CSS_URL - assumed 'BRACKETPRESS_CSS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/bracketpress/templates/locations.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bracketpress/lib/functions.php:96
    • > PHP Warning
      Use of undefined constant BRACKETPRESS_CSS_URL - assumed 'BRACKETPRESS_CSS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/bracketpress/templates/locations.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/bracketpress/lib/bracketpress-shortcodes.php:28
    • > PHP Warning
      Use of undefined constant BRACKETPRESS_CSS_URL - assumed 'BRACKETPRESS_CSS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/bracketpress/templates/locations.php on line 2
    • > PHP Notice
      Undefined index: changeposition in wp-content/plugins/bracketpress/templates/teams.php on line 37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bracketpress/templates/teams.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bracketpress/bracketpress-config.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were 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
10 plugin tags: tournament, gambling, bracket, sports, march madness...

bracketpress/bracketpress.php Passed 13 tests

"BracketPress" version 1.7.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
40 characters long description:
Run and score a tournament bracket pool.

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
There were no executable files found in this plugin3,710 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP217116512,308
CSS362641,060
JavaScript110827342

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity15.67
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods94
▷ Static methods1718.09%
▷ Public methods8489.36%
▷ Protected methods00.00%
▷ Private methods1010.64%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants23100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/images/region_key.png9.73KB4.06KB▼ 58.25%
media/images/Button-Add-icon.png1.36KB1.29KB▼ 5.46%