78% sportspress

Code Review | SportsPress - Sports Club & League Manager

WordPress plugin SportsPress - Sports Club & League Manager scored 78% from 54 tests.

About plugin

  • Plugin page: sportspress
  • Plugin version: 2.7.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.1
  • WordPress version: 6.3.1
  • First release: Nov 23, 2013
  • Latest release: Mar 11, 2023
  • Number of updates: 292
  • Update frequency: every 11.9 days
  • Top authors: ThemeBoy (59.59%)brianmiyaji (40.75%)

Code review

54 tests

User reviews

349 reviews

Install metrics

10,000+ active / 782,033 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲4.66MB] [CPU: ▲45.14ms] Passed 4 tests

Analyzing server-side resources used by SportsPress - Sports Club & League Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /7.29 ▲3.8295.29 ▲14.58
Dashboard /wp-admin10.36 ▲7.05109.42 ▲55.20
Posts /wp-admin/edit.php8.00 ▲4.64100.13 ▲50.28
Add New Post /wp-admin/post-new.php11.54 ▲5.65184.17 ▲92.31
Media Library /wp-admin/upload.php7.76 ▲4.5396.23 ▲60.51
Overview /wp-admin/admin.php?page=sportspress-overview7.7385.03
Seasons /wp-admin/edit-tags.php?taxonomy=sp_season7.7684.19
League Tables /wp-admin/edit.php?post_type=sp_table7.8790.26
Add New /wp-admin/post-new.php?post_type=sp_event8.46119.14
Configure /wp-admin/admin.php?page=sportspress-config7.9891.78
Positions /wp-admin/edit-tags.php?taxonomy=sp_position&post_type=sp_player7.7686.83
Player Lists /wp-admin/edit.php?post_type=sp_list7.8791.89
Players /wp-admin/edit.php?post_type=sp_player7.8794.22
Calendars /wp-admin/edit.php?post_type=sp_calendar7.87123.31
SportsPress /wp-admin/admin.php?page=sportspress8.5192.06

Server storage [IO: ▲4.71MB] [DB: ▲0.15MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 664 new files
Database: no new tables, 197 new options
New WordPress options
sportspress_player_show_positions
sportspress_text[Current Team]
sportspress_event_show_player_numbers
sportspress_team_page_template
sportspress_event_blocks_show_matchday
sportspress_link_venues
sportspress_player_performance_sections
sportspress_event_logos_show_results
sportspress_table_increment
widget_sportspress-team-gallery
...

Browser metrics Passed 4 tests

Checking browser requirements for SportsPress - Sports Club & League Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,387 ▲59814.45 ▲1.2510.05 ▲1.0682.15 ▲33.30
Dashboard /wp-admin2,634 ▲4315.45 ▲0.62108.83 ▼8.9245.36 ▲2.13
Posts /wp-admin/edit.php2,294 ▲2052.06 ▲0.0738.16 ▲1.3333.03 ▼1.99
Add New Post /wp-admin/post-new.php1,723 ▲20923.26 ▲5.72723.61 ▲114.7440.43 ▼7.00
Media Library /wp-admin/upload.php1,593 ▲2114.16 ▼0.05104.31 ▲6.1941.63 ▼2.78
Overview /wp-admin/admin.php?page=sportspress-overview1,0992.1925.3548.70
Seasons /wp-admin/edit-tags.php?taxonomy=sp_season1,5452.5038.0532.79
League Tables /wp-admin/edit.php?post_type=sp_table1,3302.5445.9631.03
Add New /wp-admin/post-new.php?post_type=sp_event3,2707.60217.82114.98
Configure /wp-admin/admin.php?page=sportspress-config1,5372.4536.8833.60
Positions /wp-admin/edit-tags.php?taxonomy=sp_position&post_type=sp_player1,5512.4845.2535.63
Player Lists /wp-admin/edit.php?post_type=sp_list1,3432.6739.8029.38
Players /wp-admin/edit.php?post_type=sp_player1,3592.5542.2730.39
Calendars /wp-admin/edit.php?post_type=sp_calendar1,3542.6743.2528.14
SportsPress /wp-admin/admin.php?page=sportspress1,8332.5935.1241.48

Uninstaller [IO: ✅] [DB: ▲0.13MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 16 options
    • widget_sportspress-player-gallery
    • widget_recent-comments
    • widget_sportspress-countdown
    • widget_sportspress-event-blocks
    • widget_sportspress-event-calendar
    • widget_sportspress-league-table
    • db_upgraded
    • widget_sportspress-team-gallery
    • widget_sportspress-birthdays
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 33× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sportspress/includes/widgets/class-sp-widget-event-blocks.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Secondary_Post' not found in wp-content/plugins/sportspress/includes/class-sp-league-table.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Custom_Post' not found in wp-content/plugins/sportspress/includes/class-sp-event.php:13
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/sportspress/templates/event-logos-block.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'SP_Custom_Post' not found in wp-content/plugins/sportspress/includes/class-sp-player.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sportspress/includes/widgets/class-sp-widget-player-list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sportspress/templates/event-logos-block.php:45
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/sportspress/templates/event-logos-inline.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sportspress/includes/widgets/class-sp-widget-event-list.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sportspress/includes/widgets/class-sp-widget-league-table.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/post-new.php?post_type=sp_event
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=sp_event 2243:2 Uncaught TypeError: tinyMCE.addI18n(...) is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

sportspress/sportspress.php Passed 13 tests

The main PHP file in "SportsPress - Sports Club & League Manager" ver. 2.7.16 adds more information about the plugin and also serves as the entry point for this plugin
81 characters long description:
Manage your club and its players, staff, events, league tables, and player lists.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin49,745 lines of code in 328 files:
LanguageFilesBlank linesComment linesLines of code
PHP2576,4219,50640,195
CSS196412174,880
JavaScript223312323,144
JSON26001,346
SVG10086
XML10059
Markdown219035

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 182)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity19.76
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity182.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes198
▷ Abstract classes21.01%
▷ Concrete classes19698.99%
▷ Final classes10.51%
Methods1,000
▷ Static methods23223.20%
▷ Public methods94194.10%
▷ Protected methods232.30%
▷ Private methods363.60%
Functions280
▷ Named functions27899.29%
▷ Anonymous functions20.71%
Constants96
▷ Global constants9396.88%
▷ Class constants33.12%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
259 PNG files occupy 0.27MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flags/ksa.png0.37KB0.33KB▼ 11.81%
assets/images/flags/mya.png0.35KB0.25KB▼ 26.89%
assets/images/flags/mac.png0.42KB0.27KB▼ 35.51%
assets/images/welcome/sportspress-pro.png4.13KB3.51KB▼ 15.05%
assets/images/flags/est.png0.14KB0.10KB▼ 28.06%