10% car-rental

Code Review | Car Rental by BestWebSoft

WordPress plugin Car Rental by BestWebSoft scored 10% from 54 tests.

About plugin

  • Plugin page: car-rental
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.2.2
  • WordPress version: 5.9.2
  • First release: Jun 9, 2016
  • Latest release: Sep 4, 2019
  • Number of updates: 19
  • Update frequency: every 62.2 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active / 22,573 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/car-rental/car-rental.php+256
    Trying to access array offset on value of type null

Server metrics [RAM: ▲1.26MB] [CPU: ▼290.04ms] Passed 4 tests

Analyzing server-side resources used by Car Rental by BestWebSoft
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.84 ▲1.3262.33 ▲13.60
Dashboard /wp-admin4.66 ▲1.2542.54 ▲9.82
Posts /wp-admin/edit.php4.90 ▲1.2648.50 ▲11.74
Add New Post /wp-admin/post-new.php8.18 ▲1.21104.53 ▼1,190.52
Media Library /wp-admin/upload.php4.61 ▲1.3134.55 ▲8.80
Car Classes /wp-admin/edit-tags.php?taxonomy=car_class&post_type=bws-cars4.6438.01
Vehicle Types /wp-admin/edit-tags.php?taxonomy=vehicle_type&post_type=bws-cars4.6443.08
All Cars /wp-admin/edit.php?post_type=bws-cars4.7038.77
Settings /wp-admin/edit.php?post_type=bws-cars&page=car-rental-settings5.2947.56
Extras /wp-admin/edit-tags.php?taxonomy=extra&post_type=bws-cars4.6437.07
BWS Panel /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel4.9133.06
Menus /wp-admin/nav-menus.php4.5941.66
Add New /wp-admin/post-new.php?post_type=bws-cars4.8960.76
Widgets /wp-admin/widgets.php6.4970.64
Manufacturers /wp-admin/edit-tags.php?taxonomy=manufacturer&post_type=bws-cars4.6439.08

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 134 new files
Database: 5 new tables, 4 new options
New tables
wp_crrntl_currency
wp_crrntl_extras_order
wp_crrntl_orders
wp_crrntl_statuses
wp_crrntl_locations
New WordPress options
widget_car-rental-filter
crrntl_options
bstwbsftwppdtplgns_options
widget_car-rental-order-info

Browser metrics Passed 4 tests

Car Rental by BestWebSoft: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,129 ▲37516.43 ▲0.7313.75 ▲7.622.31 ▼0.37
Dashboard /wp-admin3,099 ▲2456.14 ▼0.08121.84 ▼16.97200.39 ▲39.98
Posts /wp-admin/edit.php2,866 ▲1753.28 ▲0.0564.27 ▲2.34171.14 ▲23.91
Add New Post /wp-admin/post-new.php1,795 ▲12917.14 ▼3.37403.72 ▼55.44193.65 ▲34.62
Media Library /wp-admin/upload.php1,906 ▲2085.82 ▲0.39124.62 ▼16.06233.75 ▲44.17
Car Classes /wp-admin/edit-tags.php?taxonomy=car_class&post_type=bws-cars2,0695.3687.31165.96
Vehicle Types /wp-admin/edit-tags.php?taxonomy=vehicle_type&post_type=bws-cars2,0775.3787.57169.89
All Cars /wp-admin/edit.php?post_type=bws-cars1,9425.3278.84159.14
Settings /wp-admin/edit.php?post_type=bws-cars&page=car-rental-settings4,6355.75102.94261.44
Extras /wp-admin/edit-tags.php?taxonomy=extra&post_type=bws-cars2,1644.7378.52166.28
BWS Panel /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel4,5983.0963.65197.44
Menus /wp-admin/nav-menus.php2,6663.5183.79172.72
Add New /wp-admin/post-new.php?post_type=bws-cars4,46414.05294.20472.22
Widgets /wp-admin/widgets.php2,81225.56607.73198.66
Manufacturers /wp-admin/edit-tags.php?taxonomy=manufacturer&post_type=bws-cars2,0805.3675.85180.95

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 3 options in the database
    • bstwbsftwppdtplgns_options
    • widget_car-rental-order-info
    • widget_car-rental-filter

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 17× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/car-rental/includes/orders-table.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/car-rental/includes/taxonomy-metadata.php:145
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/car-rental/includes/orders-table.php on line 10
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/car-rental/includes/taxonomy-metadata.php on line 18
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/car-rental/includes/orders-table.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/car-rental/templates/page-choose-car.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/car-rental/bws_menu/product_list.php:7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/car-rental/includes/orders-table.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/car-rental/includes/slider-template.php:384
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/car-rental/templates/page-choose-extras.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/custom-admin-page/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/captcha-bws/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/donate-button/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/contact-form-plugin/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/facebook-button-plugin/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/custom-search-plugin/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-google-2-step-verification/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-google-analytics/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-google-maps/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/htaccess/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/job-board/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/google-shortlink/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/limit-attempts/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-linkedin/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/multilanguage/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/pdf-print/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-pinterest/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/portfolio/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/post-to-csv/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/profile-extra-fields/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/promobar/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/quotes-and-tips/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/rating-bws/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/realty/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/relevant/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-smtp/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/sender/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/social-buttons-pack/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/slider-bws/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/social-login-bws/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/subscriber/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-testimonials/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/timesheet/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/twitter-plugin/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/updater/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/user-role/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-cars&page=crrntl-bws-panel
    • > Network (severe)
    http://ps.w.org/visitors-online/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=bws-cars
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?v=3&key&libraries=places&callback=initMap&language=en&ver=5.9.2 85:375 "You are using this API without a key. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors"

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (Slider with the left search car form.), #2 (Slider with the right search car form.), #3 (Slider with the center search car form.), #4 ("Choose a car" page.), #5 ("Choose Extras" page.), #6 ("Review & Book" page.), #7 ("Car Rental Settings" page in the admin panel.), #8 (Slider settings on "Car Rental Settings" page in the admin panel.), #9 ("Add New Slide" page in the admin panel.), #10 ("Edit Slide" page in the admin panel.), #11 ("Cars Management" page in the admin panel.), #12 ("Edit Extra" page in the admin panel.), #13 ("Add New Car" page in the admin panel.), #14 ("Orders Management" page in the admin panel.), #15 ("Edit Order" page in the admin panel.)
Please take inspiration from this readme.txt

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

The principal PHP file in "Car Rental by BestWebSoft" v. 1.1.2 is loaded by WordPress automatically on each request
64 characters long description:
Create your personal car rental/booking and reservation website.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected32,339 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PO File125,1496,92911,137
PHP218771,01710,217
CSS139821968,034
JavaScript105661,0622,881
SVG10070

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity90.00
▷ Minimum class complexity17.00
▷ Maximum class complexity247.00
Average method complexity12.54
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods54
▷ Static methods00.00%
▷ Public methods4787.04%
▷ Protected methods00.00%
▷ Private methods712.96%
Functions125
▷ Named functions125100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
57 PNG files occupy 6.38MB with 1.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/filter-results.png0.30KB0.25KB▼ 18.71%
images/continue-flipped.png0.19KB0.13KB▼ 31.94%
includes/demo-data/images/extras-1.png14.37KB5.68KB▼ 60.51%
images/info.png0.42KB0.37KB▼ 12.79%
images/update.png0.29KB0.30KB0.00%