78% mstw-league-manager

Code Review | MSTW League Manager

WordPress plugin MSTW League Manager scored 78% from 54 tests.

About plugin

  • Plugin page: mstw-league-manager
  • Plugin version: 2.10
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Jan 31, 2016
  • Latest release: Oct 14, 2022
  • Number of updates: 100
  • Update frequency: every 24.8 days
  • Top authors: MarkODonnell (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 10,285 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.20MB] [CPU: ▼3.61ms] Passed 4 tests

A check of server-side resources used by MSTW League Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1340.60 ▼2.00
Dashboard /wp-admin3.54 ▲0.2349.18 ▲2.47
Posts /wp-admin/edit.php3.66 ▲0.3049.76 ▲5.30
Add New Post /wp-admin/post-new.php6.12 ▲0.2384.73 ▼16.10
Media Library /wp-admin/upload.php3.44 ▲0.2135.04 ▲1.19
Update Games /wp-admin/admin.php?page=mstw-lm-update-games3.4536.19
CSV Import /wp-admin/admin.php?page=mstw-lm-csv-import3.4435.52
Add Games /wp-admin/admin.php?page=mstw-lm-add-games3.4534.78
Venues /wp-admin/edit.php?post_type=mstw_lm_venue3.5239.89
League Manager /wp-admin/admin.php?page=league-manager-page3.4433.15
Update Records /wp-admin/admin.php?page=mstw-lm-update-records3.4436.93
Seasons /wp-admin/admin.php?page=mstw-lm-seasons3.4133.29
Leagues /wp-admin/edit-tags.php?taxonomy=mstw_lm_league&post_type=mstw_lm_game3.4738.81
Teams /wp-admin/edit.php?post_type=mstw_lm_team3.5237.46
Manage Games /wp-admin/edit.php?post_type=mstw_lm_game3.5240.68

Server storage [IO: ▲1.51MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 68 new files
Database: no new tables, 7 new options
New WordPress options
mstw_league_manager_activated
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for MSTW League Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,113 ▲35615.41 ▲1.197.52 ▲5.4841.96 ▼1.56
Dashboard /wp-admin2,401 ▲2106.46 ▲1.58117.13 ▲9.18103.47 ▲62.06
Posts /wp-admin/edit.php2,335 ▲2463.48 ▲1.4747.85 ▲13.8673.29 ▲41.52
Add New Post /wp-admin/post-new.php1,590 ▲5723.36 ▲0.10641.15 ▼39.2530.43 ▼20.41
Media Library /wp-admin/upload.php1,471 ▲804.11 ▼0.1579.03 ▼17.6381.64 ▲34.36
Update Games /wp-admin/admin.php?page=mstw-lm-update-games1,1963.2442.4367.34
CSV Import /wp-admin/admin.php?page=mstw-lm-csv-import1,2903.0938.3970.69
Add Games /wp-admin/admin.php?page=mstw-lm-add-games1,1243.1941.7564.89
Venues /wp-admin/edit.php?post_type=mstw_lm_venue1,3803.4445.8967.71
League Manager /wp-admin/admin.php?page=league-manager-page1,1643.1641.6365.24
Update Records /wp-admin/admin.php?page=mstw-lm-update-records1,1043.0839.5757.99
Seasons /wp-admin/admin.php?page=mstw-lm-seasons1,1553.0542.0063.95
Leagues /wp-admin/edit-tags.php?taxonomy=mstw_lm_league&post_type=mstw_lm_game1,7933.3139.7468.18
Teams /wp-admin/edit.php?post_type=mstw_lm_team1,4063.3542.8771.23
Manage Games /wp-admin/edit.php?post_type=mstw_lm_game1,4783.4244.6172.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • mstw_league_manager_activated
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=mstw-lm-seasons
    • > Notice in wp-content/plugins/mstw-league-manager/includes/mstw-lm-seasons-admin.php+194
    Undefined variable: current_league

SRP 50% 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
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-team-cpt-admin.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-schedule-table.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mstw-league-manager/templates/taxonomy-league.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-venue-table.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mstw-league-manager/mstw-league-manager.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-venue-cpt-admin.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-admin.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-team-schedule.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-game-cpt-admin.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mstw-league-manager/includes/mstw-lm-standings-table.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

mstw-league-manager/mstw-league-manager.php Passed 13 tests

The main PHP script in "MSTW League Manager" version 2.10 is automatically included on every request by WordPress
73 characters long description:
Manages multiple sports leagues. Displays league schedules and standings.

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
Success! There were no dangerous files found in this plugin17,585 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP294,6998,31413,690
CSS42932352,318
JavaScript175486151,577

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity76.83
▷ Minimum class complexity15.00
▷ Maximum class complexity138.00
Average method complexity5.38
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods208
▷ Static methods00.00%
▷ Public methods20297.12%
▷ Protected methods62.88%
▷ Private methods00.00%
Functions238
▷ Named functions238100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.38MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
images/lmt-header-bkgd.png49.90KB0.30KB▼ 99.40%
images/lm-header-bkgd.png49.90KB0.30KB▼ 99.40%
images/mstw-logo-32x32.png52.27KB0.48KB▼ 99.09%
images/mstw-video-icon.png48.65KB16.96KB▼ 65.13%