68% booking-calendar

Code Review | Booking calendar, Appointment Booking System

WordPress plugin Booking calendar, Appointment Booking System scored68%from 54 tests.

About plugin

  • Plugin page: booking-calendar
  • Plugin version: 3.2.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 13, 2015
  • Latest release: Oct 28, 2023
  • Number of updates: 628
  • Update frequency: every 4.6 days
  • Top authors: wpdevart (100%)

Code review

54 tests

User reviews

113 reviews

Install metrics

4,000+ active /503,904 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.48MB] [CPU: ▲3.13ms] Passed 4 tests

Server-side resources used by Booking calendar, Appointment Booking System
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.95 ▲1.4948.73 ▲10.68
Dashboard /wp-admin4.84 ▲1.4951.37 ▼9.06
Posts /wp-admin/edit.php4.89 ▲1.5351.31 ▲3.13
Add New Post /wp-admin/post-new.php7.35 ▲1.47102.71 ▲7.78
Media Library /wp-admin/upload.php4.70 ▲1.4752.22 ▲16.23
Themes /wp-admin/admin.php?page=wpdevart-themes5.6052.62
Reservations /wp-admin/admin.php?page=wpdevart-reservations5.2882.28
Calendars /wp-admin/admin.php?page=wpdevart-calendars5.0439.42
Global Settings /wp-admin/admin.php?page=wpdevart-global-settings4.7843.85
User Permissions /wp-admin/admin.php?page=wpdevart-user-permissions4.7942.66
Featured plugins /wp-admin/admin.php?page=wpdevart-add-booking4.7041.70
Extras /wp-admin/admin.php?page=wpdevart-extras4.8445.52
Forms /wp-admin/admin.php?page=wpdevart-forms4.8442.35
Uninstall /wp-admin/admin.php?page=wpdevart-booking-uninstall4.7039.67

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 226 new files
Database: 7 new tables, 7 new options
New tables
wp_wpdevart_dates
wp_wpdevart_extras
wp_wpdevart_reservations
wp_wpdevart_themes
wp_wpdevart_payments
wp_wpdevart_calendars
wp_wpdevart_forms
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_wpdevart_bc_widget
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Booking calendar, Appointment Booking System
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,027 ▲26614.93 ▲0.5814.92 ▲13.3441.42 ▲3.17
Dashboard /wp-admin2,268 ▲915.79 ▲0.1282.33 ▼7.8983.14 ▲48.41
Posts /wp-admin/edit.php2,191 ▲882.18 ▲0.1433.77 ▼5.4434.55 ▼3.74
Add New Post /wp-admin/post-new.php1,755 ▲22922.46 ▼0.64629.92 ▼71.6436.17 ▼18.75
Media Library /wp-admin/upload.php1,482 ▲794.25 ▲0.10102.58 ▲1.6376.18 ▲28.18
Themes /wp-admin/admin.php?page=wpdevart-themes1,2173.4543.64101.98
Reservations /wp-admin/admin.php?page=wpdevart-reservations1,3443.6490.1783.05
Calendars /wp-admin/admin.php?page=wpdevart-calendars1,0191.7925.4534.87
Global Settings /wp-admin/admin.php?page=wpdevart-global-settings1,2403.4342.3188.53
User Permissions /wp-admin/admin.php?page=wpdevart-user-permissions1,5793.4641.2187.94
Featured plugins /wp-admin/admin.php?page=wpdevart-add-booking1,3923.4642.07106.60
Extras /wp-admin/admin.php?page=wpdevart-extras1,2153.4542.6181.62
Forms /wp-admin/admin.php?page=wpdevart-forms1,2213.4540.4776.91
Uninstall /wp-admin/admin.php?page=wpdevart-booking-uninstall1,1673.4742.0278.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 7 tables
    • wp_wpdevart_dates
    • wp_wpdevart_themes
    • wp_wpdevart_payments
    • wp_wpdevart_calendars
    • wp_wpdevart_forms
    • wp_wpdevart_extras
    • wp_wpdevart_reservations
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_wpdevart_bc_widget

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/booking-calendar/booking_calendar.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/booking-calendar/includes/widgets/widget-booking_calendar.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/booking-calendar/includes/textfortr.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: appointment booking, reservation calendar, booking calendar, booking, booking system

booking-calendar/booking_calendar.php 92% from 13 tests

The main file in "Booking calendar, Appointment Booking System" v. 3.2.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("booking-calendar.php" instead of "booking_calendar.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin72,484 lines of code in 124 files:
LanguageFilesBlank linesComment linesLines of code
PO File5121,77526,35146,073
PHP3477730913,644
CSS74301127,002
JavaScript5136772,000
Sass1328241,560
LESS1328341,550
SVG100655

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 170)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity81.06
▷ Minimum class complexity1.00
▷ Maximum class complexity887.00
Average method complexity9.35
▷ Minimum method complexity1.00
▷ Maximum method complexity170.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods307
▷ Static methods5417.59%
▷ Public methods19764.17%
▷ Protected methods00.00%
▷ Private methods11035.83%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
43 PNG files occupy 0.35MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/hire_expert/4.png4.39KB3.08KB▼ 29.96%
css/images/ui-icons_222222_256x240.png6.84KB4.18KB▼ 38.90%
css/images/wait.png0.36KB0.36KB0.00%
css/images/extras.png0.95KB1.60KB0.00%
css/images/hire_expert/1.png2.30KB1.72KB▼ 25.29%