74% sports-leagues

Code Review | AnWP Sports Leagues - for basketball, hockey and others

WordPress plugin AnWP Sports Leagues - for basketball, hockey and others scored74%from 54 tests.

About plugin

  • Plugin page: sports-leagues
  • Plugin version: 0.12.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Apr 2, 2019
  • Latest release: Oct 23, 2023
  • Number of updates: 56
  • Update frequency: every 30.0 days
  • Top authors: anwppro (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /8,074 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.14MB] [CPU: ▲28.52ms] Passed 4 tests

This is a short check of server-side resources used by AnWP Sports Leagues - for basketball, hockey and others
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /7.52 ▲4.0663.68 ▲24.02
Dashboard /wp-admin7.47 ▲4.1771.66 ▲27.36
Posts /wp-admin/edit.php7.52 ▲4.1679.12 ▲33.20
Add New Post /wp-admin/post-new.php10.19 ▲4.30130.94 ▲46.47
Media Library /wp-admin/upload.php7.40 ▲4.1769.78 ▲29.51
Games /wp-admin/edit.php?post_type=sl_game7.5166.89
Documentation /wp-admin/admin.php?page=redirect_sl_docs7.1246.91
All Tournaments /wp-admin/edit.php?post_type=sl_tournament7.5173.05
All Teams /wp-admin/edit.php?post_type=sl_team7.4960.01
Add New Player /wp-admin/post-new.php?post_type=sl_player7.5578.49
All Officials /wp-admin/edit.php?post_type=sl_official7.4964.40
Add New /wp-admin/post-new.php?post_type=sl_standing7.4867.98
All Players /wp-admin/edit.php?post_type=sl_player7.4960.13
Seasons /wp-admin/edit-tags.php?taxonomy=sl_season&post_type=sl_tournament7.5259.56
Standings /wp-admin/edit.php?post_type=sl_standing7.4972.27

Server storage [IO: ▲8.08MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 375 new files
Database: 4 new tables, 17 new options
New tables
wp_sl_events
wp_sl_games
wp_sl_player_stats
wp_sl_missing_players
New WordPress options
widget_sl-widget-games
widget_sl-widget-video
theysaidso_admin_options
sl_version
widget_sl-widget-next-game
widget_recent-posts
widget_sl-widget-player
widget_sl-widget-teams
widget_theysaidso_widget
widget_sl-widget-last-game
...

Browser metrics Passed 4 tests

An overview of browser requirements for AnWP Sports Leagues - for basketball, hockey and others
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,638 ▲87714.56 ▲0.0823.40 ▲21.6838.64 ▼3.26
Dashboard /wp-admin2,816 ▲6354.96 ▼0.71103.45 ▲7.4080.18 ▲38.50
Posts /wp-admin/edit.php2,729 ▲6292.70 ▲0.7336.39 ▼2.6638.37 ▼2.03
Add New Post /wp-admin/post-new.php1,930 ▲40419.73 ▼3.40545.80 ▼99.1328.34 ▼27.93
Media Library /wp-admin/upload.php2,106 ▲7124.49 ▲0.32100.55 ▲2.1864.42 ▲21.88
Games /wp-admin/edit.php?post_type=sl_game1,9053.1549.9652.17
Documentation /wp-admin/admin.php?page=redirect_sl_docs10,7416.80230.35127.97
All Tournaments /wp-admin/edit.php?post_type=sl_tournament1,7922.9944.3933.32
All Teams /wp-admin/edit.php?post_type=sl_team1,7772.6634.5234.24
Add New Player /wp-admin/post-new.php?post_type=sl_player2,6114.8170.2385.35
All Officials /wp-admin/edit.php?post_type=sl_official1,7642.6833.5633.83
Add New /wp-admin/post-new.php?post_type=sl_standing1,9263.9370.7178.45
All Players /wp-admin/edit.php?post_type=sl_player1,8102.6634.1233.84
Seasons /wp-admin/edit-tags.php?taxonomy=sl_season&post_type=sl_tournament1,8842.3829.5033.73
Standings /wp-admin/edit.php?post_type=sl_standing1,7162.6633.5732.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 4 tables
    • wp_sl_games
    • wp_sl_player_stats
    • wp_sl_events
    • wp_sl_missing_players
  • The uninstall procedure has failed, leaving 17 options in the database
    • widget_recent-comments
    • widget_sl-widget-standing
    • sl_db_version
    • widget_sl-widget-next-game
    • widget_theysaidso_widget
    • widget_sl-widget-birthdays
    • db_upgraded
    • widget_sl-widget-games
    • widget_sl-widget-players-stats
    • widget_sl-widget-teams
    • ...

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 33× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Leagues_Widget' not found in wp-content/plugins/sports-leagues/includes/widgets/class-sports-leagues-widget-games.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sports-leagues/includes/shortcodes/class-sports-leagues-shortcode-standing.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sports-leagues/includes/shortcodes/class-sports-leagues-shortcode-tournament-list.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sports-leagues/includes/blocks/class-sports-leagues-block-players-stats.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/sports-leagues/theme-support/layout-b.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sports-leagues/includes/blocks/class-sports-leagues-block-game-countdown.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sports-leagues/includes/shortcodes/class-sports-leagues-shortcode-teams.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/sports-leagues/theme-support/layout-a.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Sports_Leagues_Widget' not found in wp-content/plugins/sports-leagues/includes/widgets/class-sports-leagues-widget-video.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sports-leagues/includes/cmb2-fields/class-anwp-sl-cmb2-field-select2.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: baseball, sports, sport, rugby, cricket...

sports-leagues/sports-leagues.php Passed 13 tests

The main file in "AnWP Sports Leagues - for basketball, hockey and others" v. 0.12.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
136 characters long description:
Full-featured solution for any team sports website. Manage players, games, teams, rosters, tournaments, standings and leagues with ease.

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 detected101,128 lines of code in 333 files:
LanguageFilesBlank linesComment linesLines of code
CSS273,71132946,525
PHP1776,32210,62729,967
JavaScript354,1454,31922,601
Markdown52620691
JSON800541
Sass2100506
SVG7900297

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity52.16
▷ Minimum class complexity1.00
▷ Maximum class complexity398.00
Average method complexity5.46
▷ Minimum method complexity1.00
▷ Maximum method complexity93.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes51
▷ Abstract classes11.96%
▷ Concrete classes5098.04%
▷ Final classes12.00%
Methods608
▷ Static methods132.14%
▷ Public methods52085.53%
▷ Protected methods6210.20%
▷ Private methods264.28%
Functions41
▷ Named functions1126.83%
▷ Anonymous functions3073.17%
Constants7
▷ Global constants114.29%
▷ Class constants685.71%
▷ Public constants6100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
31 PNG files occupy 0.92MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/datatables/DataTables-1.13.2/images/sort_asc_disabled.png0.14KB0.25KB0.00%
admin/img/tutorial/2019-04-02_13-20-10.png31.92KB12.00KB▼ 62.40%
public/img/empty_logo.png2.11KB1.92KB▼ 8.97%
admin/img/tutorial/step_6.png56.39KB25.04KB▼ 55.59%
admin/img/cmb2-icon.png3.87KB1.77KB▼ 54.30%