89% lh-booking-widget

Code Review | Little Hotelier Booking Widget

WordPress plugin Little Hotelier Booking Widget scored89%from 54 tests.

About plugin

  • Plugin page: lh-booking-widget
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.3
  • WordPress version: 6.3.1
  • First release: Jan 5, 2017
  • Latest release: Oct 24, 2022
  • Number of updates: 5
  • Update frequency: every 423.2 days
  • Top authors: carl-alberto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,020 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by Little Hotelier Booking Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.75 ▲3.94
Dashboard /wp-admin3.33 ▲0.0247.32 ▼1.44
Posts /wp-admin/edit.php3.38 ▲0.0245.96 ▲1.55
Add New Post /wp-admin/post-new.php5.91 ▲0.0278.73 ▼19.74
Media Library /wp-admin/upload.php3.25 ▲0.0235.50 ▲0.84

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_lhw_widget
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Little Hotelier Booking Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.28 ▼0.092.02 ▲0.3244.07 ▼0.10
Dashboard /wp-admin2,192 ▲185.49 ▼0.0393.16 ▲9.9340.84 ▼2.14
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0233.22 ▼5.5936.04 ▲1.60
Add New Post /wp-admin/post-new.php1,529 ▼823.19 ▲4.96660.07 ▲47.8147.31 ▼20.96
Media Library /wp-admin/upload.php1,400 ▼34.20 ▲0.02103.51 ▲3.0447.58 ▲4.58

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_lhw_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: wordpress, little hotelier, plugin, booking widget

lh-booking-widget/little-hotelier-booking-widget.php 69% from 13 tests

Analyzing the main PHP file in "Little Hotelier Booking Widget" version 1.2.1
Please take the time to 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: Name the main plugin file the same as the plugin slug ("lh-booking-widget.php" instead of "little-hotelier-booking-widget.php")
  • Domain Path: The domain path is invalid: folder "/lang/" does not exist
  • Requires at least: Required version does not match the one declared in readme.txt ("3.9" instead of "4.0")

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
No dangerous file extensions were detected78 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3238278

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin