78% ensemble

Code Review | Ensemble

WordPress plugin Ensemble scored78%from 54 tests.

About plugin

  • Plugin page: ensemble
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-5.1.0
  • WordPress version: 6.3.1
  • First release: May 21, 2018
  • Latest release: Feb 11, 2019
  • Number of updates: 22
  • Update frequency: every 12.1 days
  • Top authors: DrewAPicture (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,108 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.78MB] [CPU: ▲3.53ms] Passed 4 tests

An overview of server-side resources used by Ensemble
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4245.84 ▲6.93
Dashboard /wp-admin4.28 ▲0.9359.47 ▲8.98
Posts /wp-admin/edit.php4.33 ▲0.9352.91 ▼0.38
Add New Post /wp-admin/post-new.php6.89 ▲0.9695.95 ▼0.56
Media Library /wp-admin/upload.php4.13 ▲0.8648.47 ▲8.11
Units /wp-admin/edit-tags.php?taxonomy=ensemble_unit4.1039.08
Venues /wp-admin/admin.php?page=ensemble-admin-venues4.4344.29
Instructors /wp-admin/admin.php?page=ensemble-admin-people-instructors4.1743.85
Competing Units /wp-admin/admin.php?page=ensemble-unit-admin4.0034.48
Directors /wp-admin/admin.php?page=ensemble-admin-people-directors4.1739.65
Seasons /wp-admin/edit-tags.php?taxonomy=ensemble_season4.1038.73
Contests /wp-admin/admin.php?page=ensemble-admin-contests4.4644.53
Classifications /wp-admin/edit-tags.php?taxonomy=ensemble_class4.1041.36
Integrations /wp-admin/admin.php?page=ensemble-admin-integrations4.1037.72
Ensemble /wp-admin/admin.php?page=ensemble-admin4.3040.34

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 114 new files
Database: 2 new tables, 9 new options
New tables
wp_ensemble_venues
wp_ensemble_contests
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
ensemble_installed
wp_ensemble_contests_db_version
widget_theysaidso_widget
can_compress_scripts
wp_ensemble_venues_db_version
db_upgraded

Browser metrics Passed 4 tests

Ensemble: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲7714.33 ▼0.021.78 ▼0.1244.09 ▼3.15
Dashboard /wp-admin2,269 ▲925.62 ▼0.0491.88 ▼5.7844.13 ▲0.00
Posts /wp-admin/edit.php2,174 ▲771.99 ▼0.0335.73 ▼1.4636.94 ▲3.24
Add New Post /wp-admin/post-new.php1,585 ▲5723.05 ▼0.11670.82 ▼21.9753.92 ▼7.84
Media Library /wp-admin/upload.php1,474 ▲774.12 ▼0.09104.42 ▼2.2047.77 ▼0.96
Units /wp-admin/edit-tags.php?taxonomy=ensemble_unit1,4852.6357.5241.58
Venues /wp-admin/admin.php?page=ensemble-admin-venues1,0922.6955.1940.15
Instructors /wp-admin/admin.php?page=ensemble-admin-people-instructors1,0132.2131.3125.80
Competing Units /wp-admin/admin.php?page=ensemble-unit-admin1,4852.5243.8432.51
Directors /wp-admin/admin.php?page=ensemble-admin-people-directors1,0132.2230.9724.65
Seasons /wp-admin/edit-tags.php?taxonomy=ensemble_season1,3002.3934.9432.14
Contests /wp-admin/admin.php?page=ensemble-admin-contests1,6896.47127.9055.50
Classifications /wp-admin/edit-tags.php?taxonomy=ensemble_class1,2952.4735.4030.60
Integrations /wp-admin/admin.php?page=ensemble-admin-integrations8682.2630.0428.68
Ensemble /wp-admin/admin.php?page=ensemble-admin1,0622.2132.1235.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 9 options
    • can_compress_scripts
    • wp_ensemble_venues_db_version
    • widget_theysaidso_widget
    • wp_ensemble_contests_db_version
    • theysaidso_admin_options
    • db_upgraded
    • ensemble_installed
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=ensemble_class
    • > User deprecated in wp-includes/functions.php+5828
    Hook add_tag_form_pre is deprecated since version 3.0.0! Use {$taxonomy}_pre_add_form instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 79× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Ensemble\\Components\\People\\Directors\\Admin\\absint() in wp-content/plugins/ensemble/includes/components/people/directors/admin/views/edit.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Ensemble\\Components\\Venues\\Admin\\esc_html_e() in wp-content/plugins/ensemble/includes/components/venues/admin/views/add.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/ensemble/includes/components/people/instructors/admin/class-list-table.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Ensemble\\Core\\Interfaces\\Loader' not found in wp-content/plugins/ensemble/includes/components/people/directors/admin/class-actions.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Ensemble\\Core\\do_action() in wp-content/plugins/ensemble/includes/core/admin/views/overview.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Ensemble\\Core\\Interfaces\\Loader' not found in wp-content/plugins/ensemble/includes/core/class-requests.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Ensemble\\Core\\Interfaces\\Loader' not found in wp-content/plugins/ensemble/includes/core/admin/class-settings.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_roles() in wp-content/plugins/ensemble/uninstall.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Ensemble\\Core\\Interfaces\\Loader' not found in wp-content/plugins/ensemble/includes/core/class-users.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Ensemble\\Core\\Interfaces\\Loader' not found in wp-content/plugins/ensemble/includes/components/people/directors/class-setup.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

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
Please fix the following attributes:
  • Screenshots: Please a description for screenshot #7 in ensemble/assets to your readme.txt
You can take inspiration from this readme.txt

ensemble/ensemble.php Passed 13 tests

Analyzing the main PHP file in "Ensemble" version 1.1.1
105 characters long description:
Easily manage the data for a color guard circuit (or similar sport/activity organization) with WordPress.

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
Everything looks great! No dangerous files found in this plugin7,031 lines of code in 113 files:
LanguageFilesBlank linesComment linesLines of code
PHP1041,9545,6026,866
CSS53123135
JavaScript462630

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.40
▷ Minimum class complexity1.00
▷ Maximum class complexity102.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces24
Interfaces7
Traits5
Classes66
▷ Abstract classes57.58%
▷ Concrete classes6192.42%
▷ Final classes34.92%
Methods394
▷ Static methods225.58%
▷ Public methods34487.31%
▷ Protected methods164.06%
▷ Private methods348.63%
Functions25
▷ Named functions2288.00%
▷ Anonymous functions312.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin