52% hbook

Code Review | Booking Calendar - Event Calendar

WordPress plugin Booking Calendar - Event Calendar scored 52% from 53 tests.

About plugin

  • Plugin page: hbook
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.3.2
  • WordPress version: 5.8.1
  • First release: Sep 27, 2019
  • Latest release: Dec 20, 2019
  • Number of updates: 4
  • Update frequency: every 21.5 days
  • Top authors: omnivo (100%)

Code review

53 tests

User reviews

5 reviews

Install metrics

7,000+ active / 5,151 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.81MB] [CPU: ▼290.75ms] Passed 4 tests

This is a short check of server-side resources used by Booking Calendar - Event Calendar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2233.13 ▲11.60
Dashboard /wp-admin2.83 ▼0.2222.75 ▼16.44
Posts /wp-admin/edit.php2.83 ▼0.2718.59 ▼21.80
Add New Post /wp-admin/post-new.php2.83 ▼2.6018.93 ▼1,112.16
Media Library /wp-admin/upload.php2.83 ▼0.1723.91 ▼12.59
Export Bookings /wp-admin/admin.php?page=omnivo_calendar_admin_bookings_export2.8320.49
All Calendar Columns /wp-admin/edit.php?post_type=omnivo_weekdays2.8425.15
Shortcode Generator /wp-admin/admin.php?page=omnivo_calendar_admin2.8324.15
All Events /wp-admin/edit.php?post_type=omnivo_event2.8421.06
Event Post Type /wp-admin/admin.php?page=omnivo_calendar_admin_page_event_post_type2.8320.94
Google Calendar /wp-admin/admin.php?page=omnivo_calendar_admin_page_google_calendar2.8320.90
Add New /wp-admin/post-new.php?post_type=omnivo_event2.8417.23
Email config /wp-admin/admin.php?page=omnivo_calendar_admin_page_email_config2.8423.04
Categories /wp-admin/edit-tags.php?taxonomy=events_category&post_type=omnivo_event2.8417.81
Calendar Bookings /wp-admin/admin.php?page=omnivo_calendar_admin_bookings2.8420.94

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 353 new files
Database: 3 new tables, 11 new options
New tables
wp_omnivo_calendar_event_hours
wp_omnivo_calendar_guests
wp_omnivo_calendar_event_hours_booking
New WordPress options
omnivo_calendar_events_settings
omnivo_calendar_event_hours_booking_table_modify_1
omnivo_calendar_guests_table_installed
widget_omnivo_calendar_upcoming_events
omnivo_calendar_event_hours_booking_table_installed
omnivo_calendar_event_hours_table_column_slots_per_user
omnivo_calendar_google_calendar
omnivo_calendar_contact_form_options
omnivo_calendar_google_calendar_options
omnivo_calendar_event_hours_table_installed
...

Browser metrics Passed 4 tests

