10% hotelierscom-booking-module

Code Review | Hoteliers.com Booking Module

WordPress plugin Hoteliers.com Booking Module scored10%from 54 tests.

About plugin

  • Plugin page: hotelierscom-book...
  • Plugin version: 1.10.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1
  • WordPress version: 6.3.1
  • First release: Mar 1, 2017
  • Latest release: Oct 14, 2020
  • Number of updates: 218
  • Update frequency: every 6.1 days
  • Top authors: hotelierscom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /4,450 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/hotelierscom-booking-module/htlrs_booking_module.php+13
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.94MB] [CPU: ▼52.84ms] Passed 4 tests

An overview of server-side resources used by Hoteliers.com Booking Module
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.37 ▼31.85
Dashboard /wp-admin2.08 ▼1.2710.41 ▼48.62
Posts /wp-admin/edit.php2.08 ▼1.284.98 ▼42.05
Add New Post /wp-admin/post-new.php2.08 ▼3.816.45 ▼88.84
Media Library /wp-admin/upload.php2.08 ▼1.154.83 ▼30.37
Translations /wp-admin/admin.php?page=htlrs_booking_module__translations2.085.99
Settings /wp-admin/admin.php?page=htlrs_booking_module__settings2.086.08

Server storage [IO: ▲2.08MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 250 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_add_hhtlrsbm_widget
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Hoteliers.com Booking Module: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.35 ▼0.001.65 ▲0.1340.44 ▼1.65
Dashboard /wp-admin2,225 ▲445.67 ▲0.0082.40 ▼15.3679.47 ▲35.07
Posts /wp-admin/edit.php2,130 ▲302.00 ▲0.0234.62 ▼2.3733.18 ▼1.82
Add New Post /wp-admin/post-new.php1,552 ▲2423.65 ▲0.39747.62 ▲116.3350.23 ▼9.44
Media Library /wp-admin/upload.php1,427 ▲274.26 ▲0.0698.80 ▼12.4480.07 ▲31.79
Translations /wp-admin/admin.php?page=htlrs_booking_module__translations1,1892.3225.8626.71
Settings /wp-admin/admin.php?page=htlrs_booking_module__settings1,2032.0828.6525.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/hotelierscom-booking-module/htlrs_booking_module.php+13
    define(): Declaration of case-insensitive constants is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_add_hhtlrsbm_widget
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Smoke test failed, please fix the following
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=htlrs_booking_module__settings
    • > Deprecated in wp-content/plugins/hotelierscom-booking-module/htlrs_booking_module.php+19
    define(): Declaration of case-insensitive constants is deprecated

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/hotelierscom-booking-module/admin/footer.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/hotelierscom-booking-module/vendor/tubalmartin/cssmin/gui/index.php on line 3
    • > PHP Warning
      require(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/hotelierscom-booking-module/vendor/tubalmartin/cssmin/gui/index.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/hotelierscom-booking-module/htlrs_booking_module.php:12
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/hotelierscom-booking-module/vendor/tubalmartin/cssmin/tests/run.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/hotelierscom-booking-module/widget.php:9
    • > PHP Warning
      require(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/hotelierscom-booking-module/vendor/tubalmartin/cssmin/tests/run.php on line 3

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: module, booking, hoteliers, hotelierscom

hotelierscom-booking-module/htlrs_booking_module.php 92% from 13 tests

The main PHP script in "Hoteliers.com Booking Module" version 1.10.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("hotelierscom-booking-module.php" instead of "htlrs_booking_module.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin29,362 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
CSS852,02965421,469
JavaScript151,2987845,221
PHP213675392,210
Markdown11190196
HTML110183
JSON30083

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity32.20
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods74
▷ Static methods34.05%
▷ Public methods3445.95%
▷ Protected methods00.00%
▷ Private methods4054.05%
Functions32
▷ Named functions2784.38%
▷ Anonymous functions515.62%
Constants12
▷ Global constants650.00%
▷ Class constants650.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
31 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/hc_logo.png2.77KB2.13KB▼ 22.97%
images/jquery.ui/ui-bg_diagonals-thick_20_666666_40x40.png0.30KB0.15KB▼ 49.68%
images/logo.png0.60KB0.65KB0.00%
images/jquery.ui/ui-bg_diagonals-thick_18_b81900_40x40.png0.41KB0.15KB▼ 62.44%
admin/colorpicker/images/custom_hsb_h.png0.95KB0.73KB▼ 23.40%