68% nd-sports-booking

Code Review | Sports Booking

WordPress plugin Sports Booking scored68%from 54 tests.

About plugin

  • Plugin page: nd-sports-booking
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.9
  • WordPress version: 6.3.1
  • First release: Mar 10, 2021
  • Latest release: May 24, 2022
  • Number of updates: 8
  • Update frequency: every 57.5 days
  • Top authors: nicdark (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,319 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.93ms] Passed 4 tests

Server-side resources used by Sports Booking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0847.28 ▲7.44
Dashboard /wp-admin3.39 ▲0.0551.79 ▼13.04
Posts /wp-admin/edit.php3.44 ▲0.0850.86 ▼0.27
Add New Post /wp-admin/post-new.php5.97 ▲0.0887.77 ▼2.82
Media Library /wp-admin/upload.php3.31 ▲0.0841.30 ▲0.43
Calendar View /wp-admin/admin.php?page=nd-sports-booking-settings-calendar-view3.2542.56
Add New Booking /wp-admin/admin.php?page=nd-sports-booking-settings-add-orders3.2635.75
Add Timing /wp-admin/admin.php?page=nd-sports-booking-add-timing3.2831.67
Stripe /wp-admin/admin.php?page=nd-sports-booking-stripe3.2838.96
Premium Addons /wp-admin/admin.php?page=nd-sports-booking-settings-premium-addons3.2832.66
Import Export /wp-admin/admin.php?page=nd-sports-booking-settings-import-export3.2837.11
Paypal /wp-admin/admin.php?page=nd-sports-booking-paypal3.2837.03
Sports /wp-admin/edit.php?post_type=nd_spt_cpt_13.3640.42
All Bookings /wp-admin/admin.php?page=nd-sports-booking-settings-orders3.3730.56
Sports Booking /wp-admin/admin.php?page=nd-sports-booking-settings3.2934.65

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 76 new files
Database: 1 new table, 6 new options
New tables
wp_nd_spt_booking
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Sports Booking
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲24913.69 ▼0.685.31 ▲3.6443.72 ▲3.98
Dashboard /wp-admin2,317 ▲1265.88 ▼0.02118.05 ▲19.0945.01 ▲1.33
Posts /wp-admin/edit.php2,196 ▲1102.20 ▲0.1538.38 ▲0.7536.46 ▲1.91
Add New Post /wp-admin/post-new.php1,603 ▲8323.16 ▼0.02675.88 ▼13.3359.74 ▲1.88
Media Library /wp-admin/upload.php1,499 ▲1114.43 ▲0.32104.11 ▼10.6747.29 ▲0.55
Calendar View /wp-admin/admin.php?page=nd-sports-booking-settings-calendar-view1,0031.9629.5026.34
Add New Booking /wp-admin/admin.php?page=nd-sports-booking-settings-add-orders1,4492.0524.4628.06
Add Timing /wp-admin/admin.php?page=nd-sports-booking-add-timing9822.0524.0628.24
Stripe /wp-admin/admin.php?page=nd-sports-booking-stripe1,8282.0324.7329.74
Premium Addons /wp-admin/admin.php?page=nd-sports-booking-settings-premium-addons1,3762.2127.2235.07
Import Export /wp-admin/admin.php?page=nd-sports-booking-settings-import-export1,0222.0222.6227.12
Paypal /wp-admin/admin.php?page=nd-sports-booking-paypal1,3072.0324.1428.17
Sports /wp-admin/edit.php?post_type=nd_spt_cpt_11,1691.9631.8834.64
All Bookings /wp-admin/admin.php?page=nd-sports-booking-settings-orders8662.0624.1125.51
Sports Booking /wp-admin/admin.php?page=nd-sports-booking-settings1,3482.0324.4128.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_nd_spt_booking
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-calendar-view
    • > Notice in wp-content/plugins/nd-sports-booking/addons/calendar-view/index.php+20
    Undefined index: nd_spt_arrive_from_filter
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-orders
    • > Notice in wp-content/plugins/nd-sports-booking/inc/admin/3-orders/include/orders.php+7
    Undefined index: nd_spt_order_status
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-calendar-view
    • > Notice in wp-content/plugins/nd-sports-booking/addons/calendar-view/index.php+22
    Undefined index: nd_spt_date
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-calendar-view
    • > Notice in wp-content/plugins/nd-sports-booking/addons/calendar-view/index.php+23
    Undefined index: nd_spt_sport
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-calendar-view
    • > Notice in wp-content/plugins/nd-sports-booking/inc/functions/functions.php+55
    A non well formed numeric value encountered
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-add-orders
    • > Notice in wp-content/plugins/nd-sports-booking/inc/admin/3-orders/include/add.php+263
    Undefined variable: nd_spt_occasions_array
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-add-orders
    • > Warning in wp-content/plugins/nd-sports-booking/inc/admin/3-orders/include/add.php+263
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-orders
    • > Notice in wp-content/plugins/nd-sports-booking/inc/admin/3-orders/include/orders.php+5
    Undefined index: nd_spt_pag_from
    • > GET request to /wp-admin/admin.php?page=nd-sports-booking-settings-orders
    • > Notice in wp-content/plugins/nd-sports-booking/inc/admin/3-orders/include/orders.php+6
    Undefined index: nd_spt_pag_to

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 52× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: nd_spt_month_today in wp-content/plugins/nd-sports-booking/inc/shortcodes/include/nd_spt_booking_calendar.php on line 6
    • > PHP Notice
      Undefined variable: match_finalresultlabel in wp-content/plugins/nd-sports-booking/addons/elementor/widgets/match/layout/layout-1.php on line 42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nd-sports-booking/inc/admin/plugin-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nd-sports-booking/inc/cpt/cpt-1.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nd-sports-booking/inc/admin/5-stripe/index.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nd-sports-booking/inc/admin/3-orders/include/add.php:4
    • > PHP Notice
      Undefined variable: match_finalresultlabel in wp-content/plugins/nd-sports-booking/addons/elementor/widgets/match/layout/layout-1.php on line 18
    • > PHP Notice
      Undefined variable: match_player1result in wp-content/plugins/nd-sports-booking/addons/elementor/widgets/match/layout/layout-1.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function nd_spt_get_next_prev_month_year() in wp-content/plugins/nd-sports-booking/inc/shortcodes/include/nd_spt_booking_calendar.php:9
    • > PHP Notice
      Undefined variable: match_player2label in wp-content/plugins/nd-sports-booking/addons/elementor/widgets/match/layout/layout-1.php on line 50

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 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
2 plugin tags: sports, booking

nd-sports-booking/nd-sports-booking.php 92% from 13 tests

This is the main PHP file of "Sports Booking" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 210 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected6,896 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP302,8943755,329
CSS917863948
JavaScript4351156543
SVG20276

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity8.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods20
▷ Static methods15.00%
▷ Public methods1680.00%
▷ Protected methods420.00%
▷ Private methods00.00%
Functions66
▷ Named functions66100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
23 PNG files occupy 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon-down-grey.png1.06KB0.19KB▼ 82.46%
assets/img/remove.png0.16KB0.15KB▼ 9.52%
assets/img/004-restaurant.png18.86KB3.49KB▼ 81.48%
inc/shortcodes/include/004-sport.png13.56KB4.11KB▼ 69.70%
assets/img/001-time.png18.75KB3.35KB▼ 82.13%