78% oscar-hotel-booking-engine

Code Review | Oscar Hotel Booking Engine

WordPress plugin Oscar Hotel Booking Engine scored78%from 54 tests.

About plugin

  • Plugin page: oscar-hotel-booki...
  • Plugin version: 4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 21, 2017
  • Latest release: Dec 19, 2022
  • Number of updates: 57
  • Update frequency: every 34.7 days
  • Top authors: redforts (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /7,702 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.71ms] Passed 4 tests

This is a short check of server-side resources used by Oscar Hotel Booking Engine
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0736.97 ▼11.66
Dashboard /wp-admin3.37 ▲0.0246.04 ▼17.04
Posts /wp-admin/edit.php3.48 ▲0.1247.35 ▼5.18
Add New Post /wp-admin/post-new.php5.96 ▲0.0897.74 ▲7.05
Media Library /wp-admin/upload.php3.29 ▲0.0636.48 ▲3.05

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 54 new files
Database: no new tables, 8 new options
New WordPress options
ohbe_settings
db_upgraded
widget_recent-comments
widget_ohbe_search_widget
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Oscar Hotel Booking Engine
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,964 ▲21815.12 ▲0.7720.96 ▲19.0337.12 ▼8.03
Dashboard /wp-admin2,241 ▲534.99 ▲0.13109.34 ▲4.1072.06 ▲34.12
Posts /wp-admin/edit.php2,126 ▲372.30 ▲0.2933.92 ▼2.3034.68 ▲1.92
Add New Post /wp-admin/post-new.php1,546 ▲1323.08 ▲0.07788.58 ▲99.7237.20 ▼25.68
Media Library /wp-admin/upload.php1,423 ▲354.33 ▲0.1199.32 ▼11.1779.85 ▲34.59

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_ohbe_search_widget
    • widget_theysaidso_widget

Smoke tests 50% 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 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
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/oscar-hotel-booking-engine/includes/admin/help-en.php
    • > /wp-content/plugins/oscar-hotel-booking-engine/includes/admin/help-es.php
    • > /wp-content/plugins/oscar-hotel-booking-engine/includes/admin/help-nl.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/oscar-hotel-booking-engine/includes/admin/widgets/ohbe-search-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/oscar-hotel-booking-engine/oscar-hotel-booking-engine.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/oscar-hotel-booking-engine/includes/templates/OHBE-virtual-page-creator.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/oscar-hotel-booking-engine/includes/templates/pages/booking.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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 important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

oscar-hotel-booking-engine/oscar-hotel-booking-engine.php 85% from 13 tests

The main PHP script in "Oscar Hotel Booking Engine" version 4.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin3,036 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP141705271,472
PO File935145819
JavaScript42943298
SVG100288
Sass63723156
CSS3153

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity22.17
▷ Minimum class complexity5.00
▷ Maximum class complexity32.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods74
▷ Static methods4459.46%
▷ Public methods7297.30%
▷ Protected methods00.00%
▷ Private methods22.70%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
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
assets/images/redforts-icon.png0.56KB0.40KB▼ 28.07%