51% court-reservation

Code Review | Court Reservation - Manage Your Court Bookings Online

WordPress plugin Court Reservation - Manage Your Court Bookings Online scored51%from 54 tests.

About plugin

  • Plugin page: court-reservation
  • Plugin version: 1.8.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 3, 2018
  • Latest release: Nov 21, 2023
  • Number of updates: 153
  • Update frequency: every 12.9 days
  • Top authors: webmuehle (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /9,960 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲4.94MB] [CPU: ▲36.53ms] 75% from 4 tests

This is a short check of server-side resources used by Court Reservation - Manage Your Court Bookings Online
Please take the time to fix the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,802.73ms on /wp-admin/admin.php?page=court-reservation)
PageMemory (MB)CPU Time (ms)
Home /8.44 ▲4.9873.39 ▲29.45
Dashboard /wp-admin8.46 ▲5.1685.72 ▲33.61
Posts /wp-admin/edit.php8.46 ▲5.1088.59 ▲42.88
Add New Post /wp-admin/post-new.php10.42 ▲4.54133.96 ▲40.18
Media Library /wp-admin/upload.php8.46 ▲5.2384.86 ▲53.33
Reservations /wp-admin/admin.php?page=courtres-reservations8.4672.21
Edit Members /wp-admin/admin.php?page=courtres-user8.4668.26
Settings /wp-admin/admin.php?page=courtres8.4666.53
Challenges /wp-admin/admin.php?page=courtres-challenges8.4668.54
Court Reservation /wp-admin/admin.php?page=court-reservation8.461,802.73
Members /wp-admin/admin.php?page=courtres-users8.4682.15
Edit Court /wp-admin/admin.php?page=courtres-court8.4669.61
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.4669.50
Events /wp-admin/admin.php?page=courtres-events8.4666.99
Edit Events /wp-admin/admin.php?page=courtres-event8.4671.11

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 258 new files
Database: 8 new tables, 10 new options
New tables
wp_courtres_reserv_players
wp_courtres_settings
wp_courtres_piramids_players
wp_courtres_courts
wp_courtres_events
wp_courtres_piramid_challenges
wp_courtres_reservations
wp_courtres_piramids
New WordPress options
fs_active_plugins
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
fs_debug_mode
fs_accounts
widget_theysaidso_widget
fs_gdpr

Browser metrics Passed 4 tests

Court Reservation - Manage Your Court Bookings Online: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,098 ▲31114.19 ▼0.2110.71 ▲8.6627.31 ▼19.10
Dashboard /wp-admin2,371 ▲1975.83 ▲0.24102.22 ▲7.3545.58 ▲5.89
Posts /wp-admin/edit.php2,291 ▲1912.71 ▲0.7459.54 ▲21.9135.97 ▼0.71
Add New Post /wp-admin/post-new.php1,674 ▲14521.04 ▼2.65679.74 ▼2.7058.40 ▲5.85
Media Library /wp-admin/upload.php1,579 ▲1764.31 ▲0.02121.42 ▲17.6642.65 ▼6.16
Reservations /wp-admin/admin.php?page=courtres-reservations1,1592.2945.5030.39
Edit Members /wp-admin/admin.php?page=courtres-user1,2589.70103.5727.23
Settings /wp-admin/admin.php?page=courtres1,1432.1333.3028.66
Challenges /wp-admin/admin.php?page=courtres-challenges1,2802.3945.5028.92
Court Reservation /wp-admin/admin.php?page=court-reservation1,4012.1835.5551.96
Members /wp-admin/admin.php?page=courtres-users1,1282.2436.1030.30
Edit Court /wp-admin/admin.php?page=courtres-court1,0302.0031.4328.99
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,2152.1131.7328.49
Events /wp-admin/admin.php?page=courtres-events1,1172.2532.9930.44
Edit Events /wp-admin/admin.php?page=courtres-event1,0992.2435.8930.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/court-reservation/freemius/includes/class-freemius.php+8663
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_courtres_piramid_challenges
    • wp_courtres_piramids
    • wp_courtres_reserv_players
    • wp_courtres_piramids_players
  • Zombie WordPress options detected upon uninstall: 10 options
    • fs_gdpr
    • widget_recent-comments
    • db_upgraded
    • fs_accounts
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_active_plugins
    • fs_debug_mode

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=courtres-event
    • > Notice in wp-content/plugins/court-reservation/includes/class-courtres-base.php+91
    Trying to get property 'option_value' of non-object

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/court-reservation/admin/partials/courtres-notice-message.php
  • 40× 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 esc_attr() in wp-content/plugins/court-reservation/public/partials/courtres-public-table-calendar.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/court-reservation/public/partials/courtres-public-display.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/court-reservation/admin/partials/courtres-courts.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/court-reservation/admin/partials/__courtres-settings.php:17
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/court-reservation/public/partials/courtres-public-table.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/court-reservation/public/partials/courtres-public-challenges.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Courtres_Entity_Base' not found in wp-content/plugins/court-reservation/includes/entity/challenges.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Courtres_Entity_Base' not found in wp-content/plugins/court-reservation/includes/entity/piramid.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/court-reservation/admin/partials/courtres-event.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/court-reservation/admin/partials/courtres-court.php:18

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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

court-reservation/courtres.php 85% from 13 tests

The main PHP file in "Court Reservation - Manage Your Court Bookings Online" ver. 1.8.5 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("court-reservation.php" instead of "courtres.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected51,530 lines of code in 192 files:
LanguageFilesBlank linesComment linesLines of code
PHP1559,02718,64844,239
CSS224131563,133
PO File51,1041,6192,241
JavaScript81531991,676
Markdown1680214
JSON10027

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
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity77.21
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes62
▷ Abstract classes23.23%
▷ Concrete classes6096.77%
▷ Final classes00.00%
Methods1,365
▷ Static methods22016.12%
▷ Public methods98672.23%
▷ Protected methods261.90%
▷ Private methods35325.86%
Functions108
▷ Named functions10597.22%
▷ Anonymous functions32.78%
Constants131
▷ Global constants10076.34%
▷ Class constants3123.66%
▷ Public constants31100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
public/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
public/css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
public/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%