68% booking-for-woocommerce

Code Review | Booking Addon for WooCommerce

WordPress plugin Booking Addon for WooCommerce scored 68% from 54 tests.

About plugin

  • Plugin page: booking-for-wooco...
  • Plugin version: 4.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 5.9.2
  • First release: Oct 23, 2019
  • Latest release: Mar 25, 2022
  • Number of updates: 50
  • Update frequency: every 17.7 days
  • Top authors: mvvapps (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

2,000+ active / 20,496 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
Installer ran successfully

Server metrics [RAM: ▲4.55MB] [CPU: ▼270.10ms] Passed 4 tests

This is a short check of server-side resources used by Booking Addon for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.37 ▲4.8678.78 ▲29.83
Dashboard /wp-admin8.39 ▲4.9859.94 ▲26.67
Posts /wp-admin/edit.php8.39 ▲4.7561.56 ▲25.38
Add New Post /wp-admin/post-new.php10.59 ▲3.62115.96 ▼1,152.71
Media Library /wp-admin/upload.php8.39 ▲5.1045.73 ▲20.28
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.3943.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 261 new files
Database: no new tables, 5 new options
New WordPress options
mvvwb_version
fs_gdpr
fs_accounts
fs_active_plugins
fs_debug_mode

Browser metrics Passed 4 tests

Booking Addon for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,866 ▲12216.36 ▲0.789.09 ▲3.012.27 ▼0.02
Dashboard /wp-admin2,956 ▲956.82 ▲0.58128.94 ▼6.11177.02 ▲13.78
Posts /wp-admin/edit.php2,752 ▲613.32 ▲0.0766.43 ▲2.75156.77 ▲12.78
Add New Post /wp-admin/post-new.php1,744 ▲7520.96 ▼0.58476.77 ▲49.36160.38 ▼0.86
Media Library /wp-admin/upload.php1,756 ▲555.99 ▲0.44138.35 ▼8.72212.60 ▲22.75
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,4682.8857.53114.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/booking-for-woocommerce/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 5 options in the database
    • fs_accounts
    • mvvwb_version
    • fs_gdpr
    • fs_debug_mode
    • fs_active_plugins

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/booking-for-woocommerce/include/views/admin-root.php
    • > /wp-content/plugins/booking-for-woocommerce/include/views/footer-scripts.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant MVVWB_TOKEN - assumed 'MVVWB_TOKEN' (this will throw an Error in a future version of PHP) in wp-content/plugins/booking-for-woocommerce/include/views/admin-root.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: booking, booking plugin, woocommerce, appointment plugin

booking-for-woocommerce/booking.php 85% from 13 tests

The primary PHP file in "Booking Addon for WooCommerce" version 4.2.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("3.9" instead of "4.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("booking-for-woocommerce.php" instead of "booking.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin37,900 lines of code in 217 files:
LanguageFilesBlank linesComment linesLines of code
PHP1288,13116,55136,107
JSON200705
PO File1224225474
CSS13527304
JavaScript723462263
XML14047

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity87.55
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.63
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods1,326
▷ Static methods19414.63%
▷ Public methods98574.28%
▷ Protected methods151.13%
▷ Private methods32624.59%
Functions143
▷ Named functions11379.02%
▷ Anonymous functions3020.98%
Constants139
▷ Global constants11482.01%
▷ Class constants2517.99%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/booking-for-woocommerce.png11.25KB4.39KB▼ 60.94%