73% motopress-hotel-booking-lite

Code Review | Hotel Booking Lite

WordPress plugin Hotel Booking Lite scored73%from 54 tests.

About plugin

  • Plugin page: motopress-hotel-b...
  • Plugin version: 4.8.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Apr 4, 2018
  • Latest release: Nov 24, 2023
  • Number of updates: 191
  • Update frequency: every 10.8 days
  • Top authors: jetmonsters (58.12%)MotoPress (38.22%)endzevich (4.71%)

Code review

54 tests

User reviews

54 reviews

Install metrics

10,000+ active /438,613 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲10.25MB] [CPU: ▲113.90ms] 25% from 4 tests

Analyzing server-side resources used by Hotel Booking Lite
Please fix the following
  • RAM: Total memory usage must be kept under 10MB (currently 13.60MB on /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_room_attribute)
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,510.29ms on /wp-admin/admin.php?page=mphb_extensions)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 10.25MB on /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_room_attribute)
PageMemory (MB)CPU Time (ms)
Home /13.05 ▲9.59126.90 ▲86.03
Dashboard /wp-admin13.80 ▲10.49268.93 ▲221.55
Posts /wp-admin/edit.php13.87 ▲10.50164.95 ▲110.49
Add New Post /wp-admin/post-new.php18.91 ▲13.02219.88 ▲129.52
Media Library /wp-admin/upload.php13.64 ▲10.41162.64 ▲129.56
Seasons /wp-admin/edit.php?post_type=mphb_season13.77153.22
Payment History /wp-admin/edit.php?post_type=mphb_payment13.77152.68
Extensions /wp-admin/admin.php?page=mphb_extensions13.891,510.29
Customers /wp-admin/admin.php?page=mphb_customers13.94132.21
Shortcodes /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_shortcodes13.60133.45
Calendar /wp-admin/admin.php?page=mphb_calendar13.59131.53
Amenities /wp-admin/edit-tags.php?taxonomy=mphb_room_type_facility&post_type=mphb_room_type13.76135.44
Reports /wp-admin/admin.php?page=mphb_reports14.16151.85
Generate Accommodations /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_rooms_generator13.60139.59
Attributes /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_room_attribute13.60137.73

Server storage [IO: ▲10.46MB] [DB: ▲0.04MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 681 new files
Database: 7 new tables, 12 new options
New tables
wp_mphb_sync_stats
wp_mphb_api_keys
wp_mphb_customers_meta
wp_mphb_sync_urls
wp_mphb_customers
wp_mphb_sync_logs
wp_mphb_sync_queue
New WordPress options
widget_theysaidso_widget
widget_mphb_search_availability_widget
widget_mphb_rooms_widget
mphb_passed_notices
mphb_registered_attributes
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
mphb_custom_roles_version
...

Browser metrics Passed 4 tests

A check of browser resources used by Hotel Booking Lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,081 ▲31913.80 ▼0.4817.76 ▲15.9040.26 ▼5.09
Dashboard /wp-admin2,368 ▲2015.62 ▼0.0195.59 ▼16.4748.12 ▲5.38
Posts /wp-admin/edit.php2,270 ▲1702.13 ▲0.1940.34 ▼1.0338.82 ▲4.85
Add New Post /wp-admin/post-new.php1,644 ▲11818.90 ▼4.46677.52 ▲72.3340.69 ▼6.70
Media Library /wp-admin/upload.php1,570 ▲1704.17 ▼0.05109.59 ▲12.0350.23 ▲7.22
Seasons /wp-admin/edit.php?post_type=mphb_season1,2402.0539.6435.91
Payment History /wp-admin/edit.php?post_type=mphb_payment1,2892.0435.8336.28
Extensions /wp-admin/admin.php?page=mphb_extensions1,2432.5741.5339.51
Customers /wp-admin/admin.php?page=mphb_customers1,2832.4642.5432.66
Shortcodes /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_shortcodes3,0361.6528.8039.65
Calendar /wp-admin/admin.php?page=mphb_calendar1,7632.3147.2137.12
Amenities /wp-admin/edit-tags.php?taxonomy=mphb_room_type_facility&post_type=mphb_room_type1,4652.3032.9837.62
Reports /wp-admin/admin.php?page=mphb_reports1,5083.4885.3940.07
Generate Accommodations /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_rooms_generator1,0291.8130.0529.99
Attributes /wp-admin/edit.php?post_type=mphb_room_type&page=mphb_room_attribute1,0091.6627.1330.59

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie tables were found after uninstall: 7 tables
    • wp_mphb_customers
    • wp_mphb_sync_logs
    • wp_mphb_customers_meta
    • wp_mphb_sync_urls
    • wp_mphb_sync_queue
    • wp_mphb_sync_stats
    • wp_mphb_api_keys
  • This plugin does not fully uninstall, leaving 12 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_mphb_rooms_widget
    • widget_recent-posts
    • mphb_custom_roles_version
    • db_upgraded
    • mphb_db_version
    • mphb_registered_attributes
    • ...

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 | 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
Please fix the following
  • 219× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\Advanced\\Api\\Data\\AbstractPostData' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/advanced/api/data/payment-data.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\Admin\\Fields\\TextField' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/admin/fields/color-picker-field.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\PostTypes\\EditableCPT' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/post-types/service-cpt.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\PostTypes\\EditableCPT' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/post-types/attributes-cpt.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'MPHB\\BookingRules\\RuleVerifyInterface' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/booking-rules/abstract-rule.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\BackgroundPausableProcess' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/upgrades/background-booking-upgrader-2-2-0.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\Emails\\Booking\\Customer\\BaseEmail' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/emails/booking/customer/pending-email.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\PostTypes\\AbstractCPT' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/post-types/editable-cpt.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\Admin\\Fields\\InputField' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/admin/fields/install-plugin-field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MPHB\\Advanced\\Api\\Controllers\\AbstractRestObjectController' not found in wp-content/plugins/motopress-hotel-booking-lite/includes/advanced/api/controllers/v1/accommodation-type-attributes-controller.php:11

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: You are using too many tags: 20 tag instead of maximum 10
The official readme.txt is a good inspiration

motopress-hotel-booking-lite/motopress-hotel-booking.php 85% from 13 tests

The primary PHP file in "Hotel Booking Lite" version 4.8.5 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("motopress-hotel-booking-lite.php" instead of "motopress-hotel-booking.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected190,566 lines of code in 638 files:
LanguageFilesBlank linesComment linesLines of code
PO File2651,1421,430106,500
PHP47213,74015,92153,558
JavaScript1073,6013,34321,717
CSS289677908,507
Markdown2600130
XML109117
SVG10019
JSON10018

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.61
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces63
Interfaces3
Traits1
Classes362
▷ Abstract classes359.67%
▷ Concrete classes32790.33%
▷ Final classes20.61%
Methods3,477
▷ Static methods40511.65%
▷ Public methods2,58174.23%
▷ Protected methods58216.74%
▷ Private methods3149.03%
Functions282
▷ Named functions17260.99%
▷ Anonymous functions11039.01%
Constants259
▷ Global constants20.77%
▷ Class constants25799.23%
▷ Public constants257100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendors/woothemes-FlexSlider/images/bg_play_pause.png1.51KB0.52KB▼ 65.52%