67% bus-booking-manager

Code Review | Multipurpose Ticket Booking Manager (Bus/Train/Ferry/Boat/Shuttle)

WordPress plugin Multipurpose Ticket Booking Manager (Bus/Train/Ferry/Boat/Shuttle) scored67%from 54 tests.

About plugin

  • Plugin page: bus-booking-manager
  • Plugin version: 4.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Sep 24, 2018
  • Latest release: Sep 25, 2023
  • Number of updates: 79
  • Update frequency: every 23.2 days
  • Top authors: magepeopleteam (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active /13,678 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: ▲0.61MB] [CPU: ▼2.20ms] Passed 4 tests

Analyzing server-side resources used by Multipurpose Ticket Booking Manager (Bus/Train/Ferry/Boat/Shuttle)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6448.55 ▲9.88
Dashboard /wp-admin3.95 ▲0.6454.35 ▲3.35
Posts /wp-admin/edit.php4.00 ▲0.6449.34 ▼7.11
Add New Post /wp-admin/post-new.php6.49 ▲0.6090.20 ▼13.74
Media Library /wp-admin/upload.php3.81 ▲0.5841.87 ▲8.71
Install WBBM Plugins /wp-admin/plugins.php?page=wbbm-plugins3.8837.07
Quick Setup /wp-admin/admin.php?page=wbbm_init_quick_setup3.7836.07
Bus /wp-admin/admin.php?page=wbbm_bus3.7837.55

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 144 new files
Database: 1 new table, 6 new options
New tables
wp_wbbm_bus_booking_list
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Multipurpose Ticket Booking Manager (Bus/Train/Ferry/Boat/Shuttle)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,074 ▲30313.38 ▼1.022.00 ▲0.3246.50 ▲5.77
Dashboard /wp-admin2,477 ▲2865.23 ▲0.36122.70 ▲18.9546.74 ▲1.95
Posts /wp-admin/edit.php2,321 ▲2292.20 ▲0.0847.01 ▲6.9538.17 ▲4.67
Add New Post /wp-admin/post-new.php1,596 ▲6723.52 ▲5.21648.17 ▲4.2157.54 ▲4.52
Media Library /wp-admin/upload.php1,687 ▲2994.55 ▲0.36106.08 ▲11.2147.70 ▲1.36
Install WBBM Plugins /wp-admin/plugins.php?page=wbbm-plugins1,1291.9045.6930.09
Quick Setup /wp-admin/admin.php?page=wbbm_init_quick_setup1,1572.3748.4852.97
Bus /wp-admin/admin.php?page=wbbm_bus1,1572.3747.5444.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_wbbm_bus_booking_list
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however 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
Please fix the following items
  • 25× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: cpt_label in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_configuration.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_pickuppoint.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_ondayoffday.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'MAGE_Setting_API' not found in wp-content/plugins/bus-booking-manager/inc/wbbm_admin_settings.php:8
    • > PHP Warning
      Use of undefined constant WBTM_PLUGIN_URL - assumed 'WBTM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_configuration.php on line 2
    • > PHP Notice
      Undefined variable: cpt_label in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_routing.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bus-booking-manager/templates/taxonomy-organozer.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_configuration.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_routing.php:3
    • > PHP Warning
      Use of undefined constant WBTM_PLUGIN_URL - assumed 'WBTM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/bus-booking-manager/inc/clean/layout/bus_tax.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/plugins.php?page=wbbm-plugins
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: mp_date_format is not defined" "ReferenceError: mp_date_format is not defined\n at mp_load_date_picker (/wp-content/plugins/bus-booking-manager//assets/helper/mp_style/mp_script.js?ver=1696993607:79:15)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/bus-booking-manager//assets/helper/mp_style/mp_script.js?ver=1696993607:94:3)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/plugins.php?page=wbbm-plugins
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).find(...).sortable is not a function" "TypeError: $(...).find(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/bus-booking-manager//assets/admin/mp_admin_settings.js?ver=1696993607:22:41)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wbbm_bus
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: mp_date_format is not defined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wbbm_bus
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).find(...).sortable is not a function
    • > GET request to /wp-admin/admin.php?page=wbbm_init_quick_setup
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: mp_date_format is not defined" "ReferenceError: mp_date_format is not defined\n at mp_load_date_picker (/wp-content/plugins/bus-booking-manager//assets/helper/mp_style/mp_script.js?ver=1696993608:79:15)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/bus-booking-manager//assets/helper/mp_style/mp_script.js?ver=1696993608:94:3)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wbbm_init_quick_setup
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).find(...).sortable is not a function" "TypeError: $(...).find(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/bus-booking-manager//assets/admin/mp_admin_settings.js?ver=1696993608:22:41)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wbbm_bus
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: mp_date_format is not defined" "ReferenceError: mp_date_format is not defined\n at mp_load_date_picker (/wp-content/plugins/bus-booking-manager//assets/helper/mp_style/mp_script.js?ver=1696993610:79:15)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/bus-booking-manager//assets/helper/mp_style/mp_script.js?ver=1696993610:94:3)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wbbm_bus
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).find(...).sortable is not a function" "TypeError: $(...).find(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/bus-booking-manager//assets/admin/mp_admin_settings.js?ver=1696993610:22:41)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #1, #10, #11, #12, #13, #14, #15, #2, #3, #4, #5, #6, #7, #8, #9 in bus-booking-manager/assets to your readme.txt
The official readme.txt is a good inspiration

bus-booking-manager/woocommerce-bus.php 92% from 13 tests

The main file in "Multipurpose Ticket Booking Manager (Bus/Train/Ferry/Boat/Shuttle)" v. 4.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bus-booking-manager.php" instead of "woocommerce-bus.php")

Code Analysis 95% 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
There were no executable files found in this plugin49,112 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
PHP485,7641,35134,094
CSS221,1314498,632
JavaScript284875566,386

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,605)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 122)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity227.77
▷ Minimum class complexity1.00
▷ Maximum class complexity2,605.00
Average method complexity15.98
▷ Minimum method complexity1.00
▷ Maximum method complexity122.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods393
▷ Static methods266.62%
▷ Public methods34287.02%
▷ Protected methods61.53%
▷ Private methods4511.45%
Functions144
▷ Named functions14298.61%
▷ Anonymous functions21.39%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
41 PNG files occupy 0.56MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/arrow_down.png1.06KB0.24KB▼ 77.47%
assets/helper/images/extra_icon.png8.99KB3.74KB▼ 58.35%
assets/helper/images/welcome/withMage.png50.10KB19.94KB▼ 60.21%
images/bus-placeholder.png3.62KB1.72KB▼ 52.44%
css/images/ui-icons_222222_256x240.png6.84KB4.18KB▼ 38.90%