62% mstw-schedules-scoreboards

Code Review | MSTW Schedules & Scoreboards

WordPress plugin MSTW Schedules & Scoreboards scored62%from 54 tests.

About plugin

  • Plugin page: mstw-schedules-sc...
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.2-5.8
  • WordPress version: 6.3.1
  • First release: Dec 8, 2014
  • Latest release: Feb 27, 2022
  • Number of updates: 77
  • Update frequency: every 34.5 days
  • Top authors: MarkODonnell (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /11,557 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.56MB] [CPU: ▼50.39ms] Passed 4 tests

An overview of server-side resources used by MSTW Schedules & Scoreboards
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.45 ▼1.0211.90 ▼25.73
Dashboard /wp-admin2.46 ▼0.8911.70 ▼47.07
Posts /wp-admin/edit.php2.46 ▼0.9013.55 ▼30.71
Add New Post /wp-admin/post-new.php2.46 ▼3.4311.48 ▼98.06
Media Library /wp-admin/upload.php2.46 ▼0.7710.95 ▼24.09
Games /wp-admin/edit.php?post_type=mstw_ss_game2.4613.48
Schedules /wp-admin/edit.php?post_type=mstw_ss_schedule2.4611.27
Teams /wp-admin/edit.php?post_type=mstw_ss_team2.4612.23
CSV Import /wp-admin/edit.php?post_type=mstw_ss_game&page=mstw_ss_import_csv_page2.469.18
Settings /wp-admin/edit.php?post_type=mstw_ss_game&page=mstw-ss-settings2.4613.62
Sports /wp-admin/edit.php?post_type=mstw_ss_sport2.4616.81
Venues /wp-admin/edit.php?post_type=mstw_ss_venue2.4612.69

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 63 new files
Database: no new tables, 13 new options
New WordPress options
mstw_ss_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
mstw_ss_version
widget_recent-posts
theysaidso_admin_options
mstw_ss_venue_options
mstw_ss_dtg_options
...

Browser metrics Passed 4 tests

Checking browser requirements for MSTW Schedules & Scoreboards
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,094 ▲34815.45 ▲1.056.52 ▲4.5542.39 ▲2.13
Dashboard /wp-admin2,383 ▲1956.46 ▲0.56135.15 ▲32.5591.57 ▲48.51
Posts /wp-admin/edit.php2,317 ▲2283.48 ▲1.4859.44 ▲17.8076.37 ▲43.57
Add New Post /wp-admin/post-new.php1,577 ▲5823.03 ▼0.09662.68 ▼8.3341.33 ▼12.57
Media Library /wp-admin/upload.php1,453 ▲744.12 ▼0.0382.81 ▼15.5290.15 ▲47.58
Games /wp-admin/edit.php?post_type=mstw_ss_game1,3713.4444.8974.52
Schedules /wp-admin/edit.php?post_type=mstw_ss_schedule1,2983.5846.4861.97
Teams /wp-admin/edit.php?post_type=mstw_ss_team1,3123.4546.6076.58
CSV Import /wp-admin/edit.php?post_type=mstw_ss_game&page=mstw_ss_import_csv_page1,2803.0742.4665.98
Settings /wp-admin/edit.php?post_type=mstw_ss_game&page=mstw-ss-settings1,5453.3643.0179.83
Sports /wp-admin/edit.php?post_type=mstw_ss_sport1,3123.4648.7375.28
Venues /wp-admin/edit.php?post_type=mstw_ss_venue1,3123.5844.6763.66

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-schedule-widget.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; mstw_ss_sched_widget has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 13 options
    • widget_theysaidso_widget
    • mstw_ss_color_options
    • mstw_ss_dtg_options
    • widget_recent-comments
    • widget_recent-posts
    • mstw_ss_version
    • theysaidso_admin_options
    • mstw_ss_options
    • db_upgraded
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mstw_ss_venue
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-schedule-widget.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; mstw_ss_sched_widget has a deprecated constructor
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mstw_ss_venue
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-cdt-widget.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; mstw_ss_cdt_widget has a deprecated constructor
    • > GET request to /wp-admin/edit.php?post_type=mstw_ss_game&page=mstw-ss-settings
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit.php?post_type=mstw_ss_game&page=mstw-ss-settings
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-schedule-cpt-admin.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-schedule-slider.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-venue-cpt-admin.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-cdt-widget.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-countdown-timer.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-schedule-widget.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mstw-schedules-scoreboards/templates/single-game.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-schedule-table.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/mstw-schedules-scoreboards/includes/mstw-ss-globals.php:29
    • > PHP Warning
      include_once(): Failed opening 'WP_PLUGIN_DIR/mstw-schedules-scoreboards/includes/mstw-ss-globals.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/mstw-schedules-scoreboards/mstw-schedules-scoreboards.php on line 33

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=mstw_ss_game&page=mstw-ss-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:11743 Uncaught Error: Syntax error, unrecognized expression: $sbt_date_header_color

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: countdown timer, team schedule, schedule, scoreboards, sports...

mstw-schedules-scoreboards/mstw-schedules-scoreboards.php Passed 13 tests

"MSTW Schedules & Scoreboards" version 1.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
81 characters long description:
Replaces the MSTW Game Schedules plugin. Includes game schedules and scoreboards.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin11,584 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP281,9084,9717,784
PO File16638351,851
CSS21571441,745
JavaScript9106147204

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity61.25
▷ Minimum class complexity5.00
▷ Maximum class complexity149.00
Average method complexity5.38
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods4989.09%
▷ Protected methods610.91%
▷ Private methods00.00%
Functions183
▷ Named functions183100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 0.51MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/mstw-logo-32x32.png52.27KB0.48KB▼ 99.09%
images/logos/mstw-logo-square-150x150.png57.04KB1.63KB▼ 97.15%
images/next.png49.45KB0.20KB▼ 99.59%
images/logos/default-table-logo.png51.75KB0.48KB▼ 99.07%
images/logos/mstw-logo-41x28.png51.75KB0.48KB▼ 99.07%