78% tobook-hotel-booking-engine

Code Review | tobook Hotel Booking Engine

WordPress plugin tobook Hotel Booking Engine scored 78% from 54 tests.

About plugin

  • Plugin page: tobook-hotel-book...
  • Plugin version: 1.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-5.8
  • WordPress version: 6.3.1
  • First release: Jul 30, 2021
  • Latest release: Feb 28, 2022
  • Number of updates: 23
  • Update frequency: every 9.3 days
  • Top authors: tobook (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 696 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.01ms] Passed 4 tests

Server-side resources used by tobook Hotel Booking Engine
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.52 ▼3.48
Dashboard /wp-admin3.40 ▲0.1043.85 ▼3.87
Posts /wp-admin/edit.php3.52 ▲0.1645.97 ▲1.64
Add New Post /wp-admin/post-new.php5.98 ▲0.1090.56 ▼4.92
Media Library /wp-admin/upload.php3.33 ▲0.1034.37 ▲0.22
tbengine plugin /wp-admin/options-general.php?page=tbengine-plugin3.2729.92

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for tobook Hotel Booking Engine
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.29 ▼1.524.63 ▲2.4045.21 ▲0.61
Dashboard /wp-admin2,210 ▲194.83 ▼1.06107.08 ▲4.3641.72 ▼5.40
Posts /wp-admin/edit.php2,096 ▲72.03 ▼0.0139.95 ▲2.3334.63 ▲1.19
Add New Post /wp-admin/post-new.php1,535 ▲1518.24 ▼5.01595.25 ▼71.3365.63 ▲10.75
Media Library /wp-admin/upload.php1,392 ▲14.18 ▼0.0594.36 ▼5.3642.04 ▼2.32
tbengine plugin /wp-admin/options-general.php?page=tbengine-plugin8172.0425.5126.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=tbengine-plugin
    • > Notice in wp-content/plugins/tobook-hotel-booking-engine/tbengine-settings.php+154
    Trying to access array offset on value of type bool

SRP 50% 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
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/tobook-hotel-booking-engine/tbengine-params.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tobook-hotel-booking-engine/tbengine-settings.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tobook-hotel-booking-engine/tbengine.php:47
    • > PHP Notice
      Undefined variable: tbengine_params_init in wp-content/plugins/tobook-hotel-booking-engine/tbengine-params.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: reservation, tobook, engine, offers, travel...

tobook-hotel-booking-engine/tbengine.php 92% from 13 tests

"tobook Hotel Booking Engine" version 1.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tobook-hotel-booking-engine.php" instead of "tbengine.php")

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
Good job! No executable or dangerous file extensions detected11,568 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71,1001,3198,641
HTML4101,294
CSS1019141872
PHP311612577
PO File84056184

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin