79% wp-hotelier

Code Review | WP Hotelier

WordPress plugin WP Hotelier scored79%from 54 tests.

About plugin

  • Plugin page: wp-hotelier
  • Plugin version: 2.11.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 19, 2017
  • Latest release: Sep 19, 2023
  • Number of updates: 123
  • Update frequency: every 18.6 days
  • Top authors: benitolopez (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

3,000+ active /72,387 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: ▲3.14MB] [CPU: ▲14.42ms] Passed 4 tests

This is a short check of server-side resources used by WP Hotelier
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.94 ▲2.4850.37 ▲10.57
Dashboard /wp-admin6.68 ▲3.3773.54 ▲23.12
Posts /wp-admin/edit.php6.73 ▲3.3764.35 ▲16.01
Add New Post /wp-admin/post-new.php9.29 ▲3.40117.11 ▲7.99
Media Library /wp-admin/upload.php6.58 ▲3.3556.07 ▲23.56
Add New /wp-admin/post-new.php?post_type=room6.8273.21
Categories /wp-admin/edit-tags.php?taxonomy=room_cat&post_type=room6.5850.20
Extras /wp-admin/edit.php?post_type=extra6.6552.75
Add Reservation /wp-admin/admin.php?page=hotelier-add-reservation6.5451.94
Facilities /wp-admin/edit-tags.php?taxonomy=room_facilities&post_type=room6.5852.61
All Rooms /wp-admin/edit.php?post_type=room6.6552.36
Settings /wp-admin/admin.php?page=hotelier-settings6.6757.80
Reservations /wp-admin/edit.php?post_type=room_reservation6.6663.53
Rates /wp-admin/edit-tags.php?taxonomy=room_rate&post_type=room6.5853.05
Logs /wp-admin/admin.php?page=hotelier-logs6.5146.43

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 391 new files
Database: 5 new tables, 13 new options
New tables
wp_hotelier_reservation_itemmeta
wp_hotelier_bookings
wp_hotelier_reservation_items
wp_hotelier_sessions
wp_hotelier_rooms_bookings
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
hotelier_version
widget_hotelier-widget-rooms
hotelier_settings
widget_theysaidso_widget
widget_hotelier-widget-ajax-room-booking
widget_hotelier-widget-rooms-filter
widget_hotelier-widget-room-search
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Hotelier
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲24914.17 ▼0.446.96 ▲5.2437.87 ▼1.07
Dashboard /wp-admin2,304 ▲1195.82 ▼0.0398.08 ▼7.9335.03 ▼7.27
Posts /wp-admin/edit.php2,187 ▲982.02 ▲0.0237.31 ▼6.2134.10 ▲0.49
Add New Post /wp-admin/post-new.php1,599 ▲6022.99 ▲4.75657.06 ▲45.5653.03 ▼5.52
Media Library /wp-admin/upload.php1,489 ▲984.17 ▼0.0896.12 ▼0.1042.80 ▼0.49
Add New /wp-admin/post-new.php?post_type=room3,4897.69208.85111.79
Categories /wp-admin/edit-tags.php?taxonomy=room_cat&post_type=room1,3662.1432.6429.19
Extras /wp-admin/edit.php?post_type=extra1,1352.0032.4626.79
Add Reservation /wp-admin/admin.php?page=hotelier-add-reservation9801.8426.0836.10
Facilities /wp-admin/edit-tags.php?taxonomy=room_facilities&post_type=room1,3412.2026.0827.23
All Rooms /wp-admin/edit.php?post_type=room1,1972.5741.8927.37
Settings /wp-admin/admin.php?page=hotelier-settings3,1893.3453.8943.65
Reservations /wp-admin/edit.php?post_type=room_reservation1,2032.2433.5027.36
Rates /wp-admin/edit-tags.php?taxonomy=room_rate&post_type=room1,3352.1425.1628.38
Logs /wp-admin/admin.php?page=hotelier-logs9461.7224.4531.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 5 tables in the database
    • wp_hotelier_rooms_bookings
    • wp_hotelier_reservation_items
    • wp_hotelier_sessions
    • wp_hotelier_reservation_itemmeta
    • wp_hotelier_bookings
  • Zombie WordPress options were found after uninstall: 13 options
    • widget_theysaidso_widget
    • widget_hotelier-widget-booking
    • widget_hotelier-widget-rooms-filter
    • widget_recent-posts
    • widget_hotelier-widget-room-search
    • theysaidso_admin_options
    • hotelier_settings
    • hotelier_version
    • can_compress_scripts
    • widget_recent-comments
    • ...

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% 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
8 plugin tags: booking, reservations, wphotelier, rooms, hostel...

wp-hotelier/hotelier.php 69% from 13 tests

This is the main PHP file of "WP Hotelier" version 2.11.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-hotelier.php" instead of "hotelier.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.1" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin42,128 lines of code in 371 files:
LanguageFilesBlank linesComment linesLines of code
PHP3196,8459,31822,491
SVG140128,788
CSS92,4093778,162
JavaScript28306711,506
XML127161,181

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity24.20
▷ Minimum class complexity1.00
▷ Maximum class complexity156.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes80
▷ Abstract classes22.50%
▷ Concrete classes7897.50%
▷ Final classes11.28%
Methods834
▷ Static methods18822.54%
▷ Public methods76791.97%
▷ Protected methods313.72%
▷ Private methods364.32%
Functions230
▷ Named functions22798.70%
▷ Anonymous functions31.30%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/frontend/photoswipe/default-skin/default-skin.png0.53KB0.72KB0.00%
assets/images/placeholder.png1.13KB1.24KB0.00%