83% astro-booking-engine

Code Review | Astro Booking Engine

WordPress plugin Astro Booking Engine scored83%from 54 tests.

About plugin

  • Plugin page: astro-booking-engine
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.1
  • WordPress version: 6.3.1
  • First release: May 10, 2023
  • Latest release: Sep 27, 2023
  • Number of updates: 13
  • Update frequency: every 10.8 days
  • Top authors: alian (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /217 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▲2.23ms] Passed 4 tests

An overview of server-side resources used by Astro Booking Engine
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0557.82 ▲12.46
Dashboard /wp-admin3.39 ▲0.0558.40 ▼4.72
Posts /wp-admin/edit.php3.44 ▲0.0960.80 ▲10.90
Add New Post /wp-admin/post-new.php5.99 ▲0.1192.65 ▼9.72
Media Library /wp-admin/upload.php3.32 ▲0.0955.19 ▲21.17
Booking engine /wp-admin/admin.php?page=astro-booking-engine3.7270.04

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 426 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_astro_be
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Astro Booking Engine
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲21213.88 ▼0.7010.77 ▲8.7743.71 ▼0.36
Dashboard /wp-admin2,243 ▲665.96 ▲0.2795.56 ▲4.8666.28 ▲20.98
Posts /wp-admin/edit.php2,168 ▲682.39 ▲0.3940.72 ▲5.5234.03 ▼6.39
Add New Post /wp-admin/post-new.php1,739 ▲21322.88 ▲5.31684.00 ▲33.3640.43 ▼11.61
Media Library /wp-admin/upload.php1,452 ▲584.48 ▲0.2494.40 ▼5.0885.87 ▲42.71
Booking engine /wp-admin/admin.php?page=astro-booking-engine5,6542.1936.6944.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_astro_be
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 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
Please take a closer look at the following
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/astro-booking-engine/includes/tabs/tab-settings-verticalbooking.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/astro-booking-engine/templates/iperbooking.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/astro-booking-engine/templates/passepartout.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/astro-booking-engine/includes/tabs/tab-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/astro-booking-engine/includes/classes/class-astro-booking-engine-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/astro-booking-engine/templates/simplebooking.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/astro-booking-engine/astro-booking-engine-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/astro-booking-engine/templates/verticalbooking.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/astro-booking-engine/includes/tabs/tab-settings-passepartout.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/astro-booking-engine/includes/tabs/tab-layout.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: hotel widget, booking engine, hotel booking engine, hotel booking, reservation widget...

astro-booking-engine/astro-booking-engine.php 85% from 13 tests

The primary PHP file in "Astro Booking Engine" version 1.2.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.0" instead of "7.2")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("6.0.1" instead of "5.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin48,309 lines of code in 109 files:
LanguageFilesBlank linesComment linesLines of code
CSS831,4702,23043,288
PHP184041794,168
PO File2341547525
JavaScript611399328

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.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

All PNG images should be compressed to minimize bandwidth usage for end users
312 PNG files occupy 0.99MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendors/jquery-ui-themes/themes/start/images/ui-icons_fcd113_256x240.png4.56KB4.18KB▼ 8.31%
vendors/jquery-ui-themes/themes/trontastic/images/ui-icons_ffffff_256x240.png6.39KB4.18KB▼ 34.52%
vendors/jquery-ui-themes/themes/humanity/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png0.42KB0.16KB▼ 62.82%
vendors/jquery-ui-themes/themes/eggplant/images/ui-icons_8d78a5_256x240.png4.56KB4.18KB▼ 8.31%
vendors/jquery-ui-themes/themes/blitzer/images/ui-bg_glass_55_fbf8ee_1x400.png0.44KB0.13KB▼ 70.00%