84% mybooking-reservation-engine

Code Review | MyBooking Reservation Engine

WordPress plugin MyBooking Reservation Engine scored84%from 54 tests.

About plugin

  • Plugin page: mybooking-reserva...
  • Plugin version: 1.10.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Apr 4, 2020
  • Latest release: Aug 17, 2023
  • Number of updates: 64
  • Update frequency: every 19.2 days
  • Top authors: juanmiqueo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,586 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.00ms] Passed 4 tests

Analyzing server-side resources used by MyBooking Reservation Engine
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1343.48 ▲2.26
Dashboard /wp-admin3.45 ▲0.1450.60 ▲0.47
Posts /wp-admin/edit.php3.56 ▲0.2047.84 ▲1.55
Add New Post /wp-admin/post-new.php6.03 ▲0.1484.22 ▼8.28
Media Library /wp-admin/upload.php3.37 ▲0.1437.55 ▲2.83

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 180 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
widget_mybooking_rent_engine_selector_wizard_widget
db_upgraded
widget_mybooking_engine_contact_widget
widget_mybooking_transfer_engine_selector_widget
theysaidso_admin_options
widget_mybooking_activities_engine_activity_widget
widget_mybooking_rent_engine_selector_widget
widget_recent-posts
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for MyBooking Reservation Engine
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,993 ▲23216.53 ▲2.2575.24 ▲73.0345.93 ▼0.31
Dashboard /wp-admin2,198 ▲335.55 ▼0.0386.86 ▼4.0079.24 ▲31.00
Posts /wp-admin/edit.php2,118 ▲182.00 ▼0.0137.67 ▲1.8632.36 ▼2.52
Add New Post /wp-admin/post-new.php1,705 ▲17724.40 ▲1.24667.94 ▼3.7555.71 ▼3.86
Media Library /wp-admin/upload.php1,415 ▲154.13 ▲0.0297.62 ▼16.3176.13 ▲27.72

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 11 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_mybooking_engine_contact_widget
    • widget_mybooking_rent_engine_selector_wizard_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_mybooking_transfer_engine_selector_widget
    • widget_mybooking_activities_engine_activity_widget
    • theysaidso_admin_options
    • ...

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)
Everything seems fine, however this is by no means an exhaustive test

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 items
  • 75× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-selector-widget-tmpl.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-activities-activity-widget-tmpl.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-product-week-planning.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-routes-product.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-activities-order.php:11
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-transfer-selector-widget.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-planning-tmpl.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-transfer-checkout-tmpl.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_privacy_policy_url() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-cookies-notice.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/mybooking-reservation-engine/mybooking-templates/mybooking-plugin-selector-wizard-container.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: online booking system, tours booking system, car rental reservation, properties booking system, online booking engine...

mybooking-reservation-engine/mybooking-wp-plugin.php 92% from 13 tests

The main PHP script in "MyBooking Reservation Engine" version 1.10.5 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mybooking-reservation-engine.php" instead of "mybooking-wp-plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected34,927 lines of code in 138 files:
LanguageFilesBlank linesComment linesLines of code
PHP872,5702,10313,467
PO File63,1205,8989,938
CSS171,0123965,656
SVG20114,750
JavaScript61955636
Markdown23030480

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 117)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity34.38
▷ Minimum class complexity1.00
▷ Maximum class complexity406.00
Average method complexity4.64
▷ Minimum method complexity1.00
▷ Maximum method complexity117.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods218
▷ Static methods83.67%
▷ Public methods18584.86%
▷ Protected methods10.46%
▷ Private methods3214.68%
Functions17
▷ Named functions847.06%
▷ Anonymous functions952.94%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
19 PNG files occupy 0.29MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/styles/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
assets/styles/images/ui-bg_glass_75_ffffff_1x400.png0.10KB0.10KB▼ 4.67%
assets/img/flags@2x.png170.28KB68.04KB▼ 60.04%
assets/images/mybooking-logo-bn.png1.44KB0.82KB▼ 43.30%
assets/styles/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%