79% booking-package

Code Review | Booking Package

WordPress plugin Booking Package scored79%from 54 tests.

About plugin

  • Plugin page: booking-package
  • Plugin version: 1.6.23
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4
  • WordPress version: 6.3.1
  • First release: Feb 26, 2018
  • Latest release: Nov 28, 2023
  • Number of updates: 489
  • Update frequency: every 4.5 days
  • Top authors: masaakitanaka (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

10,000+ active /680,435 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲4.36MB] [CPU: ▲29.26ms] Passed 4 tests

Analyzing server-side resources used by Booking Package
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /7.92 ▲4.4564.92 ▲22.82
Dashboard /wp-admin7.94 ▲4.6394.85 ▲42.06
Posts /wp-admin/edit.php7.94 ▲4.5783.45 ▲36.72
Add New Post /wp-admin/post-new.php9.68 ▲3.79121.81 ▲23.83
Media Library /wp-admin/upload.php7.94 ▲4.7066.94 ▲33.65
Calendar Accounts /wp-admin/admin.php?page=booking-package_schedule_page7.9489.28
General Settings /wp-admin/admin.php?page=booking-package_setting_page7.94117.02
Booked Customers /wp-admin/admin.php?page=booking-package/index.php7.9480.66
Users /wp-admin/admin.php?page=booking-package_members_page7.9595.47

Server storage [IO: ▲3.90MB] [DB: ▲0.05MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 51 new files
Database: 17 new tables, 34 new options
New tables
wp_booking_package_booked_customers
wp_booking_package_template_schedules
wp_booking_package_taxes
wp_booking_package_form
wp_booking_package_webhook
wp_booking_package_error
wp_booking_package_calendar_accounts
wp_booking_package_guests
wp_booking_package_coupons
wp_booking_package_services
...
New WordPress options
_booking-package_css_v
_booking-package_javascript_v
booking_package_db_version
booking_package_lost_password
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_booking_package_widget
_booking_package_siteToken
...

Browser metrics Passed 4 tests

Booking Package: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲20614.35 ▲0.111.63 ▼0.0727.85 ▼17.03
Dashboard /wp-admin2,349 ▲1755.60 ▼0.1296.65 ▼2.7547.61 ▲4.18
Posts /wp-admin/edit.php2,156 ▲561.96 ▲0.0040.12 ▲1.4636.25 ▲0.82
Add New Post /wp-admin/post-new.php1,572 ▲4723.01 ▼0.07625.11 ▼30.5951.10 ▼3.19
Media Library /wp-admin/upload.php1,453 ▲534.20 ▼0.1094.33 ▼8.2941.68 ▲0.09
Calendar Accounts /wp-admin/admin.php?page=booking-package_schedule_page8,9312.5642.4230.53
General Settings /wp-admin/admin.php?page=booking-package_setting_page5,8772.8942.7255.84
Booked Customers /wp-admin/admin.php?page=booking-package/index.php1,2862.1138.6239.52
Users /wp-admin/admin.php?page=booking-package_members_page1,2991.8428.0126.24

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
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/booking-package/uninstall.php+7
    Constant BOOKING_PACKAGE_EXTENSION_URL already defined
  • The uninstall procedure has failed, leaving 22 options in the database
    • _booking-package_css_v
    • _booking_package_siteToken
    • booking_package_accept_subscribers_as_users
    • booking_package_visitors_registration_for_member
    • booking_package_ical_token
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • _booking_package_databaseUpdateErrors
    • booking_package_reject_non_membder
    • booking_package_lost_password
    • ...

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: booking system, reservation system, appointment system, appointment, reservation...

booking-package/index.php 92% from 13 tests

The principal PHP file in "Booking Package" v. 1.6.23 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("booking-package.php" instead of "index.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected54,797 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1715,1621,14426,603
PHP119,1521,74019,003
CSS73,9244196,813
SVG1032,370
Markdown1207
JSON1001

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,551)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 112)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity225.92
▷ Minimum class complexity1.00
▷ Maximum class complexity1,551.00
Average method complexity7.64
▷ Minimum method complexity1.00
▷ Maximum method complexity112.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods384
▷ Static methods00.00%
▷ Public methods37296.88%
▷ Protected methods00.00%
▷ Private methods123.12%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin