62% awebooking

Code Review | AweBooking - Hotel Booking System

WordPress plugin AweBooking - Hotel Booking System scored 62% from 54 tests.

About plugin

  • Plugin page: awebooking
  • Plugin version: 3.2.26
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2
  • WordPress version: 6.3.1
  • First release: Jun 29, 2017
  • Latest release: Oct 7, 2019
  • Number of updates: 202
  • Update frequency: every 4.1 days
  • Top authors: awethemes (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

2,000+ active / 121,151 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲5.90MB] [CPU: ▲37.79ms] 25% from 4 tests

Analyzing server-side resources used by AweBooking - Hotel Booking System
It is recommended to improve the following
  • RAM: Total memory usage should be kept under 10MB (currently 10.55MB on /wp-admin/admin.php?awebooking=/calendar)
  • CPU: Total CPU usage should be kept under 500.00ms (currently 829.89ms on /wp-admin/admin.php?awebooking=/about)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.90MB on /wp-admin/admin.php?awebooking=/tools)
PageMemory (MB)CPU Time (ms)
Home /8.96 ▲5.5073.71 ▲32.60
Dashboard /wp-admin9.36 ▲6.05156.40 ▲107.65
Posts /wp-admin/edit.php9.40 ▲6.0487.89 ▲39.63
Add New Post /wp-admin/post-new.php12.23 ▲6.35134.53 ▲34.34
Media Library /wp-admin/upload.php9.22 ▲5.9977.08 ▲44.58
Bookings /wp-admin/edit.php?post_type=awebooking9.6375.46
AweBooking /wp-admin/admin.php?page=awebooking8.9573.59
Amenities /wp-admin/edit-tags.php?taxonomy=hotel_amenity&post_type=room_type9.4575.42
Settings /wp-admin/admin.php?awebooking=/settings10.5684.55
Room Types /wp-admin/edit.php?post_type=room_type9.5975.69
Services /wp-admin/edit.php?post_type=hotel_service9.5173.49
Hotels /wp-admin/edit.php?post_type=hotel_location8.9558.88
About /wp-admin/admin.php?awebooking=/about9.90829.89
Calendar /wp-admin/admin.php?awebooking=/calendar10.5595.98
Tools /wp-admin/admin.php?awebooking=/tools9.9077.35

