68% booking-calendar

Code Review | Booking calendar, Appointment Booking System

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

About plugin

  • Plugin page: booking-calendar
  • Plugin version: 3.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-5.9
  • WordPress version: 5.9.2
  • First release: Dec 13, 2015
  • Latest release: Feb 2, 2022
  • Number of updates: 603
  • Update frequency: every 3.7 days
  • Top authors: wpdevart (100%)

Code review

54 tests

User reviews

109 reviews

Install metrics

6,000+ active / 447,304 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: ▲0.08MB] [CPU: ▼329.60ms] Passed 4 tests

Server-side resources used by Booking calendar, Appointment Booking System
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.0960.31 ▲7.94
Dashboard /wp-admin3.52 ▲0.1135.61 ▼12.70
Posts /wp-admin/edit.php3.74 ▲0.1045.90 ▲6.33
Add New Post /wp-admin/post-new.php6.98 ▲0.0197.72 ▼1,288.47
Media Library /wp-admin/upload.php3.40 ▲0.1126.63 ▼23.57
User Permissions /wp-admin/admin.php?page=wpdevart-user-permissions3.4731.90
Featured plugins /wp-admin/admin.php?page=wpdevart-add-booking3.4131.01
Global Settings /wp-admin/admin.php?page=wpdevart-global-settings3.4631.06
Extras /wp-admin/admin.php?page=wpdevart-extras3.4932.41
Calendars /wp-admin/admin.php?page=wpdevart-calendars3.6830.20
Reservations /wp-admin/admin.php?page=wpdevart-reservations4.0539.49
Themes /wp-admin/admin.php?page=wpdevart-themes5.0337.33
Forms /wp-admin/admin.php?page=wpdevart-forms3.4931.87
Uninstall /wp-admin/admin.php?page=wpdevart-booking-uninstall3.4129.38

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 223 new files
Database: 7 new tables, 1 new option
New tables
wp_wpdevart_calendars
wp_wpdevart_dates
wp_wpdevart_reservations
wp_wpdevart_payments
wp_wpdevart_extras
wp_wpdevart_themes
wp_wpdevart_forms
New WordPress options
widget_wpdevart_bc_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 /4,066 ▲31217.42 ▲2.2112.69 ▲5.462.71 ▲0.46
Dashboard /wp-admin2,980 ▲1196.22 ▲0.07118.41 ▼42.37172.11 ▼20.32
Posts /wp-admin/edit.php2,763 ▲723.28 ▲0.0666.29 ▼4.19137.51 ▼18.30
Add New Post /wp-admin/post-new.php1,735 ▲6916.29 ▼4.04415.20 ▼141.54202.87 ▼6.83
Media Library /wp-admin/upload.php1,800 ▲1055.82 ▲0.36127.32 ▼25.94203.50 ▼0.47
User Permissions /wp-admin/admin.php?page=wpdevart-user-permissions2,0315.1589.67221.28
Featured plugins /wp-admin/admin.php?page=wpdevart-add-booking1,8435.4286.09187.04
Global Settings /wp-admin/admin.php?page=wpdevart-global-settings1,6005.1277.27249.26
Extras /wp-admin/admin.php?page=wpdevart-extras1,5745.1379.68200.47
Calendars /wp-admin/admin.php?page=wpdevart-calendars1,2962.7658.93182.80
Reservations /wp-admin/admin.php?page=wpdevart-reservations1,7585.2776.13248.16
Themes /wp-admin/admin.php?page=wpdevart-themes1,5745.2374.83198.75
Forms /wp-admin/admin.php?page=wpdevart-forms1,5745.0378.39204.47
Uninstall /wp-admin/admin.php?page=wpdevart-booking-uninstall1,4955.1976.06119.09

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_themes
    • wp_wpdevart_calendars
    • wp_wpdevart_forms
    • wp_wpdevart_payments
    • wp_wpdevart_extras
    • wp_wpdevart_dates
    • wp_wpdevart_reservations
  • This plugin does not fully uninstall, leaving 1 option in the database
    • 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: Call to undefined function __() in wp-content/plugins/booking-calendar/includes/textfortr.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/booking-calendar/includes/widgets/widget-booking_calendar.php:3

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: booking system, booking calendar, reservation calendar, booking, appointment booking

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

The main file in "Booking calendar, Appointment Booking System" v. 3.2.0 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 plugin70,678 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
PO File5021,35125,83445,186
PHP3375021712,769
CSS74291126,967
JavaScript5134761,991
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 165)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity74.06
▷ Minimum class complexity1.00
▷ Maximum class complexity751.00
Average method complexity8.68
▷ Minimum method complexity1.00
▷ Maximum method complexity165.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods295
▷ Static methods5016.95%
▷ Public methods19265.08%
▷ Protected methods00.00%
▷ Private methods10334.92%
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.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/featured_plugins/Pricing-table.png12.94KB4.08KB▼ 68.44%
css/images/featured_plugins/coming_soon.png12.40KB5.21KB▼ 57.98%
css/images/featured_plugins/gallery-album-icon.png10.74KB4.69KB▼ 56.38%
css/images/arrow_up.png0.33KB0.45KB0.00%
css/images/hire_expert/1.png2.30KB1.72KB▼ 25.29%