84% woocommerce-accommodation-bookings

Code Review | WooCommerce Accommodation Bookings

WordPress plugin WooCommerce Accommodation Bookings scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-accom...
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.2
  • WordPress version: 6.3.1
  • First release: Jan 6, 2016
  • Latest release: Oct 11, 2023
  • Number of updates: 93
  • Update frequency: every 30.7 days
  • Top authors: royho (15.05%)akeda (11.83%)sadowski (10.75%)bor0 (10.75%)jshreve (7.53%)

Code review

54 tests

User reviews

14 reviews

Install metrics

2,000+ active /138,067 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.43ms] Passed 4 tests

Server-side resources used by WooCommerce Accommodation Bookings
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0747.55 ▲2.13
Dashboard /wp-admin3.37 ▲0.0252.84 ▼11.84
Posts /wp-admin/edit.php3.48 ▲0.1252.63 ▲1.53
Add New Post /wp-admin/post-new.php5.95 ▲0.06101.74 ▼13.55
Media Library /wp-admin/upload.php3.29 ▲0.0639.65 ▲2.22

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Accommodation Bookings
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.28 ▼0.001.77 ▼0.2348.29 ▲2.20
Dashboard /wp-admin2,208 ▲345.64 ▲0.0693.58 ▼3.3945.95 ▲1.12
Posts /wp-admin/edit.php2,113 ▲101.99 ▼0.0145.71 ▲6.7840.37 ▲3.58
Add New Post /wp-admin/post-new.php1,536 ▲823.72 ▲0.66646.32 ▼18.5656.17 ▲2.79
Media Library /wp-admin/upload.php1,413 ▲134.20 ▲0.0097.98 ▼3.0543.56 ▼1.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woocommerce-accommodation-bookings/includes/admin/views/html-accommodation-booking-rates-fields.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function absint() in wp-content/plugins/woocommerce-accommodation-bookings/includes/admin/views/html-accommodation-booking-data.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woocommerce_wp_text_input() in wp-content/plugins/woocommerce-accommodation-bookings/includes/admin/views/html-accommodation-booking-rates.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woocommerce-accommodation-bookings/includes/admin/views/html-accommodation-booking-tabs.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woocommerce-accommodation-bookings/includes/admin/views/html-accommodation-booking-availability-fields.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woocommerce_wp_text_input() in wp-content/plugins/woocommerce-accommodation-bookings/includes/admin/views/html-accommodation-booking-availability.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === woocommerce-accommodation-bookings === )
The official readme.txt might help

woocommerce-accommodation-bookings/woocommerce-accommodation-bookings.php Passed 13 tests

The main PHP file in "WooCommerce Accommodation Bookings" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
64 characters long description:
An accommodations add-on for the WooCommerce Bookings extension.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected2,144 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP223697901,887
JavaScript53249207
Sass16049
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity19.83
▷ Minimum class complexity7.00
▷ Maximum class complexity52.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods98
▷ Static methods99.18%
▷ Public methods8889.80%
▷ Protected methods11.02%
▷ Private methods99.18%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin