72% wp-base-booking-of-appointments-services-and-events

Code Review | WP BASE Booking of Appointments, Services and Events

WordPress plugin WP BASE Booking of Appointments, Services and Events scored72%from 54 tests.

About plugin

  • Plugin page: wp-base-booking-o...
  • Plugin version: 3.9.7
  • PHP compatiblity: 5.5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 8, 2018
  • Latest release: Nov 2, 2023
  • Number of updates: 112
  • Update frequency: every 17.7 days
  • Top authors: PuckRobin (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

400+ active /30,448 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲7.88MB] [CPU: ▲59.51ms] 25% from 4 tests

Server-side resources used by WP BASE Booking of Appointments, Services and Events
Please take the time to fix the following items
  • RAM: Total memory usage must be kept under 10MB (currently 11.88MB on /wp-admin/admin.php?page=appointments)
  • CPU: Total CPU usage must kept under 500.00ms (currently 2,996.91ms on /wp-admin/admin.php?page=app_addons)
  • Extra RAM: The extra memory usage must be under 5MB (currently 7.88MB on /wp-admin/admin.php?page=appointments)
PageMemory (MB)CPU Time (ms)
Home /9.92 ▲6.4684.81 ▲46.17
Dashboard /wp-admin11.70 ▲8.35163.88 ▲100.05
Posts /wp-admin/edit.php11.71 ▲8.35108.58 ▲62.54
Add New Post /wp-admin/post-new.php14.26 ▲8.37154.64 ▲68.39
Media Library /wp-admin/upload.php11.60 ▲8.3696.96 ▲60.94
Business Settings /wp-admin/admin.php?page=app_business11.74115.24
Your Bookings /wp-admin/users.php?page=your_bookings11.7895.47
Clients /wp-admin/admin.php?page=app_clients11.6396.12
Schedules /wp-admin/admin.php?page=app_schedules11.94103.49
Payment History /wp-admin/admin.php?page=app_transactions11.6287.36
Global Settings /wp-admin/admin.php?page=app_settings11.8489.86
Monetary Settings /wp-admin/admin.php?page=app_monetary11.83116.33
Addons /wp-admin/admin.php?page=app_addons12.032,996.91
Tools /wp-admin/admin.php?page=app_tools11.6294.22
Dashboard /wp-admin/admin.php?page=appointments11.88109.79

Server storage [IO: ▲6.24MB] [DB: ▲0.20MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 461 new files
Database: 9 new tables, 16 new options
New tables
wp_base_wh_a
wp_base_meta
wp_base_workers
wp_base_services
wp_base_wh_w
wp_base_wh_s
wp_base_transactions
wp_base_locations
wp_base_bookings
New WordPress options
wp_base_last_update
can_compress_scripts
widget_appointments_theme_selector
wp_base_db_version
widget_appointments_services
widget_recent-posts
widget_recent-comments
db_upgraded
widget_appointments_monthly_calendar
wp_base_installed
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP BASE Booking of Appointments, Services and Events
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,302 ▲55613.20 ▼1.174.73 ▲3.1340.93 ▼2.96
Dashboard /wp-admin2,504 ▲3235.62 ▼0.1099.55 ▼2.9044.70 ▲6.27
Posts /wp-admin/edit.php2,344 ▲2472.02 ▲0.0841.13 ▲5.7237.28 ▲4.24
Add New Post /wp-admin/post-new.php1,747 ▲21622.56 ▼0.63792.35 ▲83.2674.19 ▲20.77
Media Library /wp-admin/upload.php1,672 ▲2724.34 ▲0.14102.03 ▼1.7040.34 ▼4.54
Business Settings /wp-admin/admin.php?page=app_business1,9476.06126.3183.00
Your Bookings /wp-admin/users.php?page=your_bookings1,1624.0578.9027.26
Clients /wp-admin/admin.php?page=app_clients1,3933.6760.6028.95
Schedules /wp-admin/admin.php?page=app_schedules1,3354.6285.0947.37
Payment History /wp-admin/admin.php?page=app_transactions1,6534.0569.2835.84
Global Settings /wp-admin/admin.php?page=app_settings2,3324.0177.1138.24
Monetary Settings /wp-admin/admin.php?page=app_monetary2,1833.9173.7753.81
Addons /wp-admin/admin.php?page=app_addons2,7975.2974.0868.44
Tools /wp-admin/admin.php?page=app_tools1,1433.4761.1329.73
Dashboard /wp-admin/admin.php?page=appointments2,1753.9372.9031.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure failed, leaving 9 tables in the database
    • wp_base_wh_a
    • wp_base_transactions
    • wp_base_wh_w
    • wp_base_workers
    • wp_base_bookings
    • wp_base_meta
    • wp_base_locations
    • wp_base_services
    • wp_base_wh_s
  • The uninstall procedure has failed, leaving 16 options in the database
    • widget_recent-comments
    • wp_base_last_update
    • theysaidso_admin_options
    • widget_appointments_monthly_calendar
    • widget_appointments_service_providers
    • widget_theysaidso_widget
    • appointments_salt
    • widget_recent-posts
    • wp_base_db_version
    • wp_base_shortcodes
    • ...

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-base-booking-of-appointments-services-and-events/sample/sample-appointments-page.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BASE() in wp-content/plugins/wp-base-booking-of-appointments-services-and-events/includes/admin/service-props.php:369
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/wp-base-booking-of-appointments-services-and-events/wp-base.php:32
    • > PHP Notice
      Undefined variable: mce_locale in wp-content/plugins/wp-base-booking-of-appointments-services-and-events/includes/admin/tinymce/langs/langs.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-base-booking-of-appointments-services-and-events/sample/sample-custom-functions.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_contents() in wp-content/plugins/wp-base-booking-of-appointments-services-and-events/includes/admin/tinymce/langs/langs.php:10

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-base-booking-of-appointments-services-and-events/wp-base.php 85% from 13 tests

The primary PHP file in "WP BASE Booking of Appointments, Services and Events" version 3.9.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-base-booking-of-appointments-services-and-events.php" instead of "wp-base.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected77,269 lines of code in 248 files:
LanguageFilesBlank linesComment linesLines of code
PHP738,16811,05836,033
JavaScript1452,5802,12421,257
CSS273,00798019,927
SVG315052

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 121)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity74.33
▷ Minimum class complexity1.00
▷ Maximum class complexity490.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity121.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes84
▷ Abstract classes00.00%
▷ Concrete classes84100.00%
▷ Final classes22.38%
Methods1,540
▷ Static methods1399.03%
▷ Public methods1,32586.04%
▷ Protected methods322.08%
▷ Private methods18311.88%
Functions311
▷ Named functions28992.93%
▷ Anonymous functions227.07%
Constants62
▷ Global constants4674.19%
▷ Class constants1625.81%
▷ Public constants16100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
186 PNG files occupy 0.89MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/cupertino/images/ui-icons_72a7cf_256x240.png4.44KB4.17KB▼ 6.02%
css/flick/images/ui-icons_0073ea_256x240.png4.44KB4.17KB▼ 6.02%
css/base/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
css/humanity/images/ui-icons_f35f07_256x240.png4.44KB4.17KB▼ 6.02%
css/pepper-grinder/images/ui-bg_fine-grain_10_eceadf_60x60.png10.51KB1.42KB▼ 86.44%