61% ota-sync-booking-engine-widget

Code Review | OTA Sync Booking Engine Widget

WordPress plugin OTA Sync Booking Engine Widget scored61%from 54 tests.

About plugin

  • Plugin page: ota-sync-booking-...
  • Plugin version: 1.2.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2022
  • Latest release: Sep 11, 2023
  • Number of updates: 25
  • Update frequency: every 18.7 days
  • Top authors: otasync (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /966 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.71MB] [CPU: ▼55.99ms] Passed 4 tests

Server-side resources used by OTA Sync Booking Engine Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.27 ▼1.195.09 ▼39.97
Dashboard /wp-admin2.29 ▼1.015.46 ▼47.98
Posts /wp-admin/edit.php2.29 ▼1.067.28 ▼47.12
Add New Post /wp-admin/post-new.php2.29 ▼3.597.69 ▼88.88
Media Library /wp-admin/upload.php2.29 ▼0.936.24 ▼29.43
Wiget Settings /wp-admin/admin.php?page=otasync_widget_settings2.296.88
Iframe Settings /wp-admin/admin.php?page=iframe_widget_settings2.296.45
OTA Sync /wp-admin/admin.php?page=otasync_w_options2.296.66

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 19 new options
New WordPress options
otasync_w_background_color
show_destinations
widget_ota_sync_widget
otasync_w_fields_bg_color
can_compress_scripts
otasync_w_user_id
otasync_w_fields_border_color
otasync_w_fields_text_color
widget_recent-posts
widget_recent-comments
...

Browser metrics 75% from 4 tests

Checking browser requirements for OTA Sync Booking Engine Widget
Having an awesome user experience is important, so please improve the following
  • Nodes: Limit the number of DOM nodes under 25,000 (currently 41,590 on /wp-admin/admin.php?page=iframe_widget_settings)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8413.26 ▼1.051.70 ▼0.4245.05 ▲3.77
Dashboard /wp-admin2,236 ▲575.84 ▼0.02103.80 ▼4.5974.85 ▲33.00
Posts /wp-admin/edit.php2,122 ▲332.01 ▼0.0437.49 ▼4.7234.66 ▼1.27
Add New Post /wp-admin/post-new.php1,693 ▲17922.33 ▲4.65746.03 ▲80.6957.84 ▲2.15
Media Library /wp-admin/upload.php1,415 ▲274.22 ▲0.00102.03 ▼5.7180.44 ▲35.14
Wiget Settings /wp-admin/admin.php?page=otasync_widget_settings1,0902.0327.3631.03
Iframe Settings /wp-admin/admin.php?page=iframe_widget_settings41,59011.24715.50226.78
OTA Sync /wp-admin/admin.php?page=otasync_w_options8082.0524.9826.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the otasync_custom_css_file handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 19 options in the database
    • otasync_w_fields_text_color
    • widget_recent-comments
    • show_destinations
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • otasync_w_fields_border_color
    • otasync_w_lang
    • widget_recent-posts
    • otasync_w_background_color
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=otasync_w_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the otasync_custom_css_file handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=otasync_w_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the otasync_bs_css_file handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=otasync_w_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the otasync_datepicker_css_file handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=otasync_w_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the otasync_style_css_file2 handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otasync\\Ota_Sync_Booking_Engine_Widget\\register_activation_hook() in wp-content/plugins/ota-sync-booking-engine-widget/otasync-widget.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/ota-sync-booking-engine-widget/assets/scripts.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=otasync_widget_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=otasync_widget_settings 209 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=otasync_widget_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=otasync_widget_settings 213 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=otasync_widget_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=otasync_widget_settings 217 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=otasync_widget_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=otasync_widget_settings 221 The specified value "#fff" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=otasync_widget_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=otasync_widget_settings 225 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=otasync_widget_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=otasync_widget_settings 229 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=otasync_widget_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=otasync_widget_settings 233 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=iframe_widget_settings
    • > Network (severe)
    https://checkout.flutterwave.com/v3.js - Failed to load resource: the server responded with a status of 403 ()
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=otasync_w_options
    • > Javascript (severe) in unknown
    https://app.otasync.me/engine/en/assets/js/main.js?v=1 77:1129 Uncaught TypeError: Cannot read properties of null (reading 'forEach')
    • > GET request to /wp-admin/admin.php?page=iframe_widget_settings
    • > Console-api (severe) in unknown
    https://app.otasync.me/engine/en/assets/js/call.js?v=1 0:7238 TypeError: Failed to fetchat https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7127at new Promise ()at getGeoLocation (https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7107)at https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7304at new Promise ()at getVisitorCountry (https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7284)at https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:8897at new Promise ()at getVisitorCurrency (https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7401)at setHeader (https://app.otasync.me/engine/en/assets/js/header.js?v=1:312:31)
    • > GET request to /wp-admin/admin.php?page=iframe_widget_settings
    • > Console-api (severe) in unknown
    https://app.otasync.me/engine/en/assets/js/header.js?v=1 312:16 TypeError: Failed to fetchat https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7127at new Promise ()at getGeoLocation (https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7107)at https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7304at new Promise ()at getVisitorCountry (https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7284)at https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:8897at new Promise ()at getVisitorCurrency (https://app.otasync.me/engine/en/assets/js/call.js?v=1:1:7401)at setHeader (https://app.otasync.me/engine/en/assets/js/header.js?v=1:312:31)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add a description for screenshot #0 in ota-sync-booking-engine-widget/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Screenshot.url), #2 (screenshotulr2)
The official readme.txt is a good inspiration

ota-sync-booking-engine-widget/otasync-widget.php 85% from 13 tests

The entry point to "OTA Sync Booking Engine Widget" version 1.2.5 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ota-sync-booking-engine-widget.php" instead of "otasync-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected7,599 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,9881,7206,972
PHP27273445
CSS42516182

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png9.73KB4.07KB▼ 58.21%
assets/logo.png3.48KB1.20KB▼ 65.52%
assets/banner-772x250.png83.40KB32.37KB▼ 61.18%
assets/logo-2.png2.79KB2.76KB▼ 1.36%
assets/icon-256x256.png25.17KB10.07KB▼ 59.98%