78% hotel-booking-by-xfor

Code Review | Hotel Booking by Xfor

WordPress plugin Hotel Booking by Xfor scored78%from 54 tests.

About plugin

  • Plugin page: hotel-booking-by-...
  • Plugin version: 0.1.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Aug 28, 2021
  • Latest release: Feb 8, 2022
  • Number of updates: 8
  • Update frequency: every 21.0 days
  • Top authors: utz0r2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /744 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.22MB] [CPU: ▼1.03ms] Passed 4 tests

Analyzing server-side resources used by Hotel Booking by Xfor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1930.30 ▼10.46
Dashboard /wp-admin3.53 ▲0.2358.61 ▲2.37
Posts /wp-admin/edit.php3.65 ▲0.2957.10 ▲3.45
Add New Post /wp-admin/post-new.php6.13 ▲0.24103.21 ▲5.02
Media Library /wp-admin/upload.php3.45 ▲0.2237.33 ▲0.54

Server storage [IO: ▲1.20MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 85 new files
Database: 5 new tables, 6 new options
New tables
wp_xfor_rooms
wp_xfor_settings
wp_xfor_room_types
wp_xfor_orders
wp_xfor_room_types_images
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Hotel Booking by Xfor: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲20215.13 ▲0.739.95 ▲8.2845.03 ▲0.32
Dashboard /wp-admin2,273 ▲846.26 ▲1.31133.97 ▲23.4851.01 ▲5.44
Posts /wp-admin/edit.php2,159 ▲702.97 ▲0.9849.24 ▲9.4144.47 ▲7.98
Add New Post /wp-admin/post-new.php1,575 ▲6123.98 ▲6.43691.20 ▲36.9946.48 ▼3.46
Media Library /wp-admin/upload.php1,452 ▲645.45 ▲1.20106.44 ▲7.9549.52 ▲8.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/hotel-booking-by-xfor/public/views/hotel_booking.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/hotel-booking-by-xfor/backend/views/home.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hotel-booking-by-xfor/backend/init.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hotel-booking-by-xfor/includes/ajax.php:119
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/hotel-booking-by-xfor/hotel-booking.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hotel-booking-by-xfor/public/init.php:8

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: reservation, booking, booking engine, room, hotel

hotel-booking-by-xfor/hotel-booking.php 92% from 13 tests

"Hotel Booking by Xfor" version 0.1.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hotel-booking-by-xfor.php" instead of "hotel-booking.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin5,717 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript211441572,439
PHP113811211,364
CSS7222391,067
PO File2345356734
SVG90258
Markdown214051
JSON4004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.33
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods11100.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
20 PNG files occupy 0.24MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshots/2.png29.13KB14.83KB▼ 49.11%
assets/libs/dx/imgs_dhx_material/controls.png0.74KB0.70KB▼ 6.31%
assets/screenshots/7.png36.05KB17.59KB▼ 51.20%
assets/libs/dx/imgs_dhx_material/clock_big.png1.33KB0.86KB▼ 35.80%
assets/libs/dx/imgs_dhx_material/export_pdf.png1.63KB0.43KB▼ 73.31%