72% bebetterhotels-booking-form

Code Review | BeBetterHotels Booking Form

WordPress plugin BeBetterHotels Booking Form scored 72% from 54 tests.

About plugin

  • Plugin page: bebetterhotels-bo...
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-5.2.4
  • WordPress version: 5.9.2
  • First release: Nov 28, 2019
  • Latest release: Dec 23, 2019
  • Number of updates: 5
  • Update frequency: every 5.4 days
  • Top authors: bebetterhotels (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 386 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼290.60ms] Passed 4 tests

Server-side resources used by BeBetterHotels Booking Form
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1054.42 ▲0.33
Dashboard /wp-admin3.45 ▲0.0433.00 ▼1.26
Posts /wp-admin/edit.php3.67 ▲0.0436.50 ▼1.35
Add New Post /wp-admin/post-new.php6.91 ▼0.0694.81 ▼1,160.13
Media Library /wp-admin/upload.php3.33 ▲0.0425.42 ▲2.05
BeBetterHotels /wp-admin/options-general.php?page=bebetterhotels3.2824.35

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 762 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Checking browser requirements for BeBetterHotels Booking Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,917 ▲16316.38 ▲0.4110.46 ▲3.502.48 ▼0.20
Dashboard /wp-admin2,897 ▲366.06 ▼0.10115.36 ▼18.94153.02 ▼13.21
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0162.62 ▼4.44139.08 ▼5.95
Add New Post /wp-admin/post-new.php1,761 ▲10021.34 ▲5.35435.14 ▲2.64158.75 ▲0.40
Media Library /wp-admin/upload.php1,703 ▲55.51 ▲0.00143.32 ▼2.97180.33 ▼7.97
BeBetterHotels /wp-admin/options-general.php?page=bebetterhotels8341.9736.2871.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • recovery_mode_email_last_sent

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
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=bebetterhotels
    • > Error in wp-content/plugins/bebetterhotels-booking-form/bbh-booking-form.php+100
    Uncaught UnexpectedValueException: DirectoryIterator::__construct(wp-content/plugins/bebetterhotels-booking-form/assets/css/jquery-ui/themes/1.13.1/): failed to open dir: No such file or directory in wp-content/plugins/bebetterhotels-booking-form/bbh-booking-form.php:100
    Stack trace:
    #0 wp-content/plugins/bebetterhotels-booking-form/bbh-booking-form.php(100): DirectoryIterator->__construct()
    #1 wp-includes/class-wp-hook.php(307): bbh_options_page_html()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/bebetterhotels-booking-form/bbh-booking-form.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/bebetterhotels-booking-form/templates/booking-form.php on line 2
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/bebetterhotels-booking-form/templates/booking-form.php on line 2
    • > PHP Notice
      Trying to get property 'locale' of non-object in wp-content/plugins/bebetterhotels-booking-form/templates/booking-form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bebetterhotels-booking-form/templates/options-general.php:2
    • > PHP Notice
      Trying to get property 'customer' of non-object in wp-content/plugins/bebetterhotels-booking-form/templates/booking-form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bebetterhotels-booking-form/includes/class-bbh-template-loader.php:4
    • > PHP Notice
      Trying to get property 'url' of non-object in wp-content/plugins/bebetterhotels-booking-form/templates/booking-form.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bebetterhotels-booking-form/templates/booking-form.php:7
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/bebetterhotels-booking-form/templates/booking-form.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: appointment, calendar, reservations, hotels, bebetterhotels...

bebetterhotels-booking-form/bbh-booking-form.php 85% from 13 tests

The principal PHP file in "BeBetterHotels Booking Form" v. 1.0.9 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("bebetterhotels-booking-form.php" instead of "bbh-booking-form.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin19,842 lines of code in 110 files:
LanguageFilesBlank linesComment linesLines of code
CSS996431,61919,116
PHP6107252451
PO File24848124
Sass180116
JavaScript26035

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods562.50%
▷ Protected methods337.50%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
646 PNG files occupy 1.84MB with 0.57MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/jquery-ui/themes/1.12.1/excite-bike/images/ui-icons_fcdd4a_256x240.png4.57KB4.18KB▼ 8.43%
assets/css/jquery-ui/themes/1.11.4/vader/images/ui-icons_cccccc_256x240.png6.81KB4.17KB▼ 38.71%
assets/css/jquery-ui/themes/1.12.1/south-street/images/ui-icons_808080_256x240.png6.95KB4.18KB▼ 39.83%
assets/css/jquery-ui/themes/1.12.1/ui-lightness/images/ui-icons_ffd27a_256x240.png4.57KB4.18KB▼ 8.43%
assets/css/jquery-ui/themes/1.11.4/eggplant/images/ui-bg_flat_0_eeeeee_40x100.png0.21KB0.08KB▼ 60.45%