83% brs-booking-reservation-system-woocommerce

Code Review | BRS - Booking & Reservation System (WooCommerce)

WordPress plugin BRS - Booking & Reservation System (WooCommerce) scored83%from 54 tests.

About plugin

  • Plugin page: brs-booking-reser...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 29, 2015
  • Latest release: Feb 2, 2015
  • Number of updates: 18
  • Update frequency: every 23.1 days
  • Top authors: uouapps (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

20+ active /12,961 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.48ms] Passed 4 tests

An overview of server-side resources used by BRS - Booking & Reservation System (WooCommerce)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.84 ▼5.21
Dashboard /wp-admin3.31 ▲0.0042.51 ▼7.60
Posts /wp-admin/edit.php3.36 ▲0.0045.24 ▼2.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.14 ▼22.80
Media Library /wp-admin/upload.php3.23 ▲0.0037.74 ▲6.11

Server storage [IO: ▲3.44MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 144 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for BRS - Booking & Reservation System (WooCommerce)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲7413.24 ▼1.061.52 ▼0.3245.74 ▼1.64
Dashboard /wp-admin2,215 ▲245.83 ▲0.93100.54 ▼5.2539.25 ▼3.17
Posts /wp-admin/edit.php2,098 ▲92.05 ▲0.0140.39 ▲0.2734.21 ▼0.46
Add New Post /wp-admin/post-new.php1,555 ▲1323.18 ▲4.92693.26 ▲91.8957.05 ▼1.27
Media Library /wp-admin/upload.php1,394 ▲124.25 ▼0.13108.41 ▲11.9946.44 ▲5.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Product' not found in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/class-uou-product-uou_booking.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/brs-booking-reservation-system-woocommerce/templates/single-product/add-to-cart/uou_booking.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/admin/views/uou-resource-booking-availability-fields.php:12
    • > PHP Warning
      Use of undefined constant UOU_BOOKINGS_DIR - assumed 'UOU_BOOKINGS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/class-uou-bookings-post-types.php on line 8
    • > PHP Warning
      include_once(UOU_BOOKINGS_DIR/includes/vendor/cuztom/cuztom.php): failed to open stream: No such file or directory in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/class-uou-bookings-post-types.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'Cuztom_Post_Type' not found in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/class-uou-bookings-post-types.php:10
    • > PHP Warning
      include_once(): Failed opening 'UOU_BOOKINGS_DIR/includes/vendor/cuztom/cuztom.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/class-uou-bookings-post-types.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/admin/views/uou-booking-tab.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/admin/views/uou-own-booking-availability.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/brs-booking-reservation-system-woocommerce/includes/vendor/wrapper/views/frontend.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

brs-booking-reservation-system-woocommerce/uou-bookings.php 77% from 13 tests

"BRS - Booking & Reservation System (WooCommerce)" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • 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
  • Main file name: The principal plugin file should be the same as the plugin slug ("brs-booking-reservation-system-woocommerce.php" instead of "uou-bookings.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 247 characters long)

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 detected23,108 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
CSS1390914411,869
JavaScript238644325,478
PHP531,3051,2083,602
SVG4001,492
LESS2133388
PO File173109183
Markdown134081
JSON10015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity14.12
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes42
▷ Abstract classes00.00%
▷ Concrete classes42100.00%
▷ Final classes00.00%
Methods182
▷ Static methods105.49%
▷ Public methods17998.35%
▷ Protected methods00.00%
▷ Private methods31.65%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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
16 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/cuztom/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
includes/vendor/cuztom/assets/images/jquery-ui/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
includes/vendor/cuztom/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
includes/vendor/cuztom/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
assets/css/chosen-sprite.png0.63KB0.88KB0.00%