68% opal-hotel-room-booking

Code Review | Opal Hotel Room Booking

WordPress plugin Opal Hotel Room Booking scored 68% from 54 tests.

About plugin

  • Plugin page: opal-hotel-room-b...
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2
  • WordPress version: 5.9.2
  • First release: Sep 13, 2016
  • Latest release: Oct 28, 2019
  • Number of updates: 284
  • Update frequency: every 4.0 days
  • Top authors: wpopal (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

600+ active / 27,378 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: ▲4.11MB] [CPU: ▼247.68ms] Passed 4 tests

An overview of server-side resources used by Opal Hotel Room Booking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /7.08 ▲3.9696.35 ▲70.68
Dashboard /wp-admin7.63 ▲4.2382.26 ▲48.33
Posts /wp-admin/edit.php7.82 ▲4.1989.89 ▲49.84
Add New Post /wp-admin/post-new.php11.11 ▲4.11141.32 ▼1,159.58
Media Library /wp-admin/upload.php7.48 ▲4.19146.81 ▲122.80
Settings /wp-admin/admin.php?page=opalhotel-settings7.6574.43
Add New Offer /wp-admin/post-new.php?post_type=opalhotel_offer8.1187.04
Offers /wp-admin/edit.php?post_type=opalhotel_offer7.6273.06
Categories /wp-admin/edit-tags.php?taxonomy=opalhotel_room_cat&post_type=opalhotel_room7.5169.85
Destinations /wp-admin/edit-tags.php?taxonomy=opalhotel_hotel_des&post_type=opalhotel_hotel7.5172.22
Packages /wp-admin/edit.php?post_type=opalhotel_package7.6277.39
Menus /wp-admin/nav-menus.php7.4579.93
Widgets /wp-admin/widgets.php9.3498.61
Amenities /wp-admin/edit.php?post_type=opalhotel_amenities7.6375.59
Catetories /wp-admin/edit-tags.php?taxonomy=opalhotel_hotel_cat&post_type=opalhotel_hotel7.5171.89

Server storage [IO: ▲10.79MB] [DB: ▲0.04MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 1,081 new files
Database: 5 new tables, 59 new options
New tables
wp_opalhotel_pricing
wp_opalhotel_order_items
wp_opalhotel_ratings
wp_opalhotel_rating_item
wp_opalhotel_order_itemmeta
New WordPress options
opalhotel_rooms_page_id
opalhotel_account_page_id
opalhotel_max_rooms_number
widget_opalhotel-hotel-destination
opalhotel_price_decimals_separator
widget_opalhotel-rooms
opalhotel_email_from_name
opalhotel_enabled_rating
opalhotel_price_number_of_decimal
widget_opalhotel-single-book-room
...

Browser metrics Passed 4 tests

Checking browser requirements for Opal Hotel Room Booking
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,600 ▲84621.35 ▲5.6039.79 ▲33.243.32 ▲0.88
Dashboard /wp-admin3,388 ▲5278.73 ▲2.60165.21 ▲25.90158.20 ▲0.42
Posts /wp-admin/edit.php3,217 ▲5326.18 ▲2.9595.74 ▲29.84138.94 ▼1.61
Add New Post /wp-admin/post-new.php1,876 ▲21520.65 ▲4.60397.40 ▼4.54143.98 ▼14.36
Media Library /wp-admin/upload.php2,004 ▲3067.17 ▲1.60123.04 ▼17.33197.27 ▲12.99
Settings /wp-admin/admin.php?page=opalhotel-settings2,7735.9785.94164.26
Add New Offer /wp-admin/post-new.php?post_type=opalhotel_offer3,33711.20207.70217.03
Offers /wp-admin/edit.php?post_type=opalhotel_offer1,9006.2694.60119.74
Categories /wp-admin/edit-tags.php?taxonomy=opalhotel_room_cat&post_type=opalhotel_room2,1606.0389.36110.68
Destinations /wp-admin/edit-tags.php?taxonomy=opalhotel_hotel_des&post_type=opalhotel_hotel2,1816.0587.47111.42
Packages /wp-admin/edit.php?post_type=opalhotel_package1,9096.1492.22118.82
Menus /wp-admin/nav-menus.php3,5426.74114.10129.09
Widgets /wp-admin/widgets.php2,80430.32587.87185.54
Amenities /wp-admin/edit.php?post_type=opalhotel_amenities1,8906.2287.16116.45
Catetories /wp-admin/edit-tags.php?taxonomy=opalhotel_hotel_cat&post_type=opalhotel_hotel2,1576.0887.35110.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables detected upon uninstall: 5 tables
    • wp_opalhotel_rating_item
    • wp_opalhotel_order_itemmeta
    • wp_opalhotel_pricing
    • wp_opalhotel_order_items
    • wp_opalhotel_ratings
  • Zombie WordPress options detected upon uninstall: 59 options
    • opalhotel_room_catalog_image_size
    • opalhotel_cart_page_id
    • opalhotel_hotel_available_page_id
    • widget_opalhotel-hotels-lastest-deals
    • opalhotel_favorited_page_id
    • widget_opalhotel-single-hotel-destination
    • opalhotel_meta_box_errors
    • widget_opalhotel-single-book-room
    • opalhotel_reservation_page_id
    • opalhotel_currency
    • ...

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/opal-hotel-room-booking/templates/loop/details.php
  • 43× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opal-hotel-room-booking/includes/vendors/cmb2/init.php:126

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === opal-hotel-room-booking === )
You can look at the official readme.txt

opal-hotel-room-booking/opal-hotel-room-booking.php 92% from 13 tests

The main PHP script in "Opal Hotel Room Booking" version 1.2.7 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected113,984 lines of code in 856 files:
LanguageFilesBlank linesComment linesLines of code
PO File12115,53120,32534,969
PHP3587,10512,15128,830
SVG235213520,805
CSS392,1441,46813,695
JavaScript862,2201,96710,181
Sass115553894,797
Markdown32280657
JSON20045
Ruby17125

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity15.33
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes180
▷ Abstract classes137.22%
▷ Concrete classes16792.78%
▷ Final classes10.60%
Methods1,191
▷ Static methods26322.08%
▷ Public methods1,06689.50%
▷ Protected methods1159.66%
▷ Private methods100.84%
Functions292
▷ Named functions29199.66%
▷ Anonymous functions10.34%
Constants14
▷ Global constants642.86%
▷ Class constants857.14%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
45 PNG files occupy 0.17MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/libraries/prettyPhoto/images/prettyPhoto/dark_rounded/sprite.png3.98KB2.56KB▼ 35.79%
includes/vendors/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
assets/libraries/prettyPhoto/images/prettyPhoto/default/sprite_next.png1.33KB0.39KB▼ 70.69%
includes/vendors/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
assets/libraries/prettyPhoto/images/prettyPhoto/facebook/sprite.png4.13KB2.26KB▼ 45.33%