46% ameliabooking

Code Review | Booking for Appointments and Events Calendar - Amelia

WordPress plugin Booking for Appointments and Events Calendar - Amelia scored46%from 54 tests.

About plugin

  • Plugin page: ameliabooking
  • Plugin version: 1.0.91
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3.2
  • WordPress version: 6.3.1
  • First release: Dec 11, 2018
  • Latest release: Nov 14, 2023
  • Number of updates: 159
  • Update frequency: every 11.3 days
  • Top authors: ameliabooking (100%)

Code review

54 tests

User reviews

494 reviews

Install metrics

60,000+ active /484,892 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.82MB] [CPU: ▲20.17ms] Passed 4 tests

A check of server-side resources used by Booking for Appointments and Events Calendar - Amelia
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.26 ▲1.8069.68 ▲24.59
Dashboard /wp-admin5.19 ▲1.8964.85 ▲16.23
Posts /wp-admin/edit.php5.19 ▲1.8462.94 ▲19.47
Add New Post /wp-admin/post-new.php12.48 ▲6.60168.95 ▲71.97
Media Library /wp-admin/upload.php4.99 ▲1.7654.81 ▲20.39
Custom Fields /wp-admin/admin.php?page=wpamelia-cf5.23375.21
Notifications /wp-admin/admin.php?page=wpamelia-notifications5.23298.95
Appointments /wp-admin/admin.php?page=wpamelia-appointments5.24297.55
Customers /wp-admin/admin.php?page=wpamelia-customers5.22287.94
Dashboard /wp-admin/admin.php?page=wpamelia-dashboard5.24312.11
Locations /wp-admin/admin.php?page=wpamelia-locations5.21309.37
Events /wp-admin/admin.php?page=wpamelia-events5.27308.58
Calendar /wp-admin/admin.php?page=wpamelia-calendar5.23482.13
Finance /wp-admin/admin.php?page=wpamelia-finance5.22287.12
Services /wp-admin/admin.php?page=wpamelia-services5.27291.23

Server storage [IO: ▲182.13MB] [DB: ▲0.10MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • The filesystem usage should be lower than 25MB (currently using 182.13MB)
Filesystem: 6,410 new files
Database: 55 new tables, 7 new options
New tables
wp_amelia_services_views
wp_amelia_packages
wp_amelia_providers_to_google_calendar
wp_amelia_customer_bookings_to_events_periods
wp_amelia_providers_to_locations
wp_amelia_events_tags
wp_amelia_appointments
wp_amelia_providers_views
wp_amelia_providers_to_periods
wp_amelia_coupons_to_events
...
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
amelia_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for Booking for Appointments and Events Calendar - Amelia
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲16214.46 ▲0.091.81 ▼0.0027.68 ▼16.50
Dashboard /wp-admin2,311 ▲1345.55 ▼0.0794.37 ▲4.5179.36 ▲39.92
Posts /wp-admin/edit.php2,219 ▲1162.01 ▲0.0644.68 ▲8.6938.45 ▲0.39
Add New Post /wp-admin/post-new.php6,315 ▲4,77818.96 ▼4.511,097.79 ▲393.5140.84 ▼13.11
Media Library /wp-admin/upload.php1,519 ▲1224.23 ▲0.0895.19 ▼8.4681.97 ▲38.00
Custom Fields /wp-admin/admin.php?page=wpamelia-cf1,7299.44195.1187.10
Notifications /wp-admin/admin.php?page=wpamelia-notifications3,14711.70175.97119.08
Appointments /wp-admin/admin.php?page=wpamelia-appointments1,6228.03100.4286.85
Customers /wp-admin/admin.php?page=wpamelia-customers1,9999.1894.0144.15
Dashboard /wp-admin/admin.php?page=wpamelia-dashboard2,04210.41154.5968.01
Locations /wp-admin/admin.php?page=wpamelia-locations1,9479.2285.4657.14
Events /wp-admin/admin.php?page=wpamelia-events1,70210.4388.0143.85
Calendar /wp-admin/admin.php?page=wpamelia-calendar2,75918.6691.6688.66
Finance /wp-admin/admin.php?page=wpamelia-finance2,0118.6991.9750.25
Services /wp-admin/admin.php?page=wpamelia-services1,73110.0991.9044.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 55 tables in the database
    • wp_amelia_providers_to_timeouts
    • wp_amelia_notifications_to_entities
    • wp_amelia_providers_to_specialdays_periods_location
    • wp_amelia_customer_bookings_to_extras
    • wp_amelia_custom_fields_events
    • wp_amelia_services_views
    • wp_amelia_customer_bookings
    • wp_amelia_providers_to_daysoff
    • wp_amelia_categories
    • wp_amelia_appointments
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • amelia_settings
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=wpamelia-services
    • > POST request to /wp-admin/admin-ajax.php?action=wpamelia_api&call=/users/providers&ameliaNonce=65d208e7af
    • > Notice in wp-content/plugins/ameliabooking/src/Application/Services/User/ProviderApplicationService.php+322
    Undefined index: externalId

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
Please fix the following items
  • 30× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/ameliabooking/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie_and_session.php
    • > /wp-content/plugins/ameliabooking/src/Infrastructure/ContainerConfig/application.services.php
    • > /wp-content/plugins/ameliabooking/src/Infrastructure/ContainerConfig/infrastructure.user.php
    • > /wp-content/plugins/ameliabooking/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/ameliabooking/src/Infrastructure/ContainerConfig/command.bus.php
    • > /wp-content/plugins/ameliabooking/view/backend/view.php
    • > /wp-content/plugins/ameliabooking/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/invalid_cookie_name.php
    • > /wp-content/plugins/ameliabooking/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/storage.php
    • > /wp-content/plugins/ameliabooking/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_samesite_strict.php
    • > /wp-content/plugins/ameliabooking/src/Infrastructure/ContainerConfig/domain.event.bus.php
  • 2610× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Microsoft\\Graph\\Core\\Enum' not found in wp-content/plugins/ameliabooking/vendor/microsoft/microsoft-graph/src/Model/DeviceManagementExchangeAccessStateReason.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Microsoft\\Graph\\Core\\Enum' not found in wp-content/plugins/ameliabooking/vendor/microsoft/microsoft-graph/src/Model/RatingCanadaMoviesType.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'AmeliaStripe\\Service\\AbstractService' not found in wp-content/plugins/ameliabooking/vendor/stripe/stripe-php/lib/Service/FileService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Microsoft\\Graph\\Model\\Entity' not found in wp-content/plugins/ameliabooking/vendor/microsoft/microsoft-graph/src/Model/EducationClass.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'AmeliaStripe\\Service\\AbstractService' not found in wp-content/plugins/ameliabooking/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Omnipay\\PayPal\\Message\\RestResponse' not found in wp-content/plugins/ameliabooking/vendor/omnipay/paypal/src/Message/RestAuthorizeResponse.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/ameliabooking/vendor/microsoft/microsoft-graph/tests/Functional/WebhooksTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'AmeliaBooking\\Infrastructure\\Repository\\AbstractRepository' not found in wp-content/plugins/ameliabooking/src/Infrastructure/Repository/Bookable/Service/PackageCustomerServiceRepository.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Microsoft\\Graph\\Core\\Enum' not found in wp-content/plugins/ameliabooking/vendor/microsoft/microsoft-graph/src/Model/MobileAppContentFileUploadState.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Omnipay\\Mollie\\Message\\Response\\AbstractMollieResponse' not found in wp-content/plugins/ameliabooking/vendor/omnipay/mollie/src/Message/Response/RevokeCustomerMandateResponse.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpamelia-services
    • > Console-api (warning) in wp-content/plugins/ameliabooking/public/js/chunks/amelia-booking-services-c2f27f531c55883118ec.js+0:338566
    Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props
    • > GET request to /wp-admin/admin.php?page=wpamelia-notifications
    • > Deprecation (warning) in unknown
    /wp-content/plugins/ameliabooking/public/js/chunks/amelia-booking-notifications-c2f27f531c55883118ec.js 0 Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=wpamelia-dashboard
    • > Console-api (warning) in wp-content/plugins/ameliabooking/public/js/chunks/amelia-booking-dashboard-c2f27f531c55883118ec.js+0:385408
    bar chart: \"scales.[x/y]Axes.barThickness\" is deprecated. Please use \"dataset.barThickness\" instead
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpamelia-dashboard
    • > Console-api (warning) in wp-content/plugins/ameliabooking/public/js/chunks/amelia-booking-dashboard-c2f27f531c55883118ec.js+0:385408
    bar chart: \"scales.[x/y]Axes.barPercentage\" is deprecated. Please use \"dataset.barPercentage\" instead
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpamelia-dashboard
    • > Console-api (warning) in wp-content/plugins/ameliabooking/public/js/chunks/amelia-booking-dashboard-c2f27f531c55883118ec.js+0:385408
    bar chart: \"scales.[x/y]Axes.categoryPercentage\" is deprecated. Please use \"dataset.categoryPercentage\" instead

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

ameliabooking/ameliabooking.php 92% from 13 tests

"Booking for Appointments and Events Calendar - Amelia" version 1.0.91's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 157 characters long)

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please fix the following items
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/ameliabooking/vendor/stripe/stripe-php/data/ca-certificates.crt
    • .xlsm - Excel Macro-Enabled Workbook in Microsoft Excel
      • wp-content/plugins/ameliabooking/vendor/symfony/http-foundation/Tests/File/Fixtures/case-sensitive-mime-type.xlsm
613,491 lines of code in 4,884 files:
LanguageFilesBlank linesComment linesLines of code
PHP3,46152,428174,496263,960
Vuejs Component41215,7506,132112,618
PO File3363,865110,73686,755
JavaScript3938,06867846,392
LESS476,40977132,087
JSON611031,195
Markdown1075,613018,252
Sass14267317,559
CSS511017915,845
SVG2522624,175
XML1765502,727
C118847879
YAML239019538
C/C++ Header24046132
reStructuredText19413597
Bourne Shell1203492
Pascal2417479
m41111141
make214038
HTML10014
Dockerfile18010
INI1016

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 191)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.36
▷ Minimum class complexity1.00
▷ Maximum class complexity515.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity191.00
Code structure
Namespaces441
Interfaces157
Traits33
Classes3,170
▷ Abstract classes702.21%
▷ Concrete classes3,10097.79%
▷ Final classes34711.19%
Methods20,570
▷ Static methods1,5877.72%
▷ Public methods18,93792.06%
▷ Protected methods9154.45%
▷ Private methods7183.49%
Functions717
▷ Named functions14820.64%
▷ Anonymous functions56979.36%
Constants3,266
▷ Global constants912.79%
▷ Class constants3,17597.21%
▷ Public constants3,175100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
990 compressed PNG files occupy 4.44MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/flags/pe.png0.54KB0.73KB0.00%
v3/src/assets/img/flags/sc.png0.88KB1.17KB0.00%
public/img/flags/cu.png0.83KB0.98KB0.00%
assets/img/flags/cd.png0.95KB1.16KB0.00%
public/img/flags/mq.png0.87KB1.09KB0.00%