62% joomsport-sports-league-results-management

Code Review | JoomSport - for Sports: Team & League, Football, Hockey & more

WordPress plugin JoomSport - for Sports: Team & League, Football, Hockey & more scored62%from 54 tests.

About plugin

  • Plugin page: joomsport-sports-...
  • Plugin version: 5.3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 29, 2016
  • Latest release: Sep 21, 2023
  • Number of updates: 122
  • Update frequency: every 20.3 days
  • Top authors: beardev (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

2,000+ active /84,858 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲4.11MB] [CPU: ▲40.40ms] Passed 4 tests

Analyzing server-side resources used by JoomSport - for Sports: Team & League, Football, Hockey & more
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /7.52 ▲4.0680.57 ▲35.47
Dashboard /wp-admin7.45 ▲4.11103.19 ▲28.08
Posts /wp-admin/edit.php7.52 ▲4.16114.33 ▲62.49
Add New Post /wp-admin/post-new.php10.06 ▲4.17132.84 ▲35.57
Media Library /wp-admin/upload.php7.34 ▲4.11105.19 ▲64.34
Leagues /wp-admin/edit-tags.php?taxonomy=joomsport_tournament&post_type=joomsport_season7.3791.34
Extra field New /wp-admin/options.php?page=joomsport-extrafields-form7.3990.69
Event New /wp-admin/options.php?page=joomsport-events-form7.3889.96
Venues /wp-admin/edit.php?post_type=joomsport_venue7.4595.39
Matchdays /wp-admin/edit-tags.php?taxonomy=joomsport_matchday&post_type=joomsport_match7.3689.81
Game stages /wp-admin/admin.php?page=joomsport-page-gamestages7.3586.88
Game stages New /wp-admin/options.php?page=joomsport-gamestages-form7.3990.86
Box score stats /wp-admin/admin.php?page=joomsport-page-boxfields7.3586.65
Import /wp-admin/admin.php?page=joomsport_import7.3488.28
Help /wp-admin/admin.php?page=joomsport_help7.3586.65

