77% calendar-booking

Code Review | Scheduling Plugin - Online Booking for WordPress

WordPress plugin Scheduling Plugin - Online Booking for WordPress scored77%from 54 tests.

About plugin

  • Plugin page: calendar-booking
  • Plugin version: 3.5.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Apr 26, 2018
  • Latest release: Oct 29, 2023
  • Number of updates: 185
  • Update frequency: every 10.9 days
  • Top authors: startbooking (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /153,257 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.22MB] [CPU: ▲4.59ms] Passed 4 tests

Analyzing server-side resources used by Scheduling Plugin - Online Booking for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1942.15 ▼2.76
Dashboard /wp-admin3.52 ▲0.2156.42 ▲5.43
Posts /wp-admin/edit.php3.63 ▲0.2856.86 ▲9.93
Add New Post /wp-admin/post-new.php7.23 ▲1.3498.52 ▲8.08
Media Library /wp-admin/upload.php3.44 ▲0.2145.50 ▲7.60

Server storage [IO: ▲16.03MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 542 new files
Database: no new tables, 16 new options
New WordPress options
cbsb_rest_token_history
can_compress_scripts
widget_startbooking_services
cbsb_login_hash
widget_startbooking_single_service
widget_startbooking_address_widget
widget_recent-posts
cbsb_user_token_migrated
cbsb_connection
widget_startbooking_hours_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by Scheduling Plugin - Online Booking for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲14114.34 ▼0.011.72 ▼0.0343.39 ▲0.15
Dashboard /wp-admin2,311 ▲1315.64 ▼0.0388.17 ▼5.7044.30 ▲3.08
Posts /wp-admin/edit.php2,214 ▲1142.13 ▲0.1337.40 ▲0.1138.76 ▲4.11
Add New Post /wp-admin/post-new.php1,757 ▲22930.98 ▲7.881,211.76 ▲529.1239.42 ▼15.97
Media Library /wp-admin/upload.php1,511 ▲1084.31 ▲0.1396.14 ▼7.0245.92 ▼0.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.02MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 16 options in the database
    • widget_recent-posts
    • cbsb_user_token_migrated
    • widget_startbooking_services
    • can_compress_scripts
    • widget_startbooking_address_widget
    • db_upgraded
    • cbsb_connection
    • widget_startbooking_group_booking
    • theysaidso_admin_options
    • widget_startbooking_hours_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/calendar-booking/admin/connected/app-handoff.php
  • 28× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/calendar-booking/admin/connected/header.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'CBSB_BASE_DIRinc/widgets/address.php' (include_path='.:/usr/share/php') in wp-content/plugins/calendar-booking/inc/widgets.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/calendar-booking/inc/routes.php:15
    • > PHP Warning
      require_once(CBSB_BASE_DIRinc/partners/wpcom.php): failed to open stream: No such file or directory in wp-content/plugins/calendar-booking/inc/partners/index.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/calendar-booking/inc/response-cleaning.php:49
    • > PHP Warning
      include(): Failed opening 'CBSB_BASE_DIRadmin/connected/header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/calendar-booking/admin/connected/app-handoff.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/calendar-booking/admin/404.php:1
    • > PHP Warning
      Use of undefined constant CBSB_BASE_DIR - assumed 'CBSB_BASE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/calendar-booking/inc/widgets.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/calendar-booking/inc/shortcodes.php:212
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/calendar-booking/inc/content.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 80% 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
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can take inspiration from this readme.txt

calendar-booking/start-booking.php 62% from 13 tests

The main PHP file in "Scheduling Plugin - Online Booking for WordPress" ver. 3.5.10 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "5.2")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Description: Please don't use more than 140 characters for the plugin description (currently 175 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("calendar-booking.php" instead of "start-booking.php")

Code Analysis Passed 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 detected19,698 lines of code in 453 files:
LanguageFilesBlank linesComment linesLines of code
PO File186,52912,51815,390
PHP29533483,536
SVG3106394
JSON36200362
CSS5008
JavaScript8088

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity14.42
▷ Minimum class complexity3.00
▷ Maximum class complexity34.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods70
▷ Static methods00.00%
▷ Public methods6897.14%
▷ Protected methods00.00%
▷ Private methods22.86%
Functions105
▷ Named functions105100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
47 PNG files occupy 1.38MB with 0.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/confetti.png4.28KB4.28KB0.00%
public/images/mailchimp.png10.53KB4.32KB▼ 58.96%
public/images/product-screenshot.png449.55KB179.19KB▼ 60.14%
public/images/zoom.png6.56KB2.88KB▼ 56.08%
public/images/icons/icon-embed@2x.png3.51KB2.28KB▼ 35.04%