67% woo-bookings-extensions

Code Review | WooCommerce Bookings Extensions

WordPress plugin WooCommerce Bookings Extensions scored67%from 54 tests.

About plugin

  • Plugin page: woo-bookings-exte...
  • Plugin version: 3.0.1
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Jan 22, 2019
  • Latest release: Nov 11, 2022
  • Number of updates: 66
  • Update frequency: every 21.1 days
  • Top authors: mbezuidenhout (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,167 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
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.92ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Bookings Extensions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.92 ▼8.95
Dashboard /wp-admin3.31 ▼0.0453.60 ▼11.13
Posts /wp-admin/edit.php3.36 ▲0.0048.13 ▼0.78
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.61 ▼2.81
Media Library /wp-admin/upload.php3.23 ▲0.0039.07 ▲0.64

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Bookings Extensions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.76 ▲0.401.92 ▲0.1145.38 ▲1.84
Dashboard /wp-admin2,198 ▲215.59 ▼0.0684.57 ▼8.0338.47 ▼4.25
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0133.91 ▼8.0535.57 ▼1.55
Add New Post /wp-admin/post-new.php1,526 ▼022.89 ▼0.22698.17 ▲32.0971.10 ▲10.26
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.0399.93 ▼15.6045.23 ▼2.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-bookings-extensions/vendor/symfony/translation/Resources/bin/translation-status.php
    • > /wp-content/plugins/woo-bookings-extensions/admin/partials/woocommerce-bookings-extensions-admin-display.php
  • 195× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-bookings-extensions/vendor/johngrogg/ics-parser/tests/RecurrencesTest.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\InvalidArgumentException' not found in wp-content/plugins/woo-bookings-extensions/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/woo-bookings-extensions/vendor/symfony/translation/Loader/CsvFileLoader.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Provider\\ProviderInterface' not found in wp-content/plugins/woo-bookings-extensions/vendor/symfony/translation/Provider/NullProvider.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-bookings-extensions/vendor/johngrogg/ics-parser/tests/KeyValueTest.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/woo-bookings-extensions/vendor/symfony/translation/PseudoLocalizationTranslator.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Loader\\LoaderInterface' not found in wp-content/plugins/woo-bookings-extensions/vendor/symfony/translation/Loader/ArrayLoader.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\CarbonInterface' not found in wp-content/plugins/woo-bookings-extensions/vendor/nesbot/carbon/src/Carbon/Carbon.php:510
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-bookings-extensions/vendor/symfony/translation/Tests/Formatter/MessageFormatterTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-bookings-extensions/vendor/symfony/translation/Tests/Loader/QtFileLoaderTest.php:18

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 90% 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
7 plugin tags: calendar, bookings, booking, woocommerce, accommodation...

woo-bookings-extensions/woocommerce-bookings-extensions.php 77% from 13 tests

The main file in "WooCommerce Bookings Extensions" v. 3.0.1 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:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-bookings-extensions.php" instead of "woocommerce-bookings-extensions.php")
  • Requires PHP: Required version must match the one declared in readme.txt ("8.0.2" instead of "8.0")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/woo-bookings-extensions/vendor/nesbot/carbon/bin/carbon.bat
      • wp-content/plugins/woo-bookings-extensions/vendor/nesbot/carbon/bin/upgrade-carbon.bat
109,625 lines of code in 1,332 files:
LanguageFilesBlank linesComment linesLines of code
PHP9359,04228,61346,376
JavaScript2171,1524,12444,645
XSD499764,991
TypeScript16175594,708
HTML3645004,009
CSS244494701,882
JSON33001,720
Markdown323490883
XML1730328
PO File89147
YAML60017
Qt Linguist10010
DOS Batch2008
INI1001

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 157)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity14.67
▷ Minimum class complexity1.00
▷ Maximum class complexity311.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity157.00
Code structure
Namespaces40
Interfaces31
Traits26
Classes215
▷ Abstract classes146.51%
▷ Concrete classes20193.49%
▷ Final classes146.97%
Methods2,201
▷ Static methods41218.72%
▷ Public methods1,89185.92%
▷ Protected methods1818.22%
▷ Private methods1295.86%
Functions333
▷ Named functions10130.33%
▷ Anonymous functions23269.67%
Constants122
▷ Global constants86.56%
▷ Class constants11493.44%
▷ Public constants11197.37%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin