77% bus-ticket-booking-with-seat-reservation

Code Review | Bus Ticket Booking with Seat Reservation

WordPress plugin Bus Ticket Booking with Seat Reservation scored77%from 54 tests.

About plugin

  • Plugin page: bus-ticket-bookin...
  • Plugin version: 5.2.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Sep 10, 2018
  • Latest release: Aug 10, 2023
  • Number of updates: 159
  • Update frequency: every 11.6 days
  • Top authors: magepeopleteam (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

800+ active /34,607 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.86ms] Passed 4 tests

Analyzing server-side resources used by Bus Ticket Booking with Seat Reservation
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.18 ▼3.13
Dashboard /wp-admin3.33 ▼0.0247.05 ▼11.49
Posts /wp-admin/edit.php3.44 ▲0.0944.62 ▼3.06
Add New Post /wp-admin/post-new.php5.93 ▲0.0483.05 ▼13.74
Media Library /wp-admin/upload.php3.25 ▲0.0236.91 ▲4.02
Bus /wp-admin/admin.php?page=wbtm_bus3.2228.18
Quick Setup /wp-admin/admin.php?page=wbtm_quick_setup3.2233.51

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 255 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bus Ticket Booking with Seat Reservation
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,023 ▲27713.27 ▼1.121.69 ▼0.0344.46 ▼2.27
Dashboard /wp-admin2,420 ▲2325.14 ▲0.26107.01 ▼8.0840.27 ▼1.84
Posts /wp-admin/edit.php2,270 ▲1812.08 ▲0.0442.37 ▲7.5932.97 ▼3.38
Add New Post /wp-admin/post-new.php1,553 ▲3423.41 ▲0.51615.85 ▼28.0651.49 ▲1.66
Media Library /wp-admin/upload.php1,635 ▲2534.48 ▲0.29104.92 ▲7.4642.22 ▼4.72
Bus /wp-admin/admin.php?page=wbtm_bus1,1032.3545.4350.64
Quick Setup /wp-admin/admin.php?page=wbtm_quick_setup1,1062.3145.9041.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/templates/bus-search-list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/admin/template/pickup_point.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_custom() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/templates/bus-search-result.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/admin/template/seat_pricing.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/template-hooks/search-form/button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/template-hooks/get_form_data.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/templates/bus-search-form.php:1
    • > PHP Fatal error
      require_once(): Failed opening required 'WBTM_PLUGIN_DIRpublic/template-hooks/get_form_data.php' (include_path='.:/usr/share/php') in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/template-hooks/templating.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/template-hooks/search-form/dates.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/bus-ticket-booking-with-seat-reservation/public/templates/bus-search-form-fields.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wbtm_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-ticket-booking-with-seat-reservation//assets/admin/mp_admin_settings.js?ver=1696835415: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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wbtm_quick_setup
    • > 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=wbtm_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-ticket-booking-with-seat-reservation//assets/admin/mp_admin_settings.js?ver=1696835417: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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: You can look at the official readme.txt

bus-ticket-booking-with-seat-reservation/woocommerce-bus.php 92% from 13 tests

The entry point to "Bus Ticket Booking with Seat Reservation" version 5.2.6 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bus-ticket-booking-with-seat-reservation.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
Everything looks great! No dangerous files found in this plugin54,596 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP876,3431,93437,006
CSS461,30678410,511
JavaScript226313674,771
PO File21,0231,5882,308

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,641)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 125)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity166.13
▷ Minimum class complexity1.00
▷ Maximum class complexity2,641.00
Average method complexity13.45
▷ Minimum method complexity1.00
▷ Maximum method complexity125.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes38
▷ Abstract classes00.00%
▷ Concrete classes38100.00%
▷ Final classes00.00%
Methods504
▷ Static methods275.36%
▷ Public methods41882.94%
▷ Protected methods61.19%
▷ Private methods8015.87%
Functions171
▷ Named functions171100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
86 PNG files occupy 0.54MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/helper/images/welcome/missing_img.png76.65KB30.46KB▼ 60.26%
admin/assets/css/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
public/seat-template/images/seat-panel-single-left.png1.04KB0.91KB▼ 12.39%
public/seat-template/images/arrow_up.png1.03KB0.23KB▼ 77.65%
admin/assets/css/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%