68% bike-rental

Code Review | Bike Rental by BestWebSoft

WordPress plugin Bike Rental by BestWebSoft scored 68% from 54 tests.

About plugin

  • Plugin page: bike-rental
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 5.8.1
  • First release: Sep 24, 2021
  • Latest release: Sep 24, 2021
  • Number of updates: 3
  • Update frequency: every 10.7 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 79 total downloads

Benchmarks

Plugin footprint 65% 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: ▲2.42MB] [CPU: ▼98.16ms] Passed 4 tests

Analyzing server-side resources used by Bike Rental by BestWebSoft
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.90 ▲2.0782.40 ▲41.59
Dashboard /wp-admin5.66 ▲2.61100.98 ▲45.78
Posts /wp-admin/edit.php5.71 ▲2.6099.53 ▲48.26
Add New Post /wp-admin/post-new.php7.92 ▲2.49140.32 ▼517.82
Media Library /wp-admin/upload.php5.51 ▲2.5170.67 ▲37.82
General Settings /wp-admin/edit.php?post_type=bws_extra&page=bkng_general_settings6.43107.55
Add New /wp-admin/post-new.php?post_type=bws_bike6.43102.66
Types /wp-admin/edit-tags.php?taxonomy=bike_type&post_type=bws_bike5.5683.87
Locations /wp-admin/edit.php?post_type=bws_bike&page=bkrntl_bws_bike_locations5.6687.74
Types /wp-admin/edit-tags.php?taxonomy=extra_type&post_type=bws_extra5.5685.06
BWS Panel /wp-admin/edit.php?post_type=bws_bike&page=bkrntl-bws-panel5.8786.65
Extra /wp-admin/edit.php?post_type=bws_extra5.6788.73
Add New /wp-admin/post-new.php?post_type=bws_extra6.08107.40
Your profile /wp-admin/edit.php?post_type=bws_bike&page=bkng_user_profile5.9788.50
Bikes /wp-admin/edit.php?post_type=bws_bike5.6791.67