Server storage [IO: ▲14.33MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,710 new files
Database: 9 new tables, 11 new options
New tables
wp_awebooking_pricing
wp_awebooking_booking
wp_p2p_relationships
wp_awebooking_rooms
wp_awebooking_booking_itemmeta
wp_awebooking_tax_rates
wp_awebooking_booking_items
wp_awebooking_availability
wp_p2p_relationshipmeta
New WordPress options
widget_recent-comments
widget_awebooking_check_availability
awebooking_db_version
awebooking_admin_notices
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
awebooking_settings
db_upgraded
awebooking_version
...

Browser metrics Passed 4 tests

Checking browser requirements for AweBooking - Hotel Booking System
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,044 ▲30915.65 ▲1.2923.27 ▲21.5438.14 ▼10.91
Dashboard /wp-admin2,284 ▲965.80 ▲0.9192.27 ▼17.5438.20 ▲2.67
Posts /wp-admin/edit.php2,164 ▲752.01 ▼0.0335.50 ▼2.8330.46 ▼1.60
Add New Post /wp-admin/post-new.php1,594 ▲7323.02 ▼0.06624.60 ▼14.4664.31 ▼13.92
Media Library /wp-admin/upload.php1,460 ▲754.18 ▼0.06101.44 ▼0.4841.50 ▼5.69
Bookings /wp-admin/edit.php?post_type=awebooking1,3352.6853.9631.92
AweBooking /wp-admin/admin.php?page=awebooking280.440.083.71
Amenities /wp-admin/edit-tags.php?taxonomy=hotel_amenity&post_type=room_type1,4092.6438.6629.98
Settings /wp-admin/admin.php?awebooking=/settings2,4213.3954.0228.88
Room Types /wp-admin/edit.php?post_type=room_type1,2972.7944.5729.06
Services /wp-admin/edit.php?post_type=hotel_service1,1922.7842.4230.48
Hotels /wp-admin/edit.php?post_type=hotel_location280.440.084.12
About /wp-admin/admin.php?awebooking=/about9602.4535.4351.97
Calendar /wp-admin/admin.php?awebooking=/calendar1,5793.5259.0137.27
Tools /wp-admin/admin.php?awebooking=/tools9822.4433.4826.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 9 tables
    • wp_awebooking_booking_itemmeta
    • wp_awebooking_booking
    • wp_awebooking_pricing
    • wp_p2p_relationships
    • wp_p2p_relationshipmeta
    • wp_awebooking_tax_rates
    • wp_awebooking_availability
    • wp_awebooking_booking_items
    • wp_awebooking_rooms
  • The uninstall procedure has failed, leaving 11 options in the database
    • widget_recent-comments
    • awebooking_version
    • theysaidso_admin_options
    • awebooking_settings
    • widget_recent-posts
    • awebooking_db_version
    • awebooking_admin_notices
    • widget_awebooking_check_availability
    • can_compress_scripts
    • db_upgraded
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/awebooking/inc/Admin/Calendar/views/partials/row-divider.php
    • > /wp-content/plugins/awebooking/inc/Admin/Calendar/views/partials/row-days.php
    • > /wp-content/plugins/awebooking/inc/Admin/Calendar/views/partials/row-events.php
    • > /wp-content/plugins/awebooking/inc/Admin/Calendar/views/partials/marker.php
    • > /wp-content/plugins/awebooking/templates/_docs.php
    • > /wp-content/plugins/awebooking/inc/Admin/Calendar/views/partials/row-heading.php
  • 643× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ruler\\Operator\\VariableOperator' not found in wp-content/plugins/awebooking/vendor/ruler/ruler/src/Ruler/Operator/SymmetricDifference.php:23
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_id() on null in wp-content/plugins/awebooking/inc/Admin/views/booking/html-service-item.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Ruler\\RuleBuilder\\Variable' not found in wp-content/plugins/awebooking/vendor/ruler/ruler/src/Ruler/RuleBuilder/VariableProperty.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'AweBooking\\Model\\Booking\\Item' not found in wp-content/plugins/awebooking/inc/Model/Booking/Fee_Item.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/awebooking/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Ruler\\Operator\\VariableOperator' not found in wp-content/plugins/awebooking/vendor/ruler/ruler/src/Ruler/Operator/Floor.php:23
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/awebooking/awethemes/relationships/tests/bootstrap.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined method stdClass::value() in wp-content/plugins/awebooking/vendor/wplibs/form/src/Resources/html/html-group.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/awebooking/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Roomify\\Bat\\Event\\AbstractEvent' not found in wp-content/plugins/awebooking/vendor/roomify/bat/src/Event/Event.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=awebooking
    • > Network (severe)
    wp-admin/admin.php?page=awebooking - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/edit.php?post_type=hotel_location
    • > Network (severe)
    wp-admin/edit.php?post_type=hotel_location - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?awebooking=/calendar
    • > Console-api (severe) in unknown
    /wp-content/plugins/awebooking/assets/vendor/flatpickr/flatpickr.min.js?ver=4.5.1 1:44212 TypeError: Cannot read properties of undefined (reading 'push')at Object.onReady (/wp-content/plugins/awebooking/assets/js/admin/admin.min.js?ver=3.2.26:1:16373)at q (/wp-content/plugins/awebooking/assets/vendor/flatpickr/flatpickr.min.js?ver=4.5.1:2:30076)at /wp-content/plugins/awebooking/assets/vendor/flatpickr/flatpickr.min.js?ver=4.5.1:2:43919at r (/wp-content/plugins/awebooking/assets/vendor/flatpickr/flatpickr.min.js?ver=4.5.1:2:43932)at n (/wp-content/plugins/awebooking/assets/vendor/flatpickr/flatpickr.min.js?ver=4.5.1:2:44164)at ve (/wp-content/plugins/awebooking/assets/vendor/flatpickr/flatpickr.min.js?ver=4.5.1:2:44500)at e.value (/wp-content/plugins/awebooking/assets/js/admin/page-calendar.min.js?ver=3.2.26:1:3399)at new e (/wp-content/plugins/awebooking/assets/js/admin/page-calendar.min.js?ver=3.2.26:1:1422)at HTMLDocument. (/wp-content/plugins/awebooking/assets/js/admin/page-calendar.min.js?ver=3.2.26:1:3612)at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)
    • > GET request to /wp-admin/admin.php?awebooking=/calendar
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading '_tippy')" "TypeError: Cannot read properties of undefined (reading '_tippy')\n at n.initialize (/wp-content/plugins/awebooking/assets/js/admin/schedule-calendar.min.js?ver=3.2.26:1:2688)\n at h.View (/wp-includes/js/backbone.min.js?ver=1.4.1:2:14648)\n at new n (/wp-includes/js/backbone.min.js?ver=1.4.1:2:23485)\n at new e (/wp-content/plugins/awebooking/assets/js/admin/page-calendar.min.js?ver=3.2.26:1:1454)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/awebooking/assets/js/admin/page-calendar.min.js?ver=3.2.26:1:3612)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?awebooking=/calendar
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading '_tippy')

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #7 (Plugin settings) image required
You can take inspiration from this readme.txt

awebooking/awebooking.php Passed 13 tests

"AweBooking - Hotel Booking System" version 3.2.26's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
48 characters long description:
A simple hotel reservation system for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin214,368 lines of code in 1,510 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11216,64724,45780,370
PHP1,01319,20752,17072,546
PO File12014,31518,50232,323
CSS331,9891,32514,739
Sass801,6501768,364
JSON28002,210
SVG1080941,573
HTML211001,147
Markdown61300462
JSX19417366
XML41919115
Bourne Shell1228100
YAML18149
Dockerfile1334

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity9.83
▷ Minimum class complexity1.00
▷ Maximum class complexity225.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces139
Interfaces69
Traits45
Classes712
▷ Abstract classes537.44%
▷ Concrete classes65992.56%
▷ Final classes40.61%
Methods6,193
▷ Static methods4126.65%
▷ Public methods5,01280.93%
▷ Protected methods1,01716.42%
▷ Private methods1642.65%
Functions615
▷ Named functions35157.07%
▷ Anonymous functions26442.93%
Constants321
▷ Global constants268.10%
▷ Class constants29591.90%
▷ Public constants295100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
16 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
vendor/cmb2/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%