73% sports-bench-lite

Code Review | Sports Bench Lite

WordPress plugin Sports Bench Lite scored73%from 54 tests.

About plugin

  • Plugin page: sports-bench-lite
  • Plugin version: 2.2
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Mar 30, 2022
  • Latest release: May 10, 2022
  • Number of updates: 6
  • Update frequency: every 6.8 days
  • Top authors: ArenaPigskin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /380 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲5.68MB] [CPU: ▲16.50ms] 75% from 4 tests

Analyzing server-side resources used by Sports Bench Lite
It is recommended to improve the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.68MB on /wp-admin/edit-tags.php?taxonomy=sports-bench-post-players)
PageMemory (MB)CPU Time (ms)
Home /9.85 ▲6.3567.29 ▲25.74
Dashboard /wp-admin9.71 ▲6.3779.75 ▲31.25
Posts /wp-admin/edit.php9.82 ▲6.4291.43 ▲39.26
Add New Post /wp-admin/post-new.php9.57 ▲3.6466.12 ▼30.27
Media Library /wp-admin/upload.php9.63 ▲6.3677.91 ▲39.87
Add New /wp-admin/admin.php?page=sports-bench-add-game-form9.6166.73
Teams /wp-admin/edit-tags.php?taxonomy=sports-bench-post-teams9.6263.89
Add New /wp-admin/admin.php?page=sports-bench-add-player-form9.6167.80
All Players /wp-admin/admin.php?page=sports-bench-players9.6063.42
/wp-admin/admin.php?page=sports-bench-edit-game-form9.6169.15
/wp-admin/admin.php?page=sports-bench-edit-player-form9.6171.04
Divisions/Conferences /wp-admin/admin.php?page=sports-bench-divisions9.6062.48
/wp-admin/admin.php?page=sports-bench-edit-team-form9.6177.56
All Teams /wp-admin/admin.php?page=sports-bench-teams9.6065.62
Players /wp-admin/edit-tags.php?taxonomy=sports-bench-post-players9.6262.30

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 215 new files
Database: 6 new tables, 11 new options
New tables
wp_sb_teams
wp_sb_game_stats
wp_sb_divisions
wp_sb_games
wp_sb_players
wp_sb_game_info
New WordPress options
widget_sports_bench_scoreboard_widget
can_compress_scripts
sports-bench-sport
widget_sports_bench_standings_widget
widget_sports_bench_stats_widget
sports_bench_version
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by Sports Bench Lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,267 ▲50613.74 ▼0.617.90 ▲6.0538.48 ▼2.53
Dashboard /wp-admin2,465 ▲2885.67 ▲0.0691.24 ▲2.9344.46 ▼1.08
Posts /wp-admin/edit.php2,334 ▲2342.08 ▲0.0637.63 ▼1.6934.24 ▼1.97
Add New Post /wp-admin/post-new.php2,166 ▲63818.46 ▼4.59699.28 ▼13.5855.68 ▲2.06
Media Library /wp-admin/upload.php1,599 ▲1964.26 ▲0.11101.84 ▼8.4140.13 ▼4.18
Add New /wp-admin/admin.php?page=sports-bench-add-game-form3,6582.7562.41142.90
Teams /wp-admin/edit-tags.php?taxonomy=sports-bench-post-teams1,4732.3431.4630.99
Add New /wp-admin/admin.php?page=sports-bench-add-player-form1,2992.7041.2235.93
All Players /wp-admin/admin.php?page=sports-bench-players1,1262.2229.7634.41
/wp-admin/admin.php?page=sports-bench-edit-game-form3,6572.7445.3165.51
/wp-admin/admin.php?page=sports-bench-edit-player-form1,2982.6846.8240.96
Divisions/Conferences /wp-admin/admin.php?page=sports-bench-divisions1,2222.4744.0737.02
/wp-admin/admin.php?page=sports-bench-edit-team-form1,5492.5151.9660.49
All Teams /wp-admin/admin.php?page=sports-bench-teams1,1242.2230.4433.99
Players /wp-admin/edit-tags.php?taxonomy=sports-bench-post-players1,4732.3435.1132.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie tables were found after uninstall: 6 tables
    • wp_sb_teams
    • wp_sb_game_stats
    • wp_sb_divisions
    • wp_sb_game_info
    • wp_sb_players
    • wp_sb_games
  • Zombie WordPress options were found after uninstall: 11 options
    • widget_sports_bench_stats_widget
    • can_compress_scripts
    • sports-bench-sport
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_sports_bench_scoreboard_widget
    • db_upgraded
    • sports_bench_version
    • theysaidso_admin_options
    • widget_sports_bench_standings_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 74× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Bench\\Classes\\Screens\\Screen' not found in wp-content/plugins/sports-bench-lite/includes/classes/screens/admin/class-games-screen.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Bench\\Classes\\Base\\Teams' not found in wp-content/plugins/sports-bench-lite/includes/classes/sports/volleyball/class-volleyball-teams.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/sports-bench-lite/includes/classes/rest-api/class-team-rest-api.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sports-bench-lite/public/partials/widgets/stats-widget.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Bench\\Classes\\Base\\Teams' not found in wp-content/plugins/sports-bench-lite/includes/classes/sports/basketball/class-basketball-teams.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Bench\\Classes\\Screens\\Admin\\PlayersScreen' not found in wp-content/plugins/sports-bench-lite/admin/partials/players/add-edit-player.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Bench\\Classes\\Screens\\Admin\\DivisionsScreen' not found in wp-content/plugins/sports-bench-lite/admin/partials/divisions/divisions-listing.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Bench\\Classes\\Screens\\Admin\\GamesScreen' not found in wp-content/plugins/sports-bench-lite/admin/partials/games/add-edit-game.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/sports-bench-lite/includes/classes/rest-api/class-division-rest-api.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Bench\\Classes\\Base\\Game' not found in wp-content/plugins/sports-bench-lite/includes/classes/sports/hockey/class-hockey-game.php:32

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
No plugin tags provided

sports-bench-lite/sports-bench-lite.php 92% from 13 tests

The main PHP script in "Sports Bench Lite" version 2.2 is automatically included on every request by WordPress
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 937 characters long)

Code Analysis 97% from 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 detected65,573 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1304,54514,65244,728
PO File67,06236,22220,676
Markdown3310103
CSS33103844
JavaScript2202222

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 223)
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity36.40
▷ Minimum class complexity1.00
▷ Maximum class complexity284.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity223.00
Code structure
Namespaces17
Interfaces0
Traits0
Classes95
▷ Abstract classes00.00%
▷ Concrete classes95100.00%
▷ Final classes00.00%
Methods962
▷ Static methods40.42%
▷ Public methods90894.39%
▷ Protected methods60.62%
▷ Private methods484.99%
Functions86
▷ Named functions8497.67%
▷ Anonymous functions22.33%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.03MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/sb-logo-light-blue.png26.76KB27.08KB0.00%