68% coaching-staffs

Code Review | Coaching Staffs

WordPress plugin Coaching Staffs scored 68% from 54 tests.

About plugin

  • Plugin page: coaching-staffs
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.8
  • WordPress version: 6.3.1
  • First release: Aug 19, 2013
  • Latest release: Aug 5, 2021
  • Number of updates: 50
  • Update frequency: every 58.2 days
  • Top authors: MarkODonnell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 5,630 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 gracefully, with no errors

Server metrics [RAM: ▼0.48MB] [CPU: ▼34.45ms] Passed 4 tests

This is a short check of server-side resources used by Coaching Staffs
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1929.31 ▼13.66
Dashboard /wp-admin3.48 ▲0.1729.07 ▼21.68
Posts /wp-admin/edit.php3.48 ▲0.1225.13 ▼32.09
Add New Post /wp-admin/post-new.php3.48 ▼2.4126.81 ▼70.35
Media Library /wp-admin/upload.php3.48 ▲0.2529.78 ▼5.95
Staff Positions /wp-admin/edit.php?post_type=staff_position3.4834.61
Staffs /wp-admin/edit-tags.php?taxonomy=staffs&post_type=staff_position3.4827.16
Coaches /wp-admin/edit.php?post_type=coach3.4825.29
Display Settings /wp-admin/admin.php?page=mstw-cs-display-settings3.4827.08

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Coaching Staffs
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲11113.42 ▼0.971.64 ▼0.6043.31 ▼8.98
Dashboard /wp-admin2,249 ▲585.05 ▲0.14110.18 ▲6.2887.81 ▲46.50
Posts /wp-admin/edit.php2,132 ▲462.29 ▲0.2934.97 ▼7.8134.81 ▼2.27
Add New Post /wp-admin/post-new.php1,577 ▲5723.14 ▼0.06699.12 ▼29.7037.69 ▼16.75
Media Library /wp-admin/upload.php1,446 ▲584.50 ▲0.23110.29 ▲3.70100.57 ▲53.44
Staff Positions /wp-admin/edit.php?post_type=staff_position1,1242.2534.6631.63
Staffs /wp-admin/edit-tags.php?taxonomy=staffs&post_type=staff_position1,2962.0030.5230.92
Coaches /wp-admin/edit.php?post_type=coach1,1492.2733.8630.90
Display Settings /wp-admin/admin.php?page=mstw-cs-display-settings3,4473.37118.5336.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/coaching-staffs/includes/mstw-coaching-staffs-admin.php+601
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 264 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mstw-cs-display-settings
    • > Notice in wp-content/plugins/coaching-staffs/includes/mstw-coaching-staffs-admin.php+1439
    Trying to access array offset on value of type bool

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
Almost there! Just fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/coaching-staffs/theme-templates/single-coach.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/coaching-staffs/includes/mstw-coaching-staffs-admin.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/coaching-staffs/theme-templates/taxonomy-staffs.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/coaching-staffs/mstw-coaching-staffs.php:33

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: sports roster, sports team roster, sports teams, sports, roster...

coaching-staffs/mstw-coaching-staffs.php 85% from 13 tests

"Coaching Staffs" version 1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 141 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("coaching-staffs.php" instead of "mstw-coaching-staffs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,855 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP86781,0622,607
CSS24355220
JavaScript15128

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions84
▷ Named functions84100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.28MB with 0.28MB 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/mstw-admin-menu-icon.png51.45KB0.27KB▼ 99.47%
images/mstw-logo-16x16.png51.45KB0.27KB▼ 99.47%
images/mstw-logo-square.png57.07KB1.56KB▼ 97.27%
images/logo-square-615x615.png77.52KB4.83KB▼ 93.77%