77% booking-x

Code Review | Booking X - Appointment and Reservation Availability Calendar

WordPress plugin Booking X - Appointment and Reservation Availability Calendar scored77%from 54 tests.

About plugin

  • Plugin page: booking-x
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 16, 2021
  • Latest release: Aug 19, 2023
  • Number of updates: 48
  • Update frequency: every 18.5 days
  • Top authors: dunskii (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /5,341 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲3.24MB] [CPU: ▲20.08ms] Passed 4 tests

An overview of server-side resources used by Booking X - Appointment and Reservation Availability Calendar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.68 ▲3.2270.97 ▲30.75
Dashboard /wp-admin6.51 ▲3.2165.93 ▲18.22
Posts /wp-admin/edit.php6.64 ▲3.2979.15 ▲28.57
Add New Post /wp-admin/post-new.php9.38 ▲3.50106.97 ▲2.79
Media Library /wp-admin/upload.php6.48 ▲3.2567.80 ▲30.88
Bookings /wp-admin/edit.php?post_type=bkx_booking6.5562.83
/wp-admin/edit.php?post_type=bkx_seat6.5461.49
Extra /wp-admin/edit.php?post_type=bkx_addition6.5460.00
Settings /wp-admin/edit.php?post_type=bkx_booking&page=bkx-setting6.6956.53
Service /wp-admin/edit.php?post_type=bkx_base6.5460.79

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 324 new files
Database: no new tables, 18 new options
New WordPress options
widget_recent-comments
bkx_set_booking_page
bkx_my_account_page_id
theysaidso_admin_options
bkx_dashboard_page_id
widget_recent-posts
bkx_notice_time_extended_text_alias
db_upgraded
bkx_label_of_step1
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Booking X - Appointment and Reservation Availability Calendar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,289 ▲54323.93 ▲9.5040.08 ▲38.4518.03 ▼22.00
Dashboard /wp-admin2,360 ▲1699.90 ▲4.88135.63 ▲29.6842.17 ▼4.63
Posts /wp-admin/edit.php2,303 ▲2148.91 ▲6.8776.62 ▲39.7137.19 ▲4.14
Add New Post /wp-admin/post-new.php1,575 ▲4221.74 ▼1.14545.14 ▼112.6634.70 ▼16.12
Media Library /wp-admin/upload.php1,559 ▲17111.21 ▲6.98145.96 ▲36.1342.86 ▼4.43
Bookings /wp-admin/edit.php?post_type=bkx_booking1,4689.2578.5028.74
/wp-admin/edit.php?post_type=bkx_seat1,2989.0887.6332.98
Extra /wp-admin/edit.php?post_type=bkx_addition1,2909.0976.3027.60
Settings /wp-admin/edit.php?post_type=bkx_booking&page=bkx-setting1,1749.4565.3929.10
Service /wp-admin/edit.php?post_type=bkx_base1,2909.1475.6927.79

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
These items require your attention
  • This plugin does not fully uninstall, leaving 18 options in the database
    • enable_cancel_booking
    • bkx_notice_create_an_account
    • widget_recent-posts
    • bkx_alias_addition
    • bkx_set_booking_page
    • bkx_edit_booking_page_id
    • widget_theysaidso_widget
    • bkx_notice_time_extended_text_alias
    • bkx_my_account_page_id
    • enable_any_seat
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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 items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/booking-x/includes/core/booking/class-order-meta-box.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/booking-x/includes/core/functions/bkx-core-functions.php:351

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bkx_base
    • > Console-api (warning) in wp-includes/js/dist/blocks.min.js?ver=b5d3b99262dfb659bd26+9:967
    The block \"booking-x/bkx-base\" is registered with an invalid category \"booking-x\".
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bkx_base
    • > Console-api (warning) in wp-includes/js/dist/blocks.min.js?ver=b5d3b99262dfb659bd26+9:967
    The block \"booking-x/bkx-seat\" is registered with an invalid category \"booking-x\".
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bkx_base
    • > Console-api (warning) in wp-includes/js/dist/blocks.min.js?ver=b5d3b99262dfb659bd26+9:967
    The block \"booking-x/bkx-addition\" is registered with an invalid category \"booking-x\".

Optimizations

Plugin configuration 90% 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
7 plugin tags: availability calendar, booking calendar, booking system, reservations, appointment booking...

booking-x/bookingx.php 77% from 13 tests

The main PHP file in "Booking X - Appointment and Reservation Availability Calendar" ver. 1.1.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path points to an invalid folder, "/i18n/languages/" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("booking-x.php" instead of "bookingx.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin51,275 lines of code in 272 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1101,2611,72824,140
PHP1122,0034,64018,910
SVG1132,625
CSS243621842,384
Sass1433821,854
XML1001,007
JSON800287
Markdown220068

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 147)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity57.22
▷ Minimum class complexity1.00
▷ Maximum class complexity624.00
Average method complexity6.13
▷ Minimum method complexity1.00
▷ Maximum method complexity147.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes41
▷ Abstract classes00.00%
▷ Concrete classes41100.00%
▷ Final classes00.00%
Methods449
▷ Static methods6815.14%
▷ Public methods43195.99%
▷ Protected methods10.22%
▷ Private methods173.79%
Functions140
▷ Named functions13797.86%
▷ Anonymous functions32.14%
Constants12
▷ Global constants433.33%
▷ Class constants866.67%
▷ Public constants8100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
25 PNG files occupy 1.67MB with 0.72MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png203.63KB57.14KB▼ 71.94%
screenshot-5.png281.56KB81.57KB▼ 71.03%
public/images/dashicons-calendar.png2.79KB0.74KB▼ 73.60%
admin/css/jquery-ui/images/ui-icons_2e83ff_256x240.png3.69KB4.18KB0.00%
admin/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%