94% 1day-io

Code Review | 1Day Booking Engine

WordPress plugin 1Day Booking Engine scored 94% from 54 tests.

About plugin

  • Plugin page: 1day-io
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8.2
  • WordPress version: 5.9.2
  • First release: Jul 6, 2021
  • Latest release: Dec 9, 2021
  • Number of updates: 34
  • Update frequency: every 4.8 days
  • Top authors: opanasenkomaksim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 396 total downloads

Benchmarks

Plugin footprint Passed 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.16MB] [CPU: ▼294.60ms] Passed 4 tests

Server-side resources used by 1Day Booking Engine
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2455.14 ▲4.41
Dashboard /wp-admin3.59 ▲0.1834.60 ▲0.52
Posts /wp-admin/edit.php3.82 ▲0.1840.37 ▲4.59
Add New Post /wp-admin/post-new.php7.06 ▲0.0998.22 ▼1,186.78
Media Library /wp-admin/upload.php3.47 ▲0.1727.38 ▲3.46

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 52 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by 1Day Booking Engine
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,965 ▲24216.80 ▲0.7811.78 ▲5.502.13 ▼0.46
Dashboard /wp-admin2,955 ▲946.75 ▲0.61120.03 ▼19.11151.33 ▼10.86
Posts /wp-admin/edit.php2,751 ▲573.04 ▼0.2073.04 ▲6.32157.88 ▲12.35
Add New Post /wp-admin/post-new.php1,704 ▲4316.93 ▼0.47442.12 ▲42.25204.63 ▲50.36
Media Library /wp-admin/upload.php1,764 ▲695.97 ▲0.47128.59 ▼12.79195.38 ▲6.14

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

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)
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 30× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/1day-io/inc/class/init/init_hotel_taxonomy.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/1day-io/inc/hooks/products-admin-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/1day-io/inc/shortcodes/search_results.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/1day-io/inc/class/sync/sync_hotels.php:22
    • > PHP Notice
      Undefined variable: room in wp-content/plugins/1day-io/inc/templates/rooms/rates/rates-list.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/1day-io/inc/hooks/search.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr__() in wp-content/plugins/1day-io/inc/templates/search/map.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/1day-io/inc/ajax/get_rates.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/1day-io/inc/shortcodes/search_form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/1day-io/inc/class/init/init_filter_post_type.php:11

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 Passed 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
6 plugin tags: booking system, reservation, hotel booking, channel manager, booking engine...

1day-io/1day-io.php Passed 13 tests

The entry point to "1Day Booking Engine" version 1.0.3 is a PHP file that has certain tags in its header comment area
48 characters long description:
The plugin display hotels and rooms from 1day.io

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin3,243 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP397161693,238
CSS2022
JavaScript2002
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity32.25
▷ Minimum class complexity1.00
▷ Maximum class complexity128.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods73
▷ Static methods45.48%
▷ Public methods6589.04%
▷ Protected methods00.00%
▷ Private methods810.96%
Functions68
▷ Named functions5276.47%
▷ Anonymous functions1623.53%
Constants8
▷ Global constants8100.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