58% booking-weir

Code Review | Booking Weir

WordPress plugin Booking Weir scored58%from 54 tests.

About plugin

  • Plugin page: booking-weir
  • Plugin version: 1.0.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.9.0
  • WordPress version: 6.3.1
  • First release: Jan 26, 2021
  • Latest release: Mar 1, 2022
  • Number of updates: 15
  • Update frequency: every 26.7 days
  • Top authors: websevendev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,101 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.37MB] [CPU: ▲30.22ms] 75% from 4 tests

Server-side resources used by Booking Weir
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.37MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.87 ▲5.1488.83 ▲41.31
Dashboard /wp-admin9.05 ▲5.4288.44 ▲16.24
Posts /wp-admin/edit.php9.10 ▲5.4287.77 ▲35.47
Add New Post /wp-admin/post-new.php11.78 ▲5.63128.44 ▲27.86
Media Library /wp-admin/upload.php9.00 ▲5.5186.89 ▲50.23
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius9.1474.48

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 1,359 new files
Database: no new tables, 10 new options
New WordPress options
fs_accounts
widget_recent-comments
widget_recent-posts
fs_debug_mode
widget_theysaidso_widget
fs_gdpr
theysaidso_admin_options
fs_active_plugins
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Booking Weir
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲9014.62 ▲0.251.84 ▲0.0429.77 ▼9.10
Dashboard /wp-admin2,254 ▲775.62 ▼0.0587.06 ▼9.8642.83 ▼1.02
Posts /wp-admin/edit.php2,157 ▲572.03 ▼0.0236.97 ▲1.1134.97 ▼0.08
Add New Post /wp-admin/post-new.php1,546 ▲623.30 ▲4.94627.71 ▼35.9674.30 ▲17.73
Media Library /wp-admin/upload.php1,459 ▲564.25 ▲0.0699.25 ▼3.6748.14 ▲0.09
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0991.6830.6532.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/booking-weir/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • fs_active_plugins
    • fs_gdpr
    • fs_debug_mode
    • db_upgraded
    • fs_accounts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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/booking-weir/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/booking-weir/vendor/stripe/stripe-php/build.php
  • 482× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/booking-weir/vendor/setasign/fpdi/src/PdfParser/Filter/Lzw.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/booking-weir/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\StripeClientInterface' not found in wp-content/plugins/booking-weir/vendor/stripe/stripe-php/lib/BaseStripeClient.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/booking-weir/vendor/mpdf/mpdf/src/Tag/Samp.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/booking-weir/vendor/stripe/stripe-php/lib/BitcoinReceiver.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\SetHtmlPageFooter' not found in wp-content/plugins/booking-weir/vendor/mpdf/mpdf/src/Tag/SetPageHeader.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/booking-weir/vendor/stripe/stripe-php/lib/Service/DisputeService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\CSSFunction' not found in wp-content/plugins/booking-weir/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/booking-weir/vendor/mpdf/mpdf/src/Tag/Option.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/booking-weir/vendor/stripe/stripe-php/lib/Service/AccountService.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 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
7 plugin tags: scheduling, appointment, events, booking, reservation...

booking-weir/booking-weir.php Passed 13 tests

The main file in "Booking Weir" v. 1.0.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
57 characters long description:
Display a calendar that allows to select and book a time.

Code Analysis 0% 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
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/booking-weir/vendor/stripe/stripe-php/data/ca-certificates.crt
153,102 lines of code in 1,131 files:
LanguageFilesBlank linesComment linesLines of code
PHP85756,22796,265127,744
JavaScript2031,76570515,321
Markdown151,26403,089
SVG30122,880
PO File19221,0282,338
JSON17320875
CSS166518422
LESS5737224
XML7130127
YAML41046
make19027
Sass1007
Ruby1002

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 7,009)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity35.07
▷ Minimum class complexity1.00
▷ Maximum class complexity7,009.00
Average method complexity6.61
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces92
Interfaces29
Traits13
Classes650
▷ Abstract classes294.46%
▷ Concrete classes62195.54%
▷ Final classes345.48%
Methods4,225
▷ Static methods50611.98%
▷ Public methods3,52583.43%
▷ Protected methods1694.00%
▷ Private methods53112.57%
Functions199
▷ Named functions12160.80%
▷ Anonymous functions7839.20%
Constants1,345
▷ Global constants1088.03%
▷ Class constants1,23791.97%
▷ Public constants1,237100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon.png8.45KB8.94KB0.00%
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
sui/flags.png27.46KB29.21KB0.00%