Checking browser requirements for Booking Calendar - Event Calendar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,027 ▲42216.99 ▲1.5416.51 ▲7.6146.39 ▼4.08
Dashboard /wp-admin3,134 ▲2846.01 ▲0.05130.07 ▲4.30123.33 ▲12.76
Posts /wp-admin/edit.php2,881 ▲1752.71 ▲0.0173.42 ▲7.37120.94 ▲18.38
Add New Post /wp-admin/post-new.php1,779 ▼25918.87 ▼0.59359.73 ▲2.75117.01 ▲9.96
Media Library /wp-admin/upload.php1,891 ▲1225.02 ▲0.01136.62 ▼5.06136.54 ▲29.19
Export Bookings /wp-admin/admin.php?page=omnivo_calendar_admin_bookings_export1,3272.4359.1188.70
All Calendar Columns /wp-admin/edit.php?post_type=omnivo_weekdays3,0982.7267.89105.06
Shortcode Generator /wp-admin/admin.php?page=omnivo_calendar_admin6,5045.65111.37116.75
All Events /wp-admin/edit.php?post_type=omnivo_event3,2282.7364.19105.28
Event Post Type /wp-admin/admin.php?page=omnivo_calendar_admin_page_event_post_type1,2792.4163.7095.08
Google Calendar /wp-admin/admin.php?page=omnivo_calendar_admin_page_google_calendar2,1352.5862.3995.31
Add New /wp-admin/post-new.php?post_type=omnivo_event4,3629.09228.09181.99
Email config /wp-admin/admin.php?page=omnivo_calendar_admin_page_email_config2,4114.1485.6585.07
Categories /wp-admin/edit-tags.php?taxonomy=events_category&post_type=omnivo_event1,8942.5155.3096.11
Calendar Bookings /wp-admin/admin.php?page=omnivo_calendar_admin_bookings1,4942.4659.1379.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie tables were found after uninstall: 3 tables
    • wp_omnivo_calendar_event_hours
    • wp_omnivo_calendar_guests
    • wp_omnivo_calendar_event_hours_booking
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • omnivo_calendar_contact_form_options
    • omnivo_calendar_guests_table_installed
    • omnivo_calendar_events_settings
    • widget_omnivo_calendar_upcoming_events
    • omnivo_calendar_event_hours_booking_table_installed
    • omnivo_calendar_event_hours_booking_table_modify_1
    • omnivo_calendar_event_hours_table_installed
    • omnivo_calendar_event_hours_table_column_slots_per_user
    • omnivo_calendar_google_calendar_options
    • omnivo_calendar_google_calendar
    • ...

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
These errors were triggered by the plugin
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=omnivo_calendar_admin_bookings
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/admin.php?page=omnivo_calendar_admin
    • > Notice in wp-content/plugins/hbook/com/main.php+1062
    Trying to get property 'items' of non-object

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/hbook/libraries/dompdf/lib/php-css-parser/tests/quickdump.php
  • 154× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/hbook/libraries/dompdf/lib/php-svg-lib/src/Svg/Tag/LinearGradient.php:15
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/hbook/libraries/dompdf/src/Dompdf.php on line 610
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/hbook/com/shortcodes.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Glyph\\Outline' not found in wp-content/plugins/hbook/libraries/dompdf/lib/php-font-lib/src/FontLib/Glyph/OutlineSimple.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/hbook/libraries/dompdf/lib/php-css-parser/tests/Sabberworm/CSS/CSSList/DocumentTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\Value' not found in wp-content/plugins/hbook/libraries/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/hbook/libraries/dompdf/src/Positioner/TableCell.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/hbook/libraries/dompdf/lib/php-svg-lib/src/Svg/Tag/ClipPath.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/hbook/libraries/dompdf/src/FrameDecorator/Image.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/hbook/libraries/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hmtx.php:17

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: event calendar, booking, calendar, booking calendar, appointment booking

hbook/index.php 92% from 13 tests

This is the main PHP file of "Booking Calendar - Event Calendar" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hbook.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected54,114 lines of code in 277 files:
LanguageFilesBlank linesComment linesLines of code
PHP2098,82515,44042,401
JavaScript85892876,496
CSS382721333,891
Markdown62550909
XML632202
JSON500135
YAML416363
HTML10017

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity35.61
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces33
Interfaces5
Traits0
Classes186
▷ Abstract classes126.45%
▷ Concrete classes17493.55%
▷ Final classes00.00%
Methods2,034
▷ Static methods1125.51%
▷ Public methods1,73885.45%
▷ Protected methods2019.88%
▷ Private methods954.67%
Functions96
▷ Named functions8083.33%
▷ Anonymous functions1616.67%
Constants162
▷ Global constants74.32%
▷ Class constants15595.68%
▷ Public constants155100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
33 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/colorpicker/custom_rgb_r.png0.99KB0.74KB▼ 25.34%
assets/admin/images/colorpicker/colorpicker_rgb_b.png0.95KB0.76KB▼ 19.48%
assets/admin/images/colorpicker/colorpicker_submit.png0.96KB1.04KB0.00%
assets/admin/images/colorpicker/custom_rgb_g.png1.04KB0.80KB▼ 23.67%
assets/admin/images/colorpicker/slider.png0.31KB1.51KB0.00%