Server storage [IO: ▲11.46MB] [DB: ▲0.04MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 275 new files
Database: 19 new tables, 8 new options
New tables
wp_bws_bkng_bws_extra_bws_bike_relations
wp_bws_bkng_session
wp_bws_bkng_bws_extra_orders
wp_bws_bkng_bws_extra_field_post_data
wp_bws_bkng_bws_extra_field_values
wp_bws_bkng_locations
wp_bws_bkng_bws_extra_field_ids
wp_bws_bkng_bws_bike_field_post_data
wp_bws_bkng_post_location
wp_bws_bkng_bws_bike_ordered_products
...
New WordPress options
widget_bws_bkng_pre_order_widget
bkrntl_options
bkrntl_bws_extra_options
widget_bws_bkng_search_filter_widget
widget_bws_bkng_bike_widget
bstwbsftwppdtplgns_options
bkrntl_plugin_db_version
bkrntl_bws_bike_options

Browser metrics Passed 4 tests

Bike Rental by BestWebSoft: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,249 ▲64318.92 ▲3.2334.34 ▲22.1252.07 ▼1.46
Dashboard /wp-admin3,335 ▲4017.98 ▲1.92187.70 ▲32.00119.11 ▼2.04
Posts /wp-admin/edit.php3,122 ▲3834.37 ▲1.6694.48 ▲25.3497.48 ▲6.02
Add New Post /wp-admin/post-new.php1,727 ▲22721.20 ▲2.72294.04 ▼91.86122.37 ▲0.02
Media Library /wp-admin/upload.php1,980 ▲1734.88 ▼0.19147.37 ▼19.42122.42 ▼4.34
General Settings /wp-admin/edit.php?post_type=bws_extra&page=bkng_general_settings5,7107.69247.66218.15
Add New /wp-admin/post-new.php?post_type=bws_bike3,76112.25329.74158.73
Types /wp-admin/edit-tags.php?taxonomy=bike_type&post_type=bws_bike2,1553.9597.1187.05
Locations /wp-admin/edit.php?post_type=bws_bike&page=bkrntl_bws_bike_locations1,7486.18137.3675.05
Types /wp-admin/edit-tags.php?taxonomy=extra_type&post_type=bws_extra2,1553.9385.3587.38
BWS Panel /wp-admin/edit.php?post_type=bws_bike&page=bkrntl-bws-panel4,6965.66134.19169.00
Extra /wp-admin/edit.php?post_type=bws_extra1,8475.66127.8182.59
Add New /wp-admin/post-new.php?post_type=bws_extra3,66911.87306.99159.75
Your profile /wp-admin/edit.php?post_type=bws_bike&page=bkng_user_profile3,4165.94109.14159.35
Bikes /wp-admin/edit.php?post_type=bws_bike1,8505.67134.6079.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure failed, leaving 19 tables in the database
    • wp_bws_bkng_bws_extra_field_values
    • wp_bws_bkng_bws_extra_field_post_data
    • wp_bws_bkng_bws_extra_orders_meta
    • wp_bws_bkng_bws_bike_orders_meta
    • wp_bws_bkng_linked_products
    • wp_bws_bkng_bws_bike_field_values
    • wp_bws_bkng_bws_bike_field_ids
    • wp_bws_bkng_bws_extra_bws_bike_relations
    • wp_bws_bkng_bws_extra_ordered_products
    • wp_bws_bkng_post_location
    • ...
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_bws_bkng_search_filter_widget
    • bkrntl_plugin_db_version
    • bkrntl_options
    • bkrntl_bws_extra_options
    • bkrntl_bws_bike_options
    • bstwbsftwppdtplgns_options
    • widget_bws_bkng_pre_order_widget
    • widget_bws_bkng_bike_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/bike-rental/bws_booking/templates/forms/search-products.php
  • 12× 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 __() in wp-content/plugins/bike-rental/bws_menu/product_list.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bike-rental/booking_adapter/templates/bws-bkng-bike-simple-select.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bike-rental/booking_adapter/templates/bws-bkng-bike-activity-select.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bkng_get_order_id() in wp-content/plugins/bike-rental/booking_adapter/templates/bws-bkng-checkout.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bike-rental/booking_adapter/templates/bws-bkng-thank-you.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bike-rental/bws_menu/class-bws-settings.php:1328
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bike-rental/bike-rental.php:240
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bike-rental/booking_adapter/templates/bws-bkng-search-results-template.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bike-rental/booking_adapter/templates/bws-bkng-bike-model-select.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bws_bkng_get_agencies_data() in wp-content/plugins/bike-rental/bws_booking/templates/lists/agencies.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 ("Bikes" page grid view.), #2 ("Bikes" page list view.), #3 ("Checkout" page.), #4 ("Thank you" page.), #5 ("Bike Rental General Settings" page in the admin panel.), #6 ("Bike Rental Settings" page in the admin panel.), #7 ("Add New Bike" page in the admin panel.), #8 ("Attributes" page in the admin panel.), #9 ("Edit Attributes" page in the admin panel.), #10 ("Orders" page in the admin panel.), #11 ("Edit Order" page in the admin panel.), #12 ("Widgets" page in the admin panel.)
The official readme.txt is a good inspiration

bike-rental/bike-rental.php Passed 13 tests

The main PHP script in "Bike Rental by BestWebSoft" version 1.0.2 is automatically included on every request by WordPress
64 characters long description:
Give a birth for your bike rental and booking WordPress website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin55,118 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
PHP1124,5188,73923,374
PO File127,75113,61614,586
JavaScript191,0312,8638,641
CSS162464008,367
SVG400150

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity43.24
▷ Minimum class complexity1.00
▷ Maximum class complexity227.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes66
▷ Abstract classes46.06%
▷ Concrete classes6293.94%
▷ Final classes00.00%
Methods793
▷ Static methods445.55%
▷ Public methods57973.01%
▷ Protected methods384.79%
▷ Private methods17622.19%
Functions143
▷ Named functions143100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
75 PNG files occupy 6.13MB with 2.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_booking/images/no-image.png3.07KB1.00KB▼ 67.43%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_glass_75_dadada_1x400.png0.31KB0.18KB▼ 39.81%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%