84% wp-hotel-booking-woocommerce

Code Review | WP Hotel Booking WooCommerce

WordPress plugin WP Hotel Booking WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wp-hotel-booking-...
  • Plugin version: 1.9.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0
  • WordPress version: 6.3.1
  • First release: Nov 4, 2017
  • Latest release: Oct 11, 2022
  • Number of updates: 38
  • Update frequency: every 47.4 days
  • Top authors: leehld (55.26%)ThimPress (31.58%)phamtungpth (18.42%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /32,377 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.55ms] Passed 4 tests

An overview of server-side resources used by WP Hotel Booking WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.04 ▼1.18
Dashboard /wp-admin3.31 ▲0.0046.21 ▼2.96
Posts /wp-admin/edit.php3.36 ▲0.0049.75 ▲3.64
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.14 ▼13.69
Media Library /wp-admin/upload.php3.23 ▲0.0036.43 ▲4.70

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Hotel Booking WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.19 ▼1.181.81 ▲0.0944.71 ▲3.57
Dashboard /wp-admin2,206 ▲205.00 ▲0.06103.03 ▼18.1140.69 ▼3.30
Posts /wp-admin/edit.php2,089 ▼02.15 ▲0.1236.31 ▼4.4533.21 ▼5.81
Add New Post /wp-admin/post-new.php1,547 ▲2518.42 ▼4.62636.63 ▲2.8480.28 ▲26.60
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.0397.41 ▼0.0742.56 ▲0.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/wp-hotel-booking-woocommerce/templates/woocommerce/cart/cart.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-hotel-booking-woocommerce/includes/admin/views/wc-settings.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-hotel-booking-woocommerce/wp-hotel-booking-woocommerce.php:1087
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wp-hotel-booking-woocommerce/templates/woocommerce/emails/email-order-details.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: reservation, woocommerce, hotel booking, booking, hotel...

wp-hotel-booking-woocommerce/wp-hotel-booking-woocommerce.php 85% from 13 tests

Analyzing the main PHP file in "WP Hotel Booking WooCommerce" version 1.9.5
It is important to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/lang/" does not exist
  • Requires at least: Required version must match the one declared in readme.txt ("5.8" instead of "3.5")

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
Success! There were no dangerous files found in this plugin1,510 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP154127281,500
CSS1209
JavaScript1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity22.88
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods90
▷ Static methods77.78%
▷ Public methods8796.67%
▷ Protected methods00.00%
▷ Private methods33.33%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin