68% bma-lite-appointment-booking-and-scheduling

Code Review | BMA Lite - Appointment Booking and Scheduling Plugin

WordPress plugin BMA Lite - Appointment Booking and Scheduling Plugin scored68%from 54 tests.

About plugin

  • Plugin page: bma-lite-appointm...
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2.0
  • WordPress version: 6.3.1
  • First release: Feb 6, 2020
  • Latest release: Apr 29, 2023
  • Number of updates: 22
  • Update frequency: every 53.5 days
  • Top authors: redefiningtheweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,425 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.93ms] Passed 4 tests

An overview of server-side resources used by BMA Lite - Appointment Booking and Scheduling Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.16 ▼0.14
Dashboard /wp-admin3.47 ▲0.1353.38 ▼10.26
Posts /wp-admin/edit.php3.59 ▲0.2359.54 ▲0.49
Add New Post /wp-admin/post-new.php6.03 ▲0.1589.96 ▼5.82
Media Library /wp-admin/upload.php3.38 ▲0.1538.67 ▲3.56
Coupons /wp-admin/admin.php?page=rtwbmal-coupon3.4348.14
Customers /wp-admin/admin.php?page=rtwbmal-customers3.4344.71
Appearance /wp-admin/admin.php?page=rtwbmal-appearance3.4339.37
Pro Features /wp-admin/admin.php?page=rtwbmal-pro3.4638.72
Template /wp-admin/admin.php?page=rtwbmal-template3.4140.23
SMS Notifications /wp-admin/admin.php?page=rtwbmal-sms_notifications3.5134.58
Appointments /wp-admin/admin.php?page=rtwbmal-appointments3.5845.10
Forms /wp-admin/admin.php?page=rtwbmal-forms3.4140.45
Status /wp-admin/admin.php?page=rtwbmal-status3.3839.71
Employees /wp-admin/admin.php?page=rtwbmal-emp_members3.5646.14

Server storage [IO: ▲20.93MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 1,874 new files
Database: 15 new tables, 7 new options
New tables
wp_rtwbma_customer_appointments
wp_rtwbma_emp_loc
wp_rtwbma_locations
wp_rtwbma_sms_notifications
wp_rtwbma_payments
wp_rtwbma_emp_hour_break
wp_rtwbma_employees
wp_rtwbma_email_notifications
wp_rtwbma_emp_working_hour
wp_rtwbma_notifications_sent
...
New WordPress options
db_upgraded
widget_recent-comments
rtwbmal_lite_installed
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for BMA Lite - Appointment Booking and Scheduling Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,188 ▲44215.58 ▲1.2317.95 ▲16.0139.26 ▼5.19
Dashboard /wp-admin2,416 ▲2256.44 ▲1.56131.75 ▲22.9687.91 ▲46.26
Posts /wp-admin/edit.php2,340 ▲2513.40 ▲1.3651.83 ▲12.5470.96 ▲34.69
Add New Post /wp-admin/post-new.php1,583 ▲6123.03 ▲0.08656.37 ▲2.8496.28 ▲31.16
Media Library /wp-admin/upload.php1,476 ▲884.13 ▼0.0982.49 ▼17.5372.36 ▲25.35
Coupons /wp-admin/admin.php?page=rtwbmal-coupon1,5883.5767.8193.32
Customers /wp-admin/admin.php?page=rtwbmal-customers1,6973.4669.9568.75
Appearance /wp-admin/admin.php?page=rtwbmal-appearance1,5163.6644.7879.80
Pro Features /wp-admin/admin.php?page=rtwbmal-pro1,5103.5240.07120.85
Template /wp-admin/admin.php?page=rtwbmal-template1,6123.5155.9083.95
SMS Notifications /wp-admin/admin.php?page=rtwbmal-sms_notifications2,6333.9358.5984.26
Appointments /wp-admin/admin.php?page=rtwbmal-appointments3,0534.19109.0767.51
Forms /wp-admin/admin.php?page=rtwbmal-forms1,3343.3551.5062.72
Status /wp-admin/admin.php?page=rtwbmal-status1,1893.4940.4783.42
Employees /wp-admin/admin.php?page=rtwbmal-emp_members9,0653.5255.5990.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables were found after uninstall: 15 tables
    • wp_rtwbma_emp_services
    • wp_rtwbma_payments
    • wp_rtwbma_categories
    • wp_rtwbma_emp_hour_break
    • wp_rtwbma_locations
    • wp_rtwbma_emp_loc
    • wp_rtwbma_appointments
    • wp_rtwbma_customer_appointments
    • wp_rtwbma_emp_working_hour
    • wp_rtwbma_customers
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • rtwbmal_lite_installed
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=rtwbmal-coupon
    • > Notice in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/coupon/rtwbmal-coupon-display.php+70
    Undefined variable: rtwbmal_all_categories
    • > GET request to /wp-admin/admin.php?page=rtwbmal-coupon
    • > Notice in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/coupon/rtwbmal-coupon-display.php+84
    Undefined variable: rtwbmal_all_services
    • > GET request to /wp-admin/admin.php?page=rtwbmal-coupon
    • > Notice in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/coupon/rtwbmal-coupon-display.php+96
    Undefined variable: rtwbmal_all_employees

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 take a closer look at the following
  • 26× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/dashboard/rtwbmal-dashboard-display.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/rtwbma_without_verify.php:4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/customers/rtwbmal-customers-display.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/appointments/rtwbmal-appointments-display.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/pro_features/rtwbmal-pro-features.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/sms_notifications/rtwbmal-sms_notifications-display.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/rtwbmal-book-my-appointment.php:29
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/emp_members/rtwbmal-emp_members-display.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/payments/rtwbmal-payments-display.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/bma-lite-appointment-booking-and-scheduling/admin/partials/email_notifications/rtwbmal-email_notifications-display.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
Please fix the following attributes:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

bma-lite-appointment-booking-and-scheduling/rtwbmal-book-my-appointment.php 85% from 13 tests

The principal PHP file in "BMA Lite - Appointment Booking and Scheduling Plugin" v. 1.4.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bma-lite-appointment-booking-and-scheduling.php" instead of "rtwbmal-book-my-appointment.php")
  • 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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin181,040 lines of code in 1,818 files:
LanguageFilesBlank linesComment linesLines of code
JSON70058,488
JavaScript1245,3634,66145,319
YAML40024,272
CSS513,87345315,535
SVG1,55102515,158
PHP351,0238669,158
Sass18505344,649
LESS18502554,607
TypeScript513103,834
Markdown520020

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity50.86
▷ Minimum class complexity1.00
▷ Maximum class complexity276.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods99
▷ Static methods33.03%
▷ Public methods9494.95%
▷ Protected methods00.00%
▷ Private methods55.05%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png1.72KB0.89KB▼ 48.26%
assets/images/logof.png1.52KB0.51KB▼ 66.39%
assets/images/skype.png12.59KB4.74KB▼ 62.39%
assets/images/Delete-icon.png2.89KB0.67KB▼ 76.75%
assets/images/logobma.png1.39KB0.62KB▼ 55.60%