46% luxury-hotel-booking-lite

Code Review | Luxury Hotel Booking Lite

WordPress plugin Luxury Hotel Booking Lite scored46%from 54 tests.

About plugin

  • Plugin page: luxury-hotel-book...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.5
  • WordPress version: 6.3.1
  • First release: May 19, 2018
  • Latest release: Jul 14, 2021
  • Number of updates: 11
  • Update frequency: every 104.8 days
  • Top authors: creativeitem (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,802 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.67ms] Passed 4 tests

A check of server-side resources used by Luxury Hotel Booking Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1341.68 ▲3.64
Dashboard /wp-admin3.44 ▲0.1446.93 ▼2.59
Posts /wp-admin/edit.php3.56 ▲0.2049.84 ▼2.02
Add New Post /wp-admin/post-new.php6.02 ▲0.13100.22 ▼12.38
Media Library /wp-admin/upload.php3.37 ▲0.1334.79 ▲2.33
Availability /wp-admin/admin.php?page=luxury_availabiity3.3737.74
Settings /wp-admin/admin.php?page=luxury_settings3.3935.82
Help /wp-admin/admin.php?page=luxury_help3.3936.19
Rooms /wp-admin/admin.php?page=luxury_rooms3.3735.99
Booking /wp-admin/admin.php?page=luxury_booking3.3831.57

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 245 new files
Database: 12 new tables, 7 new options
New tables
wp_chb_amenity
wp_chb_room
wp_chb_payment
wp_chb_country
wp_chb_service
wp_chb_settings
wp_chb_pricing
wp_chb_booking
wp_chb_booking_room
wp_chb_booking_service
...
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

A check of browser resources used by Luxury Hotel Booking Lite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10014.47 ▼0.271.83 ▼0.2043.91 ▼1.14
Dashboard /wp-admin2,244 ▲564.86 ▼0.03101.60 ▼26.6340.99 ▼16.62
Posts /wp-admin/edit.php2,127 ▲352.01 ▼0.0439.99 ▼4.9335.16 ▼3.47
Add New Post /wp-admin/post-new.php1,565 ▲2323.36 ▲5.04594.51 ▼24.0249.45 ▼7.09
Media Library /wp-admin/upload.php1,423 ▲384.21 ▼0.0197.44 ▼4.9243.46 ▼0.14
Availability /wp-admin/admin.php?page=luxury_availabiity1,1553.6950.0147.03
Settings /wp-admin/admin.php?page=luxury_settings8162.1717.1721.69
Help /wp-admin/admin.php?page=luxury_help1,4143.3944.95106.81
Rooms /wp-admin/admin.php?page=luxury_rooms1,3603.6662.6351.26
Booking /wp-admin/admin.php?page=luxury_booking1,3373.9849.8441.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 12 tables
    • wp_chb_service
    • wp_chb_booking_service
    • wp_chb_payment
    • wp_chb_settings
    • wp_chb_room
    • wp_chb_amenity
    • wp_chb_country
    • wp_chb_pricing
    • wp_chb_room_type
    • wp_chb_booking_room
    • ...
  • This plugin does not fully uninstall, leaving 7 options in the database
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=luxury_settings
    • > Error in wp-content/plugins/luxury-hotel-booking-lite/templates/admin/page-settings.php+34
    Uncaught Error: Class 'Inc\api\DataApi' not found in wp-content/plugins/luxury-hotel-booking-lite/templates/admin/page-settings.php:34
    Stack trace:
    #0 wp-content/plugins/luxury-hotel-booking-lite/inc/Api/Callbacks/AdminCallbacks.php(31): require_once()
    #1 wp-includes/class-wp-hook.php(310): Inc\Api\Callbacks\AdminCallbacks->settings()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=luxury_booking
    • > Notice in wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-booking-list.php+13
    Undefined index: param1
    • > GET request to /wp-admin/admin.php?page=luxury_booking
    • > Notice in wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-booking-list.php+14
    Undefined index: param2
    • > GET request to /wp-admin/admin.php?page=luxury_booking
    • > Notice in wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-booking-list.php+15
    Undefined index: param3
    • > GET request to /wp-admin/admin.php?page=luxury_booking
    • > Notice in wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-booking-list.php+16
    Undefined index: param4

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 41× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-booking-summary.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/modal-booking-edit.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-booking-list.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-booking-detail.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/modal-floor-add.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/modal-booking-add-room-list.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/modal-room-edit.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-room-availability.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/luxury-hotel-booking-lite.php
    • > /wp-content/plugins/luxury-hotel-booking-lite/templates/admin/module-pricing-manager-selector.php
  • 77× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/lib/Account.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/tests/UtilTest.php:5
    • > PHP Fatal error
      Cannot use Stripe\\Object as Object because 'Object' is a special class name in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/lib/Util/Util.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/tests/InvoiceTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/tests/ObjectTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/lib/Transfer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ExternalAccount' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/lib/AlipayAccount.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/lib/Error/ApiConnection.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/tests/TestCase.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Inc\\Base\\BaseController' not found in wp-content/plugins/luxury-hotel-booking-lite/inc/Base/SettingsLinks.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=luxury_booking
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: moment is not a function" "TypeError: moment is not a function\n at new DateRangePicker (/wp-content/plugins/luxury-hotel-booking-lite/assets/daterangepicker/daterangepicker.js?ver=6.3.1:36:26)\n at HTMLDivElement.\u003Canonymous> (/wp-content/plugins/luxury-hotel-booking-lite/assets/daterangepicker/daterangepicker.js?ver=6.3.1:1621:40)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:3129)\n at e.\u003Ccomputed>.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:1594)\n at $.fn.daterangepicker (/wp-content/plugins/luxury-hotel-booking-lite/assets/daterangepicker/daterangepicker.js?ver=6.3.1:1617:14)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=luxury_booking:273:28)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&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,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=luxury_booking
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: moment is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

luxury-hotel-booking-lite/luxury-hotel-booking-lite.php 92% from 13 tests

"Luxury Hotel Booking Lite" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/luxury-hotel-booking-lite/vendor/stripe/stripe-php/data/ca-certificates.crt
28,426 lines of code in 188 files:
LanguageFilesBlank linesComment linesLines of code
CSS3119621511,273
PHP1351,4461,1428,223
SVG2034,591
JavaScript118416803,995
Markdown21230184
JSON300114
XML20030
YAML23016

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.32
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces12
Interfaces1
Traits0
Classes87
▷ Abstract classes55.75%
▷ Concrete classes8294.25%
▷ Final classes11.22%
Methods387
▷ Static methods13935.92%
▷ Public methods35290.96%
▷ Protected methods205.17%
▷ Private methods153.88%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
37 PNG files occupy 3.97MB with 0.99MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/upgrade/payment_report.png67.61KB19.81KB▼ 70.70%
assets/icheck/square/orange@2x.png4.37KB3.04KB▼ 30.35%
assets/icheck/line/line.png0.57KB0.79KB0.00%
assets/jquery-ui/images/ui-icons_cc0000_256x240.png4.57KB4.18KB▼ 8.43%
assets/icheck/square/red.png2.14KB1.83KB▼ 14.52%