67% booking

Code Review | WP Booking Calendar

WordPress plugin WP Booking Calendar scored67%from 54 tests.

About plugin

  • Plugin page: booking
  • Plugin version: 9.8.12
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4
  • WordPress version: 6.3.1
  • First release: Aug 15, 2009
  • Latest release: Nov 24, 2023
  • Number of updates: 729
  • Update frequency: every 7.2 days
  • Top authors: wpdevelop (100%)

Code review

54 tests

User reviews

548 reviews

Install metrics

60,000+ active /3,128,280 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲8.85MB] [CPU: ▲65.70ms] 50% from 4 tests

A check of server-side resources used by WP Booking Calendar
The following require your attention
  • RAM: You should keep total memory usage under 10MB (currently 12.35MB on /wp-admin/admin.php?page=wpbc-availability)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 8.85MB on /wp-admin/admin.php?page=wpbc-availability)
PageMemory (MB)CPU Time (ms)
Home /11.61 ▲8.1499.18 ▲58.42
Dashboard /wp-admin12.40 ▲9.09113.79 ▲61.64
Posts /wp-admin/edit.php12.45 ▲9.09153.38 ▲102.26
Add New Post /wp-admin/post-new.php15.00 ▲9.11165.96 ▲73.23
Media Library /wp-admin/upload.php12.32 ▲9.09103.99 ▲69.52
Settings /wp-admin/admin.php?page=wpbc-settings12.53111.08
Bookings /wp-admin/admin.php?page=wpbc12.36138.35
Get Pro /wp-admin/admin.php?page=wpbc-go-pro12.3497.11
Add Booking /wp-admin/admin.php?page=wpbc-new12.38135.23
Availability /wp-admin/admin.php?page=wpbc-availability12.35100.79

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 387 new files
Database: 3 new tables, 146 new options
New tables
wp_booking_dates_props
wp_bookingdates
wp_booking
New WordPress options
booking_email_reservation_content
booking_gcal_events_from_offset
booking_is_show_legend
booking_start_day_weeek
booking_widget_title
booking_form_field_active3
booking_gcal_is_send_email
booking_feedback_03
booking_email_trash
booking_widget_calendar_count
...

Browser metrics Passed 4 tests

A check of browser resources used by WP Booking Calendar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,412 ▲1,62531.19 ▲16.89105.63 ▲103.6138.60 ▼7.53
Dashboard /wp-admin4,047 ▲1,87328.28 ▲22.66546.71 ▲459.2380.86 ▲40.07
Posts /wp-admin/edit.php2,208 ▲1082.04 ▲0.0639.68 ▲2.6337.11 ▼3.03
Add New Post /wp-admin/post-new.php3,772 ▲2,24421.40 ▼1.83728.09 ▲36.6042.81 ▼8.02
Media Library /wp-admin/upload.php1,511 ▲1144.18 ▼0.03109.67 ▲5.9448.16 ▲3.11
Settings /wp-admin/admin.php?page=wpbc-settings5,79417.71501.4362.78
Bookings /wp-admin/admin.php?page=wpbc2,5934.1876.3298.69
Get Pro /wp-admin/admin.php?page=wpbc-go-pro2,9069.85314.83162.57
Add Booking /wp-admin/admin.php?page=wpbc-new2,9143.7872.4178.95
Availability /wp-admin/admin.php?page=wpbc-availability9,9054.82106.52184.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables detected upon uninstall: 3 tables
    • wp_booking_dates_props
    • wp_booking
    • wp_bookingdates
  • Zombie WordPress options detected upon uninstall: 146 options
    • booking_view_days_num
    • theysaidso_admin_options
    • booking_translation_update_status
    • booking_email_newbookingbyperson_content
    • booking_email_new_visitor
    • booking_form_field_label3
    • booking_admin_panel_skin
    • booking_form_field_label1
    • booking_load_balancer_max_threads
    • booking_is_email_approval_send_copy_to_admin
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/booking/wpdev-booking.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/booking/core/lib/wpdev-booking-widget.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WPBC_JS_CSS' not found in wp-content/plugins/booking/core/wpbc-js.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/booking/core/lib/wpbc-calendar-legend.php:258
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_bk_action() in wp-content/plugins/booking/includes/_feedback/feedback.php:596
    • > PHP Fatal error
      Uncaught Error: Class 'WPBC_JS_CSS' not found in wp-content/plugins/booking/core/wpbc-css.php:13

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
Please take inspiration from this readme.txt

booking/wpdev-booking.php 85% from 13 tests

The main PHP file in "WP Booking Calendar" ver. 9.8.12 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("booking.php" instead of "wpdev-booking.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 462 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin103,938 lines of code in 320 files:
LanguageFilesBlank linesComment linesLines of code
PHP11315,55319,34848,709
JavaScript1127,4348,30129,403
CSS929592,95225,502
SVG100288
Markdown28036

PHP code Passed 2 tests

An overview 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.29
Average class complexity28.92
▷ Minimum class complexity1.00
▷ Maximum class complexity403.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes62
▷ Abstract classes58.06%
▷ Concrete classes5791.94%
▷ Final classes11.75%
Methods560
▷ Static methods295.18%
▷ Public methods45380.89%
▷ Protected methods91.61%
▷ Private methods9817.50%
Functions766
▷ Named functions74897.65%
▷ Anonymous functions182.35%
Constants40
▷ Global constants40100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon-16x16.png1.22KB1.28KB0.00%
assets/libs/chosen/chzn-sprite.png0.53KB0.88KB0.00%
assets/img/clock_fill.png0.71KB0.67KB▼ 5.61%
assets/libs/chosen/chzn-sprite@2x.png0.72KB0.83KB0.00%
assets/img/bc_black-16x16.png1.12KB1.16KB0.00%