42% thebooking

Code Review | WordPress Booking Plugin - TheBooking

WordPress plugin WordPress Booking Plugin - TheBooking scored42%from 54 tests.

About plugin

  • Plugin page: thebooking
  • Plugin version: 1.4.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Jun 14, 2021
  • Number of updates: 24
  • Update frequency: every 4.3 days
  • Top authors: vonstroheim (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /1,080 total downloads

Benchmarks

Plugin footprint 30% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲2.02MB] [CPU: ▲0.35ms] Passed 4 tests

Server-side resources used by WordPress Booking Plugin - TheBooking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.79 ▲2.3357.81 ▲20.61
Dashboard /wp-admin5.59 ▲2.2963.33 ▲12.20
Posts /wp-admin/edit.php5.64 ▲2.2864.82 ▲12.02
Add New Post /wp-admin/post-new.php7.12 ▲1.2372.24 ▼35.98
Media Library /wp-admin/upload.php5.52 ▲2.2850.48 ▲13.15
Services /wp-admin/admin.php?page=thebooking-services5.93152.47
Availability /wp-admin/admin.php?page=thebooking-availability5.77154.67
Reservations /wp-admin/admin.php?page=thebooking5.76146.88
Customers /wp-admin/admin.php?page=thebooking-customers5.76149.40
Core settings /wp-admin/admin.php?page=thebooking-core6.49148.21

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 714 new files
Database: 6 new tables, 8 new options
New tables
wp_tbkl_locations
wp_tbkl_services_meta
wp_tbkl_customers
wp_tbkl_reservations
wp_tbkl_availability
wp_tbkl_services
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
recovery_mode_email_last_sent
can_compress_scripts
tbkg_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Booking Plugin - TheBooking
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,153 ▲41822.23 ▲7.49220.88 ▲219.1040.10 ▲1.89
Dashboard /wp-admin2,278 ▲905.82 ▲0.92102.56 ▼5.3439.32 ▼4.26
Posts /wp-admin/edit.php2,157 ▲652.01 ▲0.0343.78 ▲0.8434.25 ▼3.13
Add New Post /wp-admin/post-new.php1,541 ▲2724.33 ▲6.79693.88 ▼9.3938.85 ▼17.97
Media Library /wp-admin/upload.php1,456 ▲654.25 ▲0.09106.17 ▼15.0144.49 ▼7.57
Services /wp-admin/admin.php?page=thebooking-services1,22711.44210.0745.04
Availability /wp-admin/admin.php?page=thebooking-availability1,49312.61240.2844.60
Reservations /wp-admin/admin.php?page=thebooking1,29311.58177.9436.45
Customers /wp-admin/admin.php?page=thebooking-customers1,22011.30165.7934.77
Core settings /wp-admin/admin.php?page=thebooking-core550.440.1010.29

Uninstaller [IO: ▲8.52MB] [DB: ▲0.01MB] 0% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Error in wp-content/plugins/thebooking/Functions.php+82
    Uncaught Error: Call to undefined method TheBooking\Settings::_clean_uninstall() in wp-content/plugins/thebooking/Functions.php:82
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): TheBooking\plugin_uninstall()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(1269): do_action()
    #4 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • This plugin has failed uninstalling correctly, leaving 714 files (8.52MB) in the plugin directory
    • (new file) Admin/UI_CoreSettings.php
    • (new file) Admin/Images/user-placeholder.png
    • (new file) Admin/Blocks/block.js
    • (new file) Admin/UI_Availability/Panel_WeeklyWorkingHours.php
    • (new file) Admin/Blocks/blockNext.js
    • (new file) Admin/UI_Availability/Panel_ClosingDates.php
    • (new file) Admin.php
    • (new file) Admin/UI_Availability/Panel_Locations.php
    • (new file) Actions.php
    • (new file) Admin/UI_Availability.php
    • ...
  • This plugin does not fully uninstall, leaving 6 tables in the database
    • wp_tbkl_services_meta
    • wp_tbkl_locations
    • wp_tbkl_availability
    • wp_tbkl_services
    • wp_tbkl_customers
    • wp_tbkl_reservations
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • tbkg_version
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=thebooking-core
    • > Error in wp-content/plugins/thebooking/Modules/PriceModule.php+217
    Uncaught Error: Class 'NumberFormatter' not found in wp-content/plugins/thebooking/Modules/PriceModule.php:217
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): TheBooking\Modules\PriceModule::currency_settings_panel()
    #1 wp-includes/plugin.php(205): WP_Hook->apply_filters()
    #2 wp-content/plugins/thebooking/Admin.php(36): apply_filters()
    #3 wp-includes/class-wp-hook.php(310): TheBooking\Admin::TheBooking\{closure}()
    #4 wp-includes/plugin.php(205): WP_Hook->apply_filters()
    #5 wp-content/plugins/thebooking/Functions.php(353): apply_filters()
    #6 wp-content/plugins/thebooking/Admin.php(160): TheBooking\localize_backend_script()
    #7 wp-includes/class-wp-hook.php(310): TheBooking\Admin::load_backend_resources()
    #8 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #9 wp-includes/plugin.php(517): WP_

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 take a closer look at the following
  • 271× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Auth\\CredentialsLoader' not found in wp-content/plugins/thebooking/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/thebooking/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:22
    • > PHP Fatal error
      Cannot declare class Error, because the name is already in use in wp-content/plugins/thebooking/vendor/symfony/polyfill-php70/Resources/stubs/Error.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/thebooking/vendor/google/apiclient-services/src/Google/Service/Calendar/EventCreator.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheItemInterface' not found in wp-content/plugins/thebooking/vendor/google/auth/src/Cache/Item.php:25
    • > PHP Warning
      Class 'Google\\AccessToken\\Revoke' not found in wp-content/plugins/thebooking/vendor/google/apiclient/src/aliases.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/thebooking/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/thebooking/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php:21
    • > PHP Warning
      require(wp-content/plugins/thebooking/vendor/moneyphp/money/resources/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/thebooking/vendor/moneyphp/money/resources/generate-money-factory.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/thebooking/vendor/google/apiclient-services/src/Google/Service/Calendar/Resource/Colors.php:26

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=thebooking-core
    • > Network (severe)
    wp-admin/admin.php?page=thebooking-core - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: events, booking calendar, appointment, booking, appointment system...

thebooking/thebooking.php Passed 13 tests

Analyzing the main PHP file in "WordPress Booking Plugin - TheBooking" version 1.4.4
27 characters long description:
A WordPress booking plugin.

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
Good job! No executable or dangerous file extensions detected102,655 lines of code in 672 files:
LanguageFilesBlank linesComment linesLines of code
PHP56011,19233,74778,428
CSS3434726515,542
Markdown311,78305,089
JSON19002,132
JavaScript18972751,150
SVG730270
YAML12025
Dockerfile18010
make1409

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity15.32
▷ Minimum class complexity1.00
▷ Maximum class complexity633.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces71
Interfaces46
Traits10
Classes484
▷ Abstract classes132.69%
▷ Concrete classes47197.31%
▷ Final classes9620.38%
Methods3,579
▷ Static methods52014.53%
▷ Public methods3,07185.81%
▷ Protected methods1875.22%
▷ Private methods3218.97%
Functions293
▷ Named functions10736.52%
▷ Anonymous functions18663.48%
Constants561
▷ Global constants7112.66%
▷ Class constants49087.34%
▷ Public constants490100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
Admin/Images/user-placeholder.png25.50KB13.21KB▼ 48.21%