78% mwb-bookings-for-woocommerce

Code Review | Bookings for WooCommerce - Schedule Appointments, Manage Bookings, Show Availability, Calendar Listings

WordPress plugin Bookings for WooCommerce - Schedule Appointments, Manage Bookings, Show Availability, Calendar Listings scored78%from 54 tests.

About plugin

  • Plugin page: mwb-bookings-for-...
  • Plugin version: 3.1.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 21, 2021
  • Latest release: Nov 15, 2023
  • Number of updates: 29
  • Update frequency: every 31.4 days
  • Top authors: wpswings (72.41%)makewebbetter (31.03%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /28,850 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.00MB] [CPU: ▼4.97ms] Passed 4 tests

A check of server-side resources used by Bookings for WooCommerce - Schedule Appointments, Manage Bookings, Show Availability, Calendar Listings
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.65 ▲3.34
Dashboard /wp-admin3.31 ▲0.0043.25 ▼4.41
Posts /wp-admin/edit.php3.36 ▲0.0046.42 ▼0.96
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.14 ▼15.72
Media Library /wp-admin/upload.php3.23 ▲0.0035.59 ▲1.22

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Bookings for WooCommerce - Schedule Appointments, Manage Bookings, Show Availability, Calendar Listings
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.351.79 ▲0.0043.64 ▲5.51
Dashboard /wp-admin2,198 ▲215.65 ▲0.0793.94 ▼1.5344.14 ▲5.48
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0340.54 ▼0.0937.65 ▼1.21
Add New Post /wp-admin/post-new.php1,526 ▼223.48 ▲0.28651.62 ▲10.5054.88 ▼0.24
Media Library /wp-admin/upload.php1,403 ▲64.24 ▲0.05102.27 ▲2.1945.81 ▲0.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mwb-bookings-for-woocommerce/common/partials/mwb-bookings-for-woocommerce-common-display.php
    • > /wp-content/plugins/mwb-bookings-for-woocommerce/public/partials/mwb-bookings-for-woocommerce-public-display.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Product' not found in wp-content/plugins/mwb-bookings-for-woocommerce/includes/class-wc-product-mwb-booking.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mwb-bookings-for-woocommerce/index.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/mwb-bookings-for-woocommerce/public/partials/wps-mybookings-details-tab.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mwb-bookings-for-woocommerce/public/index.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/mwb-bookings-for-woocommerce/onboarding/templates/mwb-bookings-for-woocommerce-onboarding-template.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: appointment booking, availability calendar, scheduling, booking system, calendar...

mwb-bookings-for-woocommerce/mwb-bookings-for-woocommerce.php 92% from 13 tests

The main file in "Bookings for WooCommerce - Schedule Appointments, Manage Bookings, Show Availability, Calendar Listings" v. 3.1.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 409 characters long)

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
Good job! No executable or dangerous file extensions detected31,934 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1071,0731,21720,895
CSS255762775,112
PHP346242,1414,947
PO File1255334621
JSON400249
Markdown4760103
SVG5005
XML1002

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity52.75
▷ Minimum class complexity1.00
▷ Maximum class complexity207.00
Average method complexity5.13
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods148
▷ Static methods85.41%
▷ Public methods13792.57%
▷ Protected methods21.35%
▷ Private methods96.08%
Functions20
▷ Named functions1785.00%
▷ Anonymous functions315.00%
Constants1
▷ Global constants1100.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
54 compressed PNG files occupy 0.23MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/lib/datatables/media/images/sort_desc.png0.15KB0.25KB0.00%
admin/image/checked.png0.49KB0.42KB▼ 14.14%
package/lib/datatables/media/images/sort_desc_disabled.png0.14KB0.25KB0.00%
admin/image/star.png2.62KB2.67KB0.00%
admin/image/YouTube_32px.png0.41KB0.25KB▼ 39.48%