Server storage [IO: ▲3.53MB] [DB: ▲0.03MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/joomsport-sports-league-results-management/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 314 new files
Database: 18 new tables, 12 new options
New tables
wp_joomsport_events_depending
wp_joomsport_teamstats
wp_joomsport_box_fields
wp_joomsport_match_events
wp_joomsport_maps
wp_joomsport_seasons
wp_joomsport_season_table
wp_joomsport_match_statuses
wp_joomsport_extra_fields
wp_joomsport_squad
...
New WordPress options
db_upgraded
joomsport_flush_rewrite_rules
theysaidso_admin_options
widget_wpb_joomsport_standings
joomsport_recalc_seasons
widget_recent-comments
widget_recent-posts
widget_wpb_joomsport_matches
widget_wpb_jommsport_players
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for JoomSport - for Sports: Team & League, Football, Hockey & more
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,268 ▲48216.12 ▲1.445.10 ▲2.9933.97 ▼10.10
Dashboard /wp-admin2,567 ▲3646.47 ▲0.61145.01 ▲25.0283.98 ▲41.62
Posts /wp-admin/edit.php2,501 ▲4014.18 ▲2.1369.87 ▲33.3186.60 ▲52.55
Add New Post /wp-admin/post-new.php1,874 ▲34423.71 ▲2.73704.78 ▲27.0337.96 ▼10.70
Media Library /wp-admin/upload.php1,573 ▲1765.13 ▲0.8792.53 ▼32.8695.10 ▲44.74
Leagues /wp-admin/edit-tags.php?taxonomy=joomsport_tournament&post_type=joomsport_season1,5583.7154.2178.98
Extra field New /wp-admin/options.php?page=joomsport-extrafields-form1,5473.6156.3372.80
Event New /wp-admin/options.php?page=joomsport-events-form1,3743.8358.7580.05
Venues /wp-admin/edit.php?post_type=joomsport_venue1,4113.8460.0462.37
Matchdays /wp-admin/edit-tags.php?taxonomy=joomsport_matchday&post_type=joomsport_match1,6803.9252.7676.90
Game stages /wp-admin/admin.php?page=joomsport-page-gamestages1,3403.6265.9873.71
Game stages New /wp-admin/options.php?page=joomsport-gamestages-form1,2653.5953.8366.20
Box score stats /wp-admin/admin.php?page=joomsport-page-boxfields1,3483.5661.8480.19
Import /wp-admin/admin.php?page=joomsport_import1,1323.5049.5559.98
Help /wp-admin/admin.php?page=joomsport_help1,3433.6750.7979.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables detected upon uninstall: 18 tables
    • wp_joomsport_playerlist
    • wp_joomsport_extra_fields
    • wp_joomsport_season_table
    • wp_joomsport_extra_select
    • wp_joomsport_seasons
    • wp_joomsport_matches
    • wp_joomsport_events
    • wp_joomsport_match_events
    • wp_joomsport_groups
    • wp_joomsport_box_match
    • ...
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_recent-posts
    • db_upgraded
    • joomsport_recalc_seasons
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_wpb_jommsport_teamstat
    • widget_wpb_joomsport_standings
    • joomsport_flush_rewrite_rules
    • widget_wpb_joomsport_matches
    • ...

Smoke tests 25% 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 no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/joomsport-sports-league-results-management/sportleague/views/default/widgets/teamstat.php
    • > /wp-content/plugins/joomsport-sports-league-results-management/sportleague/views/default/widgets/players.php
    • > /wp-content/plugins/joomsport-sports-league-results-management/sportleague/views/default/widgets/standings.php
    • > /wp-content/plugins/joomsport-sports-league-results-management/joomsport.php
  • 136× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant JOOMSPORT_PATH_MODELS - assumed 'JOOMSPORT_PATH_MODELS' (this will throw an Error in a future version of PHP) in wp-content/plugins/joomsport-sports-league-results-management/sportleague/classes/objects/class-jsport-club.php on line 7
    • > PHP Warning
      Use of undefined constant JOOMSPORT_PATH_SL_HELPERS - assumed 'JOOMSPORT_PATH_SL_HELPERS' (this will throw an Error in a future version of PHP) in wp-content/plugins/joomsport-sports-league-results-management/sportleague/classes/h2h/class_jsport_h2h_all.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'JOOMSPORT_PATH_SL_HELPERSjs-helper-btw.php' (include_path='.:/usr/share/php') in wp-content/plugins/joomsport-sports-league-results-management/sportleague/classes/h2h/class_jsport_h2h_local.php on line 3
    • > PHP Warning
      require_once(JOOMSPORT_PATH_SL_HELPERSjs-helper-btw.php): failed to open stream: No such file or directory in wp-content/plugins/joomsport-sports-league-results-management/sportleague/classes/h2h/class_jsport_h2h_all.php on line 3
    • > PHP Notice
      Undefined variable: res in wp-content/plugins/joomsport-sports-league-results-management/sportleague/views/default/widgets/teamstat.php on line 12
    • > PHP Notice
      Trying to get property 'opposite' of non-object in wp-content/plugins/joomsport-sports-league-results-management/sportleague/views/default/elements/match_stat/last_matches_reverse.php on line 10
    • > PHP Warning
      require_once(JOOMSPORT_PATH_MODELSmodel-jsport-clublist.php): failed to open stream: No such file or directory in wp-content/plugins/joomsport-sports-league-results-management/sportleague/classes/objects/class-jsport-clublist.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'JOOMSPORT_PATH_INCLUDESmoderator/helpers/joomsport-moderate-helper.php' (include_path='.:/usr/share/php') in wp-content/plugins/joomsport-sports-league-results-management/includes/moderator/joomsport-moderate-acl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'JoomsportModerateHelper' not found in wp-content/plugins/joomsport-sports-league-results-management/sportleague/views/default/moder/team_list.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/joomsport-sports-league-results-management/includes/pages/joomsport-page-events.php on line 8

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=joomsport_help
    • > Network (severe)
    https://useresponse.com/404 - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: hockey, tournament, sports, sports team, league...

joomsport-sports-league-results-management/joomsport.php 92% from 13 tests

This is the main PHP file of "JoomSport - for Sports: Team & League, Football, Hockey & more" version 5.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("joomsport-sports-league-results-management.php" instead of "joomsport.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin48,491 lines of code in 236 files:
LanguageFilesBlank linesComment linesLines of code
PHP1875,1492,17528,155
CSS2217224714,778
JavaScript227182483,886
PO File1395715834
SVG200808
Markdown112026
HTML1004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.70
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes162
▷ Abstract classes21.23%
▷ Concrete classes16098.77%
▷ Final classes00.00%
Methods952
▷ Static methods47449.79%
▷ Public methods88492.86%
▷ Protected methods171.79%
▷ Private methods515.36%
Functions38
▷ Named functions2771.05%
▷ Anonymous functions1128.95%
Constants45
▷ Global constants4088.89%
▷ Class constants511.11%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
54 PNG files occupy 0.22MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/reverse_order.png3.30KB0.70KB▼ 78.85%
sportleague/assets/images/photos_ico_active.png1.48KB0.75KB▼ 49.27%
sportleague/assets/images/out-raw.png3.44KB0.87KB▼ 74.74%
sportleague/assets/images/chart_ico_active.png1.43KB0.73KB▼ 49.01%
sportleague/assets/images/box_inactive.png2.89KB0.15KB▼ 94.93%